diff options
Diffstat (limited to 'counter_v/simulation.v')
-rw-r--r-- | counter_v/simulation.v | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/counter_v/simulation.v b/counter_v/simulation.v new file mode 100644 index 0000000..1dfbf25 --- /dev/null +++ b/counter_v/simulation.v @@ -0,0 +1,27 @@ +module sim_test; + + /* Make a reset that pulses once. */ + reg reset = 0; + initial begin + $dumpfile("simulation.vcd"); + $dumpvars(0, sim_test); + + # 17 reset = 1; + # 11 reset = 0; + # 29 reset = 1; + # 11 reset = 0; + //# 100 $stop; + # 200 $finish; + end + + /* Make a regular pulsing clock. */ + reg clk = 0; + always #5 clk = !clk; + + wire [5:0] value; + top top_logic (value, clk, reset); + + initial + $monitor("At time %t, value = %h (%0d)", + $time, value, value); +endmodule // sim_test |