Simulation speed
The claim
One potential gain of Waveflow is a faster simulation loop. A system engineer evaluates an algorithm in untimed Python; the hardware team then simulates RTL, which is accurate and slow. Waveflow’s loosely-timed pysim sits between them: the same bit-exact Python arithmetic, plus the timing of the hardware – latency, throughput, back-pressure – without synthesizing anything.
That is only useful if the timing costs little on top of the arithmetic, and much less than RTL. This section measures both, on blocks small enough to understand completely. It is an assessment, not a demonstration: the goal is to know what the simulation costs and why, and where to improve it.
The cost model
The measurements so far fit a simple additive model:
pysim time = untimed model time + (SimPy events) x (cost per event)
- The untimed model time is the arithmetic, and it is the same code in both runs: the pysim’s tasks call the model’s functions. Making the model faster makes the pysim faster by the same amount.
- The events are the transactions – a message handed over, a memory read, a modelled delay. How many a transaction needs is a property of the model’s structure.
- The cost per event is SimPy’s own (about 0.6 us for a bare event on the test machine) plus Waveflow’s work around it: building and parsing a message, interface bookkeeping. On memcpy it is about 16 us today; on the processor model about 2.7 us, measured on another machine (below). It is a property of what an event carries: a processor call moves no data.
So the honest questions are how many events a design needs, and what each one costs – which is why the first block measured is memcpy, which has no arithmetic at all.
Results
| block | untimed model | Waveflow pysim | RTL (XSI) or gem5 | notes |
|---|---|---|---|---|
| memcpy, per copy | 0.5 us | 0.4 ms (25 events) | – | no compute: the per-transaction cost, flat in the copy length |
SSR FFT L = 1024, per frame |
1.87 ms (vectorized numpy) | 2.29 ms flat; 4.44 ms per task | 131 ms | plus ~131 s csynth and a 24.5 s XSI build per design point |
| processor model, per scheduler operation | 3.25 us (Python + calibrated prices) | 15.2 us (4.46 events) | gem5 HPI: 692 us simulating it; 11.3 ms of a whole run, plus 5.6 s a run | three optimization rounds took the pysim from 31.8 us; warm prices (cold first pass 23.2 us) |
systolic engine 8×8×32, per product (preliminary) |
0.036 ms | 0.73 ms (44 events) | 43 ms | plus ~80 s csynth and a 20 s XSI build per design point |
CG on the vector unit, per 8×32 job of three iterations |
0.05 ms (cg_solve); 7.4 ms the unit’s interpreter |
15 ms, of which 8.1 ms builds the harness (104 events) | 4.9 s | plus ~114 s csynth and a 154 s XSI build per design point |
| matched filter on the vector unit, per 64-sample chunk at 8 antennas | 0.009 ms (numpy); 0.35 ms the unit’s interpreter | 0.99 ms (34 events) | 266 ms | plus ~101 s csynth and a 138 s XSI build per design point |
Measured 2026-10-13 on one Windows 11 machine (Intel 13th-generation-class CPU, Python 3.14),
nothing else running, best of several runs. The processor-model row was measured 2026-11-06 on a
Linux workstation (Intel Core i7-7700K, 8 threads at 4.2 GHz, Python 3.12.3, SimPy 4.1.2) with gem5
v25.1 and the A53 platform calibrated with Vitis 2025.1’s gcc, its load average below 1 before each
series; the two machines differ in age and Python version, so compare times within a machine, and
across machines the ratios. The two vector-unit rows were measured 2026-11-06 on the same Linux
workstation with Vitis HLS / Vivado xsim 2025.1, otherwise idle, each fitted over four problem sizes,
after Stage 10 of plans/vecunit_new.md made the unit’s own Python faster.
Against a compiled model the picture changes, and it should be read that way. The FFT’s untimed model is vectorized numpy – a fair baseline, and what most system engineers write – but not compiled. Rewritten as typed loops and compiled, which is real work, it would take an estimated ~0.05 ms a frame. The pysim would call the same compiled arithmetic and keep its measured overhead, ~0.05 + 0.42 = ~0.47 ms flat: about 9 times the compiled model, still about 280 times faster than RTL. The estimate and its basis are on the FFT page.
How it is measured
- Per-frame cost, not total. Each fidelity runs at several frame counts and is fitted to
setup + frames x per_frame, so building a graph or a simulator does not hide in the per-frame number. The one-time costs are reported beside it. - Same frames, same bits. Every run of every fidelity is checked bit-exact against the golden.
- Best of N. Other load on a machine only ever adds time, so each point keeps its fastest run. When comparing two versions of the code, runs of the two alternate, each in a fresh process.
- Outcomes, not just bits. An optimization must leave the simulated outcome unchanged: when every message arrived, every task’s firings. A faster simulation of something else is not a speedup.
What is still slow
- The cost per event, about 16 us against SimPy’s 0.6 us: mostly building and parsing small messages, and interface code. See memcpy.
- The untimed models themselves. The FFT’s bit-exact model is vectorized numpy, but does about a thousand int64 operations per sample, because it reproduces the vendor library step by step. A compiled model would lower the untimed baseline and the pysim. See the FFT.
- Fine-grained designs. A design that moves many small messages pays the per-transaction cost many times; memcpy’s 0.4 ms per copy is about 800 times a numpy copy.
The pages
- memcpy – the cost of a transaction, with no arithmetic to hide it.
- The SSR FFT – three ways to run the same bit-exact FFT, and the lessons from making its pysim fast.
- The processor model – a scheduler’s operations untimed, in the pysim and on gem5, and three rounds that halved the pysim’s cost with every simulated outcome unchanged.
- The systolic engine – preliminary: a tiny model beside a timed simulation, and where its pysim time goes.
- CG on the vector unit – an iterative program on the programmable vector unit: the unit’s interpreter is the untimed term; its pysim made 3 to 5 times faster with no result changed.
- The matched filter on the vector unit – a streaming program on the same unit: small blocks, so the timing costs more against the arithmetic.
Table of contents
- Simulation speed: memcpy - The cost of one transaction in Waveflow's pysim, measured on memcpy, which has no arithmetic: about 0.4 ms and 25 SimPy events per copy whatever its length, against about 0.5 us for the same copy as a numpy slice. Where the time goes (message building and parsing, interface code, SimPy itself), how it came down from 94 events and 0.6 ms in one day, and what is left.
- Simulation speed: the SSR FFT - One bit-exact 1024-point FFT run three ways on the same frames: the untimed Python model in vectorized numpy (1.87 ms a frame), Waveflow's pysim (2.29 ms flat, 4.44 ms with one process per task) and the synthesized RTL under XSI (131 ms, plus about two and a half minutes of synthesis and build per design point). What the pysim adds and why, how its cost came down from 350 ms a frame in one day, the lessons for the next block, and an estimate against a compiled model, which the pysim would call too: about 0.05 ms a frame untimed, about 0.47 ms in the flat pysim, the timing then most of the cost.
- Simulation speed: the processor model - A scheduler's operations on the calibrated A53 model, run three ways on the same trace: the untimed Python with its calibrated prices (3.25 us an operation), Waveflow's Processor in the pysim (15.2 us), and gem5's HPI core (692 us of host time simulating the operation; a whole gem5 run takes 11.3 ms an operation plus 5.6 s). The pysim adds 11.9 us an operation, about 2.7 us per SimPy event; three optimization rounds took it from 31.8 us to 14.9 us, every simulated outcome unchanged. What the remaining time is, why the ratio to the untimed model rose while both got faster, and what is left.
- Simulation speed: the systolic engine - PRELIMINARY (measured on a development laptop in use; to be re-run on the lab machine). Bit-exact complex matrix products from 32×32×32 to 256×32×256 run three ways on the same operands: the untimed model (0.08 to 7.9 ms), Waveflow's tile-level pysim of the memory-backed engine (60 to 236 ms, cycle counts 5-6% under the RTL's) and the synthesized RTL under XSI (1.5 to 75 s, after 224 s of csynth and 140 s of XSI build). The RTL takes 20 to over 300 times as long as the pysim, the gap growing with size. Then how the pysim got there: vectorized lane groups, the engine's flat pysim, one coalesced memory read per tile, and a direct path for converting matrices to words.
- Simulation speed: CG on the vector unit - Bit-exact CG solves of an 8×n right-hand side (n = 32 to 2,048, 1 to 64 jobs on the vector unit) run four ways on the same operands: the application's untimed model (1 to 4 ms), the unit's interpreter (8.5 to 474 ms), Waveflow's pysim of the unit (28 ms to 1.0 s, cycle counts within 0.14% of the RTL's) and the synthesized RTL under XSI (4.1 to 315 s, after 114 s of csynth and 154 s of XSI build). The RTL takes 146 to 315 times as long as the whole pysim. Making the unit's own Python faster without changing a single result (Stage 10 of the plan) cut the pysim by 3 to 5 times and the interpreter by 1.6 to 1.8 times: how, and what is left.
- Simulation speed: the matched filter on the vector unit - One bit-exact matched-filter frame of 256 to 16,384 samples at 8 antennas (4 to 256 chunks on the vector unit) run four ways on the same operands: the application's untimed model (0.07 to 2.3 ms), the unit's interpreter (1.5 to 89 ms), Waveflow's pysim of the unit (8.6 to 258 ms) and the synthesized RTL under XSI (1.1 to 68 s, after 101 s of csynth and 138 s of XSI build). The RTL takes 132 to 265 times as long as the whole pysim. A streaming program moves a small block per event, so its run is half SimPy and the framework; making the unit's own Python faster without changing a result (Stage 10) sped its interpreter 1.4 times and its pysim 1.1 to 1.2 times. pysim over-charges a chunk by 6%, the calibration's known gap on this build.