mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-23 19:47:55 +00:00
initialized iCE40 brams (mode 0)
This commit is contained in:
parent
4cc4400514
commit
b4d7a590e8
5 changed files with 261 additions and 54 deletions
|
@ -5,8 +5,15 @@ 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}"
|
||||
sed -e "s/ABITS = ./ABITS = $abits/g; s/DBITS = ./DBITS = $dbits/g;" < test_bram.v > ${id}.v
|
||||
sed -e "s/ABITS = ./ABITS = $abits/g; s/DBITS = ./DBITS = $dbits/g;" < test_bram_tb.v > ${id}_tb.v
|
||||
if [ $((RANDOM % 2)) -eq 0 ]; then
|
||||
iadr=0
|
||||
idat=0
|
||||
else
|
||||
iadr=$((RANDOM % (1 << abits)))
|
||||
idat=$((RANDOM % (1 << dbits)))
|
||||
fi
|
||||
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
|
||||
# iverilog -s bram_tb -o ${id}_tb ${id}_syn.v ${id}_tb.v /opt/lscc/iCEcube2.2014.08/verilog/sb_ice_syn.v
|
||||
iverilog -s bram_tb -o ${id}_tb ${id}_syn.v ${id}_tb.v ../cells_sim.v
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue