Skip to content

passthrough_stream_fifo: gate ptr updates on full handshake (#264 #313)#322

Merged
phsauter merged 2 commits into
v2-devfrom
fix/264-313-passthrough-fifo-handshake
Jun 30, 2026
Merged

passthrough_stream_fifo: gate ptr updates on full handshake (#264 #313)#322
phsauter merged 2 commits into
v2-devfrom
fix/264-313-passthrough-fifo-handshake

Conversation

@colluca

@colluca colluca commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Addresses #264 and #313.

The read and write pointer updates previously fired on valid_i/ready_i alone, without checking the other side of the handshake. With assertions disabled or in synthesized netlists this corrupted the FIFO pointers whenever a push happened while full, or a pop happened while empty.

Fix: gate read-pointer advance on (ready_i && valid_o) and write-pointer advance on (valid_i && ready_o). The SameCycleRW mechanism is unaffected — ready_o already includes the (SameCycleRW && ready_i && valid_o) term, so simultaneous push+pop when full continues to work correctly.

@colluca colluca added the v2 label Jun 25, 2026
The read and write pointer updates previously fired on valid_i/ready_i
alone, without checking the other side of the handshake. With assertions
disabled or in synthesized netlists this corrupted the FIFO pointers
whenever a push happened while full, or a pop happened while empty.

Fix: gate read-pointer advance on (ready_i && valid_o) and
write-pointer advance on (valid_i && ready_o).  The SameCycleRW
mechanism is unaffected — ready_o already includes the
(SameCycleRW && ready_i && valid_o) term, so simultaneous push+pop
when full continues to work correctly (#313).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@phsauter phsauter force-pushed the fix/264-313-passthrough-fifo-handshake branch from 609bb00 to 3bdec35 Compare June 30, 2026 10:46
@phsauter phsauter force-pushed the fix/264-313-passthrough-fifo-handshake branch from 3bdec35 to 99cb3e2 Compare June 30, 2026 10:54
@phsauter phsauter merged commit a49dc11 into v2-dev Jun 30, 2026
5 checks passed
@phsauter phsauter deleted the fix/264-313-passthrough-fifo-handshake branch June 30, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants