aboutsummaryrefslogtreecommitdiff
path: root/test/passes/inline-indexers/simple2.fir
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes/inline-indexers/simple2.fir')
-rw-r--r--test/passes/inline-indexers/simple2.fir26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/passes/inline-indexers/simple2.fir b/test/passes/inline-indexers/simple2.fir
new file mode 100644
index 00000000..a334b626
--- /dev/null
+++ b/test/passes/inline-indexers/simple2.fir
@@ -0,0 +1,26 @@
+; RUN: firrtl -i %s -o %s.v -X verilog -p c 2>&1 | tee %s.out | FileCheck %s
+
+;CHECK: Inline Indexers
+circuit top :
+ module top :
+ output o1 : UInt
+ output o2 : UInt
+ wire m : UInt<32>[2]
+ wire i : UInt
+ m[0] := UInt("h1")
+ m[1] := UInt("h1")
+ i := UInt("h1")
+ infer accessor a = m[i]
+ o1 := a
+ o2 := a
+
+;CHECK: wire a : UInt<32>
+;CHECK: a := m$0
+;CHECK: when eqv(i_1, UInt("h1")) : a := m$1
+;CHECK: wire a_1 : UInt<32>
+;CHECK: a_1 := m$0
+;CHECK: when eqv(i_2, UInt("h1")) : a_1 := m$1
+
+
+
+;CHECK: Done!