CIRCT  19.0.0git
ESITypes.h
Go to the documentation of this file.
1 //===- ESITypes.h - types for the ESI dialect -------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Types for ESI are mostly in tablegen. This file should contain C++ types used
10 // in MLIR type parameters and other supporting declarations.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef CIRCT_DIALECT_ESI_ESITYPES_H
15 #define CIRCT_DIALECT_ESI_ESITYPES_H
16 
18 #include "circt/Support/LLVM.h"
19 #include "mlir/IR/Dialect.h"
20 #include "mlir/IR/Operation.h"
21 
22 #include "ESIDialect.h"
23 
24 namespace circt {
25 namespace esi {
26 struct BundledChannel;
27 } // namespace esi
28 } // namespace circt
29 
30 #define GET_TYPEDEF_CLASSES
31 #include "circt/Dialect/ESI/ESITypes.h.inc"
32 
33 namespace circt {
34 namespace esi {
35 
37  StringAttr name;
38  ChannelDirection direction;
39  ChannelType type;
40 
41  int operator==(const BundledChannel &that) const {
42  return name == that.name && direction == that.direction &&
43  type == that.type;
44  }
45 };
46 
47 // NOLINTNEXTLINE(readability-identifier-naming)
48 inline llvm::hash_code hash_value(const BundledChannel channel) {
49  return llvm::hash_combine(channel.name, channel.direction, channel.type);
50 }
51 
52 // If 'type' is an esi:ChannelType, will return the inner type of said channel.
53 // Else, returns 'type'.
54 mlir::Type innerType(mlir::Type type);
55 } // namespace esi
56 } // namespace circt
57 
58 #endif
llvm::hash_code hash_value(const BundledChannel channel)
Definition: ESITypes.h:48
mlir::Type innerType(mlir::Type type)
Definition: ESITypes.cpp:184
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition: DebugAnalysis.h:21
Definition: esi.py:1
int operator==(const BundledChannel &that) const
Definition: ESITypes.h:41
ChannelDirection direction
Definition: ESITypes.h:38