13#include "mlir/IR/Builders.h"
14#include "mlir/IR/DialectImplementation.h"
15#include "llvm/ADT/TypeSwitch.h"
21#define GET_TYPEDEF_CLASSES
22#include "circt/Dialect/Arc/ArcTypes.cpp.inc"
24unsigned StateType::getBitWidth() {
25 if (llvm::isa<seq::ClockType>(getType()))
27 return hw::getBitWidth(getType());
31StateType::verify(llvm::function_ref<InFlightDiagnostic()> emitError,
33 if (llvm::isa<seq::ClockType>(innerType))
35 if (hw::getBitWidth(innerType) < 0)
36 return emitError() <<
"state type must have a known bit width; got "
41unsigned MemoryType::getStride() {
42 unsigned stride = (getWordType().getWidth() + 7) / 8;
43 return llvm::alignToPowerOf2(stride, llvm::bit_ceil(std::min(stride, 16U)));
46void ArcDialect::registerTypes() {
48#define GET_TYPEDEF_LIST
49#include "circt/Dialect/Arc/ArcTypes.cpp.inc"
mlir::Type innerType(mlir::Type type)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.