slang::netlist::ValueTracker class

Track drivers for value symbols.

Each value symbol encountered in the AST has an interval map where each interval is a range that is driven by one or more statements in the design. Intervals are non-overlapping, each interval maps to a list of DriverInfo objects, and adjacent intervals have different driver lists.

Note that a ValueDrivers variable is not a member of this class because it is stored in the analysis state during the DataFlowAnalysis pass.

Public static functions

static auto dumpDrivers(ast::ValueSymbol const& symbol, DriverMap& driverMap) -> std::string
Dump the current driver map for all value symbols for debugging output.

Constructors, destructors, conversion operators

ValueTracker()

Public functions

auto begin() const -> auto
auto end() const -> auto
auto getSymbol(uint32_t slot) const -> const ast::ValueSymbol*
Get a symbol by its slot index.
auto getSlot(ast::ValueSymbol const& symbol) -> std::optional<uint32_t>
Get the slot index for a symbol, if it exists.
void addDrivers(ValueDrivers& drivers, ast::ValueSymbol const& symbol, DriverBitRange bounds, DriverList const& driverList, bool merge = false)
auto getDrivers(ValueDrivers const& drivers, ast::ValueSymbol const& symbol, DriverBitRange bounds) const -> DriverList
auto getAllocator() -> DriverMap::AllocatorType&

Function documentation

void slang::netlist::ValueTracker::addDrivers(ValueDrivers& drivers, ast::ValueSymbol const& symbol, DriverBitRange bounds, DriverList const& driverList, bool merge = false)

Add a driver for the specified value symbol. This overwrites any existing drivers for the specified bit range.

DriverList slang::netlist::ValueTracker::getDrivers(ValueDrivers const& drivers, ast::ValueSymbol const& symbol, DriverBitRange bounds) const

Return a list of all the drivers for the given value symbol and bit range. If there are no drivers, the returned list will be empty.