diff options
author | Clifford Wolf <clifford@clifford.at> | 2017-07-19 15:23:15 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2017-07-19 15:27:41 +0200 |
commit | cb0a0f7ef81555cb5c8e51cabb806a302c92b91a (patch) | |
tree | 1c96061a3bd7ae6c303c185ceb095de5035c03ba /examples/icestick | |
parent | 70e01c1802bef592452cada1cba0224185e8029e (diff) | |
download | icestorm-cb0a0f7ef81555cb5c8e51cabb806a302c92b91a.tar.gz icestorm-cb0a0f7ef81555cb5c8e51cabb806a302c92b91a.tar.bz2 icestorm-cb0a0f7ef81555cb5c8e51cabb806a302c92b91a.zip |
Improve rs232demo test bench
Diffstat (limited to 'examples/icestick')
-rw-r--r-- | examples/icestick/rs232demo_tb.v | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/examples/icestick/rs232demo_tb.v b/examples/icestick/rs232demo_tb.v index 3e95abf..5b9aee1 100644 --- a/examples/icestick/rs232demo_tb.v +++ b/examples/icestick/rs232demo_tb.v @@ -1,8 +1,11 @@ module testbench; localparam integer PERIOD = 12000000 / 9600; - reg clk = 1; - always #5 clk = ~clk; + // reg clk = 0; + // initial #10 forever #5 clk = ~clk; + + reg clk; + always #5 clk = (clk === 1'b0); reg RX = 1; wire TX; @@ -48,12 +51,7 @@ module testbench; $dumpvars(0, testbench); end - // send break - repeat (20 * PERIOD) @(posedge clk); - RX <= 0; - repeat (20 * PERIOD) @(posedge clk); - RX <= 1; - repeat (20 * PERIOD) @(posedge clk); + repeat (10 * PERIOD) @(posedge clk); // turn all LEDs on send_byte("1"); @@ -70,6 +68,7 @@ module testbench; send_byte("5"); repeat (10 * PERIOD) @(posedge clk); + $finish; end endmodule |