CIRCT
18.0.0git
|
A simple bit vector type. More...
#include <MooreTypes.h>
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... | |
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... | |
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.
|
inline |
Create a null SBVT.
Definition at line 136 of file MooreTypes.h.
|
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.
|
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<<().
PackedType SimpleBitVectorType::getType | ( | MLIRContext * | context | ) | const |
Convert this SBVT to an actual type.
Definition at line 72 of file MooreTypes.cpp.
References circt::moore::IntType::Bit, domain, explicitSign, explicitSize, circt::moore::IntType::get(), circt::moore::PackedRangeDim::get(), circt::moore::IntType::getKindFromDomainAndSize(), circt::moore::IntType::Logic, sign, size, circt::moore::TwoValued, and usedAtom.
|
inline |
Check whether this type is equivalent to another.
Definition at line 161 of file MooreTypes.h.
References domain, sign, and size.
Referenced by operator==().
|
inline |
Check whether the type is signed.
Definition at line 155 of file MooreTypes.h.
References sign, and circt::moore::Signed.
|
inline |
Check whether the type is unsigned.
Definition at line 152 of file MooreTypes.h.
References sign, and circt::moore::Unsigned.
|
inline |
|
inline |
Definition at line 165 of file MooreTypes.h.
References explicitSign, explicitSize, isEquivalent(), size, and usedAtom.
|
inline |
Format this simple bit vector type as a string.
Definition at line 177 of file MooreTypes.h.
Domain circt::moore::SimpleBitVectorType::domain |
The domain, which dictates whether this is a bit
or logic
vector.
Definition at line 186 of file MooreTypes.h.
Referenced by getType(), circt::moore::hash_value(), isEquivalent(), and circt::moore::operator<<().
bool circt::moore::SimpleBitVectorType::explicitSign |
Whether the sign was explicit in the source text.
Definition at line 198 of file MooreTypes.h.
Referenced by getType(), circt::moore::hash_value(), circt::moore::operator<<(), and operator==().
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 201 of file MooreTypes.h.
Referenced by circt::moore::UnpackedType::getSimpleBitVectorOrNull(), getType(), circt::moore::hash_value(), circt::moore::operator<<(), and operator==().
Sign circt::moore::SimpleBitVectorType::sign |
The sign.
Definition at line 188 of file MooreTypes.h.
Referenced by getType(), circt::moore::hash_value(), isEquivalent(), isSigned(), isUnsigned(), and circt::moore::operator<<().
unsigned circt::moore::SimpleBitVectorType::size = 0 |
The size of the vector.
Definition at line 184 of file MooreTypes.h.
Referenced by getRange(), getType(), circt::moore::hash_value(), isEquivalent(), operator bool(), circt::moore::operator<<(), operator==(), and SimpleBitVectorType().
bool circt::moore::SimpleBitVectorType::usedAtom |
Whether the type used an integer atom like int
in the source text.
Definition at line 196 of file MooreTypes.h.
Referenced by getType(), circt::moore::hash_value(), and operator==().