-
Notifications
You must be signed in to change notification settings - Fork 615
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
Emit FIRRTL andr, orr for Bits.{andR, orR} #1315
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks straightforward to me. It makes me wonder though if we should have some document that specifically documents changes we make to emitted firrtl and verilog
bfdb10d
to
a654008
Compare
(Added this above...) This PR does change how Previously, this would generate:
This PR changes this emission to:
|
The old behavior (andR on a 0-bit UInt returns 1) is correct, for the same reason that |
While we can special case this in Chisel, this should be fixed in FIRRTL first. That Chisel is generating the following FIRRTL which results in the Verilog that is incorrect as @aswaterman identifies.
|
@seldridge can we address @aswaterman concern? Requires a firrtl change? |
Change the emission strategy for Bits methods andR and orR to emit FIRRTL bitwise reduce operations andr and orr. Add two tests that assert the correct behavior of these operations in BitwiseOpsSpec. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
a654008
to
6a3eb31
Compare
With the @albert-magyar fixes in chipsalliance/firrtl#1362, this is now doing the right thing in terms of Verilog emission. The language up top has been updated accordingly. I'm going to go ahead and merge as there is no effective change to the content of this PR. |
Change the emission strategy for
Bits
methodsandR
andorR
to emit FIRRTL bitwise reduce operationsandr
andorr
. The CHIRRTL emission strategy for these two operations now matches the emission ofxorR
(which already usedxorr
).Add two tests that assert the correct behavior of these operations in
BitwiseOpsSpec
.This should fix one of the Verilog emission problems shown in chipsalliance/firrtl#1338 of:
This will now emit the following CHIRRTL for
Foo(4)
:And the resulting Verilog:
For the case of a zero-width wire, you get the reductions that @albert-magyar introduced in chipsalliance/firrtl#1362.
Related issue:
Type of change: other enhancement
Impact: API modification (to emitted CHIRRTL)
Development Phase: implementation
Release Notes