CIRCT  19.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
circt::moore::UnpackedDim Class Reference

An unpacked dimension. More...

#include <MooreTypes.h>

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

Public Member Functions

UnpackedType getInner () const
 Get the element type of the dimension. This is the x in x[a:b]. More...
 
void format (llvm::raw_ostream &os, llvm::function_ref< void(llvm::raw_ostream &)> around={}) const
 Format this type in SystemVerilog syntax. More...
 
void formatDim (llvm::raw_ostream &os) const
 Format just the dimension part, [...]. More...
 
UnpackedType resolved () const
 Resolve one level of name or type reference indirection. More...
 
UnpackedType fullyResolved () const
 Resolve all name or type reference indirections. 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)
 

Protected Member Functions

const detail::DimStoragegetImpl () const
 

Detailed Description

An unpacked dimension.

Definition at line 903 of file MooreTypes.h.

Member Function Documentation

◆ classof()

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

Definition at line 905 of file MooreTypes.h.

◆ format()

void UnpackedDim::format ( llvm::raw_ostream &  os,
llvm::function_ref< void(llvm::raw_ostream &)>  around = {} 
) const

Format this type in SystemVerilog syntax.

Useful to present the type back to the user in diagnostics. The unpacked dimensions are separated from any packed dimensions by calling the provided around callback, or a $ if no callback has been provided. This can be useful when printing declarations like bit [7:0] foo [16] to have the type properly surround the declaration name foo, and to easily tell packed from unpacked dimensions in types like bit [7:0] $ [15].

Definition at line 849 of file MooreTypes.cpp.

References circt::moore::UnpackedType::format().

◆ formatDim()

void UnpackedDim::formatDim ( llvm::raw_ostream &  os) const

Format just the dimension part, [...].

Definition at line 874 of file MooreTypes.cpp.

◆ fullyResolved()

UnpackedType UnpackedDim::fullyResolved ( ) const

Resolve all name or type reference indirections.

See UnpackedType::fullyResolved.

Definition at line 900 of file MooreTypes.cpp.

References circt::moore::detail::DimStorage::fullyResolved, and getImpl().

◆ getImpl()

const detail::DimStorage * UnpackedDim::getImpl ( ) const
protected

Definition at line 904 of file MooreTypes.cpp.

Referenced by fullyResolved(), getInner(), and resolved().

◆ getInner()

UnpackedType UnpackedDim::getInner ( ) const

Get the element type of the dimension. This is the x in x[a:b].

Definition at line 847 of file MooreTypes.cpp.

References getImpl(), and circt::moore::detail::DimStorage::inner.

◆ resolved()

UnpackedType UnpackedDim::resolved ( ) const

Resolve one level of name or type reference indirection.

See UnpackedType::resolved.

Definition at line 898 of file MooreTypes.cpp.

References getImpl(), and circt::moore::detail::DimStorage::resolved.


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