CIRCT  18.0.0git
Public Member Functions | Static Public Member Functions | 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
Collaboration diagram for circt::moore::UnpackedAssocDim:
Collaboration graph

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={})


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 965 of file MooreTypes.h.

Member Function Documentation

◆ get()

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

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

Friends And Related Function Documentation

◆ detail::DimStorage

friend struct detail::DimStorage

Definition at line 977 of file MooreTypes.h.

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