aboutsummaryrefslogtreecommitdiff
path: root/test/passes
diff options
context:
space:
mode:
authorjackbackrack2015-05-14 13:39:56 -0700
committerjackbackrack2015-05-14 13:39:56 -0700
commit369a6d9ee974f7ca825174e053742e0d4f440575 (patch)
tree1fa3fc4a103505d4b5eac777d320bc825dd90de5 /test/passes
parent54c33b61ff2c6da7fcd717885316604ecc559c25 (diff)
parent521a4277bfc1d764dc9ee771c604200525e871cb (diff)
merge
Diffstat (limited to 'test/passes')
-rw-r--r--test/passes/expand-accessors/accessor-mem.fir14
-rw-r--r--test/passes/expand-whens/scoped-reg.fir12
-rw-r--r--test/passes/jacktest/bundlewire.fir8
-rw-r--r--test/passes/lower-to-ground/test.fir13
4 files changed, 36 insertions, 11 deletions
diff --git a/test/passes/expand-accessors/accessor-mem.fir b/test/passes/expand-accessors/accessor-mem.fir
index 984b6acd..b87f954f 100644
--- a/test/passes/expand-accessors/accessor-mem.fir
+++ b/test/passes/expand-accessors/accessor-mem.fir
@@ -1,19 +1,19 @@
-; RUN: firrtl -i %s -o %s.flo -x abcdefg -p c | tee %s.out | FileCheck %s
+; RUN: firrtl -i %s -o %s.flo -x X -p c | tee %s.out | FileCheck %s
;CHECK: Expand Accessors
circuit top :
module top :
- mem m : UInt<32>[10][10][10]
- wire i : UInt
+ mem m : UInt<32>[2][2][2]
+ wire i : UInt<4>
accessor a = m[i] ;CHECK: accessor a = m[i]
- accessor b = a[i] ;CHECK: b := (a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9])[i]
- accessor c = b[i] ;CHECK: c := (b[0] b[1] b[2] b[3] b[4] b[5] b[6] b[7] b[8] b[9])[i]
+ accessor b = a[i] ;CHECK: b := (a[0] a[1])[i]
+ accessor c = b[i] ;CHECK: c := (b[0] b[1])[i]
wire j : UInt
j := c
accessor x = m[i] ;CHECK: accessor x = m[i]
- accessor y = x[i] ;CHECK: (x[0] x[1] x[2] x[3] x[4] x[5] x[6] x[7] x[8] x[9])[i] := y
- accessor z = y[i] ;CHECK: (y[0] y[1] y[2] y[3] y[4] y[5] y[6] y[7] y[8] y[9])[i] := z
+ accessor y = x[i] ;CHECK: (x[0] x[1])[i] := y
+ accessor z = y[i] ;CHECK: (y[0] y[1])[i] := z
z := j
; CHECK: Finished Expand Accessors
diff --git a/test/passes/expand-whens/scoped-reg.fir b/test/passes/expand-whens/scoped-reg.fir
new file mode 100644
index 00000000..20c91386
--- /dev/null
+++ b/test/passes/expand-whens/scoped-reg.fir
@@ -0,0 +1,12 @@
+; RUN: firrtl -i %s -o %s.flo -x abcdefghijk -p c | tee %s.out | FileCheck %s
+; CHECK: Expand Whens
+circuit top :
+ module A :
+ wire p : UInt
+ when p :
+ reg r : UInt
+ on-reset r := UInt(10)
+ r := UInt(20)
+; CHECK: r := Register(mux-uu(reset, UInt(10), UInt(20)), mux-uu(reset, UInt(1), p))
+; CHECK: Finished Expand Whens
+
diff --git a/test/passes/jacktest/bundlewire.fir b/test/passes/jacktest/bundlewire.fir
index cd5b2dfe..cea54ed4 100644
--- a/test/passes/jacktest/bundlewire.fir
+++ b/test/passes/jacktest/bundlewire.fir
@@ -1,17 +1,17 @@
-; RUN: firrtl -i %s -o %s.flo -x X -p cg | tee %s.out | FileCheck %s
+; RUN: firrtl -i %s -o %s.flo -x X -p ct | tee %s.out | FileCheck %s
; CHECK: Expand Whens
circuit TestLower :
module Inst :
- input x : UInt
- output y : UInt
+ input data : { w : UInt , x : UInt }
+ input tag : { y : UInt, z : UInt }
module TestLower :
mem m : {data : { w : UInt , x : UInt } tag : { y : UInt, z : UInt }}[8]
wire index : UInt
accessor r = m[index]
inst i of Inst
- i.x := r
+ i.data := r.data
; CHECK: Finished Expand Whens
diff --git a/test/passes/lower-to-ground/test.fir b/test/passes/lower-to-ground/test.fir
new file mode 100644
index 00000000..5f5f37fb
--- /dev/null
+++ b/test/passes/lower-to-ground/test.fir
@@ -0,0 +1,13 @@
+; RUN: firrtl -i %s -o %s.flo -x X -p cdt | tee %s.out | FileCheck %s
+; CHECK: Done!
+
+circuit Top :
+ module Queue :
+ output out : {valid : UInt<1>, flip ready : UInt<1>}
+ module Top :
+ output this : {out : {valid : UInt<1>, flip ready : UInt<1>}}
+ inst queue of Queue
+ this.out := queue.out
+ wire w : { x : UInt, flip y : UInt}
+ wire a : UInt
+ w.y := a