sytemverilog(sv)中 module和program的区别
标签:
it |
分类: sv |
0 根据 《VCS user guide》的描述,在package外面定义 class
、联合数组、动态数组、事件时,需要使用命令 选项
-ntb_opts dtm。具体描述如下
------------------------------------------------------------------------------------
【 You enable
testbench constructs outside programs with the-ntb_opts dtm
compile-time option and keyword argument. The keyword name comes
from “dynamic types in modules.”
The testbench constructs that you
can enter outside programs with this option are as follows:
classes associative arrays dynamic
arrays
SystemVerilog named event
】
------------------------------------------------------------------------------------
1module中定义class时,仿真时需要使用 -ntb_opts dtm
命令选项。。
2package中直接定义class,不需要使用 -ntb_opts dtm命令选项。
根据仿真打印信息,当前使用的VCS版本默认选项里有 -ntb_opts dtm 选项。
实际试验中,Makefile文件的命令选项中定义 -ntb_opts
dtm时,会打印如下红线框内的信息:
实际试验结果表明在Makefile文件的命令选项中即使不定义 -ntb_opts
dtm选项,也不会报错。
【
Warning-[DFLT_OPT] Default option found
在module中定义class实例:
(1)代码
http://s12/mw690/001RfU5Bzy73BxxPMGn1b&690module和program的区别" TITLE="sytemverilog(sv)中 module和program的区别" />
(2)Makefile文件中的命令选项
(2)Makefile文件中的命令选项
#1 Define MACRO/varible in the top of Makefile
#(1) Define varible UVM_HOME use "="
TREE =
/proj/sandstone_fe/zhuss/RV_std_for_vcsdebug_1120/
UVM_HOME = $(TREE)/DV_Lab/uvm-1.2
#(2) Define varible VCS_OPTS use "+=", named
BianLiang_ZhuiJiaZhi
VCS_OPTS += -sverilog
VCS_OPTS += -timescale=1ns/1ns
VCS_OPTS += +incdir+$(UVM_HOME)/src
VCS_OPTS += +incdir+$(UVM_HOME)/src/uvm.sv
VCS_OPTS += +incdir+$(UVM_HOME)/src/dpi/uvm_dpi.cc
VCS_OPTS += -l vcs.log
VCS_OPTS += -gui
VCS_OPTS += -R
VCS_OPTS += -ntb_opts
dtm
#(3) Source RTL files
RTL_FILES =
$(TREE)/DV_Lab/SV_Lab/example/rand_UseClassInModule/rand_UseClassInModule.sv
run:
(3)仿真结果
http://s11/mw690/001RfU5Bzy73BxNVufo1a&690module和program的区别" TITLE="sytemverilog(sv)中 module和program的区别" />
(4)仿真打印信息
http://s5/mw690/001RfU5Bzy73Byxr0Ec74&690module和program的区别" TITLE="sytemverilog(sv)中 module和program的区别" />

加载中…