Read Only Memory Tile - 2025.2 English - UG1603

AI Engine-ML Kernel and Graph Programming Guide (UG1603)

Document ID
UG1603
Release Date
2025-11-26
Version
2025.2 English

The memory tile programming supports compile‑time, read‑only shared buffers through adf::shared_buffer. This is ideal for constants, lookup tables (LUTs), filter coefficients, activation tables, or any other dataset that never changes at runtime. By declaring zero input ports, the buffer is enforced as read‑only, allowing one or more consumer kernels to read the same immutable data efficiently.

API Semantics

// Create a shared buffer with:
//   SIZE      = number of elements
//   NUM_INP   = number of input ports (must be 0 for read-only)
//   NUM_OUT   = number of output ports (>= 1 to feed consumers)
auto buffer_ro = adf::shared_buffer<DATA_TYPE>::create(SIZE, /*NUM_INP=*/0, /*NUM_OUT=*/N);

Example

buffer_ro = adf::shared_buffer<int32>::create(8, 0, 1);
// initial_value is used to initialize the buffer
adf::initial_value(buffer_ro) = {0, 1, 2, 3, 4, 5, 6, 7};
Note: The number of elements for adf::initial_value(<buffer_object>) must match the size of the <buffer_object>.