aboutsummaryrefslogtreecommitdiff
path: root/test/passes/expand-accessors/accessor-vec.fir
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes/expand-accessors/accessor-vec.fir')
-rw-r--r--test/passes/expand-accessors/accessor-vec.fir19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/passes/expand-accessors/accessor-vec.fir b/test/passes/expand-accessors/accessor-vec.fir
new file mode 100644
index 00000000..4314e062
--- /dev/null
+++ b/test/passes/expand-accessors/accessor-vec.fir
@@ -0,0 +1,19 @@
+; RUN: firrtl %s abcdefg c | tee %s.out | FileCheck %s
+
+;CHECK: Expand Accessors
+circuit top :
+ module top :
+ wire m : UInt(32)[10][10][10]
+ wire i : UInt
+ accessor a = m[i] ;CHECK: a := (m.9 m.8 m.7 m.6 m.5 m.4 m.3 m.2 m.1 m.0)[i]
+ accessor b = a[i] ;CHECK: b := (a.9 a.8 a.7 a.6 a.5 a.4 a.3 a.2 a.1 a.0)[i]
+ accessor c = b[i] ;CHECK: c := (b.9 b.8 b.7 b.6 b.5 b.4 b.3 b.2 b.1 b.0)[i]
+ wire j : UInt
+ j := c
+
+ accessor x = m[i] ;CHECK: (m.9 m.8 m.7 m.6 m.5 m.4 m.3 m.2 m.1 m.0)[i] := x
+ accessor y = x[i] ;CHECK: (x.9 x.8 x.7 x.6 x.5 x.4 x.3 x.2 x.1 x.0)[i] := y
+ accessor z = y[i] ;CHECK: (y.9 y.8 y.7 y.6 y.5 y.4 y.3 y.2 y.1 y.0)[i] := z
+ z := j
+
+; CHECK: Finished Expand Accessors