aboutsummaryrefslogtreecommitdiff
path: root/test/passes/expand-whens
diff options
context:
space:
mode:
authorazidar2015-03-18 17:28:31 -0700
committerazidar2015-03-18 17:28:31 -0700
commitc61accd4f1c46fa24cf7354d6326141950d827c8 (patch)
tree03f0d705a2e4c98e856bd4205e1d8a5ba412ce32 /test/passes/expand-whens
parentf0b8da76b17e568bd51a95ac04e7bad6ce4232c5 (diff)
Finished expand accessors and lower to ground
Diffstat (limited to 'test/passes/expand-whens')
-rw-r--r--test/passes/expand-whens/one-when.fir15
-rw-r--r--test/passes/expand-whens/two-when.fir28
2 files changed, 43 insertions, 0 deletions
diff --git a/test/passes/expand-whens/one-when.fir b/test/passes/expand-whens/one-when.fir
new file mode 100644
index 00000000..78c59493
--- /dev/null
+++ b/test/passes/expand-whens/one-when.fir
@@ -0,0 +1,15 @@
+circuit top :
+ module top :
+ mem m : UInt(1)[2]
+ wire i : UInt(1)
+ wire p : UInt(1)
+ when p :
+ accessor a = m[i]
+ i := a
+ accessor b = m[i]
+ b := i
+ else :
+ accessor c = m[i]
+ i := c
+ accessor d = m[i]
+ d := i
diff --git a/test/passes/expand-whens/two-when.fir b/test/passes/expand-whens/two-when.fir
new file mode 100644
index 00000000..16fae1e2
--- /dev/null
+++ b/test/passes/expand-whens/two-when.fir
@@ -0,0 +1,28 @@
+circuit top :
+ module top :
+ mem m : UInt(1)[2]
+ wire i : UInt(1)
+ wire p : UInt(1)
+ when p :
+ wire p2 : UInt(1)
+ when p2 :
+ accessor a = m[i]
+ i := a
+ accessor b = m[i]
+ b := i
+ else :
+ accessor c = m[i]
+ i := c
+ accessor d = m[i]
+ d := i
+ else :
+ when p2 :
+ accessor w = m[i]
+ i := w
+ accessor x = m[i]
+ x := i
+ else :
+ accessor y = m[i]
+ i := y
+ accessor z = m[i]
+ z := i