2019-08-08 04:05:11 -05:00
|
|
|
#!/bin/bash
|
|
|
|
set -ex
|
2019-12-22 08:30:04 -06:00
|
|
|
if [ -z $VIVADO_DIR ]; then
|
|
|
|
VIVADO_DIR=/opt/Xilinx/Vivado/2019.1
|
|
|
|
fi
|
2019-08-08 04:05:11 -05:00
|
|
|
sed 's/DSP48E1/DSP48E1_UUT/; /DSP48E1_UUT/,/endmodule/ p; d;' < ../cells_sim.v > test_dsp_model_uut.v
|
|
|
|
if [ ! -f "test_dsp_model_ref.v" ]; then
|
2019-12-22 08:30:04 -06:00
|
|
|
cp $VIVADO_DIR/data/verilog/src/unisims/DSP48E1.v test_dsp_model_ref.v
|
2019-08-08 04:05:11 -05:00
|
|
|
fi
|
2019-09-18 12:45:04 -05:00
|
|
|
for tb in macc_overflow_underflow \
|
2019-12-22 08:30:04 -06:00
|
|
|
simd24_preadd_noreg_nocasc simd12_preadd_noreg_nocasc \
|
|
|
|
mult_allreg_nopreadd_nocasc mult_noreg_nopreadd_nocasc \
|
2019-09-18 12:45:04 -05:00
|
|
|
mult_allreg_preadd_nocasc mult_noreg_preadd_nocasc mult_inreg_preadd_nocasc
|
2019-08-08 04:05:11 -05:00
|
|
|
do
|
2019-12-22 08:30:04 -06:00
|
|
|
iverilog -s $tb -s glbl -o test_dsp_model test_dsp_model.v test_dsp_model_uut.v test_dsp_model_ref.v $VIVADO_DIR/data/verilog/src/glbl.v
|
2019-08-08 04:05:11 -05:00
|
|
|
vvp -N ./test_dsp_model
|
|
|
|
done
|