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

This is the common base class between SIntType and UIntType. More...

#include <FIRRTLTypes.h>

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

Public Member Functions

bool isSigned ()
 
bool isUnsigned ()
 
int32_t getWidthOrSentinel () const
 Return the width of this type, or -1 if it has none specified. More...
 
IntType getConstType (bool isConst)
 Return a 'const' or non-'const' version of this type. More...
 
- Public Member Functions inherited from circt::firrtl::FIRRTLBaseType
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...
 
- Public Member Functions inherited from circt::firrtl::WidthQualifiedTypeTrait< IntType >
std::optional< int32_t > getWidth () const
 Return an optional containing the width, if the width is known (or empty if width is unknown). More...
 
bool hasWidth () const
 Return true if this integer type has a known width. More...
 

Static Public Member Functions

static IntType get (MLIRContext *context, bool isSigned, int32_t widthOrSentinel=-1, bool isConst=false)
 Return an SIntType or UIntType with the specified signedness, width, and constness. More...
 
static bool classof (Type type)
 
- Static Public Member Functions inherited from circt::firrtl::FIRRTLBaseType
static bool classof (Type type)
 Support method to enable LLVM-style type casting. More...
 

Detailed Description

This is the common base class between SIntType and UIntType.

Definition at line 296 of file FIRRTLTypes.h.

Member Function Documentation

◆ classof()

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

Definition at line 314 of file FIRRTLTypes.h.

◆ get()

IntType IntType::get ( MLIRContext *  context,
bool  isSigned,
int32_t  widthOrSentinel = -1,
bool  isConst = false 
)
static

Return an SIntType or UIntType with the specified signedness, width, and constness.

Return a SIntType or UIntType with the specified signedness, width, and constness.

Definition at line 1221 of file FIRRTLTypes.cpp.

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

◆ getConstType()

IntType IntType::getConstType ( bool  isConst)

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

Definition at line 1258 of file FIRRTLTypes.cpp.

References getConstType(), and circt::firrtl::FIRRTLBaseType::isConst().

Referenced by circt::firrtl::emitConnect(), and getConstType().

◆ getWidthOrSentinel()

int32_t IntType::getWidthOrSentinel ( ) const

Return the width of this type, or -1 if it has none specified.

Definition at line 1228 of file FIRRTLTypes.cpp.

Referenced by circt::firrtl::FIRRTLBaseType::getBitWidthOrSentinel().

◆ isSigned()

bool circt::firrtl::IntType::isSigned ( )
inline

Definition at line 305 of file FIRRTLTypes.h.

Referenced by circt::firrtl::emitConnect(), and get().

◆ isUnsigned()

bool circt::firrtl::IntType::isUnsigned ( )
inline

Definition at line 306 of file FIRRTLTypes.h.


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