mayuracc Posted July 1, 2014 Report Share Posted July 1, 2014 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 .. ? Quote Link to comment Share on other sites More sharing options...
tudor.timi Posted July 1, 2014 Report Share Posted July 1, 2014 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 Quote Link to comment Share on other sites More sharing options...
tudor.timi Posted July 1, 2014 Report Share Posted July 1, 2014 Also, the snippet you showed is not overriding the "run_test()" method of uvm_root. It's just choosing which one to call based on the value of the "+override+ plusarg. Quote Link to comment Share on other sites More sharing options...
uwes Posted July 1, 2014 Report Share Posted July 1, 2014 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 Quote Link to comment Share on other sites More sharing options...
mayuracc Posted July 1, 2014 Author Report Share Posted July 1, 2014 Thanks for the responses .. great to see a quick reply .. Although all off the above suggestions do work .. can run_test() be practically overridden ... ? if so has anyone tried it .. ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.