The polynomial on a bus
The free-running polynomial answers commands on three streams. Here the
same kernel – the same class, PolyKernel, and the
same csynth’d RTL – is put on a bus: behind memory-mapped queues on an AXI-MM crossbar, driven by a
software host (stream_kernel_mm.py). It is
the smallest bus system in the examples: one kernel, one crossbar, one host.
Nothing in the kernel changes. Its class declares which of its streams become which memory-mapped views, the framework builds them, and the host reaches them by name. The kernel’s timing is the record calibrated in its stream harness (Timing), loaded here unchanged, and the point of the example is that the system’s timing composes from it.
Learning Objectives
What this adds to the stream version, in the order the pages teach it:
- Declare a kernel’s memory-mapped views in
mm_viewsand build its device withbuild_mm_device, the kernel left stream-only. - Put the device on an AXI-MM crossbar: address ranges,
a bound adaptor that reaches each view by name, an interrupt line per view, and the DUT named with
HwSystem(sim, dut). - Write a two-thread
SwHost: a writer that sends each command as packets, and a reader that sizes each result from its header and reads in the order the kernel writes. - Make the host wait on interrupts, never poll, and check that it does not.
- Write the host’s C++ twin on its generated endpoints, and run the system flow with prefixed steps
(
mm_): the host’s traces at RTL equal pysim’s. - Run the device in its own harness: the host on a direct link, no crossbar.
- Check the composition: pysim’s cycles, composed from parts calibrated separately with nothing fitted, within 5% of the RTL.
The pages
- The device –
mm_views,build_mm_device, the address layout, and why the status is a queue for now. - The system – the crossbar, the address map, the interrupt lines,
HwSystem(sim, dut), and themm_steps on the build DAG. - The host – two threads, results sized from their header, interrupts and no polling, and the C++ twin.
- Composition – the device’s own harness (
mm_system(direct=True)) and the composition check against the RTL.
The protocol, the golden and the kernel are the stream version’s: The protocol, The golden, The kernel.
Running it
python -m examples.stream_kernel.stream_kernel_build --through mm_pysim # pysim only
python -m examples.stream_kernel.stream_kernel_build --through mm_compare # behind the crossbar (Vitis, Vivado)
python -m examples.stream_kernel.stream_kernel_build --through dev_compare # the device alone, a direct link
The bus systems share the stream example’s build DAG
(stream_kernel_build.py), its codegen and
the kernel’s csynth. The gates are
tests/examples/test_stream_kernel_mm.py. Cycle
counts on these pages were measured with Vitis HLS and Vivado 2025.1 at 100 MHz.
For a larger bus system – two kernels, a routed credit link, a shared memory – see Two kernels on a bus; for a kernel the host reconfigures through a register bank, A memory-mapped FIR.