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

[ExportVerilog][PrettifyVerilog] Fix exprInEventControl #4625

Merged
merged 1 commit into from
Feb 6, 2023

Conversation

uenoku
Copy link
Member

@uenoku uenoku commented Feb 6, 2023

This commit fixes bugs in spilling logic regarding expressions used in sensitivity list.

  • PrettifyVerilog is changed to check lowering options so that CSEd expressions are not cloned into users when exprInEventControl is enabled.
  • There was a duplicated logic in isExpressionUnableToInline and PrepareForEmission so the logic was unified into isExpressionUnableToInline.

Fix #4620

; with --lowering-options=exprInEventControl
  always @(posedge clock or posedge ~rst_n) begin
    if (~rst_n)
      r <= 1'h0;
    else
      r <= d;

; w/o --lowering-options=exprInEventControl
  wire _GEN = ~rst_n;
  always @(posedge clock or posedge _GEN) begin
    if (_GEN)
      r <= 1'h0;
    else
      r <= d;

This commit fixes bugs in spilling logic regarding expressions used in
sensitivity list.

* PrettifyVerilog is changed to check lowering options so that CSEd expressions
are not cloned into users when `exprInEventControl` is enabled.
* There was a duplicated logic in isExpressionUnableToInline and PrepareForEmission so
the logic was unified into isExpressionUnableToInline.
Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

LGTM

continue;
}
}

Copy link
Member

Choose a reason for hiding this comment

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

Great! This is way better handled by one of the pre-passes. 👍

@uenoku uenoku merged commit 0e70371 into main Feb 6, 2023
@uenoku uenoku deleted the dev/hidetou/fix-event-control branch February 6, 2023 17:38
@harrisonliew harrisonliew mentioned this pull request Feb 9, 2023
22 tasks
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.

[FIRRTL] "exprInEventControl" not working for big designs
2 participants