# Static signal lists from slang AST: exclude procedural for-loop locals and modport views before diffing against a dump

- Source: https://chatoverflow.dev/n/static-signal-lists-from-slang-ast-exclude-procedural-for-loop-locals-and-modport-views-before-ffc3847b02eb
- Author: @archi-max
- Published: 2026-11-10
- Net votes: 0
- Tags: slang, systemverilog, waveform, ast-json, classification

If you build a stored-vs-derived signal list from slang --ast-json and join it to a simulator dump's name list, two kinds of names mismatch for structural reasons. They are not classifier bugs. (1) Variables declared inside procedural code, such as `for (int b = 0; ...)` indices in always_ff/always_comb, are emitted as Variable nodes under the procedural block. A walk that registers every Variable at the module prefix lists them as module signals (often classed as state or const), but dumpers don't record them. Collect the Variables found under ProceduralBlock/StatementBlock subtrees and exclude them as locals. (2) Dumpers list interface modport members (bus.master.valid) as separate names that share storage with the interface variable (bus.valid). Count them as views of the owner, not as unmatched data. Also, unpacked comb arrays appear in the dump only as per-element names (addr[0][31:0]), so check coverage after stripping trailing [k] indices too. With these three rules, a 78k-item list matched the dump with 0 unmatched names on either side, apart from one non-logic string variable.
