vmm_opts::get_int

vmm_opts系统类通过get_int等函数提高代码复用性,允许从命令行传递测试参数,例如在验证Ethernet协议时,通过命令行参数在不同模式下(10G, 1000M, 100M)重复使用同一测试用例文件Insert_crc_error.sv,从而提升测试用例的可重用性。" 133178137,20038876,北斗导航与RAIM技术:单差载波相位完好性监测,"['GIS', '卫星导航', '定位技术', '数据处理', 'Python编程']
摘要由CSDN通过智能技术生成

vmm_opts是vmm的系统类,包含了3个函数,get_int(),get_string(),get_bit();

利用opts函数,可以大大提高代码的重复利用率。

simv +vmm_opts+FOO=HELLO

simv +vmm_opts+FOO=100


参考文献 : http://www.testbench.in/VM_12_VMM_OPTS.html

Some of the test parameters in functional verification are passed from the command line. Passing Parameters from the command line allows simulating the same testcase file with different scenario. For example, let say you are verifying Ethernet protocol. Insert_crc_error.sv is a testcase file which verifies the DUT by sending CRC error packets. Now you can use the same testcase file to verify the DUT in 3 different modes , 10G 1000M and 100M modes by passing these parameters from the command prompt, this increases the testcase reusability. 


As parameters became one of the most important techniques in reusing the testcases, vmm has added vmm_opts class to manage parameters efficiently.  
vmm_opts captures parameter from run time options. 

There are 2 ways to specify the parameters during runtime.  

 1) Command line 
vmm_opts internally uses $plusargs to recognize the options specified on command line. 
 2) text file  
If you have lot of parameters to mentions, then you can also mention all the parameters in a text file and pass it as command line options. 

vmm_opts can recognize 3 types of parameters. They are  

 String type parameters  
 Integer type parameters  
 Bit type parameters  

Following are the 3 static methods which are defined in vmm_opts to get the parameter values.  


Static  function   bit  get_bit ( string   name ,   string  doc  =   "" );  

Static  function   int  get_int ( string
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值