CIRCT  18.0.0git
Public Member Functions | Static Public Member Functions | List of all members
circt::moore::PackedType Class Reference

A packed SystemVerilog type. More...

#include <MooreTypes.h>

Inheritance diagram for circt::moore::PackedType:
Inheritance graph
[legend]
Collaboration diagram for circt::moore::PackedType:
Collaboration graph
[legend]

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)
 

Detailed Description

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:

The packed dimensions can be:

Note that every packed type is also a valid unpacked type. But unpacked types are not valid packed types.

Definition at line 414 of file MooreTypes.h.

Member Function Documentation

◆ classof()

static bool circt::moore::PackedType::classof ( Type  type)
inlinestatic

Definition at line 416 of file MooreTypes.h.

◆ format()

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 293 of file MooreTypes.cpp.

Referenced by circt::moore::PackedDim::format().

◆ fullyResolved()

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 248 of file MooreTypes.cpp.

◆ getBitSize()

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 276 of file MooreTypes.cpp.

Referenced by circt::moore::UnpackedType::castToSimpleBitVectorOrNull().

◆ getDomain()

Domain PackedType::getDomain ( ) const

Get the value domain of this type.

Definition at line 255 of file MooreTypes.cpp.

References circt::moore::TwoValued.

◆ getSign()

Sign PackedType::getSign ( ) const

Get the sign for this type.

Definition at line 266 of file MooreTypes.cpp.

References circt::moore::Unsigned.

◆ resolved()

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 241 of file MooreTypes.cpp.


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