OVM Run multiple tests

Hi,
I would like to run multiple test cases with OVM. OVM_TESTNAME allows only one test to be called. In a normal flow I would expect most regressions to be setup to run test cases sequentially. For example Test AAA followed byBBB and CCC and so on.

What is the recommended flow to accomplish the above example with OVM? I read a few threads on this issue but not clear on how to run tests sequentially one after another.

Ravi

Hi ravi,
I think you won’t be possible to run the multiple test cases one after the other without quiting the simulation. If u want to run the regression, you can execute the multiple vsim commands like.

vsim +OVM_TESTNAME=test_read_modify_write -do vsim.do -c -suppress 3829 xbus_tb_top

vsim +OVM_TESTNAME=test_read_modify_read -do vsim.do -c -suppress 3829 xbus_tb_top

regards,
shishira

Hi,

All you need to do is write a wrapper testcase which executes the number of testcases in the sequence you want and inside the testcase run them with `ovm_do (“testname”) or something similar just look into manual.

I did something similar in my previous project.

Thanks,
Puneet

Hi Ravi,

You cannot use run_test to run multiple tests in succession. Calling run_test instantiates an instance of the specified ovm_test, builds the environment and then runs through the other OVM simulation phases. OVM only allows the hierarchy to be built once, so calling run_test more than once will result in a run-time fatal error.

If you want to run a number of tests in succession (using run_test) then as Shishira has mentioned, you need to load and run a new simulation for each one.

An alternative approach where you want to run a number of related tests that all use a common environment, configured in the same way, is to use a sequence for each test. You can then run each sequence in order using a layered approach (top level sequence calls ovm_do(seq1); ovm_do(seq2); etc - I think this what Puneet was thinking of) or a virtual sequence (calls `ovm_do_on(seq1,sequencer1), etc). It is even possible to run a series sequences on remote sequencers from within a run task by calling the sequence’s start method. However, these approaches are only practical for simple tests that are driven by a small number of sequencers (ideally just one).

Regards,
Dave

We were able to do this by introducing a system_level_test class and make use of the factory. We had a system with 19 unique interfaces. 11 of these interfaces had to come up in a correct order because they were required to configure and initialize their piece of the environment to make the chip work correctly.
Along with the factory we used the barrier to construct the way the sequences would function during the run phase… This method was proposed on this site. It was called subdivided_phase_test.svh. The secret is defining a default test/agent in the top level and use the factory as the constructor for the agents. We also relied on a test configuration class that was used to pass information to all the tests. All this was wrapped into a system_level_test class.
One other interesting thing about this architecture is that one can reuse some unit level test at the system level. I believe the subdivided_phase_test is now part of the UVM…but it is called by a different name…
One other nice feature is that by using a test configuration class the tests are capable of being reactive across multiple interfaces.
This method imposes a operating system for running multitests which I think is needed because test writers only need to be concerned with their piece of the system. The subdivided _phase_test acts as a scheduler. We used this for a mixed signal verification project and cpu design.

The down side of this is that you have more files for each test you have
…system_level_test,
system_level_test_config,
sub_tests,
sequences for each phase/sub_tests (reset, config, initialize, do_run_run, maint, stop). Note: some tests use all the phase and some test use one or two…
To invoke 19 tests you pass the OVM_TESTNAME = system_level_test…

Hi
I have related query for running test in regression. How can i run test in regression without compiling my whole env again in OVM? I am compiling all the test and env for each test currently but want to compile it once and use that to run rest of the tests. is it related to simulator only? or OVM provides any such features to run test without compiling whole env and using already compiled database?

Thanks in advance.