Hi Kurt,
Now, I have seen what I consider to be a bug in the behavior of run_test. If you have *any* processes still "alive", even if they are currently dormant, blocking on an event, then when the environment run() function completes, no further phases are executed. That means that even if you have a report_summarize in your report method, it will not be called.
The workaround to this is to make a call to global_stop_request() (usually I put this at the end of my environment run() function). This seems to kill off all child processes and allows the remaning phases (extract, check, report) to execute.
The issue with run_test() appears to be that it doesn't set ovm_component::m_do_test_mode to 1 (unlike do_test()). I don't know if this is intentional or an oversight (perhaps one of the OVM developer's could shed some light on this?).
A simple workaround is to set this static member yourself. The simulation will then stop automatically at the end of your top-level env run task without the need to call global_stop_request. The configure method of your test class seems like a good place to do it, e.g.
Code:
class my_test extends ovm_test;
verif_env env1;
function new (string name, ovm_component parent);
super.new(name,parent);
endfunction : new
virtual function void build();
super.build();
$cast(env1,ovm_factory::create_component("verif_env","","env1",null) );
endfunction : build
function void configure();
ovm_component::m_do_test_mode = 1;
endfunction: configure
...
`ovm_component_utils(my_test)
endclass: my_test
Note that you need to use ovm_factory::create_component rather than the test's create_component method since the environment's parent must be set to null rather than "this" (otherwise it won't be recognised as a top-level environment).
Regards,
Dave
Bookmarks