CIRCT
19.0.0git
|
A packed SystemVerilog type. More...
#include <MooreTypes.h>
Public Member Functions | |
PackedType | resolved () const |
Resolve one level of name or type reference indirection. More... | |
PackedType | fullyResolved () const |
Resolve all name or type reference indirections. More... | |
Domain | getDomain () const |
Get the value domain of this type. More... | |
Sign | getSign () const |
Get the sign for this type. More... | |
std::optional< unsigned > | getBitSize () const |
Get the size of this type in bits. More... | |
void | format (llvm::raw_ostream &os) const |
Format this type in SystemVerilog syntax into an output stream. More... | |
Public Member Functions inherited from circt::moore::UnpackedType | |
UnpackedType | resolved () const |
Resolve one level of name or type reference indirection. More... | |
UnpackedType | fullyResolved () const |
Resolve all name or type reference indirections. More... | |
Domain | getDomain () const |
Get the value domain of this type. More... | |
Sign | getSign () const |
Get the sign for this type. More... | |
std::optional< unsigned > | getBitSize () const |
Get the size of this type in bits. More... | |
SimpleBitVectorType | getSimpleBitVectorOrNull () const |
Get this type as a simple bit vector, if it is one. More... | |
bool | isSimpleBitVector () const |
Check whether this is a simple bit vector type. More... | |
SimpleBitVectorType | getSimpleBitVector () const |
Get this type as a simple bit vector. More... | |
SimpleBitVectorType | castToSimpleBitVectorOrNull () const |
Cast this type to a simple bit vector. More... | |
bool | isCastableToSimpleBitVector () const |
Check whether this type can be cast to a simple bit vector type. More... | |
SimpleBitVectorType | castToSimpleBitVector () const |
Cast this type to a simple bit vector. More... | |
void | format (llvm::raw_ostream &os, llvm::function_ref< void(llvm::raw_ostream &os)> around={}) const |
Format this type in SystemVerilog syntax into an output stream. More... | |
void | format (llvm::raw_ostream &os, StringRef around) const |
template<typename... Args> | |
std::string | toString (Args... args) const |
Format this type in SystemVerilog syntax into a string. More... | |
Static Public Member Functions | |
static bool | classof (Type type) |
Static Public Member Functions inherited from circt::moore::UnpackedType | |
static bool | classof (Type type) |
A packed SystemVerilog type.
Packed types are the core types of SystemVerilog. They combine a core packed type with an optional sign and zero or more packed dimensions. The core packed types are:
bit
, logic
, reg
byte
, shortint
, int
, longint
, integer
, time
The packed dimensions can be:
[]
)[x:y]
)Note that every packed type is also a valid unpacked type. But unpacked types are not valid packed types.
Definition at line 423 of file MooreTypes.h.
|
inlinestatic |
Definition at line 425 of file MooreTypes.h.
void PackedType::format | ( | llvm::raw_ostream & | os | ) | const |
Format this type in SystemVerilog syntax into an output stream.
Useful to present the type back to the user in diagnostics.
Definition at line 295 of file MooreTypes.cpp.
Referenced by circt::moore::PackedDim::format().
PackedType PackedType::fullyResolved | ( | ) | const |
Resolve all name or type reference indirections.
For example, given typedef int foo; typedef foo bar;
, resolves bar
to int
.
Definition at line 250 of file MooreTypes.cpp.
std::optional< unsigned > PackedType::getBitSize | ( | ) | const |
Get the size of this type in bits.
Returns None
if any of the type's dimensions is unsized.
Definition at line 278 of file MooreTypes.cpp.
Domain PackedType::getDomain | ( | ) | const |
Get the value domain of this type.
Definition at line 257 of file MooreTypes.cpp.
References circt::moore::TwoValued.
Sign PackedType::getSign | ( | ) | const |
Get the sign for this type.
Definition at line 268 of file MooreTypes.cpp.
References circt::moore::Unsigned.
PackedType PackedType::resolved | ( | ) | const |
Resolve one level of name or type reference indirection.
For example, given typedef int foo; typedef foo bar;
, resolves bar
to foo
.
Definition at line 243 of file MooreTypes.cpp.