diff options
author | Clifford Wolf <clifford@clifford.at> | 2017-07-29 21:34:29 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2017-07-29 21:34:29 +0200 |
commit | cb87f93cf863d591c7d442222ffb1b1bcc58d84e (patch) | |
tree | de38be9bd064e922f31c72d3401502d4c1302358 /spiflash/testbench.v | |
parent | 995f366d0e524e4a52a18a5eec6efa3aa225c344 (diff) | |
download | picorv32-cb87f93cf863d591c7d442222ffb1b1bcc58d84e.tar.gz picorv32-cb87f93cf863d591c7d442222ffb1b1bcc58d84e.zip |
Improve spiflash testbench and firmware
Diffstat (limited to 'spiflash/testbench.v')
-rw-r--r-- | spiflash/testbench.v | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/spiflash/testbench.v b/spiflash/testbench.v index 6b4aaef..3a61414 100644 --- a/spiflash/testbench.v +++ b/spiflash/testbench.v @@ -5,9 +5,10 @@ module testbench; initial begin $dumpfile("testbench.vcd"); $dumpvars(0, testbench); - repeat (10000) @(posedge clk); - $display("<END>"); - $finish; + repeat (100000) @(posedge clk); + $display(""); + $display("[TIMEOUT]"); + $stop; end wire [31:0] gpio_i = 0; @@ -18,6 +19,17 @@ module testbench; wire spi_mosi; wire spi_miso; + always @(gpio_o) begin + $write("<GPIO:%02x>", gpio_o[7:0]); + if (gpio_o == 63) begin + $display("[OK]"); + $finish; + end + if (gpio_o % 8 == 7) begin + $display(""); + end + end + top uut ( .clk (clk ), .gpio_i (gpio_i ), |