-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add a test to verify legal uninferred reset
Signed-off-by: unlsycn <[email protected]>
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// RUN: circt-opt --pass-pipeline='builtin.module(firrtl.circuit(firrtl-infer-resets,any(firrtl-check-uninferred-resets)))' --verify-diagnostics %s | ||
// RUN: circt-opt --pass-pipeline='builtin.module(firrtl.circuit(firrtl-infer-resets,firrtl-inliner,any(firrtl-check-uninferred-resets)))' %s | FileCheck %s | ||
|
||
firrtl.circuit "LegalUninferredReset" { | ||
// The following two diagnostics will only appear if firrtl-inliner is not enabled | ||
// expected-note @+2 {{the module with this uninferred reset port was defined here}} | ||
// expected-error @+1 {{a port "reset" with abstract reset type was unable to be inferred by InferResets}} | ||
firrtl.module private @Adder(in %clock: !firrtl.clock, in %reset: !firrtl.reset, in %in: !firrtl.uint<10>, out %out: !firrtl.uint<10>) { | ||
%c1_ui1 = firrtl.constant 1 : !firrtl.const.uint<1> | ||
%0 = firrtl.add %in, %c1_ui1 : (!firrtl.uint<10>, !firrtl.const.uint<1>) -> !firrtl.uint<11> | ||
%_out_T = firrtl.node interesting_name %0 : !firrtl.uint<11> | ||
%1 = firrtl.tail %_out_T, 1 : (!firrtl.uint<11>) -> !firrtl.uint<10> | ||
%_out_T_1 = firrtl.node interesting_name %1 : !firrtl.uint<10> | ||
firrtl.matchingconnect %out, %_out_T_1 : !firrtl.uint<10> | ||
} | ||
firrtl.module @LegalUninferredReset(in %clock: !firrtl.clock, in %reset: !firrtl.uint<1>) { | ||
} | ||
} | ||
|
||
// CHECK-NOT: firrtl.circuit "Adder" | ||
// CHECK: firrtl.circuit "LegalUninferredReset" |