set outCnt = 1
#foreach lib ("vhdl" "vlog" "vhdl2" "vlog2")
foreach lib ("vhdl" "vlog")
source make-$lib

set elabopt = ("" "-neverwarn -notimingchecks -noipd -no_tchk_msg -no_tchk_xgen -no_vpd_msg -no_vpd_xgen")
set simopt  = ("" "-neverwarn -nocifcheck")
foreach vhdlopt ("" "-neverwarn -nopragmawarn")
  set vhdsrc  = ("alu.vhd opw.vhd opwTst.vhd" "alu.vhd opw.vhd opwS.vhd opwTst.vhd opwSTst.vhd" "opwX.vhd opwXTst.vhd")
  foreach tb ("tstcfg" "tstscfg" "tstxcfg")
    rm -rf work
    mkdir  work
    echo ncvhdl -nocopyright -v93 -nostdout -nolog $vhdlopt '<vhdFile>' \
							>> ncsim.time.$lib
    echo "------------------------------------------------" >> ncsim.time.$lib
    echo running ncvhdl
    foreach vhd ($vhdsrc[1])
      echo -n $vhd": "					>>ncsim.time.$lib
      (time ncvhdl -nocopyright -v93 -nostdout -nolog $vhdlopt $vhd) \
							>>& ncsim.time.$lib
    end
    echo ncelab -nocopyright -v93 -generic "'cyclesC=>50000'" -nostdout -nolog $elabopt[1] $tb >> ncsim.time.$lib
    echo "------------------------------------------------" >> ncsim.time.$lib
    echo -n "  $tb - ncelab"
    (time ncelab -nocopyright -v93 -generic 'cyclesC=>50000' -nostdout -nolog $elabopt[1] $tb) >>& ncsim.time.$lib
    echo ncsim -nocopyright -batch -input ncsim.scr -nostdout -nokey -logfile tmpout $simopt[1] $tb >> ncsim.time.$lib
    echo "------------------------------------------------" >> ncsim.time.$lib
    echo -n " - ncsim"
    foreach run (1 2 3)
      echo -n " "$run
      (time ncsim -nocopyright -batch -input ncsim.scr -nostdout -nokey -logfile tmpout $simopt[1] $tb) >>& ncsim.time.$lib
      mv tmpout tmpout.$outCnt
      @ outCnt++
    end
    echo "" >> ncsim.time.$lib
    echo ""
    shift vhdsrc
  end
  echo "" >> ncsim.time.$lib
  echo ""
  shift elabopt
  shift simopt
end

end
unset vhdsrc
unset elabopt
unset simopt
