-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[firtool] fix: remove unused modules before infering resets
The Chisel's Definition API generates modules that are not instantiated, whose reset cannot be inferred properly. Remove them before InferResets pass to resolve it. Signed-off-by: unlsycn <[email protected]>
- Loading branch information
Showing
2 changed files
with
30 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
; RUN: firtool %s --verify-diagnostics --split-input-file | ||
|
||
FIRRTL version 3.3.0 | ||
circuit Foo: | ||
module Adder : | ||
input clock : Clock | ||
input reset : Reset | ||
input in : UInt<10> | ||
output out : UInt<10> | ||
|
||
node _out_T = add(in, UInt<1>(0h1)) | ||
node _out_T_1 = tail(_out_T, 1) | ||
connect out, _out_T_1 | ||
|
||
; expected-warning @below {{module `Foo` is empty}} | ||
module Foo : | ||
input clock : Clock | ||
input reset : UInt<1> | ||
|
||
;// ----- | ||
|
||
FIRRTL version 3.3.0 | ||
circuit Bar: | ||
; expected-note @below {{the module with this uninferred reset port was defined here}} | ||
module Bar : | ||
input clock : Clock | ||
; expected-error @below {{a port "reset" with abstract reset type was unable to be inferred by InferResets}} | ||
input reset : Reset |