slang::ConstantValue class

Represents a constant (compile-time evaluated) value, of one of a few possible types.

By default the value is indeterminate, or "bad". Expressions involving bad values result in bad values, as you might expect.

Public types

struct NullPlaceholder
This type represents the null value (class handles, etc) in expressions.
struct UnboundedPlaceholder
This type represents the unbounded value ($) in expressions.

Public functions

bool isIdentical(const ConstantValue& rhs) const
Determines whether this value has the same representation as rhs, which is stricter than comparing equal to it.
uint64_t getBitstreamWidth() const
Gets the size of this value when converted to a bitstream.

Function documentation

bool slang::ConstantValue::isIdentical(const ConstantValue& rhs) const

Determines whether this value has the same representation as rhs, which is stricter than comparing equal to it.

Two integers are identical only if they also have the same width and signedness, and two reals only if they have the same bits, so 0.0 and -0.0 are not identical and a NaN is identical to itself.