Repository navigation
fix: a handshake's return wires are the ones laid backwards - #82
Merged
Merged
Conversation
A handshake answers backwards: `ready` leaves an instance on the west, beside the `valid` it answers, and enters the queue on the east. ELK sees a cycle for every channel and has to lay one of its wires against the flow. Its greedy cycle breaker counts wires, and a queue drives five (data, valid, size, ready, space) while it takes three, so every queue became a source and every actor a sink: a ten-queue, six-actor netlist came out as a column of queues beside a column of actors. The engine now tells ELK which wires go with the flow. In a diagram that has a wire leaving a west port or entering an east port, every other wire gets `elk.layered.priority.direction` 10 and those wires 0, so the return wires are the ones reversed; a real feedback loop still reverses a data wire, as it must. That netlist now lays out in eight layers, memory interface, decoder, cpu and multiplier in order with the queues between them, and a 175-node netlist goes from 16 data wires laid backwards to one. A diagram without return wires gets no priority at all, so its layout is exactly what it was. Claude-Session: https://claude.ai/code/session_01UtmwstZRcWJeg3C69s1TnS
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.
Why
A handshake answers backwards:
readyleaves an instance on the west, beside thevalidit answers, and enters the queue on the east. ELK sees a cycle for every channel and has to lay one of its wires against the flow. Its greedy cycle breaker counts wires, and a queue drives five (data, valid, size, ready, space) while it takes three, so every queue became a source and every actor a sink. Core.vhd of the chips workflow, ten queues and six actors, came out as a column of queues beside a column of actors.What
WorkflowElkLayoutEnginenow tells ELK which wires go with the flow. In a diagram that has a wire leaving a west port or entering an east port, every other wire getselk.layered.priority.direction10 and those wires 0, so the return wires are the ones reversed. A real feedback loop still reverses a data wire, as it must.Measured standalone on the graphs the engine hands to ELK:
Priority 2 and below changes nothing on Core.vhd; 5 and up gives the eight layers.
A diagram without return wires gets no priority at all, so wfpy and streamblocks layouts are byte for byte what they were. The new test pins both: a producer → queue → consumer handshake chain comes out in that order, and a plain graph hands ELK no priority.
Checks
tsc --noEmitcleanhttps://claude.ai/code/session_01UtmwstZRcWJeg3C69s1TnS