set outCnt = 1
source make-vlog

set elabopt = ("" "-neverwarn -notimingchecks -no_tchk_msg")
set simopt  = ("" "-neverwarn -epulse_no_msg -plinowarn")
foreach vlogopt ("" "-neverwarn -nopragmawarn")
  rm -rf work
  mkdir  work
  echo ncvlog -nocopyright -nostdout -nolog $vlogopt '<vFile>'	>> ncsim.time
  echo "------------------------------------------------"	>> ncsim.time
  echo -n running ncvlog
  foreach vlog ("opwS.v" "opwTst.v")
    echo -n $vlog": "						>>ncsim.time
    (time ncvlog -nocopyright -nostdout -nolog $vlogopt $vlog)	>>& ncsim.time 
  end
  echo ncelab -nocopyright -nostdout -nolog $elabopt[1] opwtst	>> ncsim.time
  echo "------------------------------------------------"	>> ncsim.time
  echo -n " - ncelab"
  (time ncelab -nocopyright -nostdout -nolog $elabopt[1] opwtst) >>& ncsim.time 
  echo ncsim -nocopyright -batch -input ncsim.scr -nostdout -nokey -logfile tmpout $simopt[1] opwtst >> ncsim.time
  echo "------------------------------------------------"	>> ncsim.time
  echo -n " - ncsim"
  foreach run (1 2 3)
    echo -n " "$run
    (time ncsim -nocopyright -batch -input ncsim.scr -nostdout -nokey -logfile tmpout $simopt[1] opwtst) >>& ncsim.time
    mv tmpout tmpout.$outCnt
    @ outCnt++
  end
  echo "" >> ncsim.time
  echo ""
  shift elabopt
  shift simopt
end

unset elabopt
unset simopt
