#!/bin/tcsh
set SIMV = 'false'
set SIMV_ONLY = 'false'
set IESL = 'true'
set options = "-uselic IESL"
while ($#argv != 0)
  switch($argv[1])
    case "-simv_only":
      set SIMV_ONLY = "true"
    case "-simv":
      set SIMV = 'true';
    breaksw
    case "-noiesl":
      set options = ""
    breaksw
    case "-nospecify"
      set options = `echo $options "-nospecify"`
    breaksw
    case "-h":
    case "--help":
    default:
      echo "Usage: run_sim [-noiesl] [-simv] [-simv_only] [-notiming]"
      echo "       -noiesl      : don't force use of the IESL license"
      echo "       -simv        : run simvision after sim"
      echo "       -simv_only   : run simvision only, no sim"
      echo "       -nospecify   : run simulation without specify block"
      exit 1
    breaksw
  endsw
  shift
end
echo "options=$options"
if($SIMV_ONLY == 'false') then
  irun +access+rwc -coverage B:E:F:T -covdut mr10q010 -covoverwrite -64bit $options -sv -licqueue tb_mr10q010.v ../rtl/mr10q010.v -incdir ../rtl
endif
if($SIMV == 'true' || $SIMV_ONLY == 'true') then
	simvision waves.shm
endif
