diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-06-10 14:31:38 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-06-10 14:31:38 +0200 |
commit | 032c94d094b74bec922004cbbac0dcb2ae734839 (patch) | |
tree | 704a2a2dd580548c640fc5228705b7b8894c7c5e /ice40 | |
parent | 4a79e70470987ba54a16ab97eb25d664509550fc (diff) | |
download | nextpnr-032c94d094b74bec922004cbbac0dcb2ae734839.tar.gz nextpnr-032c94d094b74bec922004cbbac0dcb2ae734839.tar.bz2 nextpnr-032c94d094b74bec922004cbbac0dcb2ae734839.zip |
Add blinky post-synthesis testbench
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'ice40')
-rw-r--r-- | ice40/.gitignore | 9 | ||||
-rw-r--r-- | ice40/blinky.sh | 7 | ||||
-rw-r--r-- | ice40/blinky_tb.v | 15 |
3 files changed, 26 insertions, 5 deletions
diff --git a/ice40/.gitignore b/ice40/.gitignore index afb0753d..d1409985 100644 --- a/ice40/.gitignore +++ b/ice40/.gitignore @@ -1,5 +1,4 @@ -/chipdb-1k.cc -/chipdb-384.cc -/chipdb-5k.cc -/chipdb-8k.cc -chipdbs/ +/blinky_chip.v +/blinky_tb +/blinky_tb.vcd +/chipdbs/ diff --git a/ice40/blinky.sh b/ice40/blinky.sh new file mode 100644 index 00000000..8a445373 --- /dev/null +++ b/ice40/blinky.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -ex +yosys blinky.ys +../nextpnr-ice40 --json blinky.json --asc blinky.asc +icebox_vlog blinky.asc > blinky_chip.v +iverilog -o blinky_tb blinky_chip.v blinky_tb.v +./blinky_tb diff --git a/ice40/blinky_tb.v b/ice40/blinky_tb.v new file mode 100644 index 00000000..300c8a37 --- /dev/null +++ b/ice40/blinky_tb.v @@ -0,0 +1,15 @@ +module blinky_tb; + reg clk; + always #5 clk = (clk === 1'b0); + + chip uut ( + .io_0_8_1(clk) + ); + + initial begin + $dumpfile("blinky_tb.vcd"); + $dumpvars(0, blinky_tb); + repeat (9000000) @(posedge clk); + $finish; + end +endmodule |