Skip to content

DRAFT: Generate C headers and fix small RTL bug in register file#150

Draft
da-gazzi wants to merge 4 commits into
pulp-platform:develfrom
mosaic-soc:pr/mosaic_transpose
Draft

DRAFT: Generate C headers and fix small RTL bug in register file#150
da-gazzi wants to merge 4 commits into
pulp-platform:develfrom
mosaic-soc:pr/mosaic_transpose

Conversation

@da-gazzi

@da-gazzi da-gazzi commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
  • Generate C headers in target/sw with both the raw-header and c-header PeakRDL plugins
  • Fix the assignment of dma_ctrl_rsp_o.ready in the register file top-level template
  • fix arbitration of stream_idx in the register frontend

Based on the CI PR; should be merged after that

@da-gazzi da-gazzi marked this pull request as draft July 9, 2026 11:29
@da-gazzi da-gazzi force-pushed the pr/mosaic_transpose branch from 23e5567 to 3bd73d2 Compare July 9, 2026 13:21
DanielKellerM added a commit that referenced this pull request Jul 9, 2026
stream_idx_o was driven by a last-wins scan over launch_pending, decoupled
from the rr_arb_tree grant. With NumRegs>1 and multiple config ports launching
different streams concurrently, the arbiter grants one port's dma_req_o while
stream_idx_o points at another port's stream, so the transfer is tracked and
completed under the wrong stream.

Drive stream_idx_o from the arbiter's winning index (rr_arb_tree idx_o), gated
by req_valid_o, so it always matches dma_req_o. NumRegs=1 was unaffected, which
is why the existing tests missed it.

Add a NumRegs=2 directed test: two ports launch on distinct streams, checking
stream_idx_o matches the arbitrated port's stream. Fails pre-fix, passes after.

Flagged by da-gazzi (#150).
@da-gazzi da-gazzi force-pushed the pr/mosaic_transpose branch from 3bd73d2 to 76bcd8e Compare July 10, 2026 08:26
Georg Rutishauser and others added 4 commits July 10, 2026 10:41
- Needed for the mosaic organization fork
- Use `subprocess.run`/`subprocess.check_output` rather than `os.popen`
- Make some functions for invoking git commands rather than spelling out the commands as strings
- Make the `deploy` target accept overridable `inputs` so the generated hardware can be changed without having to make a separate commit
- This target generates C headers in `target/sw` with both the `raw-header` and `c-header` PeakRDL plugins
- Also added to `deploy` CI job
- with `NumRegs>1`, if a new ID is read on multiple register interfaces simultaneously, `stream_idx_o` was set to the stream index that the highest regfile index is reading from. This is incorrect as it ignores the result of the arbitration between the different regfiles
- this commit changes this behavior to correctly arbitrate `stream_idx` along with the ID so that `stream_idx_o` is set to the index of the stream the granted ID read belongs to
@da-gazzi da-gazzi force-pushed the pr/mosaic_transpose branch from 76bcd8e to 487c78d Compare July 10, 2026 08:45
DanielKellerM added a commit that referenced this pull request Jul 10, 2026
stream_idx_o was driven by a last-wins scan over launch_pending, decoupled
from the rr_arb_tree grant. With NumRegs>1 and multiple config ports launching
different streams concurrently, the arbiter grants one port's dma_req_o while
stream_idx_o points at another port's stream, so the transfer is tracked and
completed under the wrong stream.

Drive stream_idx_o from the arbiter's winning index (rr_arb_tree idx_o), gated
by req_valid_o, so it always matches dma_req_o. NumRegs=1 was unaffected, which
is why the existing tests missed it.

Add a NumRegs=2 directed test: two ports launch on distinct streams, checking
stream_idx_o matches the arbitrated port's stream. Fails pre-fix, passes after.

Flagged by da-gazzi (#150).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant