CIRCT  19.0.0git
Public Member Functions | Static Public Member Functions | List of all members
circt::firrtl::FIRRTLBaseType Class Reference

#include <FIRRTLTypes.h>

Inheritance diagram for circt::firrtl::FIRRTLBaseType:
Inheritance graph
[legend]
Collaboration diagram for circt::firrtl::FIRRTLBaseType:
Collaboration graph
[legend]

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...
 

Detailed Description

Definition at line 142 of file FIRRTLTypes.h.

Member Function Documentation

◆ classof()

static bool circt::firrtl::FIRRTLBaseType::classof ( Type  type)
inlinestatic

Support method to enable LLVM-style type casting.

Definition at line 185 of file FIRRTLTypes.h.

◆ getAllConstDroppedType()

FIRRTLBaseType FIRRTLBaseType::getAllConstDroppedType ( )

Return this type with a 'const' modifiers dropped.

Definition at line 723 of file FIRRTLTypes.cpp.

References getAllConstDroppedType(), and getConstType().

Referenced by convertType(), getAllConstDroppedType(), and inferMuxReturnType().

◆ getAnonymousType()

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 685 of file FIRRTLTypes.cpp.

References getAnonymousType().

Referenced by circt::firrtl::areAnonymousTypesEquivalent(), and getAnonymousType().

◆ getBitWidthOrSentinel()

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 805 of file FIRRTLTypes.cpp.

References circt::firrtl::IntType::getWidthOrSentinel().

Referenced by inferMuxReturnType(), circt::firrtl::isTypeLarger(), and LowerXMRPass::isZeroWidth().

◆ getConstType()

FIRRTLBaseType FIRRTLBaseType::getConstType ( bool  isConst)

Return a 'const' or non-'const' version of this type.

Definition at line 711 of file FIRRTLTypes.cpp.

References getConstType(), and isConst().

Referenced by createZeroValue(), getAllConstDroppedType(), getConstType(), inferMuxReturnType(), and updateType().

◆ getMaskType()

FIRRTLBaseType FIRRTLBaseType::getMaskType ( )

Return this type with all ground types replaced with UInt<1>.

This is used for mem operations.

Definition at line 737 of file FIRRTLTypes.cpp.

References circt::calyx::direction::get(), and isConst().

◆ getPassiveType()

FIRRTLBaseType FIRRTLBaseType::getPassiveType ( )

Return this type with any flip types recursively removed from itself.

Definition at line 698 of file FIRRTLTypes.cpp.

References getPassiveType().

Referenced by getPassiveType(), and circt::firrtl::isTypeLarger().

◆ getWidthlessType()

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 768 of file FIRRTLTypes.cpp.

References circt::calyx::direction::get().

◆ isConst()

bool FIRRTLBaseType::isConst ( )

Returns true if this is a 'const' type that can only hold compile-time constant values.

Definition at line 648 of file FIRRTLTypes.cpp.

Referenced by circt::firrtl::emitConnect(), circt::firrtl::IntType::get(), getConstType(), circt::firrtl::IntType::getConstType(), getMaskType(), inferMuxReturnType(), isConstFieldDriven(), resizeType(), and updateType().

◆ isPassive()

bool circt::firrtl::FIRRTLBaseType::isPassive ( ) const
inline

Return true if this is a "passive" type - one that contains no "flip" types recursively within itself.

Definition at line 154 of file FIRRTLTypes.h.

Referenced by isConstFieldDriven(), and isRegisterType().

◆ isRegisterType()

bool circt::firrtl::FIRRTLBaseType::isRegisterType ( )
inline

Returns true if this is a non-const "passive" that which is not analog.

Definition at line 192 of file FIRRTLTypes.h.

References circt::firrtl::containsConst(), and isPassive().

◆ isResetType()

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 826 of file FIRRTLTypes.cpp.

References isResetType().

Referenced by isResetType().


The documentation for this class was generated from the following files: