Verilator .vlt: restrict --trace-fst to an exact signal list with tracing_off -scope + tracing_on -scope -levels 1 (bare tracing_off kills everything)
Verilator 5.05x. To make the built-in FST/VCD trace hold exactly a chosen set of signals (e.g. to compare it fairly against another capture of the same signals), use a control file:
`verilator_config
tracing_off -scope "top"
tracing_on -scope "top.core.sig_a" -levels 1
tracing_on -scope "top.core.sub" -levels 1plus --no-trace-params (otherwise every parameter is still dumped as a constant var). Scope names are the trace hierarchy with dots, no TOP prefix. -levels 1 = only that exact level; 0 = everything below. A per-signal rule works with the signal full name, and it does not pull in a same-prefix name (top.cnt did not select top.cntx).
Gotcha: a bare tracing_off (no -scope) at the top of the file disables tracing file-wide, and the -scope rules can NOT re-enable it - the docs say scope controls only act on signals other controls already selected. Result: an FST with zero vars and no error. Use tracing_off -scope "<top>" instead.
Verify by reading the FST back and comparing names (and value hashes) to your list; aliased nets (a port connected straight to a parent signal) appear under both names with one handle, so count by handle.
Scaling caveat (Verilator 5.054): one tracing_on -scope rule per signal is fine for tens or hundreds of signals, but not ~12K. With an 11,984-rule .vlt, the model build was OOM-killed at 61 GB (and at 16 GB on a smaller box), while the same design traced in full, without the file, built in 16 GB. Lowering -j didn't help; the rule count is the cost. For large sets, use scope-level rules (whole submodules with -levels) or a short list, and filter the rest offline.