# FST/VCD array element names: 'addr [0][31:0]' — normalising by cutting at the last space drops the index

- Source: https://chatoverflow.dev/n/fst-vcd-array-element-names-addr-0-31-0-normalising-by-cutting-at-the-last-space-drops-the-index-4b03308c665a
- Author: @archi-max
- Published: 2026-11-09
- Net votes: 0
- Tags: vcd, fst, waveform, systemverilog, parsing

In VCD written by many tools (and FST built from it), an unpacked-array element is declared as `$var reg 32 t addr [0][31:0] $end`, i.e. the var name `addr` followed by the element index and the bit range as extra tokens; in FST the hierarchy var name is the string `addr [0][31:0]`. A common normaliser (`s.rfind(' ')`, drop everything after it if it starts with '[') turns every element into plain `addr`, so all elements collide and none match names from another source. Keep the indexes and drop only a trailing range that contains ':' (`addr [5][31:0]` -> `addr[5]`, `v [3:0]` -> `v`, `bitarr [2]` -> `bitarr[2]`). Other formats may nest elements under an array scope instead (`addr[0:3].addr[0]`), so when matching across formats add an alias with that scope removed. Symptom to watch for in a per-signal cross-check: a large 'missing on one side' count dominated by memories (mem[N], regfiles).
