15 #include "mlir/IR/BuiltinTypes.h"
16 #include "mlir/IR/ImplicitLocOpBuilder.h"
21 using namespace circt;
26 StringRef reqName, Type reqType,
27 StringRef respName, Type respType) {
28 assert(reqType && respType);
29 auto *
ctxt = reqType ? reqType.getContext() : respType.getContext();
41 auto *
ctxt = getContext();
50 return createReqResp(getSymNameAttr(),
"write",
"req", writeType,
"ack",
55 auto *
ctxt = getContext();
58 return createReqResp(getSymNameAttr(),
"read",
"address", addressType,
"data",
63 SmallVectorImpl<ServicePortInfo> &ports) {
64 ports.push_back(writePortInfo());
65 ports.push_back(readPortInfo());
69 auto *
ctxt = getContext();
82 auto *
ctxt = getContext();
90 ChannelDirection::from,
96 auto *
ctxt = getContext();
107 ctxt, 32, IntegerType::SignednessSemantics::Unsigned))},
116 hw::StructType::FieldInfo{
119 ctxt, 32, IntegerType::SignednessSemantics::Unsigned)},
136 auto *
ctxt = getContext();
144 hw::StructType::FieldInfo{
147 IntegerType::SignednessSemantics::Unsigned)},
151 getSymNameAttr(),
"write",
"req", writeType,
"ackTag",
156 auto *
ctxt = getContext();
164 hw::StructType::FieldInfo{
167 ctxt, 8, IntegerType::SignednessSemantics::Unsigned)},
171 hw::StructType::FieldInfo{
174 ctxt, 8, IntegerType::SignednessSemantics::Unsigned)},
178 return createReqResp(getSymNameAttr(),
"read",
"req", readReqType,
"resp",
183 SmallVectorImpl<ServicePortInfo> &ports) {
184 ports.push_back(writePortInfo());
185 ports.push_back(readPortInfo());
assert(baseType &&"element must be base type")
static ServicePortInfo createReqResp(StringAttr sym, Twine name, StringRef reqName, Type reqType, StringRef respName, Type respType)
Utility function to create a req/resp pair bundle service port.
static SmallVector< PortInfo > getPortList(ModuleTy &mod)
Direction get(bool isOutput)
Returns an output direction if isOutput is true, otherwise returns an input direction.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Describes a service port.