The timing
These are the cycle models the timed simulation uses, at the proposed parameters. Every number says where it comes from:
- calibrated: measured at RTL on the
xczu48dr_250mhz_vitis2025_1platform and filed there; - measured at RTL: the block’s own HLS body, csynth’d and run in its own gate (xsim 2025.1), the
number a constant in the block’s model beside its source (
plans/aoa_capture_rtl.md,plans/aoa_devices_rtl.md); - measured elsewhere: measured on another design, part or clock, used until it is measured here;
- analytic: loop trip counts and pipeline depths estimated before synthesis, refitted to RTL later,
as
examples/cg_pooldid for its worker.
All cycles are at 250 MHz. A block is 2,083 cycles.
The blocks
Capture and power detector
Measured at RTL (plans/aoa_capture_rtl.md; tests/examples/test_aoa_capture_xsi.py, 22 gates). Two
stages, so the end of one block overlaps the next block’s samples: the sample stage, one pipelined loop
at a word a cycle over the block’s $C \cdot B = 2048$ words of 512 bits (each written to the ring through
port B and added into its channel’s energy – the loop 98% busy, and at RTL after the first block
every word taken the cycle it is offered); and the decide stage, a firing a block. A notification
reaches the controller 41 cycles after its block’s last word, plus a cycle for each answer that
block’s end drained, plus its send slot (its channel for a departure, $C$ + its place after the
round-robin pointer for an arrival): capture.END_CYCLES and its variants – 38 without catch-up, 3 more
at four banks, 2 fewer at one credit – fitted on 50 notifications with no residual over a cycle. It
was 16, analytic. Port B is untimed in pysim (MemSlaveBramWindow.port_b_write is a method call), so
the kernel’s own model charges the one word a cycle (why it
matters).
The ring’s read port, over the crossbar
Calibrated on xczu48dr_250mhz_vitis2025_1 (xsim 2025.1, plans/bram_fullrate_port.md). This
was the block that decided the design.
- The half-rate problem, and its fix. The BRAM window’s original bus leaf
(
waveflow/build/rtl/mm_bram_port.v) keeps one read in flight and costs two cycles a read word. The ring now uses the full-rate leaf,mm_bram_port_pipe.v(MemSlaveBramWindow(..., bram_leaf="mm_bram_port_pipe")): a word a cycle with a registered response, the slave adaptor’s front keeping two reads outstanding. It closes timing at 4 ns on this part behind a 4-master crossbar at 128 and 512 bits (which leaf). - pysim times it from records. With the platform as its
calib_dir, the window loads its leaf’s measured timing – a read costs 2 cycles plus a cycle a word, a write 1 plus a cycle a word, one at a time, and 1 cycle of turnaround after each – and the crossbar runs at its measured settings at 250 MHz (a request 2 cycles to the window, all before it contends; a read beat 1 cycle back; the crossbar page). - Measured with the units’ readers:
MemRStreams at 128 bits, 16-beat bursts, csynth’d for this part, each reading a 1,024-word block of the window over the crossbar (tests/build/test_bram_window_contention_xsi.py). A 16-beat burst repeats every 19 cycles at the port: 16 beats, 2 of latency and the 1-cycle turnaround, since the front serves one burst at a time.
| one channel’s block, one reader | port busy at 1.5 jobs a block | |
|---|---|---|
the half-rate leaf, mm_bram_port |
2,193 cycles | about 157% |
the full-rate leaf, mm_bram_port_pipe |
1,233 cycles (pysim 1,228) | about 88% |
(From the reader’s command to the block’s last word; the port’s own share is 64 bursts of 19 cycles, 1,216 a block.) One read takes 0.6 of a block period, and the port keeps up with 1.5 jobs a block with some room, where the half-rate leaf could not. With several readers at once the port is shared burst by burst: two readers starting together finish their blocks at 2,430 and 2,449 cycles, four at 4,824 to 4,881, every one within 0.21% of pysim. The ring is now in 4 banks of 128 bits (the ring), each its own window with this leaf, so readers of channels in different banks do not share a port: one bank sees about a quarter of the jobs, on average 22% busy at 1.5 jobs a block (more during a burst on its channels). A wider port would still halve a read.
The units’ readers
Measured, with the window. A unit reads its block through a memory reader of its own
(MemRStream, 16-beat bursts), over the crossbar. The read times above were measured with exactly that
reader at RTL (tests/build/test_bram_window_contention_xsi.py), so the reader runs without a residual
of its own: its pysim model with the window’s records and the crossbar’s settings gives 1,228 cycles for
a block alone against the RTL’s 1,233.
Systolic unit: one search
The computation is analytic; the read is measured. In pysim: SearchUnit
(examples/aoa_detect/units.py), its cycles systolic_cycles. The block is read into the unit’s
buffer (16 KB), then:
| Step | 8 × 8 array | 16 × 16 array |
|---|---|---|
| Read (above, full-rate port, measured) | 1,228 | 1,228 |
| $\hat{Q}$: the upper tiles of the 16 × 16 Gram, $B + 2A + 1$ cycles each | 3 tiles: 819 | 1 tile: 289 |
| Scan $W = \hat{Q} U$: 16 × 256 outputs, 16 cycles a tile, $2A + 1$ of fill | 64 tiles: 1,041 | 16 tiles: 289 |
| $p_\ell$ and the largest, pipelined behind the scan | 20 | 20 |
| A search, alone (pysim) | 3,109 (1.5 blocks) | 1,826 (0.9 block) |
At 0.75 searches a block, one 8 × 8 unit would be 112% busy and one 16 × 16 unit 66%: two 8 × 8 units or one 16 × 16. (At the half-rate port, ~2,180 cycles a read, they were 146% and 100%.)
The engine as built is slower (plans/aoa_devices_rtl.md Part D; examples/systolic/aoa_points.py,
Vitis HLS / xsim 2025.1): SystolicEngine at 16 × 16 (16 lanes, 128-bit words; csynth 2.92 ns, 1,049
DSP) takes 5,160 cycles a search back to back, 5,912 at 8 × 8 – bound by its input, about 265 cycles a
panel at both sizes – against the tiles’ 598 and 1,880. SearchUnit(engine="as_built") times it so;
feeding it at the ring’s width is plans/systolic_engine_fed.md.
Vector unit: one departure check
Measured at RTL (plans/aoa_devices_rtl.md Part B; tests/examples/test_aoa_check_xsi.py). In
pysim: CheckUnit. Read-bound: the data loop takes a word a cycle (II=1), $u^H x$ over the word’s lanes
unrolled, so the computation hides behind the read; then the header’s read, the check and the result:
units.CHECK_TAIL_CYCLES = 39 cycles after the block’s last word (it was 20, analytic). At the
design’s one 512-bit bank a check alone takes 356 cycles from its job to its result, at RTL and in
pysim, and every one of 484 results lands on pysim’s cycle (the 1,249 of four 128-bit banks was a read
of 1,024 words).
The units together: the bank’s port and the header memory
The units alone on the ring, in pysim (tests/examples/test_aoa_units.py), each with its reader, on
the crossbar at its measured settings, the windows timed from their records. From a job’s start:
| Jobs started together | Each read | The RTL’s, measured (one window) |
|---|---|---|
| one | 1,228 | 1,233 |
| two on one bank | 2,425, 2,445 | 2,430, 2,449 |
| four on one bank | 4,819 to 4,879 | 4,824 to 4,881 |
| two on different banks, behind the one front | 2,425, 2,445 (1,228 each with a port a bank) | 2,430, 2,449 |
| two on one 512-bit bank | 601, 621 | 606, 625 |
A job’s time is not its own. Two jobs on channels of one bank share its port burst by burst, and
each read takes twice as long, four take four times. Behind the one adaptor front the RTL builds, two
banks share it too (plans/aoa_capture_rtl.md, Stage 3; xsim 2025.1): two reads of different banks
take exactly as long as two of one bank, so the four 128-bit banks act as one port, and one 512-bit bank
reads the pair four times faster. pysim’s MemSlaveAdaptor models that front, 4 to 5 cycles a read
ahead of the RTL; a port a bank (1,228 each) would need a device the generator does not build. Which
reads meet depends on which channels are busy at once, which a per-job model of average times cannot
see.
Controller
Measured at RTL (plans/aoa_devices_rtl.md Part C; tests/examples/test_aoa_controller_xsi.py), with
the pools’ blocks in one device. A notification to its job at a unit: 7 or 9 cycles at RTL, 10 in pysim
on controller.MSG_CYCLES = 4; a result to its state message 10 to 13, a result costing
RESULT_EXTRA_CYCLES = 2 more (its pending entry and threshold reads, two messages out). Every one of
48 notifications and 48 results within 3 cycles of pysim, the means 0.2 and 0.1 apart.
Dispatchers and the arbiter
Calibrated, at our 128-bit one-word messages, on xczu48dr_250mhz_vitis2025_1 (Vitis and Vivado
2025.1; the fixture python -m waveflow.calib.fixtures.stream_blocks, records under the
platform’s stream_arbiter_task.decision, read by waveflow/streams/timing.py):
| 2 inputs or workers | 4 inputs or workers | |
|---|---|---|
| arbiter, priority: idle cycles a frame | 3 | 3 |
| arbiter, round robin: idle cycles a frame | 3 | 4 |
| dispatcher, first free: a job / a credit | 3 / 4 | 3 / 4 |
The arbiter’s 128-bit points were measured for this example (one-burst frames; one-word bursts give the same gaps). The dispatcher’s gaps at 128 bits equal its 32-bit table, so no points were added. The dispatcher is not needed at one unit a pool.
Inside a composite a decision can cost 2 to 4 cycles less than alone (timing.py); in the
controller’s device (the controller and both pools in one top) the gate holds every job’s dispatch and
every result’s return within 3 cycles of pysim, and dispatches each job to the unit pysim does.
The crossbar at 512 bits
Calibrated from the contention fixture’s one-reader trace (bram_window_contention.crossbar_latency,
xsim 2025.1, the full-rate leaf): a request reaches the front 2 cycles after the
reader presents it at 512 bits (2 at 128), and a read beat the reader
1 after the front sends it (1 at 128), and a 1,024-word read
alone takes 1,233 cycles at either width: the crossbar’s settings do not depend on the width, and
XBAR_SETTINGS (waveflow/calib/fixtures/bram_window_contention.py) holds at both. At 256 bits too
(the ring’s banks at $C = 12$; plans/aoa_site_c12_rtl.md, Part C): a request 2 cycles, a read beat 1.
The three-sector site: C = 12, two words a cycle
The ray-traced site (the workload) has three sectors of four frequency channels: $C = 12$
streams, their samples arriving two sample words a cycle (1,024 bits a beat, wpc = 2) into a ring of
two 512-bit banks or four of 256. Every block’s model was measured again at RTL for it
(plans/aoa_site_c12_rtl.md, Parts A to D; Vitis HLS / Vivado / xsim 2025.1, xczu48dr at 4 ns), each
a constant with its source, as at $C = 8$:
| Block | At $C = 12$ | At $C = 8$ | The model |
|---|---|---|---|
| Capture, the sample stage | a beat a cycle (II = 1): 1,536 beats a block at 2 × 512, 1,537 at 4 × 256 – 74% of the period | a word a cycle, 2,048 – 98% | |
| Capture, the end of the block | 67 cycles with catch-up, 53 without; +1 at 4 × 256, -1 at one credit; the sector gate adds none | 41, 38; +3 at 4 × 128, -2 | capture.END_CYCLES_C12 (end_cycles_of(..., C)) |
| Controller | a message 3 cycles, a result 4 more | 4, 2 | controller.MSG_CYCLES_C12 |
| Vector unit | its tail 40 cycles: a check alone 357 at 2 × 512, 661 at 4 × 256 | 39; 356 | units.CHECK_TAIL_CYCLES_C12 |
| Systolic unit (v4’s: the fed engine, its store compiled out) | a search alone 2,036 (2 × 512, 16 × 16), 4,557 (2 × 512, 8 × 8), 2,340 (4 × 256, 16 × 16), 4,646 (4 × 256, 8 × 8) | 2,033, 4,554 | units.FED_C12_EXTRA_CYCLES; the device’s search_unit.SEQ_C12_EXTRA_CYCLES |
| The ring’s window at 256 bits | the 512-bit fit: a read 2 cycles plus a cycle a word, a write 1 plus a cycle a word, 1 of turnaround; the crossbar 2 / 1 | – | a platform record, modules/full_rate_memory_mod-c957022b |
- The end of the block grows with $C$: the decide stage’s loops over the channels take a cycle a channel, its notify loop’s pipeline is deeper (its send slots taken modulo 12, not masked by 8), and with catch-up its window scan runs at II = 2 (a carried dependence on its flags). A few dozen cycles of a 2,083-cycle block, beside the next block’s samples.
- The 16 × 16 unit at 4 × 256 joins two 256-bit ring words into each 512-bit engine word as they arrive; the 8 × 8 unit at 2 × 512 splits each, as at $C = 8$; the other two forward.
- Implementation of the front end (Vivado 2025.1, out of context at 4 ns): it closes at $R$ = 2 and 4
at both bank shapes (+0.091 to +0.267 ns), and at $R = 8$ only with block-RAM cascades capped at four
(
synth_design -max_bram_cascade_height 4; the ring). The 256-bit window closes behind a 4-master crossbar at +0.447 ns, and two readers on it take 2,430 and 2,449 cycles at RTL, pysim within 0.21%.
The whole DUT at $C = 12$ against pysim (Part D; examples/aoa_detect/dut_v4.py, dut_v4.json):
five v4 designs on 500 blocks of the gated site (seed 1), each built and run at RTL (xsim 2025.1, 183 to
257 cycles a second). pysim ranks them as the RTL does by the p99 of a search’s decision, by the loss and
by the stream-level loss (Spearman 1 on each). Three are exact in outcome – the result messages, the
losses, late reads, drops and counters, each decision within 82 cycles, the p99 within 13. Two are not:
- A late search (design 5: $R = 2$, one search unit). A unit whose read comes late skips the scan
(670 to 1,758 cycles instead of a search’s 2,036 to 4,646), while the study’s model charges it a full
search, so late reads feed each other: 139 against the RTL’s 87, the loss 38.7% against 21.2%.
Charging the RTL’s cost makes design 5 exact (its result messages, loss and late reads; the p99 4,253.56
in both). Applied from the site’s cache v6 (
units.SearchUnit.LATE_CYCLES, the user’s decision); the $C = 8$ records (v3) and the site’s v4 and v5 were made before it. - Three reads at once (design 4). pysim’s front finishes the last of three concurrent reads (two banks) about 200 cycles after the RTL; from then on single decisions are up to hundreds of cycles apart, and near the end one notification differs (444 at RTL, 440 in pysim). The loss 29 against 31 missed of 222; the ranking unchanged.
The decision time, with no contention
A search, from the block’s arrival to the result message, at the proposed values:
| Step | Cycles |
|---|---|
| The block’s end: comparisons and the notification | ~20 |
| Controller and dispatcher | ~10 |
| The unit: read and compute (8 × 8, full-rate port, alone) | 3,109 |
| The arbiter and the controller’s test | ~10 |
| Total | ~3,150 cycles, 12.6 µs, about 1.5 blocks |
About 1,870 cycles (0.9 block) with a 16 × 16 array; at the half-rate port it was about 4,100 (2 blocks). An emitter lasts about 5 blocks, so with contention the decision time is a large part of its life: the timing changes what is detected.
At the block rate: first numbers
The whole DUT in pysim (AoaSystem: the capture, the ring, the controller, the pools on the crossbar,
every stream block and memory timed from the platform’s records, the units’ compute analytic), on 400
blocks of the timing workload (timing_workload(), pulsing included), at one block every 2,083 cycles.
A search’s decision time, from its block’s last word to the result message:
| Systolic, vector units | Late reads | Median | 90th percentile | Largest |
|---|---|---|---|---|
| 1, 1 | 62 | 7,480 | 13,680 | 23,702 |
| 2, 1 | 0 | 3,165 | 6,276 | 10,840 |
| 2, 2 | 0 | 3,274 | 6,426 | 10,840 |
| 4, 2 | 0 | 3,150 | 4,362 | 6,447 |
(These runs give each of the ring’s windows its own crossbar port and use four banks; behind the one adaptor front the generator builds, and with one 512-bit bank, see First results.) Alone, a search takes 3,144 cycles. This workload asks for 0.78 searches a block, so an average-rate analysis (the blocks) puts one systolic unit at 116% busy and two at 58%: two keep up, and the median agrees – but one search in ten waits two more blocks, and the worst five. The arrivals come in clusters (the pulsing episodes, the bursts), and while they last the units are far more than 58% busy. A second vector unit makes it no better (it adds readers on the same banks); four systolic units take the tail to 1.4 times a search. With one systolic unit, over-full on average, the queue outlasts the ring: 62 reads came late.
The decisions differ from the golden’s even with nothing late: a channel is pending while its job runs
(1.5 blocks for a search), so a pulse that ends meanwhile is checked a block later than the golden checks
it, or not at all. That is the timing loss, which step 4 scores against the truth.
What the timed simulation needs, in order
- The capture and power detector, with the ring (
MemSlaveBramWindow, port B charged by the kernel). Gate: its notifications equal the golden’s gate decisions, block by block. The units, each alone in its harness: built (examples/aoa_detect/units.py,tests/examples/test_aoa_units.py). Their results equal the golden’ssearchanddepart_stat, bit for bit; their reads reproduce the RTL’s contention within 0.3%; an overwritten slot is reported late.The controller, with the pools: built (examples/aoa_detect/controller.py, the DUT insystem.py,tests/examples/test_aoa_system.py). With the blocks paced so that every job is answered within its block, its result messages are exactly the golden’s decisions, through pools of one and of two (the dispatcher and arbiter timed at 128 bits); a search’s decision takes 3,144 cycles alone (below).The whole, on the timing workload: run (examples/aoa_detect/study.py,tests/examples/test_aoa_study.py), scored against the truth with the timing loss and the proxies: First results.RTL: built (plans/aoa_capture_rtl.md,plans/aoa_devices_rtl.md): each block’s HLS body, csynth and its gate, every model constant above measured; and the whole DUT against pysim (tests/examples/test_aoa_dut_xsi.py, First results): the result messages the same, each decision time within the shared front’s order (a burst a waiting reader), the five designs of the ranking in the same order. The systolic unit is a stand-in there (its formats were open), timed assystolic_cycles; its engine, measured, is slower (below).
Open, before building
The read path: a full-rate port.Built and measured (plans/bram_fullrate_port.md): the full-rate leaf, the front’s outstanding reads, the window’s calibrated timing in pysim, its records and the crossbar’s settings on the platform (above).The dispatcher’s and arbiter’s points at 128 bits.Measured (above).The crossbar’s settings measured at 250 MHz on this part, once a design is on it.Measured at 128, 256 and 512 bits (above).