slang::netlist::SymbolTracker class

Track drivers for symbols.

Each 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 SymbolDrivers is not a member of this class because it is stored in the analysis state during the DataFlowAnalysis pass.

Constructors, destructors, conversion operators

SymbolTracker()

Public functions

auto begin() const -> auto
auto end() const -> auto
auto getSymbol(uint32_t slot) const -> const ast::Symbol*
Get a symbol by its slot index.
auto getSlot(ast::Symbol const& symbol) -> std::optional<uint32_t>
Get the slot index for a symbol, if it exists.
void addDriver(SymbolDrivers& drivers, ast::Symbol const& symbol, ast::Expression const* lsp, DriverBitRange bounds, NetlistNode* node, bool merge = false)
void mergeDriver(SymbolDrivers& drivers, ast::Symbol const& symbol, ast::Expression const* lsp, DriverBitRange bounds, NetlistNode* node)
void mergeDrivers(SymbolDrivers& drivers, ast::Symbol const& symbol, DriverBitRange bounds, DriverList const& driverList)
Merge a list of drivers for the specified symbol and bit range.
auto getDrivers(SymbolDrivers& drivers, ast::Symbol const& symbol, DriverBitRange bounds) -> DriverList
auto dumpDrivers(ast::Symbol const& symbol, DriverMap& driverMap) -> std::string
Dump the current driver map for all symbols for debugging output.
auto getAllocator() -> DriverMap::AllocatorType&

Function documentation

void slang::netlist::SymbolTracker::addDriver(SymbolDrivers& drivers, ast::Symbol const& symbol, ast::Expression const* lsp, DriverBitRange bounds, NetlistNode* node, bool merge = false)

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

void slang::netlist::SymbolTracker::mergeDriver(SymbolDrivers& drivers, ast::Symbol const& symbol, ast::Expression const* lsp, DriverBitRange bounds, NetlistNode* node)

Merge a driver for the specified symbol. This adds to any existing drivers for the specified bit range.

DriverList slang::netlist::SymbolTracker::getDrivers(SymbolDrivers& drivers, ast::Symbol const& symbol, DriverBitRange bounds)

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