jobs 3.22 KB
#!/bin/sh

# Please setup as:
#    crontab -e
#    Add line: minutes hour * * * 
#     30 19 * * * /work/bb/rf/sw/bbplayer/tests/jobs

freq_8=`echo "1250 + $RANDOM % 750" | bc`
sys_period=`echo "$freq_8 * 8" | bc`
#sys_period=16000
v_period=69841

###############################################
#
# DAY  Period   Feq     DDR
# Mon  16000    62.5    32
# Tue  10416    96      32
# Wed  16000    62.5    16
# Thu  Random   Random  32
# Fri  12000    83.3    16
# Sat  16000    62.5    32 
# Sun  10664    93.75   32
#

ddd=`date +%w`
DDROPTS="on 16bits DDR"
BBDDR=""
case $ddd in 
	2) sys_period=16000; DDROPTS="on 32bits DDR";;
	1) sys_period=10416; DDROPTS="on 32bits DDR";; 
	3) sys_period=16000; export BBDDR="+define+DDR32M16";;
	4) DDROPTS="on 32bits DDR";;
	5) sys_period=12000; export BBDDR="+define+DDR32M16";;
	6) sys_period=16000; DDROPTS="on 32bits DDR";;
	0) sys_period=10664; DDROPTS="on 32bits DDR";;
esac

export BBOPTS="+sysclk=${sys_period} +vclk=${v_period}"
sys_clk=`echo "scale=1; 1000000/$sys_period" | bc`
v_clk=`echo "scale=1; 1000000/$v_period" | bc`

LOG=`date +%Y%m%d`
SUB1=`date +%Y-%m-%d`
SUB="${SUB1} nightly regression results $DDROPTS"
SUBPERF="${SUB1} nightly regression performance results $DDROPTS"

. /home/whs/bb/setup
BB_PATH=/home/whs/bb/rf/sw/root/PR
cd ${BB_PATH}/tests

echo "Nightly regression run at sysclk=${sys_clk}MHz(${sys_period}) vclk=${v_clk}MHz $DDROPTS" > ${LOG}.result
echo "<html><h1>Nightly regression Performance measured at sysclk=${sys_clk}MHz vclk=${v_clk}MHz</h1> $DDROPTS" > ${LOG}.perf.html
echo "Nightly regression Performance measured at sysclk=${sys_clk}MHz vclk=${v_clk}MHz" > /tmp/bb_perf
echo "* * * Performance Measure at `date` on `hostname` * * * " >> /tmp/bb_perf
echo "* * * Performance Measure at `date` on `hostname` * * * " >> ${LOG}.perf.html

cvs update . >> ${LOG}.update
./nightly /home/whs/bb/rf/sw/root/PR/tests/${LOG} >> ${LOG}.log 2>&1

#### Create Performance comparison #########
cd ${BB_PATH}/tests/perf
./perf /tmp/bb_perf ../${LOG}.perf.html
echo "</html>" >> ../${LOG}.perf.html
mv -f /tmp/bb_perf ../${LOG}.perf

##################################
##################################
# Export information to web server
#
machine=source.routefree.com
now="$LOG"
topdir=/home/httpd/html

###################################
# Process the coverage information
#
cd ${BB_PATH}/hw2/chip/vsim
cmView -b +DIR=sim.ipc.cm
dirname=${topdir}/bb_chip_coverage/${now}
rsh -n ${machine} mkdir ${dirname}
rcp sim.ipc.cm/reports/cmView* ${machine}:${dirname}
rsh -n ${machine} rm -f ${topdir}/bb_chip_coverage/latest
rsh -n ${machine} ln -s ${dirname} ${topdir}/bb_chip_coverage/latest

###################################
# Archive the results
#
cd ${BB_PATH}/tests
dirname=${topdir}/bb_chip_regression/${now}
rsh -n ${machine} mkdir ${dirname}
rcp ${now}.* ${machine}:${dirname}
rsh -n ${machine} rm -f ${topdir}/bb_chip_regression/latest
rsh -n ${machine} ln -s ${dirname} ${topdir}/bb_chip_regression/latest

##### Mail result out
echo "Sender: whs@broadon.com" > rr.$$
echo "From: whs@broadon.com" >> rr.$$
echo "To: bb-dv@routefree.com"  >> rr.$$
echo "Subject: ${SUB}"  >> rr.$$
cat /home/whs/bb/rf/sw/root/PR/tests/${LOG}.result >> rr.$$

/usr/lib/sendmail -v -U bb-dv@routefree.com < rr.$$
rm -rf rr.$$
rm -rf tmp.*