Skip to content

Consume Crossbar inputs during prologue - #303

Open
guosran wants to merge 12 commits into
tancheng:masterfrom
guosran:fix/crossbar-prologue-consume-rtl
Open

Consume Crossbar inputs during prologue#303
guosran wants to merge 12 commits into
tancheng:masterfrom
guosran:fix/crossbar-prologue-consume-rtl

Conversation

@guosran

@guosran guosran commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Addresses #292 with a minimized Crossbar prologue-consume fix. This PR only updates CrossbarRTL.py and its focused test.

Changes

  • Consume inputs that are skipped by prologue so the input stream stays aligned with the control schedule.
  • Do not forward the skipped token during the prologue cycle.
  • Add a concrete example as an inline test comment.

No new ports or interfaces are introduced.

@guosran guosran closed this Jun 24, 2026
@guosran
guosran force-pushed the fix/crossbar-prologue-consume-rtl branch from 6663a41 to 9c79689 Compare June 24, 2026 17:07
@guosran guosran mentioned this pull request Jun 24, 2026
@guosran

guosran commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

This PR is the isolated Crossbar part from the earlier prologue discussion. Concrete example: if ctrl addr 0 has prologue_count=1, the first input token belongs to the skipped prologue cycle. The Crossbar should consume that token to keep the stream aligned, but should not forward it. The next non-prologue token is then the first value observed by the sink.

@guosran guosran reopened this Jun 24, 2026
@guosran
guosran force-pushed the fix/crossbar-prologue-consume-rtl branch from 6663a41 to c556b0d Compare June 25, 2026 14:43
@guosran
guosran changed the base branch from kernel-submit to master June 25, 2026 14:51
@guosran
guosran marked this pull request as draft June 25, 2026 14:53
@guosran
guosran force-pushed the fix/crossbar-prologue-consume-rtl branch 2 times, most recently from 889a5be to 2177f78 Compare June 26, 2026 00:12
@guosran
guosran force-pushed the fix/crossbar-prologue-consume-rtl branch from 2177f78 to 74013d2 Compare June 26, 2026 00:16
@guosran
guosran marked this pull request as ready for review June 26, 2026 00:34
@guosran

guosran commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

Concrete example:
During prologue, a skipped input token should be consumed but not forwarded.

input token A arrives
prologue_count says this input is still in prologue

Before:
crossbar could either block on downstream rdy or incorrectly forward stale data.

After:
recv side can consume the prologue token,
send side does not require/forward that prologued output.

@yyan7223

Copy link
Copy Markdown
Collaborator

Concrete example: During prologue, a skipped input token should be consumed but not forwarded.

input token A arrives prologue_count says this input is still in prologue

Before: crossbar could either block on downstream rdy or incorrectly forward stale data.

After: recv side can consume the prologue token, send side does not require/forward that prologued output.

During prologue, a skipped input token should be consumed but not forwarded.
Sorry, why is that?
We have prologue for both fu (consumed you mentioned) and fu_crossbar/routing_crossbar (forwarded you mentioned).

@yyan7223 yyan7223 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I cannot understand the changes.

Comment thread noc/CrossbarRTL.py Outdated
s.recv_data[i].rdy @= reduce_and(s.recv_valid_vector) & \
# Prologued inputs are still required so the skipped token is
# consumed; send_required_vector decides whether it is forwarded.
s.recv_data[i].rdy @= reduce_and(s.recv_valid_or_prologue_allowing_vector) & \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why crossbar is allowed to perform routing during prologue?

@tancheng

Copy link
Copy Markdown
Owner

Concrete example: During prologue, a skipped input token should be consumed but not forwarded.
input token A arrives prologue_count says this input is still in prologue
Before: crossbar could either block on downstream rdy or incorrectly forward stale data.
After: recv side can consume the prologue token, send side does not require/forward that prologued output.

During prologue, a skipped input token should be consumed but not forwarded. Sorry, why is that? We have prologue for both fu (consumed you mentioned) and fu_crossbar/routing_crossbar (forwarded you mentioned).

+1, I thought prologue shouldn't consume input token. I thought prologue (iirc about my own design/motivation) is used to proceed even without caring about input, i.e.:

  • Even input is not there, it can proceed
  • Even input is there, it can proceed without consuming the input, as the input should be consumed in the future (after prologue cycles)

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.

3 participants