aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorazidar2015-08-20 15:31:22 -0700
committerazidar2015-08-20 15:31:22 -0700
commit169164c3ad828ccae89c43d4bdbb531f3a2e6237 (patch)
tree4eadf26bb6c5c102633c524ab11a4ddd039e79ab /test
parentc50afcbdd1a6a2835aaa97d28412d7b913193135 (diff)
Added Poison node. Includes tests. #26.
Diffstat (limited to 'test')
-rw-r--r--test/errors/high-form/Flip-Poison.fir8
-rw-r--r--test/features/Poison.fir18
2 files changed, 26 insertions, 0 deletions
diff --git a/test/errors/high-form/Flip-Poison.fir b/test/errors/high-form/Flip-Poison.fir
new file mode 100644
index 00000000..95a8c471
--- /dev/null
+++ b/test/errors/high-form/Flip-Poison.fir
@@ -0,0 +1,8 @@
+; RUN: firrtl -i %s -o %s.flo -X flo -p c | tee %s.out | FileCheck %s
+; CHECK: Poison p cannot be a bundle type with flips.
+
+circuit Flip-Poison :
+ module Flip-Poison :
+ input clk : Clock
+ poison p : {x : UInt<10>, flip y : UInt<10>}
+
diff --git a/test/features/Poison.fir b/test/features/Poison.fir
new file mode 100644
index 00000000..d8aa4411
--- /dev/null
+++ b/test/features/Poison.fir
@@ -0,0 +1,18 @@
+; RUN: firrtl -i %s -o %s.v -X verilog -p c 2>&1 | tee %s.out | FileCheck %s
+; CHECK: Done!
+circuit Poison :
+ module Poison :
+ input clk : Clock
+ input reset : UInt<1>
+ input index : UInt<7>
+ input p : UInt<1>
+ output out : {x : UInt<10>, y : UInt<10>}
+
+ poison q : {x : UInt<10>, y : UInt<10>}
+ smem m : {x : UInt<10>, y : UInt<10>}[128],clk
+ infer accessor r = m[index]
+ when p :
+ out := r
+ else :
+ out := q
+