CIRCT 21.0.0git
|
#include <FIRRTLTypes.h>
Public Member Functions | |
bool | isConst () |
Returns true if this is a 'const' type that can only hold compile-time constant values. | |
bool | isPassive () const |
Return true if this is a "passive" type - one that contains no "flip" types recursively within itself. | |
FIRRTLBaseType | getPassiveType () |
Return this type with any flip types recursively removed from itself. | |
FIRRTLBaseType | getAnonymousType () |
Return this type with any type alias types recursively removed from itself. | |
FIRRTLBaseType | getConstType (bool isConst) |
Return a 'const' or non-'const' version of this type. | |
FIRRTLBaseType | getAllConstDroppedType () |
Return this type with a 'const' modifiers dropped. | |
FIRRTLBaseType | getMaskType () |
Return this type with all ground types replaced with UInt<1>. | |
FIRRTLBaseType | getWidthlessType () |
Return this type with widths of all ground types removed. | |
int32_t | getBitWidthOrSentinel () |
If this is an IntType, AnalogType, or sugar type for a single bit (Clock, Reset, etc) then return the bitwidth. | |
bool | isRegisterType () |
Returns true if this is a non-const "passive" that which is not analog. | |
bool | isResetType () |
Return true if this is a valid "reset" type. | |
Static Public Member Functions | |
static bool | classof (Type type) |
Support method to enable LLVM-style type casting. | |
Definition at line 143 of file FIRRTLTypes.h.
|
inlinestatic |
Support method to enable LLVM-style type casting.
Definition at line 186 of file FIRRTLTypes.h.
FIRRTLBaseType FIRRTLBaseType::getAllConstDroppedType | ( | ) |
Return this type with a 'const' modifiers dropped.
Definition at line 731 of file FIRRTLTypes.cpp.
Referenced by convertType(), and inferMuxReturnType().
FIRRTLBaseType FIRRTLBaseType::getAnonymousType | ( | ) |
Return this type with any type alias types recursively removed from itself.
Return this type with any type aliases recursively removed from itself.
Definition at line 693 of file FIRRTLTypes.cpp.
Referenced by circt::firrtl::areAnonymousTypesEquivalent().
int32_t FIRRTLBaseType::getBitWidthOrSentinel | ( | ) |
If this is an IntType, AnalogType, or sugar type for a single bit (Clock, Reset, etc) then return the bitwidth.
Return -1 if the is one of these types but without a specified bitwidth. Return -2 if this isn't a simple type.
Definition at line 813 of file FIRRTLTypes.cpp.
References circt::firrtl::IntType::getWidthOrSentinel().
Referenced by inferMuxReturnType(), circt::firrtl::isTypeLarger(), and LowerXMRPass::isZeroWidth().
FIRRTLBaseType FIRRTLBaseType::getConstType | ( | bool | isConst | ) |
Return a 'const' or non-'const' version of this type.
Definition at line 719 of file FIRRTLTypes.cpp.
References isConst().
Referenced by createZeroValue(), inferMuxReturnType(), and updateType().
FIRRTLBaseType FIRRTLBaseType::getMaskType | ( | ) |
Return this type with all ground types replaced with UInt<1>.
This is used for mem
operations.
Definition at line 745 of file FIRRTLTypes.cpp.
References isConst().
FIRRTLBaseType FIRRTLBaseType::getPassiveType | ( | ) |
Return this type with any flip types recursively removed from itself.
Definition at line 706 of file FIRRTLTypes.cpp.
Referenced by circt::firrtl::isTypeLarger().
FIRRTLBaseType FIRRTLBaseType::getWidthlessType | ( | ) |
Return this type with widths of all ground types removed.
Remove the widths from this type.
This enables two types to be compared by structure and name ignoring widths.
All widths are replaced with an unknown width.
Definition at line 776 of file FIRRTLTypes.cpp.
bool FIRRTLBaseType::isConst | ( | ) |
Returns true if this is a 'const' type that can only hold compile-time constant values.
Definition at line 652 of file FIRRTLTypes.cpp.
Referenced by circt::firrtl::emitConnect(), circt::firrtl::IntType::get(), getConstType(), circt::firrtl::IntType::getConstType(), getMaskType(), inferMuxReturnType(), isConstFieldDriven(), resizeType(), and updateType().
|
inline |
Return true if this is a "passive" type - one that contains no "flip" types recursively within itself.
Definition at line 155 of file FIRRTLTypes.h.
Referenced by isConstFieldDriven(), and isRegisterType().
|
inline |
Returns true if this is a non-const "passive" that which is not analog.
Definition at line 193 of file FIRRTLTypes.h.
References circt::firrtl::containsConst(), and isPassive().
bool FIRRTLBaseType::isResetType | ( | ) |
Return true if this is a valid "reset" type.
Return true if this is a type usable as a reset.
This must be either an abstract reset, a concrete 1-bit UInt, an asynchronous reset, or an uninfered width UInt.
Definition at line 834 of file FIRRTLTypes.cpp.