39 lines
1.2 KiB
Bash
39 lines
1.2 KiB
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
set -euo pipefail
|
||
|
|
||
|
run() {
|
||
|
base="$1"
|
||
|
variant="$2"
|
||
|
shift 2
|
||
|
|
||
|
mkdir -p gen
|
||
|
iverilog -Wall -o test.out "$@" "tb/tb_DP16KD_${base}.v" DP16KD.v
|
||
|
./test.out
|
||
|
rm -f test.out
|
||
|
dir=$(readlink -f `dirname $0`)
|
||
|
vcdfile="${variant}.vcd"
|
||
|
mv tb.vcd "${dir}/gen/$vcdfile"
|
||
|
gtkwfile="${variant}.gtkw"
|
||
|
cp tb_cfg.gtkw "${dir}/gen/$gtkwfile"
|
||
|
perl -p -e "s#WORKING_DIR#$dir#g;" -e "s#VCDFILE#${vcdfile}#g;" -e "s#GTKWFILE#${gtkwfile}#g;" <tb_cfg.gtkw >"${dir}/gen/$gtkwfile"
|
||
|
}
|
||
|
|
||
|
rm -rf gen
|
||
|
|
||
|
run sync_same_width 18b_sync_same_width \
|
||
|
-P tb.DATA_WIDTH_A=18 -P tb.DATA_WIDTH_B=18 \
|
||
|
-P tb.ADDR_WIDTH_A=10 -P tb.ADDR_WIDTH_B=10
|
||
|
run sync_same_width 9b_sync_same_width \
|
||
|
-P tb.DATA_WIDTH_A=9 -P tb.DATA_WIDTH_B=9 \
|
||
|
-P tb.ADDR_WIDTH_A=11 -P tb.ADDR_WIDTH_B=11
|
||
|
run sync_same_width 4b_sync_same_width \
|
||
|
-P tb.DATA_WIDTH_A=4 -P tb.DATA_WIDTH_B=4 \
|
||
|
-P tb.ADDR_WIDTH_A=12 -P tb.ADDR_WIDTH_B=12
|
||
|
run sync_same_width 2b_sync_same_width \
|
||
|
-P tb.DATA_WIDTH_A=2 -P tb.DATA_WIDTH_B=2 \
|
||
|
-P tb.ADDR_WIDTH_A=13 -P tb.ADDR_WIDTH_B=13
|
||
|
run sync_same_width 1b_sync_same_width \
|
||
|
-P tb.DATA_WIDTH_A=1 -P tb.DATA_WIDTH_B=1 \
|
||
|
-P tb.ADDR_WIDTH_A=14 -P tb.ADDR_WIDTH_B=14
|