testit 1.33 KB
#!/bin/sh -f
#################################################################
#
#  Script to make tabular files.  Make up for lack of prefix
#  rules in smake.
#
#################################################################

RDP_OPTS=""

BASE_NAME=""
TEST_NUM=""

INDATA="InData"
OUTDATA="OutData/ew_all"
LD_LIBRARY_PATH="/ecad/vcs/vcs_2.2/sgi/lib:../../../lib/libimage"
RDP_CV=" rdp_cv $RDP_OPTS"

#
#  Usage message
#
usage()
{
  echo "Usage: testit <-b> basename <-t> test_number"
  exit 2
}

#
#  Run the verilog simulation (rdp_cv)
#
vsim()
{
  set -x

  OUTNAME=${OUTDATA}/test${TEST_NUM}.tab
  MEMNAME=${INDATA}/${BASE_NAME}.mem
  export LD_LIBRARY_PATH

  echo CV sim test ${TEST_NUM} start `date` 

  zcat ${MEMNAME}.Z > ${MEMNAME} 
  zcat ${OUTNAME}.base.Z > ${OUTNAME}.base
  $RDP_CV -e -i ${BASE_NAME} -m ${BASE_NAME} \
	-M 500 -Q ${TEST_NUM} +ew_qsim_dump=${OUTNAME} \
	-f test${TEST_NUM}_tab | tee test${TEST_NUM}_tab.out

  cmp -s ${OUTNAME} ${OUTNAME}.base
  if test $? -ne 0 ; then
    echo "TEST $TEST_NUM FAILED, tab files didn't compare"
  fi

  compress -f ${OUTNAME}
  rm -f ${OUTNAME}.base
  rm -f ${MEMNAME}
  echo CV sim test ${TEST_NUM} finish `date` 
}


#
#  Main
#
while getopts "b:t:" a
do
    case $a in
    b)  BASE_NAME=$OPTARG;;
    t)  TEST_NUM=$OPTARG;;
    \?) usage ;;
    esac
done
shift `expr $OPTIND - 1`

vsim