Shared Memory (histogram)

The shared-memory pattern moves the data off the control plane and into memory: the accelerator reads its inputs and writes its outputs over an AXI4 memory-mapped (m_axi) master, while a dedicated AXI4-Stream still carries the command and the status response. It is the next step in the examples progression after in-band stream control — control stays on a stream, but the payload now lives in shared memory addressed by pointers in the command.

The vehicle is a histogram accelerator (examples/shared_mem/, computation files keep the hist name): given a command carrying three buffer addresses, it reads ndata float samples and nbins-1 float bin edges from memory, bins the samples, and writes nbins uint32 counts back to memory.

This makes it the first example to exercise, over one m_axi bundle:

  • Multiple distinct buffers at independent addresses (data_addr, bin_edges_addr, cnt_addr).
  • Two element typesFloat32 inputs/edges and Uint32 counts.
  • Validation → statusndata/nbins bounds checks select a HistError into the response before any memory access.

Like the other full examples it walks all five stages — Python model → SimPy simulation → code generation → C and RTL simulation → timing extraction — with the kernel and testbench generated from the Python HistAccel component. It is the reference design for AXI-MM (m_axi) codegen.

Walkthrough

  1. Understanding AXI Memory-Mapped — what m_axi is (burst transfers, byte-addressed pointers into shared DRAM), and the shared-memory architecture: bulk data in memory, command/response on a dedicated stream.
  2. Python model — the HistAccel component, the HistCmd / HistResp / HistError schemas, and the MMIFMaster (read_array / write_array) interface.
  3. Python simulation — the SimPy harness (HistController + MemComponent) and parity against the numpy golden.
  4. Code generation — lowering HistAccel / HistTBHls to the multi-buffer m_axi Vitis HLS kernel and testbench.
  5. C and RTL simulation — the four-case C-sim coverage, C-synthesis, RTL co-simulation, and multi-buffer burst extraction.
  6. Viewing timing and bursts — the committed timing/burst figures and the workflow for refreshing them.

Table of contents


This site uses Just the Docs, a documentation theme for Jekyll.