weekly 8.05 KB
#!/bin/sh
#
# set tabsbtop=4

RST=`pwd`/`basename $1`.result
./rebuild_tree

echo "* * * Test run on `hostname` at `pwd` * * *" >> $RST
if [ "$SNPSLMD_LICENSE_FILE" = "" ]; then
	echo "#################################################" >> $RST
	echo "Test Failed : Please setup vcs environment first" >> $RST
	echo "#################################################" >> $RST
	exit 1
fi

cd ..
BB_PATH=`pwd`

######## update libbcppli #######
cd ${BB_PATH}/lib/libbcppli
make 

######## update sim.ipc #########
cd ${BB_PATH}/hw2
rm -f chip/vsim/External_File.txt
cd chip/vsim
export SIMDEFS='+define+FLASH_BIG +CM+ALL+LIBS +define+VIRAGE_FAST'
make sim.ipc > /dev/null 2>&1 || {
   echo "Make sim.ipc Failed" >> $RST
}

echo "+ + + Nightly  Test  Start(component level) + + +"  >> $RST
date >> $RST

######## Component level test come first ##########
#### VI component
cd ${BB_PATH}/rdpsim/test/vi
make rtests > result 2>&1
grep errors result | grep -v "errors:[[:space:]]*0" && {
    echo "Failed: vi componet level error" >> $RST
    echo "please check file: ${BB_PATH}/rdpsim/test/vi/result" >> $RST
}

grep ERROR result | grep -v "NO ERRORS" && {
    echo "Failed: vi componet level error" >> $RST
    echo "please check file: ${BB_PATH}/rdpsim/test/vi/result" >> $RST
}

#RSP test

cd $BB_PATH
cd rspsim/vuregre
make clean

# SU TEST
make su >/dev/null 2>&1
grep "Failed :0" rsptest/SUTest/regression.log /dev/null 2>&1 && {
    echo "BCP rsp SU test passed" >> $RST
} || {
    echo "ERROR: BCP rsp SU test Failed" >> $RST
    echo "please refer to ${cur_path}/rsp/rspsim/vuregre/rsptest/SUTest/regression.log" >> $RST
}


# SU SINGLE STEP TEST
make su_single >/dev/null 2>&1
grep "Failed :0" rsptest/SUTestSingle/regression.log /dev/null 2>&1 && {
    echo "BCP rsp SU SINGLE STEP test passed" >> $RST
} || {
    echo "ERROR: BCP rsp SU SINGLE_STEP test Failed" >> $RST
    echo "please refer to ${cur_path}/rsp/rspsim/vuregre/rsptest/SUTestSingle/regression.log" >> $RST
}


# VU TEST
make vu >/dev/null 2>&1
grep "Failed :0" rsptest/VUTest/regression.log /dev/null 2>&1 && {
    echo "BCP rsp VU test passed" >> $RST
} || {
    echo "ERROR: BCP rsp VU test Failed"
    echo "please refer to ${cur_path}/rsp/rspsim/vuregre/rsptest/VUTest/regression.log"  >> $RST
}

# VU SINGLE STEP TEST
make vu_single >/dev/null 2>&1
grep "Failed :0" rsptest/VUTestSingle/regression.log > /dev/null 2>&1 && {
    echo "BCP rsp VU Single step test passed"  >> $RST
} || {
    echo "ERROR: BCP rsp VU single step test Failed"  >> $RST
    echo "please refer to ${cur_path}/rsp/rspsim/vuregre/rsptest/VUTestSingle/regression.log"  >> $RST
}

export IOSIM_SERVER=127.0.0.1
export IOSIM_PORT=6767
###### check out new iosim tests ######
cd ${BB_PATH}/include
make headers

cd ${BB_PATH}/iosim
cd src
make 

###### START SIM.IPC ########
cd ${BB_PATH}/hw2/chip/vsim
${BB_PATH}/iosim/src/pi_test/gen_ext_rand External_File.txt
./sim.ipc $BBOPTS +vcs+lic+wait +CM+ALL +delay_mode_zero > sim.log&

cd ${BB_PATH}/tests
echo "+ + + Nightly  Test  Start(base on ipc simulator) + + +"  >> $RST
date  >> $RST

../iosim/src/iosim -f ../iosim/test/bcp_init.tst
../iosim/src/iosim -f ../iosim/test/bcp_vpll_init.tst

# IOSIM AI test
echo 
echo "Start BCP AI test "
../iosim/src/iosim	-f ../iosim/test/bcp_ai.tst > tmp.$$ 2>&1
grep -i "Fail" tmp.$$ && {
	echo "AI IOSIM test failed" >> $RST
} || {
    echo "AI IOSIM test passed"  >> $RST
}
cat tmp.$$

#IOSIM ri test
../iosim/src/iosim	-f ../iosim/test/bcp_ri.tst > tmp.$$ 2>&1
grep -i "Fail" tmp.$$ && {
    echo "RI IOSIM test failed" >> $RST
} || {
    echo "RI IOSIM test passed"  >> $RST
}
cat tmp.$$

#IOSIM sp test
../iosim/src/iosim -f ../iosim/test/bcp_sp.tst > tmp.$$ 2>&1
grep -i "Fail"  tmp.$$ && {
    echo "SP IOSIM test failed" >> $RST
} || {
    echo "SP IOSIM test passed"  >> $RST
}
cat tmp.$$
rm -rf tmp

##### Iosim Vi test ######
### 3 test failed
[ -d ${BB_PATH}/rdpsim/backend/test/Iosim/OutData ] || {
   mkdir -p ${BB_PATH}/rdpsim/backend/test/Iosim/OutData
}
cd ${BB_PATH}/rdpsim/backend/test/Iosim/OutData
rm -rf *
cd ..
make clean
make allvi_clean
grep -v equate OutData/Results && {
   echo "Failed: Vi iosim test error." >> $RST
} || {
   echo "VI IOSIM test passed"  >> $RST
}

##### rsp iosim test ######
#  dma pin pin_single
#

cd $BB_PATH
cd rspsim/vuregre

# DMA TEST
make dma >/dev/null 2>&1
grep "Failed" rsptest/dmatest/test.result > /dev/null 2>&1 && {
    echo "ERROR: BCP rsp DMA test Failed"  >> $RST
} || {
    echo "BCP rsp DMA test passed" >> $RST
}

# PIN TEST
make pin >/dev/null 2>&1
grep "Failed" rsptest/pinTest/test.result > /dev/null 2>&1 && {
    echo "ERROR: BCP rsp PIN test Failed" >> $RST
} || {
    echo "BCP rsp PIN test passed" >> $RST
}

# PIN SINGLE STEP TEST
make pin_single >/dev/null 2>&1
grep "Failed" rsptest/pinTestSingle/test.result > /dev/null 2>&1 && {
    echo "ERROR: BCP rsp pin Single step test Failed" >> $RST
} || {
    echo "BCP rsp PIN Single step test passed" >> $RST
}

##### rdp iosim test #####
# test039_tex cov bit failed 
#
# Make dp test one by one again
#
cd ${BB_PATH}/rdpsim/test/rdp
rm -f Outdata/*.cov
rm -f Outdata/*.rgb
rm -f Outdata/*.z
rm -f result.diff
make nightly_rdp_io > result 2>&1
make image_diff_hwio >> result.diff
grep -i error result.diff | grep -v "ERROR: Image files OutData/test039_tex_hw_0.cov" && {
   echo "Failed: rdp iosim error" >> $RST
} || {
   echo "Succeed: rdp iosim test passed" >> $RST
}

#### MI Tests #################
#
cd ${BB_PATH}/tests
../iosim/src/mi_test/mi_test -r ../hw2/chip/vsim/tests/brom.dat -v ../hw2/chip/vsim/tests/v2.dat > tmp.$$ 2>&1
grep -i "FAIL" tmp.$$ && {
	echo "MI IOSIM test failed" >> $RST
} || {
    echo "MI IOSIM test passed"  >> $RST
}
cat tmp.$$

#### JTAG Tests #################
#
cd ${BB_PATH}/tests
../iosim/src/jtag_test/jtag_test > tmp.$$ 2>&1
grep -i "FAIL" tmp.$$ && {
	echo "JTAG IOSIM test failed" >> $RST
} || {
    echo "JTAG IOSIM test passed"  >> $RST
}
cat tmp.$$

#### SI Tests #################
echo 
echo "Start BCP SI Tests "
../iosim/src/iosim	-f ../iosim/test/bcp_si.tst > tmp.$$ 2>&1
grep "Failed" tmp.$$ && {
	echo "SI IOSIM test failed" >> $RST
} || {
    echo "SI IOSIM test passed"  >> $RST
}
cat tmp.$$

#### PI Tests #################
#
cd ${BB_PATH}/tests
../iosim/src/pi_test/pi_functest -f ${BB_PATH}/hw2/chip/vsim/External_File.txt > tmp.$$ 2>&1
grep -i "FAIL" tmp.$$ && {
	echo "PI IOSIM test failed" >> $RST
} || {
    echo "PI IOSIM test passed"  >> $RST
}
cat tmp.$$

####### USB Tests ############
#
cd ${BB_PATH}/tests
../iosim/src/iosim -f ../iosim/test/bcp_ui.tst -d 0241 > tmp.$$ 2>&1
usb_fail=0
grep -i "Fail" tmp.$$ && {
    echo "USB IOSIM test failed" >> $RST
    usb_fail=1
}
cat tmp.$$

../iosim/src/iosim -f ../iosim/test/bcp_ui_ext.tst -d 0241 > tmp.$$ 2>&1
grep -i "Fail" tmp.$$ && {
    echo "USB DATA Transfer failed" >> $RST
    usb_fail=1
} 
cat tmp.$$

../iosim/src/iosim -f ../iosim/test/bcp_ui_dmaerr.tst > tmp.$$ 2>&1
usb_fail_lines=`grep -i failed tmp.$$ | wc -l` 
[ $usb_fail_lines -ne 4 ] && {
    echo "USB DMA error case failed" >> $RST
    usb_fail=1
} || { 
	usb_fail_lines=`grep -i passed tmp.$$ | wc -l` 
	[ $usb_fail_lines -ne 4 ] && {
		echo "USB DMA error case failed(2)" >> $RST
        usb_fail=1
	}
}
cat tmp.$$

../iosim/src/iosim -f ../iosim/test/bcp_ui_sec.tst  > tmp.$$ 2>&1
grep -i "Fail" tmp.$$ && {
    echo "USB Security test failed" >> $RST
	usb_fail=1
}
cat tmp.$$

[ $usb_fail -eq 0 ] && {
    echo "USB IOSIM test passed"  >> $RST
}
cat tmp.$$

cd $BB_PATH/iosim
./src/iosim -f ./test/bcp_quit.tst

###### Add VI iorand test
cd $BB_PATH
cd iosim/data/dma80
make >/dev/null 2>&1
make vitest > test.result 2>&1
count=`grep "total error = 0" test.result | wc -l`
if [ $count -eq 6 ]; then
   echo "VI IORAND test passed" >> $RST
else
   echo "ERROR: Vi IORAND test Failed" >> $RST
fi

##### cpusim tests #####
#
#
#
echo "+ + + Nightly  Test  Start(cpusim) + + +"  >> $RST
date  >> $RST
# build sim.cpu
cd ${BB_PATH}/hw2/chip/vsim
export SIMDEFS='+CM+ALL+LIBS'
make sim.cpu > /dev/null 2>&1 || {
   echo "Make sim.cpu Failed" >> $RST
}
# build individual tests
cd ${BB_PATH}/cpusim
make 
# run the tests
./RUN >> $RST

echo "+ + + Weekly  Test  End + + +" >> $RST
date >> $RST