aboutsummaryrefslogtreecommitdiff
path: root/test/passes/lower-to-ground/bundle-vecs.fir
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes/lower-to-ground/bundle-vecs.fir')
-rw-r--r--test/passes/lower-to-ground/bundle-vecs.fir41
1 files changed, 29 insertions, 12 deletions
diff --git a/test/passes/lower-to-ground/bundle-vecs.fir b/test/passes/lower-to-ground/bundle-vecs.fir
index b0de26f4..719033cb 100644
--- a/test/passes/lower-to-ground/bundle-vecs.fir
+++ b/test/passes/lower-to-ground/bundle-vecs.fir
@@ -1,9 +1,9 @@
; RUN: firrtl -i %s -o %s.v -X verilog -p c 2>&1 | tee %s.out | FileCheck %s
-; CHECK: Lower To Ground
+; CHECK: Lower Types
circuit top :
module top :
- wire i : UInt
+ input i : UInt<1>
wire j : { x : UInt<32>, flip y : UInt<32> }
wire a : { x : UInt<32>, flip y : UInt<32> }[2]
@@ -11,17 +11,34 @@ circuit top :
; CHECK: wire a{{[_$]+}}0{{[_$]+}}y : UInt<32>
; CHECK: wire a{{[_$]+}}1{{[_$]+}}x : UInt<32>
; CHECK: wire a{{[_$]+}}1{{[_$]+}}y : UInt<32>
+ a[0].x <= UInt(0)
+ a[0].y <= UInt(0)
+ a[1].x <= UInt(0)
+ a[1].y <= UInt(0)
- infer accessor b = a[i]
- ; CHECK: indexer b{{[_$]+}}x = (a{{[_$]+}}0{{[_$]+}}x a{{[_$]+}}1{{[_$]+}}x)[i] : UInt<32>
- ; CHECK: indexer (a{{[_$]+}}0{{[_$]+}}y a{{[_$]+}}1{{[_$]+}}y)[i] = b{{[_$]+}}y : UInt<32>
- j <= b
-
- infer accessor c = a[i]
- ; CHECK: indexer (a{{[_$]+}}0{{[_$]+}}x a{{[_$]+}}1{{[_$]+}}x)[i] = c{{[_$]+}}x : UInt<32>
- ; CHECK: indexer c{{[_$]+}}y = (a{{[_$]+}}0{{[_$]+}}y a{{[_$]+}}1{{[_$]+}}y)[i] : UInt<32>
- c <= j
+ j <= a[i]
+ a[i] <= j
+;CHECK: wire GEN : UInt<32>
+;CHECK: wire GEN_1 : UInt<32>
+;CHECK: wire GEN_2 : UInt<32>
+;CHECK: wire GEN_3 : UInt<32>
+;CHECK: j_x <= GEN
+;CHECK: j_y <= GEN_3
+;CHECK: node a_0_x = eqv(UInt("h0"), i)
+;CHECK: a_0_x <= mux(a_0_x, GEN_2, UInt("h0"))
+;CHECK: node a_0_y = eqv(UInt("h0"), i)
+;CHECK: a_0_y <= mux(a_0_y, GEN_1, UInt("h0"))
+;CHECK: node a_1_x = eqv(UInt("h1"), i)
+;CHECK: a_1_x <= mux(a_1_x, GEN_2, UInt("h0"))
+;CHECK: node a_1_y = eqv(UInt("h1"), i)
+;CHECK: a_1_y <= mux(a_1_y, GEN_1, UInt("h0"))
+;CHECK: node GEN_4 = eqv(UInt("h1"), i)
+;CHECK: GEN <= mux(GEN_4, a_1_x, a_0_x)
+;CHECK: GEN_1 <= j_y
+;CHECK: GEN_2 <= j_x
+;CHECK: node GEN_5 = eqv(UInt("h1"), i)
+;CHECK: GEN_3 <= mux(GEN_5, a_1_y, a_0_y)
-; CHECK: Finished Lower To Ground
+; CHECK: Finished Lower Types