Repository navigation
[ESI][BSP] Support multiple outstanding reads in HostMemReadReqSplitter - #11282
Merged
Merged
Conversation
This was referenced Oct 13, 2026
`HostMemReadReqSplitter` accepted one logical read request and refused the
next until every response word of the current one had drained, capping each
read client at one request per host round trip.
Add an optional `max_outstanding` parameter (default 1, unchanged behavior).
Each accepted request's {word count - 1, final-word valid bytes, single-word}
is queued in a metadata FIFO of that depth; the response framer loads each
burst's metadata into registers from the FIFO head (or directly from a request
accepted while the FIFO is empty and the framer idle, so no latency is added)
and re-derives `last` / `valid_bytes` from them. Requires the upstream to
return each splitter's response words in request order; tags still pass
through untouched.
- A single-chunk request can be accepted every cycle (the next request is
accepted in the cycle the previous one issues its final chunk); responses
flow one word per cycle with no bubble between bursts.
- No combinational path from `resp_in` to `req_in` ready: the in-flight limit
is a registered flag. `resp_in` ready is left ungated, since
`esi.TaggedDemux` ANDs every output's ready.
- The final-chunk test is registered and the address/length advance by a
constant chunk; datapath registers are not reset.
Plumb the limit through `HostmemReadProcessor` and `ChannelHostMem` as
`max_outstanding_reads` (default 1). `CosimBSP`/`CosimBSP_DMA` take it too and
default to 4: the cosim host answers reads in order, and it keeps the feature
exercised by every cosim test.
Tests:
- IR-only generation tests for widths 64/256 and max_outstanding 1/2/64, and
a check that max_outstanding=0 is rejected.
- A cosim test (`test_hostmem_read.py`) with one host-driven `read_list`
client per element width (24, 32, 96 bits), run with max_outstanding_reads
1 and 4. It stalls the response side, checks that exactly min(#reads, N)
requests are held in flight, then checks data, per-request element counts
and `last` placement, and streams short reads back to back.
Co-authored-by: Copilot <[email protected]>
teqdruid
force-pushed
the
dev/teqdruid/esi/hostmem-multi-outstanding-reads
branch
from
October 13, 2026 20:40
be4a633 to
65efea6
Compare
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The stateful hardware flow-control and ordering changes warrant final human review despite comprehensive test coverage.
0 open findings
What changed in this PR
Adds configurable multi-outstanding HostMem reads while preserving ordered response framing.
Changes:
- Adds metadata FIFO and in-flight tracking to the read splitter.
- Plumbs configurable limits through HostMem and cosim BSP APIs.
- Adds generation and cosimulation coverage across widths and limits.
| File | Description |
|---|---|
lib/Dialect/ESI/runtime/python/esiaccel/bsp/common.py |
Implements multi-request splitting and response framing. |
lib/Dialect/ESI/runtime/python/esiaccel/bsp/cosim.py |
Configures cosim for multiple outstanding reads. |
lib/Dialect/ESI/runtime/tests/unit/test_bsp_common.py |
Tests generation and invalid limits. |
lib/Dialect/ESI/runtime/tests/integration/hw/hostmem_read.py |
Defines the cosim test hardware. |
lib/Dialect/ESI/runtime/tests/integration/test_hostmem_read.py |
Validates concurrency, data, and burst framing. |
lib/Dialect/ESI/runtime/CHANGELOG.md |
Documents the feature and ordering requirement. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HostMemReadReqSplitteraccepted one logical read request and refused the next until every response word of the current one had drained. That caps each read client at one request per host round trip.This adds an optional
max_outstandingparameter (default1, unchanged behavior).How it works
max_outstanding.last/valid_bytesfrom them.Throughput and timing
resp_intoreq_inready; the in-flight limit is a registered flag.resp_inready is left ungated, becauseesi.TaggedDemuxANDs every output's ready.Plumbing
HostmemReadProcessorandChannelHostMemtakemax_outstanding_reads(default1).CosimBSP/CosimBSP_DMAtake it too and default to4. The cosim host answers reads in order, and this keeps the multi-outstanding path exercised by every cosim test.Why: on a PCIe-attached Agilex 7 FPGA at 400 MHz, a 256 B read takes ~1 µs to return, so one outstanding read per client limits small reads to about 0.25 GB/s. With 64 outstanding, the same clients reach:
Large single reads, which already overlapped their chunks, are unchanged.
Tests
max_outstanding1/2/64.max_outstanding=0is rejected.test_hostmem_read.py, folded in from [ESI][Runtime] Cosim test for multiple outstanding HostMem reads #11284; usesHostMem.start()from [ESI][Runtime] Expose HostMem.start() to Python #11283) with one host-drivenread_listclient per element width: 24, 32 and 96 bits (3-, 4- and 12-byte strides over the 8-byte cosim host memory word). It runs withmax_outstanding_reads1 and 4. For each width, it:lastlands exactly on each request's final element;Assisted-by: GHCP:Claude Opus 5.5