aboutsummaryrefslogtreecommitdiff
path: root/test/passes/jacktest/VendingMachine.fir
diff options
context:
space:
mode:
authorjackbackrack2015-05-20 03:52:53 -0700
committerjackbackrack2015-05-20 03:52:53 -0700
commit994fc58aa9a65eb4a5e287e121ee2e77d91db403 (patch)
tree5a75bfd8f4bd0040e577e20c928d2ee5bc56924b /test/passes/jacktest/VendingMachine.fir
parentf98ef93a1562357412fd1fce4b1f453f8a33572a (diff)
parent92e7da031a14df41ee0cab13a4a63b472fbdb5e1 (diff)
merge
Diffstat (limited to 'test/passes/jacktest/VendingMachine.fir')
-rw-r--r--test/passes/jacktest/VendingMachine.fir30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/passes/jacktest/VendingMachine.fir b/test/passes/jacktest/VendingMachine.fir
new file mode 100644
index 00000000..10784964
--- /dev/null
+++ b/test/passes/jacktest/VendingMachine.fir
@@ -0,0 +1,30 @@
+; RUN: firrtl -i %s -o %s.flo -X flo -p c | tee %s.out | FileCheck %s
+;CHECK: Done!
+circuit VendingMachine :
+ module VendingMachine :
+ output valid : UInt<1>
+ input nickel : UInt<1>
+ input dime : UInt<1>
+
+ reg state : UInt<3>
+ on-reset state := UInt<3>(0)
+ node T_22 = eq(state, UInt<3>(0))
+ when T_22 :
+ when nickel : state := UInt<3>(1)
+ when dime : state := UInt<3>(2)
+ node T_23 = eq(state, UInt<3>(1))
+ when T_23 :
+ when nickel : state := UInt<3>(2)
+ when dime : state := UInt<3>(3)
+ node T_24 = eq(state, UInt<3>(2))
+ when T_24 :
+ when nickel : state := UInt<3>(3)
+ when dime : state := UInt<3>(4)
+ node T_25 = eq(state, UInt<3>(3))
+ when T_25 :
+ when nickel : state := UInt<3>(4)
+ when dime : state := UInt<3>(4)
+ node T_26 = eq(state, UInt<3>(4))
+ when T_26 : state := UInt<3>(0)
+ node T_27 = eq(state, UInt<3>(4))
+ valid := T_27