run.sh 896 Bytes
Newer Older
1 2
#!/bin/bash

3
set -x
4 5 6 7 8 9 10
test -d $1
test -f scripts/$2.ys

rm -rf $1/work_$2
mkdir $1/work_$2
cd $1/work_$2

11 12
touch .start

13
yosys -ql yosys.log ../../scripts/$2.ys
14 15 16 17 18
if [ $? != 0 ] ; then
    echo FAIL > ${1}_${2}.status
    touch .stamp
    exit 0
fi
19
sed -i 's/reg =/dummy =/' ./synth.v
20 21 22 23 24 25 26 27

if [ -f "../../../../../techlibs/common/simcells.v" ]; then
    COMMON_PREFIX=../../../../../techlibs/common
else
    COMMON_PREFIX=/usr/local/share/yosys
fi

iverilog -o testbench  ../testbench.v synth.v ../../common.v $COMMON_PREFIX/simcells.v $COMMON_PREFIX/simlib.v
28 29 30 31 32
if [ $? != 0 ] ; then
    echo FAIL > ${1}_${2}.status
    touch .stamp
    exit 0
fi
33 34 35

if ! vvp -N testbench > testbench.log 2>&1; then
	grep 'ERROR' testbench.log
36
	echo FAIL > ${1}_${2}.status
37
elif grep 'ERROR' testbench.log || ! grep 'OKAY' testbench.log; then
38
	echo FAIL > ${1}_${2}.status
39
else
40
	echo PASS > ${1}_${2}.status
41 42 43
fi

touch .stamp