In my uvm project, I need to instantiate the test before run it. because I need to pass an array of requests to this test. so, the run_test(test_name);
doesn’t work for me. because I don’t pass the the requests array that I need to run in this test.
my test constructer is as follow:
function new(string name = “UserDefinedTest”,uvm_component parent=null,UserDefinedRequest requests_array);
super.new(name,parent);
this.requests_array = requests_array;
endfunction : new
so, how can I pass this array to the test and run the test using run_test(test_name) or using another approach.
anyone has a suggestions for this problem?
run_test(test_name) is not practical and therefore not recommended.
Instead use the test specification from the comandline.
PAssing requests to a certain test is commonly doen using configuration objects. This has nothing to do how you are caling your test.
I had built a verification environment, and what I need is to enable the user who uses this enviroment to send his own requests to run them in my verification enviroment without needing to modify the enviroment or know how it works.
so, how can provide this feature to the user? how can I help the user to send his own requests to my verification enviroment?
I know that is a different question, but this is the situation that I faced.
We have to differentiate between the verification environment and the tests. Test do not change your environment, but they are configuring it for a certain functionality.
For me it is still unclear what do you mean with ‘requests’?
One option would be soecific tests.
Have a test configuration file which you should call inside your base test. This configuration file should have the switches to indicate how the ‘request_array’ needs to be populated. This way, in your extended test, the user only needs to correctly assign the test configuration switch to pass the intended values to request_array.
In reply to JH_Engineer:
Have a test configuration file which you should call inside your base test. This configuration file should have the switches to indicate how the ‘request_array’ needs to be populated. This way, in your extended test, the user only needs to correctly assign the test configuration switch to pass the intended values to request_array.
Working with fileIO limits always your flexibility. In most cases you can generate this content following an appropriate algorithm.
But fore me it is still completely unclear what the content of your configuration file is and what do you mean with ‘how the ‘request_array’ needs to be populated’.
You want to instantiate test class so that you can pass value to it’s
data member (i.e, request array in your case), but here you
can’t do it because you might not know the instance name of
the top level class that the uvm is internally creating.
You can try uvm_test_top as object name to pass request array.
The configuration file is a class that has switches indicating what algorithm to use to generate the content (in this case it’s populating request_array data)
Then you can do this using a configuration object. This gives you the freedom to randomize the selection of the different algorithms which might result in an essential increase of your verification quality.