CIRCT  19.0.0git
Public Member Functions | Public Attributes | List of all members
circt::moore::SimpleBitVectorType Struct Reference

A simple bit vector type. More...

#include <MooreTypes.h>

Collaboration diagram for circt::moore::SimpleBitVectorType:
Collaboration graph
[legend]

Public Member Functions

 SimpleBitVectorType ()
 Create a null SBVT. More...
 
 SimpleBitVectorType (Domain domain, Sign sign, unsigned size, bool usedAtom=false, bool explicitSign=false, bool explicitSize=true)
 Create a new SBVT with the given domain, sign, and size. More...
 
PackedType getType (MLIRContext *context) const
 Convert this SBVT to an actual type. More...
 
bool isUnsigned () const
 Check whether the type is unsigned. More...
 
bool isSigned () const
 Check whether the type is signed. More...
 
Range getRange () const
 Get the range of the type. More...
 
SimpleBitVectorType toSingleBit () const
 Get a single bit version of this type by setting its size to 1. More...
 
bool isEquivalent (const SimpleBitVectorType &other) const
 Check whether this type is equivalent to another. More...
 
bool operator== (const SimpleBitVectorType &other) const
 
 operator bool () const
 Check whether this is a null type. More...
 
std::string toString () const
 Format this simple bit vector type as a string. More...
 

Public Attributes

unsigned size = 0
 The size of the vector. More...
 
Domain domain: 8
 The domain, which dictates whether this is a bit or logic vector. More...
 
Sign sign: 8
 The sign. More...
 
bool usedAtom: 1
 Whether the type used an integer atom like int in the source text. More...
 
bool explicitSign: 1
 Whether the sign was explicit in the source text. More...
 
bool explicitSize: 1
 Whether the single-bit vector had an explicit range in the source text. More...
 

Detailed Description

A simple bit vector type.

The SystemVerilog standard somewhat loosely defines a "Simple Bit Vector" type. In essence, this is a zero or one-dimensional integer type. For example, bit, logic [0:0], reg [31:0], or int are SBVs, but bit [1:0][2:0], int [4:0], bit [5:2], or bit [] are not.

Definition at line 134 of file MooreTypes.h.

Constructor & Destructor Documentation

◆ SimpleBitVectorType() [1/2]

circt::moore::SimpleBitVectorType::SimpleBitVectorType ( )
inline

Create a null SBVT.

Definition at line 136 of file MooreTypes.h.

◆ SimpleBitVectorType() [2/2]

circt::moore::SimpleBitVectorType::SimpleBitVectorType ( Domain  domain,
Sign  sign,
unsigned  size,
bool  usedAtom = false,
bool  explicitSign = false,
bool  explicitSize = true 
)
inline

Create a new SBVT with the given domain, sign, and size.

The resulting type will expand exactly to bit signed? [size-1:0].

Definition at line 140 of file MooreTypes.h.

References assert(), and size.

Member Function Documentation

◆ getRange()

Range circt::moore::SimpleBitVectorType::getRange ( ) const
inline

Get the range of the type.

Definition at line 158 of file MooreTypes.h.

References circt::moore::Down, and size.

Referenced by circt::moore::UnpackedType::getSimpleBitVectorOrNull(), and circt::moore::operator<<().

◆ getType()

PackedType SimpleBitVectorType::getType ( MLIRContext *  context) const

◆ isEquivalent()

bool circt::moore::SimpleBitVectorType::isEquivalent ( const SimpleBitVectorType other) const
inline

Check whether this type is equivalent to another.

Definition at line 170 of file MooreTypes.h.

References domain, sign, and size.

Referenced by operator==().

◆ isSigned()

bool circt::moore::SimpleBitVectorType::isSigned ( ) const
inline

Check whether the type is signed.

Definition at line 155 of file MooreTypes.h.

References sign, and circt::moore::Signed.

◆ isUnsigned()

bool circt::moore::SimpleBitVectorType::isUnsigned ( ) const
inline

Check whether the type is unsigned.

Definition at line 152 of file MooreTypes.h.

References sign, and circt::moore::Unsigned.

◆ operator bool()

circt::moore::SimpleBitVectorType::operator bool ( ) const
inline

Check whether this is a null type.

Definition at line 183 of file MooreTypes.h.

References size.

◆ operator==()

bool circt::moore::SimpleBitVectorType::operator== ( const SimpleBitVectorType other) const
inline

Definition at line 174 of file MooreTypes.h.

References explicitSign, explicitSize, isEquivalent(), size, and usedAtom.

◆ toSingleBit()

SimpleBitVectorType circt::moore::SimpleBitVectorType::toSingleBit ( ) const
inline

Get a single bit version of this type by setting its size to 1.

Definition at line 161 of file MooreTypes.h.

References size.

◆ toString()

std::string circt::moore::SimpleBitVectorType::toString ( ) const
inline

Format this simple bit vector type as a string.

Definition at line 186 of file MooreTypes.h.

Member Data Documentation

◆ domain

Domain circt::moore::SimpleBitVectorType::domain

The domain, which dictates whether this is a bit or logic vector.

Definition at line 195 of file MooreTypes.h.

Referenced by getType(), circt::moore::hash_value(), isEquivalent(), and circt::moore::operator<<().

◆ explicitSign

bool circt::moore::SimpleBitVectorType::explicitSign

Whether the sign was explicit in the source text.

Definition at line 207 of file MooreTypes.h.

Referenced by getType(), circt::moore::hash_value(), circt::moore::operator<<(), and operator==().

◆ explicitSize

bool circt::moore::SimpleBitVectorType::explicitSize

Whether the single-bit vector had an explicit range in the source text.

Essentially whether it was bit or bit[a:a].

Definition at line 210 of file MooreTypes.h.

Referenced by circt::moore::UnpackedType::getSimpleBitVectorOrNull(), getType(), circt::moore::hash_value(), circt::moore::operator<<(), and operator==().

◆ sign

Sign circt::moore::SimpleBitVectorType::sign

◆ size

unsigned circt::moore::SimpleBitVectorType::size = 0

◆ usedAtom

bool circt::moore::SimpleBitVectorType::usedAtom

Whether the type used an integer atom like int in the source text.

Definition at line 205 of file MooreTypes.h.

Referenced by getType(), circt::moore::hash_value(), and operator==().


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