CIRCT  19.0.0git
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
circt::moore::UnpackedAssocDim Class Reference

An unpacked associative dimension, like [T] or [*]. More...

#include <MooreTypes.h>

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

Public Member Functions

UnpackedType getIndexType () const
 Get the index type of the associative dimension. More...
 

Static Public Member Functions

static UnpackedAssocDim get (UnpackedType inner, UnpackedType indexType={})
 

Static Public Attributes

static constexpr StringLiteral name = "moore.unpacked_assoc_dim"
 

Friends

struct detail::DimStorage
 

Detailed Description

An unpacked associative dimension, like [T] or [*].

Associative arrays in SystemVerilog can have a concrete index type ([T]), or a wildcard index type ([*], §7.8.1). The latter is exceptionally strange, as it applies only to integer indices, but supports arbitrarily sized indices by always removing leading zeros from any index that is used in the lookup. This is interesting if a string is used to index into such an array, because strings are automatically cast to a bit vector of equivalent size, which results in a sort-of string key lookup. However, note that there are also dedicated semantics for using string as the actual index type (§7.8.2).

See IEEE 1800-2017 §7.8 "Associative arrays".

Definition at line 1013 of file MooreTypes.h.

Member Function Documentation

◆ get()

UnpackedAssocDim UnpackedAssocDim::get ( UnpackedType  inner,
UnpackedType  indexType = {} 
)
static

◆ getIndexType()

UnpackedType UnpackedAssocDim::getIndexType ( ) const

Get the index type of the associative dimension.

This returns either the type T in a dimension [T], or a null type in a dimension [*].

Definition at line 937 of file MooreTypes.cpp.

Friends And Related Function Documentation

◆ detail::DimStorage

friend struct detail::DimStorage
friend

Definition at line 1027 of file MooreTypes.h.

Member Data Documentation

◆ name

constexpr StringLiteral circt::moore::UnpackedAssocDim::name = "moore.unpacked_assoc_dim"
staticconstexpr

Definition at line 1023 of file MooreTypes.h.


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