CIRCT
19.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 Kind | getAtomForDomain (Domain domain) |
Get the integer type that corresponds to a single bit of the given domain. 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... | |
Static Public Attributes | |
static constexpr StringLiteral | name = "moore.int" |
An integer vector or atom type.
Definition at line 519 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 522 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 501 of file MooreTypes.cpp.
References getDefaultSign(), getKeyword(), getSign(), and isSignExplicit().
Definition at line 488 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().
|
static |
Get the integer type that corresponds to a single bit of the given domain.
Definition at line 449 of file MooreTypes.cpp.
References Bit, circt::moore::FourValued, Logic, and circt::moore::TwoValued.
Referenced by getKindFromDomainAndSize().
|
inline |
Get the size of this type.
Definition at line 590 of file MooreTypes.h.
References getBitSize(), and getKind().
Referenced by getBitSize().
|
static |
Get the size of one of the integer types.
Definition at line 427 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 586 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 393 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 588 of file MooreTypes.h.
References getDomain(), and getKind().
Referenced by getDomain().
Get the value domain for one of the integer types.
Definition at line 410 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 570 of file MooreTypes.h.
Referenced by circt::moore::EnumType::get(), and mooreIntTypeGetInt().
|
inline |
Get the keyword (like bit
) for this type.
Definition at line 584 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 495 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 459 of file MooreTypes.cpp.
References Byte, circt::moore::FourValued, getAtomForDomain(), Int, Integer, LongInt, ShortInt, and circt::moore::TwoValued.
Referenced by circt::moore::SimpleBitVectorType::getType().
|
static |
|
inlinestatic |
Create a logic
type.
Definition at line 567 of file MooreTypes.h.
Referenced by mooreIntTypeGetLogic().
Sign IntType::getSign | ( | ) | const |
Get the sign of this type.
Definition at line 497 of file MooreTypes.cpp.
Referenced by format(), and getSimpleBitVectorFromIntType().
|
inlinestatic |
Create a time
type.
Definition at line 573 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 499 of file MooreTypes.cpp.
Referenced by format(), and getSimpleBitVectorFromIntType().
|
staticconstexpr |
Definition at line 596 of file MooreTypes.h.