CIRCT
18.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. More... | |
bool | isPassive () const |
Return true if this is a "passive" type - one that contains no "flip" types recursively within itself. More... | |
FIRRTLBaseType | getPassiveType () |
Return this type with any flip types recursively removed from itself. More... | |
FIRRTLBaseType | getAnonymousType () |
Return this type with any type alias types recursively removed from itself. More... | |
FIRRTLBaseType | getConstType (bool isConst) |
Return a 'const' or non-'const' version of this type. More... | |
FIRRTLBaseType | getAllConstDroppedType () |
Return this type with a 'const' modifiers dropped. More... | |
FIRRTLBaseType | getMaskType () |
Return this type with all ground types replaced with UInt<1>. More... | |
FIRRTLBaseType | getWidthlessType () |
Return this type with widths of all ground types removed. More... | |
int32_t | getBitWidthOrSentinel () |
If this is an IntType, AnalogType, or sugar type for a single bit (Clock, Reset, etc) then return the bitwidth. More... | |
bool | isRegisterType () |
Returns true if this is a non-const "passive" that which is not analog. More... | |
bool | isResetType () |
Return true if this is a valid "reset" type. More... | |
Static Public Member Functions | |
static bool | classof (Type type) |
Support method to enable LLVM-style type casting. More... | |
Definition at line 140 of file FIRRTLTypes.h.
|
inlinestatic |
Support method to enable LLVM-style type casting.
Definition at line 183 of file FIRRTLTypes.h.
FIRRTLBaseType FIRRTLBaseType::getAllConstDroppedType | ( | ) |
Return this type with a 'const' modifiers dropped.
Definition at line 693 of file FIRRTLTypes.cpp.
References getAllConstDroppedType(), and getConstType().
Referenced by convertType(), getAllConstDroppedType(), 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 655 of file FIRRTLTypes.cpp.
References getAnonymousType().
Referenced by circt::firrtl::areAnonymousTypesEquivalent(), and getAnonymousType().
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 775 of file FIRRTLTypes.cpp.
References circt::firrtl::IntType::getWidthOrSentinel().
Referenced by connectToLeafs(), inferMuxReturnType(), circt::firrtl::isTypeLarger(), LowerXMRPass::isZeroWidth(), FIRRTLOperandForwarder< OpNum >::match(), ConnectSourceOperandForwarder< OpNum >::match(), and FIRRTLOperandForwarder< OpNum >::rewrite().
FIRRTLBaseType FIRRTLBaseType::getConstType | ( | bool | isConst | ) |
Return a 'const' or non-'const' version of this type.
Definition at line 681 of file FIRRTLTypes.cpp.
References getConstType(), and isConst().
Referenced by createZeroValue(), getAllConstDroppedType(), getConstType(), 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 707 of file FIRRTLTypes.cpp.
References circt::calyx::direction::get(), and isConst().
FIRRTLBaseType FIRRTLBaseType::getPassiveType | ( | ) |
Return this type with any flip types recursively removed from itself.
Definition at line 668 of file FIRRTLTypes.cpp.
References getPassiveType().
Referenced by getPassiveType(), and 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 738 of file FIRRTLTypes.cpp.
References circt::calyx::direction::get().
Referenced by FIRRTLOperandForwarder< OpNum >::match(), and ConnectSourceOperandForwarder< OpNum >::match().
bool FIRRTLBaseType::isConst | ( | ) |
Returns true if this is a 'const' type that can only hold compile-time constant values.
Definition at line 620 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 152 of file FIRRTLTypes.h.
Referenced by isConstFieldDriven(), isRegisterType(), and ConnectInvalidator::match().
|
inline |
Returns true if this is a non-const "passive" that which is not analog.
Definition at line 190 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 796 of file FIRRTLTypes.cpp.
References isResetType().
Referenced by isResetType().