Jump to content
Sign in to follow this  

Recommended Posts

Is there any way in which we could override the run_test function from the "uvm_root" class ..  ?

 

The reason i am asking this is that .. when i pass the test name via +UVM_TESTNAME="test1" I could like the run_test to run the test "test1" or some other test based on a different command line option .. 

 

E.g. 

 

If is send +UVM_TESTNAME="test1" ... run_test should run "test1"

 

but if i send +UVM_TESTNAME="test1" +override_test  , run_test should run "test2"...

 

so basically in the run_test() task I could like to have something as below :

 

test_override = uvm_cmdline_proc.get_arg_matches("+override_test",override);
if ( override.size() == 1 ) 
run_test("test2");
else 
run_test();
 
Can this be done .. ? 

Share this post


Link to post
Share on other sites

I'm guessing you want to have "test2" run by default, unless you specify which test to run. My thought is that what you are trying to do is better implemented in the run script:

#!/usr/bin/bash

test=test2

if [[ "$1" != "" ]]; then
  test=$1
fi

<simulator command> +UVM_TESTNAME=$test

Share this post


Link to post
Share on other sites

hi,

 

you dont need to override run_test() for this. there are a couple of options

 

1. if you control the cmdline then you can change +UVM_TESTNAME to "test2" yourself - no need for another switch

 

2. you can in the sv code add an override for test->test2 so that when choosing "test" actually test2 is run

 

3. you can add your logic before the run_test() call and then pass the new test so that the normal run_test() will become run_test(string:"test2")

 

4. depending upon your simulator vendor you might be able to set overrides from the simulator prompt. that allows you to run with +UVM_TESTNAME=test but then from the tcl prompt do #2 interactively

 

probably there are more ways here

 

 

/uwe

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...