Testing phases other than run_phase()

66 views
Skip to first unread message

Chad Quickstad

unread,
Apr 17, 2017, 7:54:59 PM4/17/17
to SVUnit User Group
My former employer had a proprietary in-house-developed unit test framework that only supported OVM, not UVM.  In this framework, each test case would run through all of the OVM phases (build, connect, end_of_elaboration, start_of_simulation, run, extract, check, & report).  This allowed for testing events outside of the run phase.

For example, when you need to test an ovm_error() that occurs in the check() phase, you can setup the conditions in the run() phase and then assert that the the expected ovm_error() happened in the check() phase.  For each of the unit tests, the entire set of phases run again allowing any test to test something that happens in any phase.

svunit seems to run the buld_phase, connect_phase, and end_of_elaboration_phase, then start the run_phase task when svunit_uvm_test_start() is called the first time from the unit test module's setup task.  svunit apparently calls $finish before the phases after run_phase have a chance to execute.

Is there an existing mechanism in svunit to interact with or control the uvm phases?

How have others been testing code in phases other than run_phase?

Tudor Timi

unread,
Aug 27, 2017, 6:37:01 AM8/27/17
to SVUnit User Group
You can call 'check()' manually in the test. I don't see any benefit in going through the whole UVM phase scheduling. This way, you're not really doing unit testing, since you have a lot of other classes working in the background.
Reply all
Reply to author
Forward
0 new messages