Repository navigation
Conversation
`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 that holds
requests in flight and checks the responses follows separately.
Co-authored-by: Copilot <[email protected]>
`HostMem::start()` enables the host memory service on backends which need it (cosim registers its read/write request handlers there), but it was not bound in Python, so Python code could not enable host memory before the accelerator used it. Bind it, and call it from the loopback cosim test. Co-authored-by: Copilot <[email protected]>
`hw/hostmem_read.py` builds, under `CosimBSP(max_outstanding_reads=N)`, one host-driven `read_list` client per element width (24, 32 and 96 bits, i.e. 3-, 4- and 12-byte strides over the 8-byte cosim host memory word). Each client has a response gate, an `accepted` telemetry counter, and request and response channels. The test closes the response gate, queues several reads of varied lengths, checks that exactly min(#reads, N) are accepted while nothing drains (so that many logical requests are genuinely in flight inside `HostMemReadReqSplitter`), then opens the gate and checks every returned element, the per-request element counts and that `last` lands exactly on each request's final element. It then streams short reads back to back. It runs with N = 1 and N = 4. Co-authored-by: Copilot <[email protected]>
Contributor
Author
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.
Stacked on #11282 and #11283. Please review only the last commit, "Cosim test for multiple outstanding HostMem reads". The first two commits are those PRs, and this one will be rebased once they land.
This adds a cosim test that holds several logical reads in flight inside
HostMemReadReqSplitterand checks the responses.hw/hostmem_read.pybuilds, underCosimBSP(max_outstanding_reads=N), one host-drivenread_listclient per element width: 24, 32 and 96 bits, i.e. 3-, 4- and 12-byte strides over the 8-byte cosim host memory word. Each client has:acceptedtelemetry counter;test_hostmem_read.pyruns with N = 1 and N = 4. For each width, it:HostMem.start()and closes the response gate;lastlands exactly on each request's final element;