diff options
| author | azidar | 2016-01-28 12:12:02 -0800 |
|---|---|---|
| committer | azidar | 2016-01-28 12:12:02 -0800 |
| commit | 9ed79a822f7f406c55af8082da04cb7739e772eb (patch) | |
| tree | 02b10696dd0a03faf54c8eafa046855ccfc26e8f /test/features | |
| parent | b7dcc8ccbb1459a604353a8137081a9b156d276e (diff) | |
| parent | 094c6b8e7b40a3c613547d6127b449d0b1503db3 (diff) | |
Merge branch 'new-reg-prims' of github.com:ucb-bar/firrtl
Diffstat (limited to 'test/features')
| -rw-r--r-- | test/features/IsInvalid.fir | 7 | ||||
| -rw-r--r-- | test/features/OptionalRegisterReset.fir | 17 | ||||
| -rw-r--r-- | test/features/Poison.fir | 4 | ||||
| -rw-r--r-- | test/features/Printf.fir | 2 | ||||
| -rw-r--r-- | test/features/Queue.fir | 3 | ||||
| -rw-r--r-- | test/features/TwoClocks.fir | 14 | ||||
| -rw-r--r-- | test/features/VerilogReg.fir | 3 |
7 files changed, 37 insertions, 13 deletions
diff --git a/test/features/IsInvalid.fir b/test/features/IsInvalid.fir index cf898fe9..dc7c56b4 100644 --- a/test/features/IsInvalid.fir +++ b/test/features/IsInvalid.fir @@ -12,9 +12,10 @@ circuit Top : write-latency => 1 reader => r writer => w - read-writer => rw + readwriter => rw wire x : { w : UInt<42>, x : UInt<20>} - reg c : { w : UInt<42>, x : UInt<20>},clk,reset,x + reg c : { w : UInt<42>, x : UInt<20>},clk with : + reset => (reset,x) inst other of Other clk is invalid @@ -52,7 +53,7 @@ circuit Top : ;CHECK: m.w.addr is invalid ;CHECK: m.w.en is invalid ;CHECK: m.w.clk is invalid -;CHECK: m.rw.rmode is invalid +;CHECK: m.rw.wmode is invalid ;CHECK: m.rw.data[0] is invalid ;CHECK: m.rw.data[1] is invalid ;CHECK: m.rw.data[2] is invalid diff --git a/test/features/OptionalRegisterReset.fir b/test/features/OptionalRegisterReset.fir new file mode 100644 index 00000000..54a90b67 --- /dev/null +++ b/test/features/OptionalRegisterReset.fir @@ -0,0 +1,17 @@ +; RUN: firrtl -i %s -o %s.v -X verilog -p c 2>&1 | tee %s.out | FileCheck %s +circuit Top : + module Top : + input clk : Clock + input reset : UInt<1> + input a : UInt<32> + input p : UInt<1> + output b : UInt<32> + reg r1:UInt<32> clk with : + reset => (reset, a) + when p : + b <= r1 + else : + b <= r1 + + +;CHECK: Done! diff --git a/test/features/Poison.fir b/test/features/Poison.fir index a4cb1a25..9aafe63f 100644 --- a/test/features/Poison.fir +++ b/test/features/Poison.fir @@ -16,7 +16,7 @@ circuit Poison : write-latency => 2 reader => r writer => w - read-writer => rw + readwriter => rw m.r.addr <= index m.r.en <= UInt(1) m.r.clk <= clk @@ -29,7 +29,7 @@ circuit Poison : m.rw.clk <= clk m.rw.addr <= index m.rw.en <= UInt(1) - m.rw.rmode <= UInt(1) + m.rw.wmode <= UInt(1) m.rw.mask <= wmask m.rw.data <= q when p : diff --git a/test/features/Printf.fir b/test/features/Printf.fir index 4e8682ff..d4d2f77d 100644 --- a/test/features/Printf.fir +++ b/test/features/Printf.fir @@ -17,5 +17,5 @@ circuit Top : ;CHECK: printf(clk, en, "Hello World!\n") ;CHECK: printf(clk, en, "Hello World! %x\n", x.y) ;CHECK: printf(clk, and(p, en), "In consequence\n") -;CHECK: printf(clk, and(eqv(p, UInt("h0")), en), "In alternate\n") +;CHECK: printf(clk, and(eq(p, UInt("h0")), en), "In alternate\n") ;CHECK: Done! diff --git a/test/features/Queue.fir b/test/features/Queue.fir index 9b19caf4..3ce58e31 100644 --- a/test/features/Queue.fir +++ b/test/features/Queue.fir @@ -7,6 +7,7 @@ circuit Queue : input clk : Clock input reset : UInt<1> - reg r : UInt<10>,clk,reset,in + reg r : UInt<10>,clk with : + reset => (reset,in) r <= in out <= r diff --git a/test/features/TwoClocks.fir b/test/features/TwoClocks.fir index 6562d3e1..3753ee8d 100644 --- a/test/features/TwoClocks.fir +++ b/test/features/TwoClocks.fir @@ -5,14 +5,18 @@ circuit Top : input clk2 : Clock input reset1 : UInt<1> input reset2 : UInt<1> - reg src : UInt<10>, clk1, reset1, UInt(0) - reg sink : UInt<10>, clk2, reset2, UInt(0) + reg src : UInt<10>, clk1 with : + reset => ( reset1, UInt(0)) + reg sink : UInt<10>, clk2 with : + reset => ( reset2, UInt(0)) - src <= addw(src,UInt(1)) + src <= add(src,UInt(1)) - reg sync_A : UInt<10>, clk2, reset2, UInt(0) + reg sync_A : UInt<10>, clk2 with : + reset => ( reset2, UInt(0)) sync_A <= src - reg sync_B : UInt<10>, clk2, reset2, UInt(0) + reg sync_B : UInt<10>, clk2 with : + reset => ( reset2, UInt(0)) sync_B <= sync_A sink <= sync_B diff --git a/test/features/VerilogReg.fir b/test/features/VerilogReg.fir index 33c4417f..96022933 100644 --- a/test/features/VerilogReg.fir +++ b/test/features/VerilogReg.fir @@ -7,7 +7,8 @@ circuit Poison : input p1 : UInt<1> input p2 : UInt<1> input p3 : UInt<1> - reg r : UInt<32>,clk,reset,r + reg r : UInt<32>,clk with : + reset => (reset,r) when p1 : r <= UInt(1) when p2 : |
