mrdimm-shared-history.md 3.6 KB

Shared retained limit history

The motor event layer now owns the persistent last-limit record used by both status and pending events. The axis core emits its pre-zero position, total, tag, event and low timestamp together with the high timestamp word. The engine captures them on the next clock. status_changing includes the limit pulse so that capture also advances the snapshot epoch.

Clearing the pending event bit or clearing/overwriting the 64-entry host event ring does not clear retained history. Diagnostic builds keep an independent axis-core history and a parallel engine view for comparison. Those parallel reads are excluded from the production storage module.

motor_limit_history has one addressed read and one addressed write. Event dispatch temporarily selects the read address; otherwise an independent history-axis scanner advances. The telemetry axis output identifies the actual word's axis, including event-selected reads. The stop-reason byte remains axis-owned and is selected using the same address.

A dispatch raises ev_wr_req, which prevents another dispatch on the immediately following cycle. The history scanner therefore advances at least once every two clocks. Any requested history axis is available within a conservative 2*AXIS_COUNT+2 clocks. Other words use the original axis scanner. A complete copy is bounded by 3*160 + 32*AXIS_COUNT*(2*AXIS_COUNT+2) clocks: 1248 for three axes, 10464 for twelve. Both bounds are below the 16-bit epoch modulus. These are conservative structural bounds; the old 876-clock twelve-axis copy figure does not cover this arbitration path. Full sequential formal proof remains pending.

The new tests follow the snapshot consumer through every word and every axis, compare production and diagnostic values, verify the pre-zero signed position and a 64-bit timestamp rollover, and retain X history after counter clear, event clear and 70 Y events overwriting the ring. They also bound waiting for an axis. The tests run for both three and twelve axes.

Native evidence

All measurements are native Linux TD runs. None fit the device or produced a qualified MRDIMM bitstream.

Source / run LUT Registers Result
c48af6f / shared-load-td 7105 4305 Fit failure
054d383 / shared-history-td 7061 4784 Fit failure; array not inferred as RAM
18e687f / history-port-td 6856 4786 Fit failure; single address alone insufficient
0278c6d / history-declaration-td 6856 4786 Declaration-order hypothesis rejected
8c0b507 / history-isolated-td 6946 4339 RAM inference restored; LUT still exceeds4480

TD reports the isolated history bank as230 LUT and0 registers; the design uses8 BRAM and1 DSP. A separate memory-index-probe showed that both wide and narrow write-address inputs can infer RAM, ruling out address width alone. Isolating production storage from diagnostic array reads restored inference in the actual design.

Exact source: 8c0b50728b4aa50e46cfc020c20554637a8a4bfd. Resource receipt: /data/prod2u/runs/history-isolated-td/td-receipt.json. Regression receipt: /data/prod2u/runs/history-isolated-test/RESULT.json:113 Python tests and27 RTL compilation/behavior checks passed, with no skipped Python tests. motor_history_shared_tb and motor_history_shared_12_tb are included. This is current regression coverage, not Full acceptance. Physical hardware is NOT_RUN.

Commands, from the exact Linux snapshot:

python3 tools/fw_cli.py test mrdimm --run-root /data/prod2u/runs/history-isolated-test
flock /data/prod2u/cache/heavy.lock python3 tools/fw_cli.py build mrdimm --run-root /data/prod2u/runs/history-isolated-td