-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport parentheses fix to 1.5.x (#7121)
* [ExportVerilog] Emit extra parentheses around reduction ops (#3357) This closes #3001. This PR is a follow-up onto reduction operators appear in the head of subexpression such as `a & b & &a & a`. This PR fixes the issue by setting precedence of reduction ops to lowest. Example: ```mlir hw.module @foo(%a: i4, %b: i1) -> (o1:i1) { %one4 = hw.constant -1 : i4 %and1 = comb.icmp eq %a, %one4 : i4 %and2 = comb.icmp eq %a, %one4 : i4 %and3 = comb.icmp eq %a, %one4 : i4 %and = comb.and %and1, %b, %and2, %and3 : i1 hw.output %and : i1 } ``` `circt-opt -export-verilog` produces: ```verilog module Foo( input [3:0] a, input b, output o1); assign o1 = (&a) & b & (&a) & (&a); endmodule ``` * Update CI OS version and docker image * Use v3 * Update buildAndTest.yml
- Loading branch information
Showing
3 changed files
with
29 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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