aboutsummaryrefslogtreecommitdiff
path: root/test/features/ValidIf.fir
diff options
context:
space:
mode:
Diffstat (limited to 'test/features/ValidIf.fir')
-rw-r--r--test/features/ValidIf.fir21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/features/ValidIf.fir b/test/features/ValidIf.fir
new file mode 100644
index 00000000..70c69313
--- /dev/null
+++ b/test/features/ValidIf.fir
@@ -0,0 +1,21 @@
+; RUN: firrtl -i %s -o %s.v -X verilog -p c 2>&1 | tee %s.out | FileCheck %s
+circuit Top :
+ module Top :
+ input clk : Clock
+ input reset : UInt<1>
+ input a : { w : UInt<42>, x : UInt<30>}[2]
+ input b : { w : UInt<42>, x : UInt<30>}[2]
+ input p: UInt<1>
+ input q: UInt<1>
+ output c : { w : UInt<42>, x : UInt<30>}[2]
+ output d : { w : UInt<42>, x : UInt<30>}[2]
+
+ c is invalid
+ when p :
+ when q :
+ c <= a
+ else :
+ c <= b
+ d <= validif(p,b)
+
+;CHECK: Done!