summaryrefslogtreecommitdiff
path: root/test_fsm.v
diff options
context:
space:
mode:
authorMichael Abed <michaelabed@gmail.com>2012-12-02 12:06:19 -0500
committerMichael Abed <michaelabed@gmail.com>2012-12-02 12:06:19 -0500
commitd6d76f552c28503784d9ccd26528a4d8dada18ef (patch)
tree96625c709b1a44791c0ddbc161e2753e91cdd0fb /test_fsm.v
downloadec413-lab6-d6d76f552c28503784d9ccd26528a4d8dada18ef.tar.gz
ec413-lab6-d6d76f552c28503784d9ccd26528a4d8dada18ef.tar.bz2
ec413-lab6-d6d76f552c28503784d9ccd26528a4d8dada18ef.zip
make a git repo
Diffstat (limited to 'test_fsm.v')
-rw-r--r--test_fsm.v42
1 files changed, 42 insertions, 0 deletions
diff --git a/test_fsm.v b/test_fsm.v
new file mode 100644
index 0000000..0f86ef4
--- /dev/null
+++ b/test_fsm.v
@@ -0,0 +1,42 @@
+`timescale 1ns / 1ps
+
+module test_fsm;
+
+`include "params.v"
+
+reg clk, rst;
+reg [2:0] itype;
+wire [3:0] state;
+
+fsm uut(
+ .state(state),
+ .instrtype(itype),
+ .clk(clk),
+ .rst(rst)
+);
+
+initial begin
+ //$dumpfile("test_fsm.vcd");
+ //$dumpvars(0, uut);
+ clk = 0; rst = 0; itype = RINSTR;
+ #100;
+ #19; rst = 1; #1; rst = 0;
+ itype = RINSTR;
+ #19; rst = 1; #1; rst = 0;
+ itype = MEMRINSTR;
+ #19; rst = 1; #1; rst = 0;
+ itype = MEMWINSTR;
+ #19; rst = 1; #1; rst = 0;
+ itype = BRINSTR;
+ #19; rst = 1; #1; rst = 0;
+ itype = JINSTR;
+ #19; rst = 1; #1; rst = 0;
+ #100;
+ //$finish;
+end
+
+always begin
+ clk = ~clk; #1;
+end
+
+endmodule