CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::sv::CaseBitPattern Class Reference

#include <SVOps.h>

Inheritance diagram for circt::sv::CaseBitPattern:
Collaboration diagram for circt::sv::CaseBitPattern:

Public Member Functions

size_t getWidth () const
CasePatternBit getBit (size_t bitNumber) const
 Return the specified bit, bit 0 is the least significant bit.
bool hasX () const override
 Return true if this pattern has an X.
bool hasZ () const override
 Return true if this pattern has an Z.
Attribute attr () const override
 CaseBitPattern (ArrayRef< CasePatternBit > bits, MLIRContext *context)
 Get a CasePattern from a specified list of CasePatternBit.
 CaseBitPattern (const APInt &value, MLIRContext *context)
 Get a CasePattern for the specified constant value.
 CaseBitPattern (IntegerAttr attr)
 Get a CasePattern with a correctly encoded attribute.
Public Member Functions inherited from circt::sv::CasePattern
 CasePattern (CasePatternKind kind)
virtual ~CasePattern ()
CasePatternKind getKind () const

Static Public Member Functions

static bool classof (const CasePattern *S)

Private Attributes

IntegerAttr intAttr

Additional Inherited Members

Public Types inherited from circt::sv::CasePattern
enum  CasePatternKind { CPK_bit , CPK_enum , CPK_expr , CPK_default }

Detailed Description

Definition at line 97 of file SVOps.h.

Constructor & Destructor Documentation

◆ CaseBitPattern() [1/3]

CaseBitPattern::CaseBitPattern ( ArrayRef< CasePatternBit > bits,
MLIRContext * context )

Get a CasePattern from a specified list of CasePatternBit.

Bits are specified in most least significant order - element zero is the least significant bit.

Definition at line 998 of file SVOps.cpp.

References circt::sv::CasePattern::CasePattern(), context, circt::sv::CasePattern::CPK_bit, and intAttr.

Referenced by CaseBitPattern().

◆ CaseBitPattern() [2/3]

CaseBitPattern::CaseBitPattern ( const APInt & value,
MLIRContext * context )

Get a CasePattern for the specified constant value.

Definition at line 992 of file SVOps.cpp.

References CaseBitPattern(), context, and getPatternBitsForValue().

◆ CaseBitPattern() [3/3]

circt::sv::CaseBitPattern::CaseBitPattern ( IntegerAttr attr)
inline

Get a CasePattern with a correctly encoded attribute.

Definition at line 119 of file SVOps.h.

References attr(), circt::sv::CasePattern::CasePattern(), circt::sv::CasePattern::CPK_bit, and intAttr.

Member Function Documentation

◆ attr()

Attribute circt::sv::CaseBitPattern::attr ( ) const
inlineoverridevirtual

Implements circt::sv::CasePattern.

Definition at line 108 of file SVOps.h.

References intAttr.

Referenced by CaseBitPattern().

◆ classof()

bool circt::sv::CaseBitPattern::classof ( const CasePattern * S)
inlinestatic

◆ getBit()

auto CaseBitPattern::getBit ( size_t bitNumber) const

Return the specified bit, bit 0 is the least significant bit.

Definition at line 962 of file SVOps.cpp.

References intAttr.

Referenced by hasX(), and hasZ().

◆ getWidth()

size_t circt::sv::CaseBitPattern::getWidth ( ) const
inline

Definition at line 100 of file SVOps.h.

References intAttr.

Referenced by hasX(), and hasZ().

◆ hasX()

bool CaseBitPattern::hasX ( ) const
overridevirtual

Return true if this pattern has an X.

Reimplemented from circt::sv::CasePattern.

Definition at line 967 of file SVOps.cpp.

References circt::sv::AnyX, getBit(), and getWidth().

◆ hasZ()

bool CaseBitPattern::hasZ ( ) const
overridevirtual

Return true if this pattern has an Z.

Reimplemented from circt::sv::CasePattern.

Definition at line 974 of file SVOps.cpp.

References circt::sv::AnyZ, getBit(), and getWidth().

Member Data Documentation

◆ intAttr

IntegerAttr circt::sv::CaseBitPattern::intAttr
private

Definition at line 124 of file SVOps.h.

Referenced by attr(), CaseBitPattern(), CaseBitPattern(), getBit(), and getWidth().


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