本文主要是介绍vmm_opts::get_int,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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
这篇关于vmm_opts::get_int的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!