Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backend] Unbundle dataflow-types into individual signals before RTL export #139

Open
lucas-rami opened this issue Sep 2, 2024 · 0 comments
Labels
enhancement Improvement to existing feature of Dynamatic good first issue Good for newcomers nice-to-have Cosmetic and/or light improvements to the framework

Comments

@lucas-rami
Copy link
Member

lucas-rami commented Sep 2, 2024

The IR spilled by the --lower-handhsake-to-hw (HandhsakeToHW) conversion pass still contains instances of the Handshake-level types representing dataflow channels. These are handshake::ChannelType and handshake::ControlType.

The export-rtl tool, which takes as input the IR produced by the conversion pass, currently has to unbundle these dataflow-typed values into their individual component signals on the fly, which yields difficult to read/maintain code. A nicer solution would be to run a transformation pass after --lower-handhsake-to-hw---let's call it --hw-unpack-handshake-types---that applies this dataflow-typed value unbundling on the IR itself, transforming it into an IR that does not contain any instance of Handshake-level types. The export-rtl tool will then only have to support "raw" types that each map to a single port/signal in the final RTL, simplifying its implementation.

This hypothetical --hw-unpack-handshake-types pass will most likely be a "transformation pass" that matches on module-like operations to recursively unpack all dataflow-like types into their individual constituents in all nested operations. CIRCT has a similar pass that operates on ESI channels (their version of Handshake channels basically) which one may take strong inspiration from.

The handshake::UnbundleOp and handshake::Bundle operations (which exist as part of Handshake but are not used in any pass at this point) will most likely be involved in the pass, even if just as "transient operations" useful during the transformation but that get canonicalized/folded away at the end of the pass.

@lucas-rami lucas-rami added enhancement Improvement to existing feature of Dynamatic nice-to-have Cosmetic and/or light improvements to the framework labels Sep 2, 2024
@lucas-rami lucas-rami mentioned this issue Sep 2, 2024
11 tasks
@lucas-rami lucas-rami added the good first issue Good for newcomers label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to existing feature of Dynamatic good first issue Good for newcomers nice-to-have Cosmetic and/or light improvements to the framework
Projects
None yet
Development

No branches or pull requests

1 participant