
# For every part listed in the partslist, this script goes into the
# directory for that part and simulates the part on Realmodel. The 
# simlst file so generated is then compared with the simlst.gold 
# file obtained previously by simulating the same part on Realchip
# using the same scripts. If any discrepancies are detected it 
# returns a failure for that part in the rmregression.log file.

rm -f rmregression.log

cat partslist | while read i
do
  echo >> rmregression.log
  echo Realmodel $i regression test begins
  echo -n "Realmodel $i regression test begins at " >> rmregression.log
  date >> rmregression.log

  cd $i

  simulate
  
  sed -f deldate simlst.dat > simlst.rm
  rm simlst.dat
  
  diff simlst.gold simlst.rm > rcvsrm

  if cmp simlst.gold simlst.rm 
  then
    echo "      Realmodel $i Test Passed!" >> ../rmregression.log
  else
    echo "      Realmodel $i Test Failed!" >> ../rmregression.log
  fi

  cd ..
done
