CIRCT
18.0.0git
|
An integer vector or atom type. More...
#include <MooreTypes.h>
Public Types | |
enum | Kind { Bit , Logic , Reg , Byte , ShortInt , Int , LongInt , Integer , Time } |
Public Member Functions | |
Kind | getKind () const |
Get the concrete integer vector or atom type. More... | |
Sign | getSign () const |
Get the sign of this type. More... | |
bool | isSignExplicit () const |
Whether the sign of the type was specified explicitly. More... | |
StringRef | getKeyword () const |
Get the keyword (like bit ) for this type. More... | |
Sign | getDefaultSign () const |
Get the default sign for this type. More... | |
Domain | getDomain () const |
Get the value domain for this type. More... | |
unsigned | getBitSize () const |
Get the size of this type. More... | |
void | format (llvm::raw_ostream &os) const |
Format this type in SystemVerilog syntax. More... | |
Static Public Member Functions | |
static std::optional< Kind > | getKindFromKeyword (StringRef keyword) |
Get the integer type that corresponds to a keyword (like bit ). More... | |
static StringRef | getKeyword (Kind kind) |
Get the keyword (like bit ) for one of the integer types. More... | |
static Sign | getDefaultSign (Kind kind) |
Get the default sign for one of the integer types. More... | |
static Domain | getDomain (Kind kind) |
Get the value domain for one of the integer types. More... | |
static unsigned | getBitSize (Kind kind) |
Get the size of one of the integer types. More... | |
static std::optional< Kind > | getKindFromDomainAndSize (Domain domain, unsigned size) |
Get the integer type that corresponds to a domain and bit size. More... | |
static IntType | get (MLIRContext *context, Kind kind, std::optional< Sign > sign={}) |
static IntType | getLogic (MLIRContext *context) |
Create a logic type. More... | |
static IntType | getInt (MLIRContext *context) |
Create a int type. More... | |
static IntType | getTime (MLIRContext *context) |
Create a time type. More... | |
An integer vector or atom type.
Definition at line 502 of file MooreTypes.h.
Enumerator | |
---|---|
Bit | A |
Logic | A |
Reg | A |
Byte | A |
ShortInt | A |
Int | An |
LongInt | A |
Integer | An |
Time | A |
Definition at line 505 of file MooreTypes.h.
void IntType::format | ( | llvm::raw_ostream & | os | ) | const |
Format this type in SystemVerilog syntax.
Useful to present the type back to the user in diagnostics.
Definition at line 491 of file MooreTypes.cpp.
References getDefaultSign(), getKeyword(), getSign(), and isSignExplicit().
Definition at line 478 of file MooreTypes.cpp.
References circt::calyx::direction::get(), getDefaultSign(), and circt::moore::detail::IntTypeStorage::pack().
Referenced by customTypeParser(), getInt(), getLogic(), getTime(), circt::moore::SimpleBitVectorType::getType(), and mooreIntTypeGet().
|
inline |
Get the size of this type.
Definition at line 571 of file MooreTypes.h.
References getBitSize(), and getKind().
Referenced by getBitSize().
|
static |
Get the size of one of the integer types.
Definition at line 425 of file MooreTypes.cpp.
References Bit, Byte, Int, Integer, Logic, LongInt, Reg, ShortInt, and Time.
Referenced by getSimpleBitVectorFromIntType(), and populateTypeConversion().
|
inline |
Get the default sign for this type.
Definition at line 567 of file MooreTypes.h.
References getDefaultSign(), and getKind().
Referenced by format(), get(), and getDefaultSign().
Get the default sign for one of the integer types.
Definition at line 391 of file MooreTypes.cpp.
References Bit, Byte, Int, Integer, Logic, LongInt, Reg, ShortInt, circt::moore::Signed, Time, and circt::moore::Unsigned.
|
inline |
Get the value domain for this type.
Definition at line 569 of file MooreTypes.h.
References getDomain(), and getKind().
Referenced by getDomain().
Get the value domain for one of the integer types.
Definition at line 408 of file MooreTypes.cpp.
References Bit, Byte, circt::moore::FourValued, Int, Integer, Logic, LongInt, Reg, ShortInt, Time, and circt::moore::TwoValued.
Referenced by getSimpleBitVectorFromIntType().
|
inlinestatic |
Create a int
type.
Definition at line 551 of file MooreTypes.h.
Referenced by circt::moore::EnumType::get(), and mooreIntTypeGetInt().
|
inline |
Get the keyword (like bit
) for this type.
Definition at line 565 of file MooreTypes.h.
References getKeyword(), and getKind().
Referenced by format(), and getKeyword().
|
static |
IntType::Kind IntType::getKind | ( | ) | const |
Get the concrete integer vector or atom type.
Definition at line 485 of file MooreTypes.cpp.
Referenced by getBitSize(), getDefaultSign(), getDomain(), and getKeyword().
|
static |
Get the integer type that corresponds to a domain and bit size.
For example, returns int
for (TwoValued, 32)
.
Definition at line 447 of file MooreTypes.cpp.
References Bit, Byte, circt::moore::FourValued, Int, Integer, Logic, LongInt, ShortInt, and circt::moore::TwoValued.
Referenced by circt::moore::SimpleBitVectorType::getType().
|
static |
|
inlinestatic |
Create a logic
type.
Definition at line 548 of file MooreTypes.h.
Referenced by mooreIntTypeGetLogic().
Sign IntType::getSign | ( | ) | const |
Get the sign of this type.
Definition at line 487 of file MooreTypes.cpp.
Referenced by format(), and getSimpleBitVectorFromIntType().
|
inlinestatic |
Create a time
type.
Definition at line 554 of file MooreTypes.h.
Referenced by mooreIntTypeGetTime().
bool IntType::isSignExplicit | ( | ) | const |
Whether the sign of the type was specified explicitly.
This allows us to distinguish bit unsigned
from bit
.
Definition at line 489 of file MooreTypes.cpp.
Referenced by format(), and getSimpleBitVectorFromIntType().