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

Inline assigns #29

Merged
merged 39 commits into from
Jan 6, 2020
Merged

Inline assigns #29

merged 39 commits into from
Jan 6, 2020

Conversation

leonardt
Copy link
Owner

Adds initial support for inlining assignment statements.

There's probably more cases to consider, but I think this should be a start for the coreir verilog backend (inlining primitive expressions/wires).

Requires the addition of copy constructors and cloning unique ptr logic for Expressions (eventually we'll want to extend this to support all node types).

Adds basic logic for inlining continuous wire assignments. When a wire is only read once, it will be replaced with it's driver. If it's read more than once, it will only be replaced if it it's driven by another wire (so it won't propagate/duplicate expressions, just names)

Perhaps a better name for this is wire propagation?

@leonardt
Copy link
Owner Author

(Forgot to do a code cleanup pass before submitting, so I'll do that, but feel free to point out any suggestions on refactoring)

@leonardt
Copy link
Owner Author

Also, this requires that assignments are in topologically sorted order (not necessary in Verilog). Fortunately (for now), the corier backend emits the statements in this order, but to support more general trees in the future we could simply sort the statements first.

@leonardt leonardt merged commit 4e8ec8f into master Jan 6, 2020
@leonardt leonardt deleted the inline-assigns branch January 6, 2020 19:01
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.

None yet

1 participant