summaryrefslogblamecommitdiffstats
path: root/sim-scripts/tsim-support
blob: aa4da2e436079058197cc904542b73739b902af9 (plain) (tree)
1
2
3
4
5
6
7
8
9


                      


                       


                              
                     
                      


















                                          












                        







                
                     
                          
                         
                         
                          



                           

                          

                            


                            

                          
               

 
                         




                            













                                                                            
    
 
#
#  TSIM Shared Support
#
#

runBSP=tsim-${tsimName}
bspUsesGDBSimulator="no"
bspGeneratesGDBCommands="yes"
bspSupportsGDBServerMode="yes"
bspNeedsSttySane="no"
bspNeedsDos2Unix="yes"

type ${runBSP} >/dev/null 2>&1
if [ $? -ne 0 ] ; then
  echo "Unable to find ${runBSP} on PATH."
  exit 1
fi

# required for this to run
echo | ${runBSP} -nohaspnet >/dev/null
if [ $? -ne 0 ] ; then
  echo "No TSIM License for this machine."
  exit 1
fi

runARGS()
{
  echo "-c ${bspTreeFile} ${1}"
}

gdbServerARGS()
{
  echo "-gdb"
}

bspGenerateGDBCommands()
{
cat <<EOF
tar remote :1234
load
EOF
}

checkBSPFaults()
{
  return 0
}

bspLimit()
{
  testname=$1
  case ${testname} in
    *stackchk*)limit=20 ;;
    *fatal*)   limit=1 ;;
    *minimum*) limit=1 ;;
    *block05*) limit=70 ;;
    *crypt*)   limit=400 ;;
    *linpack*) limit=140 ;;
    *linpack*) limit=140 ;;
    *sp20*)    limit=120 ;;
    *psxtime*) 
       case ${tsimName} in
         leon)  limit=240 ;;
         leon3) limit=240 ;;
         *)     limit=180 ;;
       esac
       ;;
    *)         limit=60 ;;
  esac
  echo ${limit}
}

bspSimTrustedToExit="yes"
bspGeneratesDeviceTree="yes"
bspTreeFile=${tsimName}.conf

bspGenerateDeviceTree()
{
  if [ ${inGDBScript} = no ] ; then
    if [ ${coverage} = yes ] ; then
      echo "coverage enable"
    fi
    if [ ${limit} -eq 0 ] ; then
      echo "go ${tsimGoAddress}"
    else
      echo "go ${tsimGoAddress} ${limit} s"
    fi
    if [ ${coverage} = yes ] ; then
      echo "coverage save ${2}.cov"
      echo "shell sleep 1"           # give tsim time to actually write file
    fi
    echo "quit"
  fi
}