CIRCT 20.0.0git
|
Namespaces | |
namespace | detail |
namespace | FieldIdImpl |
namespace | instance_like_impl |
namespace | module_like_impl |
Classes | |
class | HWModulePortAccessor |
struct | HWReducePatternDialectInterface |
A dialect interface to provide reduction patterns to a reducer tool. More... | |
class | HWSymbolCache |
This stores lookup tables to make manipulating and working with the IR more efficient. More... | |
struct | InnerRefNamespace |
This class represents the namespace in which InnerRef's can be resolved. More... | |
struct | InnerRefNamespaceLike |
Classify operations that are InnerRefNamespace-like, until structure is in place to do this via Traits. More... | |
struct | InnerSymbolNamespace |
struct | InnerSymbolNamespaceCollection |
class | InnerSymbolTable |
A table of inner symbols and their resolutions. More... | |
class | InnerSymbolTableCollection |
This class represents a collection of InnerSymbolTable's. More... | |
class | InnerSymTarget |
The target of an inner symbol, the entity the symbol is a handle for. More... | |
class | InstanceGraph |
HW-specific instance graph with a virtual entry node linking to all publicly visible modules. More... | |
struct | ModulePort |
struct | ModulePortInfo |
This holds a decoded list of input/inout and output ports for a module or instance. More... | |
struct | ModulePortLookupInfo |
class | PortConversion |
Base class for the port conversion of a particular port. More... | |
class | PortConversionBuilder |
class | PortConverter |
class | PortConverterImpl |
struct | PortInfo |
This holds the name, type, direction of a module's ports. More... | |
class | StmtVisitor |
This helps visit TypeOp nodes. More... | |
class | TypeAliasOr |
class | TypeOpVisitor |
This helps visit TypeOp nodes. More... | |
class | TypeVariant |
Utility type that wraps a type that may be one of several possible Types. More... | |
Typedefs | |
using | HWModuleBuilder = llvm::function_ref< void(OpBuilder &, HWModulePortAccessor &)> |
Functions | |
mlir::FailureOr< mlir::Type > | evaluateParametricType (mlir::Location loc, mlir::ArrayAttr parameters, mlir::Type type, bool emitErrors=true) |
Returns a resolved version of 'type' wherein any parameter reference has been evaluated based on the set of provided 'parameters'. | |
mlir::FailureOr< mlir::TypedAttr > | evaluateParametricAttr (mlir::Location loc, mlir::ArrayAttr parameters, mlir::Attribute paramAttr, bool emitErrors=true) |
Evaluates a parametric attribute (param.decl.ref/param.expr) based on a set of provided parameter values. | |
bool | isParametricType (mlir::Type t) |
Returns true if any part of t is parametric. | |
void | populateHWModuleLikeTypeConversionPattern (StringRef moduleLikeOpName, RewritePatternSet &patterns, TypeConverter &converter) |
LogicalResult | verifyInnerSymAttr (InnerSymbolOpInterface op) |
Verification hook for verifying InnerSym Attribute. | |
ModulePort::Direction | flip (ModulePort::Direction direction) |
Flip a port direction. | |
bool | isAnyModuleOrInstance (Operation *module) |
TODO: Move all these functions to a hw::ModuleLike interface. | |
FunctionType | getModuleType (Operation *module) |
Return the signature for the specified module as a function type. | |
StringAttr | getVerilogModuleNameAttr (Operation *module) |
Returns the verilog module name attribute or symbol name of any module-like operations. | |
StringRef | getVerilogModuleName (Operation *module) |
bool | isValidIndexBitWidth (Value index, Value array) |
bool | isCombinational (Operation *op) |
Return true if the specified operation is a combinational logic op. | |
bool | isValidParameterExpression (Attribute attr, Operation *module) |
Return true if the specified attribute tree is made up of nodes that are valid in a parameter expression. | |
LogicalResult | checkParameterInContext (Attribute value, Operation *module, Operation *usingOp, bool disallowParamRefs=false) |
Check parameter specified by value to see if it is valid within the scope of the specified module module . | |
LogicalResult | checkParameterInContext (Attribute value, ArrayAttr moduleParameters, const std::function< void(std::function< bool(InFlightDiagnostic &)>)> &instanceError, bool disallowParamRefs=false) |
Check parameter specified by value to see if it is valid according to the module's parameters. | |
bool | isOffset (Value base, Value index, uint64_t offset) |
std::unique_ptr< mlir::Pass > | createPrintInstanceGraphPass () |
std::unique_ptr< mlir::Pass > | createHWSpecializePass () |
std::unique_ptr< mlir::Pass > | createPrintHWModuleGraphPass () |
std::unique_ptr< mlir::Pass > | createFlattenIOPass (bool recursiveFlag=true, bool flattenExternFlag=false, char joinChar='.') |
std::unique_ptr< mlir::Pass > | createVerifyInnerRefNamespacePass () |
std::unique_ptr< mlir::Pass > | createFlattenModulesPass () |
std::unique_ptr< mlir::Pass > | createFooWiresPass () |
std::unique_ptr< mlir::Pass > | createHWAggregateToCombPass () |
void | registerReducePatternDialectInterface (mlir::DialectRegistry ®istry) |
Register the HW Reduction pattern dialect interface to the given registry. | |
static bool | operator== (const ModulePort &a, const ModulePort &b) |
static llvm::hash_code | hash_value (const ModulePort &port) |
mlir::Type | getCanonicalType (mlir::Type type) |
bool | isHWIntegerType (mlir::Type type) |
Return true if the specified type is a value HW Integer type. | |
bool | isHWEnumType (mlir::Type type) |
Return true if the specified type is a HW Enum type. | |
bool | isHWValueType (mlir::Type type) |
Return true if the specified type can be used as an HW value type, that is the set of types that can be composed together to represent synthesized, hardware but not marker types like InOutType or unknown types from other dialects. | |
int64_t | getBitWidth (mlir::Type type) |
Return the hardware bit width of a type. | |
bool | hasHWInOutType (mlir::Type type) |
Return true if the specified type contains known marker types like InOutType. | |
template<typename... BaseTy> | |
bool | type_isa (Type type) |
template<typename... BaseTy> | |
bool | type_isa_and_nonnull (Type type) |
template<typename BaseTy > | |
BaseTy | type_cast (Type type) |
template<typename BaseTy > | |
BaseTy | type_dyn_cast (Type type) |
template<typename OS > | |
OS & | operator<< (OS &os, const InnerSymTarget &target) |
Printing InnerSymTarget's. | |
raw_ostream & | operator<< (raw_ostream &printer, PortInfo port) |
using circt::hw::HWModuleBuilder = typedef llvm::function_ref<void(OpBuilder &, HWModulePortAccessor &)> |
LogicalResult circt::hw::checkParameterInContext | ( | Attribute | value, |
ArrayAttr | moduleParameters, | ||
const std::function< void(std::function< bool(InFlightDiagnostic &)>)> & | instanceError, | ||
bool | disallowParamRefs = false |
||
) |
Check parameter specified by value
to see if it is valid according to the module's parameters.
If not, emit an error to the diagnostic provided as an argument to the lambda 'instanceError' and return failure, otherwise return success.
If disallowParamRefs
is true, then parameter references are not allowed.
Definition at line 128 of file HWOps.cpp.
References checkParameterInContext().
LogicalResult circt::hw::checkParameterInContext | ( | Attribute | value, |
Operation * | module, | ||
Operation * | usingOp, | ||
bool | disallowParamRefs = false |
||
) |
Check parameter specified by value
to see if it is valid within the scope of the specified module module
.
If not, emit an error at the location of usingOp
and return failure, otherwise return success.
If disallowParamRefs
is true, then parameter references are not allowed.
If not, emit an error at the location of usingOp
and return failure, otherwise return success. If usingOp
is null, then no diagnostic is generated.
If disallowParamRefs
is true, then parameter references are not allowed.
Definition at line 202 of file HWOps.cpp.
References checkParameterInContext().
Referenced by checkParameterInContext(), checkParameterInContext(), isValidParameterExpression(), and circt::hw::instance_like_impl::verifyParameterStructure().
std::unique_ptr< Pass > circt::hw::createFlattenIOPass | ( | bool | recursiveFlag = true , |
bool | flattenExternFlag = false , |
||
char | joinChar = '.' |
||
) |
Definition at line 581 of file FlattenIO.cpp.
std::unique_ptr< Pass > circt::hw::createFlattenModulesPass | ( | ) |
Definition at line 150 of file FlattenModules.cpp.
Referenced by circt::firtool::populateHWToBTOR2().
std::unique_ptr< mlir::Pass > circt::hw::createFooWiresPass | ( | ) |
Definition at line 42 of file FooWires.cpp.
std::unique_ptr< Pass > circt::hw::createHWAggregateToCombPass | ( | ) |
Definition at line 185 of file HWAggregateToComb.cpp.
std::unique_ptr< Pass > circt::hw::createHWSpecializePass | ( | ) |
Definition at line 438 of file HWSpecialize.cpp.
std::unique_ptr< mlir::Pass > circt::hw::createPrintHWModuleGraphPass | ( | ) |
Definition at line 48 of file PrintHWModuleGraph.cpp.
std::unique_ptr< mlir::Pass > circt::hw::createPrintInstanceGraphPass | ( | ) |
Definition at line 42 of file HWPrintInstanceGraph.cpp.
std::unique_ptr< mlir::Pass > circt::hw::createVerifyInnerRefNamespacePass | ( | ) |
Definition at line 50 of file VerifyInnerRefNamespace.cpp.
Referenced by detail::populatePrepareForExportVerilog().
mlir::FailureOr< mlir::TypedAttr > circt::hw::evaluateParametricAttr | ( | mlir::Location | loc, |
mlir::ArrayAttr | parameters, | ||
mlir::Attribute | paramAttr, | ||
bool | emitErrors = true |
||
) |
Evaluates a parametric attribute (param.decl.ref/param.expr) based on a set of provided parameter values.
Referenced by evaluateParametricArrayType().
mlir::FailureOr< mlir::Type > circt::hw::evaluateParametricType | ( | mlir::Location | loc, |
mlir::ArrayAttr | parameters, | ||
mlir::Type | type, | ||
bool | emitErrors = true |
||
) |
Returns a resolved version of 'type' wherein any parameter reference has been evaluated based on the set of provided 'parameters'.
Referenced by evaluateParametricArrayType(), and circt::hw::instance_like_impl::resolveParametricTypes().
ModulePort::Direction circt::hw::flip | ( | ModulePort::Direction | direction | ) |
int64_t circt::hw::getBitWidth | ( | mlir::Type | type | ) |
Return the hardware bit width of a type.
Does not reflect any encoding, padding, or storage scheme, just the bit (and wire width) of a statically-size type. Reflects the number of wires needed to transmit a value of this type. Returns -1 if the type is not known or cannot be statically computed.
Definition at line 110 of file HWTypes.cpp.
References getBitWidth().
Referenced by getBitWidth(), llvm::DOTGraphTraits< circt::hw::HWModuleOp >::getEdgeAttributes(), and hwGetBitWidth().
mlir::Type circt::hw::getCanonicalType | ( | mlir::Type | type | ) |
Definition at line 49 of file HWTypes.cpp.
Referenced by isHWEnumType(), isHWIntegerType(), circt::ExportVerilog::isZeroBitType(), and verifyAggregateFieldIndexAndType().
FunctionType circt::hw::getModuleType | ( | Operation * | module | ) |
Return the signature for the specified module as a function type.
Return the signature for a module as a function type from the module itself or from an hw::InstanceOp.
Definition at line 521 of file HWOps.cpp.
Referenced by circt::hw::instance_like_impl::getPortList(), and circt::hw::instance_like_impl::verifyInstanceOfHWModule().
|
inline |
Definition at line 54 of file HWOps.h.
References getVerilogModuleNameAttr().
Referenced by circt::ExportVerilog::SharedEmitterState::gatherFiles(), and circt::ExportVerilog::getSymOpName().
StringAttr circt::hw::getVerilogModuleNameAttr | ( | Operation * | module | ) |
Returns the verilog module name attribute or symbol name of any module-like operations.
Return the name to use for the Verilog module that we're referencing here.
This is typically the symbol, but can be overridden with the verilogName attribute.
Definition at line 539 of file HWOps.cpp.
Referenced by createModuleForCut(), circt::ExportVerilog::getSymOpName(), getVerilogModuleName(), and circt::ExportVerilog::GlobalNameResolver::GlobalNameResolver().
|
static |
Definition at line 38 of file HWTypes.h.
References circt::hw::ModulePort::dir, circt::hw::ModulePort::name, and circt::hw::ModulePort::type.
Referenced by llvm::DenseMapInfo< circt::FieldRef >::getHashValue(), llvm::DenseMapInfo< JValue >::getHashValue(), llvm::DenseMapInfo< Key >::getHashValue(), llvm::DenseMapInfo< ResetSignal >::getHashValue(), and llvm::hashValue().
bool circt::hw::hasHWInOutType | ( | mlir::Type | type | ) |
Return true if the specified type contains known marker types like InOutType.
Unlike isHWValueType, this is not conservative, it only returns false on known InOut types, rather than any unknown types.
bool circt::hw::isAnyModuleOrInstance | ( | Operation * | module | ) |
TODO: Move all these functions to a hw::ModuleLike interface.
Return true if isAnyModule or instance.
bool circt::hw::isCombinational | ( | Operation * | op | ) |
Return true if the specified operation is a combinational logic op.
Definition at line 59 of file HWOps.cpp.
References circt::hw::TypeOpVisitor< ConcreteType, ResultType, ExtraArgs >::dispatchTypeOpVisitor(), circt::hw::TypeOpVisitor< ConcreteType, ResultType, ExtraArgs >::visitInvalidTypeOp(), and circt::hw::TypeOpVisitor< ConcreteType, ResultType, ExtraArgs >::visitUnhandledTypeOp().
Referenced by circt::ExportVerilog::isVerilogExpression().
bool circt::hw::isHWEnumType | ( | mlir::Type | type | ) |
Return true if the specified type is a HW Enum type.
Definition at line 73 of file HWTypes.cpp.
References getCanonicalType().
bool circt::hw::isHWIntegerType | ( | mlir::Type | type | ) |
Return true if the specified type is a value HW Integer type.
This checks that it is a signless standard dialect type.
This checks that it is a signless standard dialect type or a hw::IntType.
Definition at line 60 of file HWTypes.cpp.
References getCanonicalType().
Referenced by simplifyCLog2(), simplifyDivS(), simplifyDivU(), simplifyModS(), simplifyModU(), simplifyShl(), simplifyShrS(), and simplifyShrU().
bool circt::hw::isHWValueType | ( | mlir::Type | type | ) |
Return true if the specified type can be used as an HW value type, that is the set of types that can be composed together to represent synthesized, hardware but not marker types like InOutType or unknown types from other dialects.
Referenced by hwTypeIsAValueType().
bool circt::hw::isOffset | ( | Value | base, |
Value | index, | ||
uint64_t | offset | ||
) |
Definition at line 1834 of file HWOps.cpp.
References assert().
Referenced by foldCreateToSlice(), mergeConcatSlices(), and mergeNeiboringAssignments().
bool circt::hw::isParametricType | ( | mlir::Type | t | ) |
Returns true if any part of t is parametric.
Definition at line 1076 of file HWAttributes.cpp.
References isParamAttrWithParamRef(), and isParametricType().
Referenced by isParametricType().
bool circt::hw::isValidIndexBitWidth | ( | Value | index, |
Value | array | ||
) |
bool circt::hw::isValidParameterExpression | ( | Attribute | attr, |
Operation * | module | ||
) |
Return true if the specified attribute tree is made up of nodes that are valid in a parameter expression.
Definition at line 221 of file HWOps.cpp.
References checkParameterInContext().
OS & circt::hw::operator<< | ( | OS & | os, |
const InnerSymTarget & | target | ||
) |
Printing InnerSymTarget's.
Definition at line 247 of file InnerSymbolTable.h.
References circt::hw::InnerSymTarget::getField(), circt::hw::InnerSymTarget::getOp(), circt::hw::InnerSymTarget::getPort(), circt::hw::InnerSymTarget::isField(), and circt::hw::InnerSymTarget::isPort().
raw_ostream & circt::hw::operator<< | ( | raw_ostream & | printer, |
PortInfo | port | ||
) |
Definition at line 110 of file HWOpInterfaces.cpp.
References circt::hw::PortInfo::argNum, circt::hw::PortInfo::attrs, circt::hw::ModulePort::dir, circt::hw::PortInfo::getSym(), circt::hw::PortInfo::loc, circt::hw::ModulePort::name, and circt::hw::ModulePort::type.
|
static |
Definition at line 35 of file HWTypes.h.
References circt::hw::ModulePort::dir, circt::hw::ModulePort::name, and circt::hw::ModulePort::type.
void circt::hw::populateHWModuleLikeTypeConversionPattern | ( | StringRef | moduleLikeOpName, |
RewritePatternSet & | patterns, | ||
TypeConverter & | converter | ||
) |
Definition at line 85 of file HWModuleOpInterface.cpp.
void circt::hw::registerReducePatternDialectInterface | ( | mlir::DialectRegistry & | registry | ) |
Register the HW Reduction pattern dialect interface to the given registry.
Definition at line 236 of file HWReductions.cpp.
BaseTy circt::hw::type_cast | ( | Type | type | ) |
BaseTy circt::hw::type_dyn_cast | ( | Type | type | ) |
bool circt::hw::type_isa | ( | Type | type | ) |
Definition at line 142 of file HWTypes.h.
References type_isa().
Referenced by circt::hw::TypeVariant< Types >::classof(), type_isa(), and type_isa_and_nonnull().
bool circt::hw::type_isa_and_nonnull | ( | Type | type | ) |
Definition at line 156 of file HWTypes.h.
References type_isa().
LogicalResult circt::hw::verifyInnerSymAttr | ( | InnerSymbolOpInterface | op | ) |
Verification hook for verifying InnerSym Attribute.
Definition at line 53 of file HWOpInterfaces.cpp.