UVM run tests without using the run_test(test_name) method

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?

Thank you in Advance!

In reply to Jaafar Hassan:

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.

In reply to Jaafar Hassan:

In addition to chr_sue:

  • run_test(test_name) only lookup the test_name in factory and execute it. You can’t not pass anything to run_test except test_name.
  • Modify new constructor of uvm_object/uvm_component isn’t recommended because the UVM factory will call it when your component/object is created.

My question is: Where doesn’t requests_array data come from? You want to pass it from external file/command-line or you generate it in your test?

chr_sue, chris_le Thank you fo your replies.

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.

Thank you in advance!

In reply to JH_Engineer:

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.

In reply to JH_Engineer:

You can put user’s array data to external file. In your environment, load and execute it.
That’s my suggestion.

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.

In reply to tpan:

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’.

In reply to JH_Engineer:

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.

In reply to chr_sue:

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)

In reply to tpan:

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.

Thank you guys!
Your answers help me to solve my problem :) .