patch ies/top.sh to include DENALI
fi
sed -i "s/93 -relax/93 -elaborate -relax/gI" ${DONUT_HARDWARE_ROOT}/sim/ies/top.sh # run irun up to elaboration, skip execution
sed -i "s/-top xil_defaultlib.top/-top work.top/gI" ${DONUT_HARDWARE_ROOT}/sim/ies/top.sh # build top in work library
+ if [ -n ${DENALI} ];then
+ echo "env DENALI exists ${DENALI}, include in top.sh"
+ perl -i.ori -pe 'use Env qw(DENALI);s/(glbl.v)/$1 \\ \n +incdir+"${DENALI}\/ddvapi\/verilog"/mg' ${DONUT_HARDWARE_ROOT}/sim/ies/top.sh # add denali include directory
+ fi
if [ -f ${DONUT_HARDWARE_ROOT}/sim/ies/run.f ]; then
perl -i.ori -pe 's/(.*\/verilog\/top.v)/ -sv $1/mg' ${DONUT_HARDWARE_ROOT}/sim/ies/run.f # compile top.v with system verilog
perl -i.ori -pe 'BEGIN{undef $/;} s/(^-makelib.*\n.*glbl.v.*\n.*endlib)//mg' ${DONUT_HARDWARE_ROOT}/sim/ies/run.f # remove glbl.v from compile list
