forked from llvm/circt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update annotation handling to fix partial field reset behavior (llvm#…
…6912) Update annotation handling in InferResets and SFCCompat
- Loading branch information
1 parent
ae819a7
commit bb1cb2f
Showing
5 changed files
with
62 additions
and
17 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
; RUN: firtool %s -parse-only | circt-opt -firrtl-infer-resets | FileCheck %s --check-prefix POST-INFER-RESETS | ||
; RUN: firtool %s -parse-only | circt-opt -firrtl-infer-resets -firrtl-sfc-compat | FileCheck %s --implicit-check-not POST-SFC-COMPAT-NOT | ||
|
||
; Check that FullAsyncResetAnnotation exists after infer-resets pass | ||
; but is deleted after sfc-compat | ||
|
||
FIRRTL version 3.3.0 | ||
circuit test :%[[{ | ||
"class":"sifive.enterprise.firrtl.FullAsyncResetAnnotation", | ||
"target":"~test|test>reset" | ||
}]] | ||
module test : | ||
input clock : Clock | ||
input reset : AsyncReset | ||
; POST-INFER-RESETS: [{class = "sifive.enterprise.firrtl.FullAsyncResetAnnotation"}] | ||
; POST-SFC-COMPAT-NOT: [{class = "sifive.enterprise.firrtl.FullAsyncResetAnnotation"}] | ||
input in : { foo : UInt<8>, bar : UInt<8>} | ||
output out : { foo : UInt<8>, bar : UInt<8>} | ||
connect out, in |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
; RUN: firtool %s | FileCheck %s | ||
|
||
FIRRTL version 3.3.0 | ||
circuit test :%[[{ | ||
"class":"sifive.enterprise.firrtl.FullAsyncResetAnnotation", | ||
"target":"~test|test>reset" | ||
}]] | ||
module test : | ||
input clock : Clock | ||
input reset : AsyncReset | ||
input in : { foo : UInt<8>, bar : UInt<8>} | ||
output out : { foo : UInt<8>, bar : UInt<8>} | ||
|
||
wire reg1_w : { foo : UInt<8>, bar : UInt<8>} | ||
invalidate reg1_w.bar | ||
invalidate reg1_w.foo | ||
; CHECK: reg1_foo <= 8'hC; | ||
; CHECK: reg1_bar <= 8'h0; | ||
connect reg1_w.foo, UInt<8>(0hc) | ||
invalidate reg1_w.bar | ||
; CHECK: reg1_foo = 8'hC; | ||
; CHECK: reg1_bar = 8'h0; | ||
regreset reg1 : { foo : UInt<8>, bar : UInt<8>}, clock, reset, reg1_w | ||
wire reg2 : { foo : UInt<8>, bar : UInt<8>} | ||
connect reg1, in | ||
connect reg2, reg1 | ||
connect out, reg2 |