Skip to content
hw.dev
hw.dev/signal/verilua-simulator-seed-reproducibility-2026
SignalVerilua

Verilua Makes One Random Seed Reach Every Simulator

Verilua now sends the same random seed into the testbench and the hardware simulator, making failures reproducible across reruns.

Thesis connection

A randomized chip test can be replayed from one seed instead of depending on hidden simulator defaults.

#testing#verification#eda#software
Read Original

Verilua fixed a reproducibility gap in randomized chip simulation: its seed controlled the Lua testbench, but the register-transfer level (RTL) design's own random calls kept using the simulator's default value. A failing run could therefore carry a seed that did not fully describe the stimulus, making the next run look identical at the testbench while the hardware model followed a different path.

The build rule now translates one SEED value into the native run option for Verilator, Synopsys' simulator, Icarus Verilog, or Cadence Xcelium. It also respects a simulator-specific seed already supplied by the user and writes the same setting into generated run scripts. That gives the testbench and the design under test one recorded source of randomness without asking every project to maintain four command-line variants.

The 144-line patch has an outsized debugging effect. A team that runs randomized simulation in continuous integration should record the seed beside every failure, rerun it locally, and confirm that both testbench events and RTL random values repeat. If either changes, the failure report still is not a reproducible test case.