VMM testbech run script的编辑
时间:10-02
整理:3721RD
点击:
run script:
#!/bin/csh -f
#################### Scan Command Line ################
set INFO= "###(info) ${0}"
set ERROR = "###(error) ${0}"
set num = $#argv
set paras = "$argv[1-$num]"
set paras_pass = ""
set cov_arg =""
set testcase = ""
set defines = ""
set complist = "./list.f"
set seed = "0"
foreach i ($paras)
if ( $?get_random_seed ) then
set seed = $i
unset get_random_seed
else if ( "x$i" == "x-seed" ) then
set get_random_seed
else if ( "x$i" == "x-h" || "x$i" == "x-help" ) then
set paras_help
break
else if ( "x$i" == "x-trace" ) then
set paras_trace
else if ( "x$i" == "x-cov" ) then
set paras_cov
else if ( "x$i" == "x-clean" ) then
set paras_clean
break
else if ( $i =~ +* ) then
set paras_pass = "${paras_pass} $i"
else if ( $i !~ -*&&$i !~ +* ) then
set testcase = $i
else
echo "${ERROR}: unknown argument $paras"
set paras_help
break
endif
end
################### Remove redundant files #################
if ( $?paras_clean ) then
echo "${INFO}: remove redundant files and directories"
\rm -fr simv* *.vpd csrc DVEfiles *.key vcs* *.log urg* *.hex *.bin vc_hdrs.h
\rm -fr ../cov/coverage.* ../cov/urgReport
\rm -fr verdiLog *.fsdb VerdiLog
exit
endif
## Whether the test case exists
if ( "$testcase" == "" ) then
echo "${ERROR}: No testcase as parameter"
set paras_help
endif
#################### Help Info ################
if ( $?paras_help ) then
cat <<EOU
Usage:
runtestcase- run vcs simulation.
testcase:- testcase name,include path.
Options:
-help[-h]- Display this messages.
-clean- Clean redundant directroy and file.
-only- Only Compile Assembly/C file.
+nofsdb- Do not dump waveform.
EOU
exit 0
endif
## Whether the testcase directory exists
if ( ! -e "../tests/${testcase}.sv" ) then
echo "${ERROR}: ../tests/${testcase}.sv can not open"
exit
endif
echo"============================================================== "
echo"|||BuildRAL Class||| "
echo"============================================================== "
ralgen -l sv -t svidRegSys -b -o ../tb/ral/ral_svidRegSys.sv ../tb/ral/svidReg.ralf
echo"============================================================== "
echo"|||Build VCS and Run Simulation||| "
echo"============================================================== "
set log_file = `echo $testcase | sed "s/\//_/g"`
if ( $?paras_cov ) then
set cov_arg = "-cm line+cond+branch+fsm -cm_dir ../cov/coverage.cm"
endif
vcs -Mupdate +systemverilogext+.sv \
-lca \
-debug_all \
-notice \
-ntb_opts rvm \
${cov_arg} \
-fsdb \
$defines \
-f $complist \
../tests/${testcase}.sv \
-l ./log/${log_file}_${seed}.log
if ( $status ) then
exit;
endif
if ( $?paras_trace) then
set paras_pass = "$paras_pass +vmm_log_default=trace"
else
set paras_pass = "$paras_pass +vmm_log_default=normal"
endif
if ( $?paras_cov ) then
set cov_arg = "-cm line+cond+branch+fsm -cm_dir ../cov/coverage.cm -cm_name ${log_file}_${seed}"
endif
./simv ${paras_pass} ${cov_arg} +ntb_random_seed=$seed -a ./log/${log_file}_${seed}.log
原载地址
#!/bin/csh -f
#################### Scan Command Line ################
set INFO= "###(info) ${0}"
set ERROR = "###(error) ${0}"
set num = $#argv
set paras = "$argv[1-$num]"
set paras_pass = ""
set cov_arg =""
set testcase = ""
set defines = ""
set complist = "./list.f"
set seed = "0"
foreach i ($paras)
if ( $?get_random_seed ) then
set seed = $i
unset get_random_seed
else if ( "x$i" == "x-seed" ) then
set get_random_seed
else if ( "x$i" == "x-h" || "x$i" == "x-help" ) then
set paras_help
break
else if ( "x$i" == "x-trace" ) then
set paras_trace
else if ( "x$i" == "x-cov" ) then
set paras_cov
else if ( "x$i" == "x-clean" ) then
set paras_clean
break
else if ( $i =~ +* ) then
set paras_pass = "${paras_pass} $i"
else if ( $i !~ -*&&$i !~ +* ) then
set testcase = $i
else
echo "${ERROR}: unknown argument $paras"
set paras_help
break
endif
end
################### Remove redundant files #################
if ( $?paras_clean ) then
echo "${INFO}: remove redundant files and directories"
\rm -fr simv* *.vpd csrc DVEfiles *.key vcs* *.log urg* *.hex *.bin vc_hdrs.h
\rm -fr ../cov/coverage.* ../cov/urgReport
\rm -fr verdiLog *.fsdb VerdiLog
exit
endif
## Whether the test case exists
if ( "$testcase" == "" ) then
echo "${ERROR}: No testcase as parameter"
set paras_help
endif
#################### Help Info ################
if ( $?paras_help ) then
cat <<EOU
Usage:
runtestcase- run vcs simulation.
testcase:- testcase name,include path.
Options:
-help[-h]- Display this messages.
-clean- Clean redundant directroy and file.
-only- Only Compile Assembly/C file.
+nofsdb- Do not dump waveform.
EOU
exit 0
endif
## Whether the testcase directory exists
if ( ! -e "../tests/${testcase}.sv" ) then
echo "${ERROR}: ../tests/${testcase}.sv can not open"
exit
endif
echo"============================================================== "
echo"|||BuildRAL Class||| "
echo"============================================================== "
ralgen -l sv -t svidRegSys -b -o ../tb/ral/ral_svidRegSys.sv ../tb/ral/svidReg.ralf
echo"============================================================== "
echo"|||Build VCS and Run Simulation||| "
echo"============================================================== "
set log_file = `echo $testcase | sed "s/\//_/g"`
if ( $?paras_cov ) then
set cov_arg = "-cm line+cond+branch+fsm -cm_dir ../cov/coverage.cm"
endif
vcs -Mupdate +systemverilogext+.sv \
-lca \
-debug_all \
-notice \
-ntb_opts rvm \
${cov_arg} \
-fsdb \
$defines \
-f $complist \
../tests/${testcase}.sv \
-l ./log/${log_file}_${seed}.log
if ( $status ) then
exit;
endif
if ( $?paras_trace) then
set paras_pass = "$paras_pass +vmm_log_default=trace"
else
set paras_pass = "$paras_pass +vmm_log_default=normal"
endif
if ( $?paras_cov ) then
set cov_arg = "-cm line+cond+branch+fsm -cm_dir ../cov/coverage.cm -cm_name ${log_file}_${seed}"
endif
./simv ${paras_pass} ${cov_arg} +ntb_random_seed=$seed -a ./log/${log_file}_${seed}.log
原载地址
?要干什么呢?
有必要写这么复杂么?
多谢分享!