11#include "mlir/IR/Builders.h"
12#include "mlir/IR/DialectImplementation.h"
13#include "llvm/ADT/TypeSwitch.h"
14#include "llvm/Support/MathExtras.h"
20#define GET_TYPEDEF_CLASSES
21#include "circt/Dialect/AXI4/AXI4Types.cpp.inc"
23LogicalResult PortType::verify(function_ref<InFlightDiagnostic()> emitError,
24 uint32_t addr_width, uint32_t data_width,
25 uint32_t write_id_width, uint32_t read_id_width,
26 uint32_t user_width, WindowSetAttr windows,
27 uint32_t outstanding_writes,
28 uint32_t outstanding_reads) {
30 return emitError() <<
"port 'addr_width' must be at most 64, got "
32 if (data_width < 8 || data_width > 1024 || !llvm::isPowerOf2_32(data_width))
33 return emitError() <<
"port 'data_width' must be a power of two between 8 "
36 if (write_id_width > 32)
37 return emitError() <<
"port 'write_id_width' must be at most 32, got "
39 if (read_id_width > 32)
40 return emitError() <<
"port 'read_id_width' must be at most 32, got "
43 if (outstanding_writes > (uint64_t{1} << write_id_width))
44 return emitError() <<
"port 'outstanding_writes' must be at most "
45 << (uint64_t{1} << write_id_width)
46 <<
" for a 'write_id_width' of " << write_id_width
47 <<
", got " << outstanding_writes;
48 if (outstanding_reads > (uint64_t{1} << read_id_width))
49 return emitError() <<
"port 'outstanding_reads' must be at most "
50 << (uint64_t{1} << read_id_width)
51 <<
" for a 'read_id_width' of " << read_id_width
52 <<
", got " << outstanding_reads;
56void AXI4Dialect::registerTypes() {
58#define GET_TYPEDEF_LIST
59#include "circt/Dialect/AXI4/AXI4Types.cpp.inc"
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.