gate 5.32 KB
#!/bin/sh

. /home/whs/bb/setup
BB_PATH=/home/whs/bb/rf/sw/root/PR
RST="${BB_PATH}/tests/`basename $1`.result"

######### IOSIM SETUP ##################
SEED=$RANDOM
export IOSIM_SERVER=127.0.0.1
export IOSIM_PORT=8787
export IOSIM_ADDR=0
export IOSIM_MEM_SIZE=16384
export IOSIM_SEED=$SEED

echo "Gate level test start at `date`" >>$RST
echo "Random seed = $SEED" >>$RST

#cvs update -df
#cd vsim
#export SIMGATE=1
#make clean
#make sim.ipc
#make sim.cpu
cd ${BB_PATH}/hw2/chip/vsim 
export SIMGATE=1
export SIMDEFS="+define+VIRAGE_FAST"
make clean
make sim.ipc 
./sim.ipc +delay_mode_zero +cbus_mon +race +race=all +non_clk_mon $BBOPTS >${BB_PATH}/tests/sim.log 2>&1 &

cd ${BB_PATH}/tests
../iosim/src/iosim -f ../iosim/src/random/test/init.tst

grep_error()
{
    grep -i "$2" tmp.$$ >/dev/null 2>&1 && {
	echo "$1 Failed" >>$RST
    } || {
	echo "$1 Passed" >>$RST
    }
    cat tmp.$$
    rm tmp.$$
}

cd ${BB_PATH}/iosim/src/random/test
for tst_file in `ls *.tst`
do
    chmod a+w $tst_file 
    sed -e s/"^q"/"###q"/  $tst_file > tmp.$$
    cp -rf tmp.$$ $tst_file
    rm -rf tmp.$$
done

cd ${BB_PATH}/iosim/src/random/bcp
######### RI Single READ ############
../../iosim -f ../test/ri_sread.tst -d 0241 >tmp.$$ 2>&1
grep_error "RI single read" failed

######### RI Single WRITE ############
../../iosim -f ../test/ri_swrite.tst -d 0241 >tmp.$$ 2>&1 
grep_error "RI single write" failed

######## AI DMA test ################
../../iosim -f ../test/ai_dma.tst -d 0241 >tmp.$$ 2>&1
grep_error "AI DMA test" failed

########## SP PIO TEST ############
../../iosim -f ../test/sp_pio.tst -d 0241 >tmp.$$ 2>&1
grep_error "SP PIO TEST" failed

########## SP DMA TEST0 ###########
../../iosim -f ../test/sp_dma.tst -d 0241 >tmp.$$ 2>&1
grep_error "SP DMA TEST" failed

########## USB0 pio ################ 
../../iosim -f ../test/ui_pio.tst -d 0241 >tmp.$$ 2>&1
grep_error "USB0 pio" failed

########## USB1 pio ################
../../iosim -f ../test/ui_pio1.tst -d 0241  >tmp.$$ 2>&1
grep_error "USB1 pio" failed

########## USB0 Transaction ###########
../../iosim -f ../test/usb0_trans.tst -d 0241 >tmp.$$ 2>&1
grep_error "USB0 Transaction" failed

########## USB1 Transaction ###########
../../iosim -f ../test/usb1_trans.tst -d 0241 >tmp.$$ 2>&1
grep_error "USB1 Transaction" failed

######### VI LAN1 #####################
../test/vi_lan1 >tmp.$$ 2>&1
grep_error "VI LAN1" "Error in"

######### VI LPN2 #####################
../test/vi_lpn2 >tmp.$$ 2>&1
grep_error "VI LPN2" "Error in"

######### VI H18 #####################
../test/vi_h18 >tmp.$$ 2>&1
grep_error "VI H18" "Error in"

######### VI h32 #####################
../test/vi_h32 >tmp.$$ 2>&1
grep_error "VI H32" "Error in"

########## DP ATT Test ################
../test/dp_att_014 >tmp.$$ 2>&1
grep_error "DP ATT Test" failed

########## DP COV Test ################
../test/dp_cov_023 >tmp.$$ 2>&1
grep_error "DP COV Test" failed

########## DP EW Test ################
../test/dp_ew_116 >tmp.$$ 2>&1
grep_error "DP EW Test" failed

########## DP MS Test ################
../test/dp_ms_002 >tmp.$$ 2>&1
grep_error "DP MS Test" failed

########## DP TEX Test ################
../test/dp_tex_038 >tmp.$$ 2>&1
grep_error "DP TEX Test" failed

######### SI TESTS ############
../../si_test/si_testr -d 341 -t 0 >tmp.$$ 2>&1
grep_error "SiTestRandom(1, ForceFail_None, 0, 0)" Failed

../../si_test/si_testr -d 341 -t 1 >tmp.$$ 2>&1
grep_error "(1, ForceFail_None, StartWithXs, 0)" Failed

../../si_test/si_testr -d 341 -t 2 >tmp.$$ 2>&1
grep_error "SiTestValidCtrlCmds(1, 0, 0, 0)" Failed

../../si_test/si_testr  -d 341 -t 3 >tmp.$$ 2>&1
grep_error "SiTestInvalidCtrlrCmds(1, 0, 0, 0)" Failed

../../si_test/si_testr -d 341 -t 4 >tmp.$$ 2>&1
grep_error "SiTestCtrlrErrViaBD(1, CtrlQueryStatus, 0, 0)" Failed

../../si_test/si_testr -d 341 -t 5 >tmp.$$ 2>&1
grep_error "SiTestDmaBusyError(1, SI_DMA_WR_REG, PIF_RAM_START, 0)" Failed 

../../si_test/si_testr -d 341 -t 6 >tmp.$$ 2>&1
grep_error "SI test6" failed

../../si_test/si_testr -d 341 -t 7 >tmp.$$ 2>&1
grep_error "SI test7" failed

../../si_test/si_testr  -d 341 -t 8 10 >tmp.$$ 2>&1
grep_error "SI test8" failed

######## PI DMA test ##############
../../pi_test/pi_bufdma  >tmp.$$ 2>&1
grep_error "PI DMA test" fail

########### PI GPIO ###########
../../pi_test/pi_gp_ide_io >tmp.$$ 2>&1
grep_error "PI GPIO" fail

######### MI INTERNAL SRAM Write/Read  ############
../../mi_test/mi_random -d 0241 -t isram >tmp.$$ 2>&1
grep_error "MI Internal SRAM WRITE/Read" fail

######### MI Virage0 Write/Read  ############
../../mi_test/mi_random -d 0241 -t v0sram >tmp.$$ 2>&1
grep_error "MI Virage0 Write/Read" fail

######### MI Virage1 Write/Read  ############
../../mi_test/mi_random -d 0241 -t v1sram >tmp.$$ 2>&1
grep_error "MI Virage1 Write/Read" fail

######### MI Virage2 Write/Read  ############
../../mi_test/mi_random -d 0241 -t v2sram >tmp.$$ 2>&1
grep_error "MI Virage2 Write/Read" fail

######### MI DRAM Write/Read  ############
../../mi_test/mi_random -d 0241 -t dram >tmp.$$ 2>&1
grep_error "MI DRAM Write/Read" fail

#### PI FUNC ########
../../pi_test/pi_functest -g >tmp.$$ 2>&1 
grep_error "PI FUNC Gate level" failed

### JTAG Test #####
../../jtag_test/jtag_test -g >tmp.$$ 2>&1
grep_error "JTAG Test" failed

#### MI Test #########
../../mi_test/mi_test -s 20 -g  >tmp.$$ 2>&1
grep_error "MI Test(VIRAGE)" failed

../../iosim -f ../../../test/bcp_quit.tst

echo "Gate level test ends at `date`" >>$RST