Case study: simulation speed

The same receiver regression, 5.9× faster, bit for bit

Three Xilinx IP models took over 95 % of every openofdm_rx simulation. We replaced them with models that are bit- and cycle-exact for the way the receiver drives them, then proved it three ways. Sign-off still runs on the Xilinx models; the fast ones carry the sweeps, long runs and daily turnaround.

Ran on our side. Vivado simulator on our own desktop build runner. No customer code or customer machines were involved.

3737 s → 637 sall seven openofdm_rx tests, Vivado simulator, idle desktop, one simulation at a time, same seed, compile time excluded; all pass in both modes

Where the time went

Profiling one dual-link receiver test pair showed the problem plainly: with the Xilinx behavioural models it took about 290 s; with those models stubbed out, 6 s. Everything else in the receiver, the testbench and UVM was the small part.

Xilinx IP models in
IP models stubbed

One dual_rx test pair, about 290 s against 6 s.

Per test

Xilinx modelsFast models
The two register-only tests use no IP and take 3 s in both modes.

What was replaced

Xilinx IPConfiguration in openofdm_rxFast model
Complex multiplier (cmpy 6.0)16 × 16, 32-bit output, truncate, latency 3Full product, top bits kept
Three dividers (div_gen 5.1)Radix-2, fractional, one configuration per instanceRestoring division fitted to the Xilinx model, division by zero included
64-point FFT (xfft 9.1)Pipelined streaming, unscaled, truncationXilinx's own bit-accurate C model through DPI, with the core's handshake and latency reproduced

The FFT's timing was measured on the Xilinx model, not taken from the datasheet: the 64 outputs of a frame start 148 + ofs clocks after its last input, where ofs is 0 or −1 depending on the gap before the frame. Data while valid is low was measured too, because the receiver registers the FFT output on every clock.

Proved equal, three ways

Matching the valid outputs was not enough. A first model that matched only valid data changed 16 LLR magnitudes in a receiver run, so every check compares every output on every clock, valid or not.

  1. Lockstep bench

    5/5

    Xilinx and fast models driven with the same random stimulus: extreme operands, divisors of zero, back-to-back FFT frames, idle gaps of 0–400 clocks, resets at any point.

  2. Replay of a real run

    0 mismatches

    Every substituted instance recorded its inputs during a receiver SNR sweep: 24 instances, about 0.86 million clocks each, replayed into both models.

  3. Whole tests

    7/7 identical

    All receiver tests run in both modes and compared, down to every synchroniser and equaliser sample and every LLR.

The trap that was not in the models

The first whole-test comparison differed in 16 of 83,840 LLR magnitudes. The cause was the testbench: it drew its noise from $urandom, and the Vivado simulator seeds each thread's generator from the whole design, so the same seed gave different noise with the two model sets. Noise now has its own generator, seeded from the test's seed, and the runs are identical.

Outside the modelled envelope the models refuse rather than drift: a gap inside an FFT frame stops the simulation with a fatal error, since the Xilinx core would stall its whole pipeline there.

What it changed

Experiments that could not finish became routine. The dual-link rescue ladder hit the CI's 120-minute limit at pair 15 with the Xilinx models; with the fast models all 78 pairs take 31 minutes (both on a loaded desktop).

How to read the number. 5.9× is for the receiver regression on an idle machine. Earlier timings on a loaded desktop showed ratios up to about 28×, but load slowed the Xilinx runs most, so we report only the idle figures.

It is a simulation speed-up, not a claim about total verification time.

Using it

One switch picks the models; both builds coexist, and the default stays on the Xilinx models.

python uvm/sim/xsim.py --ip-models fast regress --tb openofdm_rx
python uvm/sim/xsim.py fastip-eq --jobs 3        # lockstep proof, writes a report
python uvm/sim/xsim.py --ip-models fast run --tb openofdm_rx --test orx_snr_sweep_test --plusargs +FASTIP_REC=rec   # record inputs for replay

Simulation too slow to sweep?

Vendor IP models are often most of the run time. We build and prove faster equivalents.

Leo Zhang, PhD, BitExact Labs
leo@bitexactlabs.com · WeChat leocheungZR