diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-04-26 08:39:31 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-04-26 08:39:31 +0200 |
commit | 752851954b8330b3f4f443f799b3b121f416b51e (patch) | |
tree | 1737b7bac591a7020ead5fa60b5bc212c17b75b1 /techlibs/ice40/tests | |
parent | b4d7a590e8d6ab5034adf9a34c1ef4a3b3c2a708 (diff) | |
download | yosys-752851954b8330b3f4f443f799b3b121f416b51e.tar.gz yosys-752851954b8330b3f4f443f799b3b121f416b51e.tar.bz2 yosys-752851954b8330b3f4f443f799b3b121f416b51e.zip |
Initialization support for all iCE40 bram modes
Diffstat (limited to 'techlibs/ice40/tests')
-rw-r--r-- | techlibs/ice40/tests/test_bram.sh | 9 | ||||
-rw-r--r-- | techlibs/ice40/tests/test_bram.v | 3 | ||||
-rw-r--r-- | techlibs/ice40/tests/test_bram_tb.v | 3 |
3 files changed, 4 insertions, 11 deletions
diff --git a/techlibs/ice40/tests/test_bram.sh b/techlibs/ice40/tests/test_bram.sh index 73d889cee..d4d641a9c 100644 --- a/techlibs/ice40/tests/test_bram.sh +++ b/techlibs/ice40/tests/test_bram.sh @@ -5,13 +5,8 @@ set -ex for abits in 7 8 9 10 11 12; do for dbits in 2 4 8 16 24 32; do id="test_bram_${abits}_${dbits}" - if [ $((RANDOM % 2)) -eq 0 ]; then - iadr=0 - idat=0 - else - iadr=$((RANDOM % (1 << abits))) - idat=$((RANDOM % (1 << dbits))) - fi + iadr=$((RANDOM % (1 << abits))) + idat=$((RANDOM % ((1 << dbits) - 1) + 1)) sed -re "s/(ABITS = )0/\1$abits/g; s/(DBITS = )0/\1$dbits/g; s/(INIT_ADDR = )0/\1$iadr/g; s/(INIT_DATA = )0/\1$idat/g;" < test_bram.v > ${id}.v sed -re "s/(ABITS = )0/\1$abits/g; s/(DBITS = )0/\1$dbits/g; s/(INIT_ADDR = )0/\1$iadr/g; s/(INIT_DATA = )0/\1$idat/g;" < test_bram_tb.v > ${id}_tb.v ../../../yosys -ql ${id}_syn.log -p "synth_ice40" -o ${id}_syn.v ${id}.v diff --git a/techlibs/ice40/tests/test_bram.v b/techlibs/ice40/tests/test_bram.v index a625b6b66..320735d07 100644 --- a/techlibs/ice40/tests/test_bram.v +++ b/techlibs/ice40/tests/test_bram.v @@ -14,8 +14,7 @@ module bram #( reg [DBITS-1:0] memory [0:2**ABITS-1]; initial begin - if (INIT_ADDR || INIT_DATA) - memory[INIT_ADDR] <= INIT_DATA; + memory[INIT_ADDR] <= INIT_DATA; end always @(posedge clk) begin diff --git a/techlibs/ice40/tests/test_bram_tb.v b/techlibs/ice40/tests/test_bram_tb.v index abf953053..bdb8d4560 100644 --- a/techlibs/ice40/tests/test_bram_tb.v +++ b/techlibs/ice40/tests/test_bram_tb.v @@ -64,8 +64,7 @@ module bram_tb #( // $dumpfile("testbench.vcd"); // $dumpvars(0, bram_tb); - if (INIT_ADDR || INIT_DATA) - memory[INIT_ADDR] <= INIT_DATA; + memory[INIT_ADDR] <= INIT_DATA; xorshift64_next; xorshift64_next; |