Compatibility with all kind of installations.

This commit is contained in:
Jean-Paul Chaput 2012-05-03 20:12:36 +00:00
parent 7849bedb7a
commit d355b92651
1 changed files with 133 additions and 135 deletions

View File

@ -1,156 +1,154 @@
#!/bin/sh #!/bin/sh
LOG_RES=/tmp/res_mips_"$$"
LOG_MSG=/tmp/msg_mips_"$$"
if [ $# -lt 1 ]; then LOG_RES=/tmp/res_mips_"$$"
echo "usage: $0 <bench_file>" LOG_MSG=/tmp/msg_mips_"$$"
exit 1
fi
if [ ! -f $1.u ]; then
echo "error: can't find '$1.u'"
exit 1
fi
TOP=$ALLIANCE_TOP if [ $# -lt 1 ]; then
MBK_CATA_LIB=.:$TOP/cells/sclib:$TOP/cells/sxlib:$TOP/cells/padlib:$TOP/cells/dplib:$TOP/cells/dp_sxlib echo "usage: $0 <bench_file>"
MBK_CATA_LIB=$MBK_CATA_LIB:$TOP/cells/fplib:$TOP/cells/rfg:$TOP/cells/dplib:$TOP/cells/rflib exit 1
MBK_CATA_LIB=$MBK_CATA_LIB:../sce/ fi
export MBK_CATA_LIB if [ ! -f $1.u ]; then
MBK_IN_LO=vst echo "error: can't find '$1.u'"
export MBK_IN_LO exit 1
fi
rm -f $LOG_RES $LOG_MSG if [ -z "$ALLIANCE_TOP" ]; then
ALLIANCE_TOP="${HOME}/alliance/Linux.slsoc6x/install"
echo "################# ---- Test de : $1 ---- #################" fi
if [ "$ALLIANCE_TOP" != "/usr/lib/alliance" ]; then
if [ -f $1.e ]; then ALLIANCE_BIN=${ALLIANCE_TOP}/bin
cp -f $1.e rome.e CELLS_TOP=${ALLIANCE_TOP}/cells
$TOP/bin/mips_asm rome.e rome foo 1> /dev/null else
fi ALLIANCE_BIN=/usr/bin
CELLS_TOP=/usr/share/alliance/cells
if [ -f $1.u ]; then fi
cp -f $1.u romu.u
$TOP/bin/mips_asm romu.u romu foo 1> /dev/null
fi
MBK_CATA_LIB=.
MBK_CATA_LIB=${MBK_CATA_LIB}:$CELLS_TOP/sclib
MBK_CATA_LIB=${MBK_CATA_LIB}:$CELLS_TOP/sxlib
MBK_CATA_LIB=${MBK_CATA_LIB}:$CELLS_TOP/padlib
MBK_CATA_LIB=${MBK_CATA_LIB}:$CELLS_TOP/dplib
MBK_CATA_LIB=${MBK_CATA_LIB}:$CELLS_TOP/dp_sxlib
MBK_CATA_LIB=${MBK_CATA_LIB}:$CELLS_TOP/fplib
MBK_CATA_LIB=${MBK_CATA_LIB}:$CELLS_TOP/rfg
MBK_CATA_LIB=${MBK_CATA_LIB}:$CELLS_TOP/dplib
MBK_CATA_LIB=${MBK_CATA_LIB}:$CELLS_TOP/rflib
MBK_CATA_LIB=${MBK_CATA_LIB}:../sce/
export MBK_CATA_LIB
$TOP/bin/asimut -zerodelay -i 0 -bdd -p 100 mips_cpu mips_cpu $1 1> $LOG_MSG 2> $LOG_RES MBK_IN_LO=vst
export MBK_IN_LO
#asimut -zerodelay -bdd -p 100 mips_cpu mips_cpu $1 2>$LOG_RES rm -f $LOG_RES $LOG_MSG
#asimut -zerodelay -bdd -p 100 mips_cpu mips_cpu $1 echo "################# ---- Test de : $1 ---- #################"
if [ -f $1.e ]; then
cp -f $1.e rome.e
$ALLIANCE_BIN/mips_asm rome.e rome foo 1> /dev/null
fi
if [ -f $1.u ]; then
cp -f $1.u romu.u
$ALLIANCE_BIN/mips_asm romu.u romu foo 1> /dev/null
fi
$ALLIANCE_BIN/asimut -zerodelay -i 0 -bdd -p 100 mips_cpu mips_cpu $1 1> $LOG_MSG 2> $LOG_RES
#$ALLIANCE_BIN/asimut -zerodelay -bdd -p 100 mips_cpu mips_cpu $1 2>$LOG_RES
#$ALLIANCE_BIN/asimut -zerodelay -bdd -p 100 mips_cpu mips_cpu $1
grep -i bad $LOG_RES >/dev/null grep -i bad $LOG_RES >/dev/null
#grep -i bad $LOG_RES #grep -i bad $LOG_RES
if [ $? -eq 0 ] ; then if [ $? -eq 0 ] ; then
echo "ERROR !" echo "ERROR !"
fi fi
grep -i good $LOG_RES > /dev/null
grep -i good $LOG_RES > /dev/null
#grep -i good $LOG_RES #grep -i good $LOG_RES
if [ $? -eq 0 ] ; then if [ $? -eq 0 ] ; then
echo "No error, you're lucky !" echo "No error, you're lucky !"
fi fi
grep -i "No such file or directory" $LOG_RES > /dev/null
if [ $? -eq 0 ] ; then
grep -i "No such file or directory" $LOG_RES > /dev/null echo "================= By jove ! a file is missing (asimut) ... ============== "
grep -i "No such file or directory" $LOG_RES
if [ $? -eq 0 ] ; then fi
echo "================= By jove ! a file is missing (asimut) ... ============== "
grep -i "No such file or directory" $LOG_RES grep -i "No such file or directory" $LOG_MSG > /dev/null
fi
if [ $? -eq 0 ] ; then
echo "================= By jove ! Il manque un fichier (asimut) ... ============== "
grep -i "No such file or directory" $LOG_MSG > /dev/null grep -i "No such file or directory" $LOG_MSG
fi
if [ $? -eq 0 ] ; then
echo "================= By jove ! Il manque un fichier (asimut) ... ============== " grep -i "core dump" $LOG_RES > /dev/null
grep -i "No such file or directory" $LOG_MSG
fi if [ $? -eq 0 ] ; then
echo "================= core dump (asimut) ... ========= "
fi
grep -i "core dump" $LOG_MSG > /dev/null
grep -i "core dump" $LOG_RES > /dev/null
if [ $? -eq 0 ] ; then
if [ $? -eq 0 ] ; then echo "================= core dump (asimut) ... ========= "
echo "================= core dump (asimut) ... ========= " fi
fi
grep "Error" $LOG_RES > /dev/null
grep -i "core dump" $LOG_MSG > /dev/null
if [ $? -eq 0 ] ; then
if [ $? -eq 0 ] ; then echo "================= Error (asimut) ... ==== "
echo "================= core dump (asimut) ... ========= " grep -i "Error" $LOG_RES
fi fi
grep "Error" $LOG_MSG > /dev/null
grep "Error" $LOG_RES > /dev/null if [ $? -eq 0 ] ; then
echo "================= Error ! (asimut) ... ==== "
if [ $? -eq 0 ] ; then grep -i "Error" $LOG_MSG
echo "================= Error (asimut) ... ==== " fi
grep -i "Error" $LOG_RES
fi grep "can't open file" $LOG_RES > /dev/null
grep "Error" $LOG_MSG > /dev/null if [ $? -eq 0 ] ; then
echo "================= A file is missing (asimut) ... ========== "
if [ $? -eq 0 ] ; then grep -i "can't open file" $LOG_RES
echo "================= Error ! (asimut) ... ==== " fi
grep -i "Error" $LOG_MSG
fi grep "can't open file" $LOG_MSG > /dev/null
if [ $? -eq 0 ] ; then
echo "================= A file is missing (asimut) ... ========== "
grep "can't open file" $LOG_RES > /dev/null grep -i "can't open file" $LOG_MSG
fi
if [ $? -eq 0 ] ; then
echo "================= A file is missing (asimut) ... ========== " grep "exception occured" $LOG_RES > /dev/null
grep -i "can't open file" $LOG_RES
fi if [ $? -eq 0 ] ; then
grep "exc" $1.u > /dev/null
grep "can't open file" $LOG_MSG > /dev/null if [ ! $? -eq 0 ] ; then
echo "================= Exception (asimut) ... ======== "
if [ $? -eq 0 ] ; then fi
echo "================= A file is missing (asimut) ... ========== " fi
grep -i "can't open file" $LOG_MSG
fi grep "exception occured" $LOG_MSG > /dev/null
if [ $? -eq 0 ] ; then
grep "exc" $1.u > /dev/null
grep "exception occured" $LOG_RES > /dev/null if [ ! $? -eq 0 ] ; then
echo "================= Exception (asimut) ... ======== "
if [ $? -eq 0 ] ; then fi
grep "exc" $1.u > /dev/null fi
if [ ! $? -eq 0 ] ; then
echo "================= Exception (asimut) ... ======== " rm -f toto.vbe
fi rm -f romu.u
fi rm -f rome.e
rm -f $LOG_RES
grep "exception occured" $LOG_MSG > /dev/null rm -f $LOG_MSG
if [ $? -eq 0 ] ; then
grep "exc" $1.u > /dev/null
if [ ! $? -eq 0 ] ; then
echo "================= Exception (asimut) ... ======== "
fi
fi
rm -f toto.vbe
rm -f romu.u
rm -f rome.e
rm -f $LOG_RES
rm -f $LOG_MSG