OVM Run Phase Completion

Simulator/OVM will terminate/complete the run phase of simulation on following conditions, right?
o Seeing raise and drop objection count is zero
o Executing terminating functions (global_stop_request, $finish…)
o On seeing end for a body if there are no objections definitions

If the above conditions are true, I have a problem i.e.

I have a environment, in which I need to re-use the IP sequences from two different teams.

One team has followed raise and drop objection and other didnt and they just wait till the end of body to complete the run phase.

I need to call these two sequences inside a for-join_none thread, the thread which has raise and objections defined will complete faster than other and hence the test is completing abruptly before completing other sequence.

Planning to change the OVM code, which will wait for both raise objections to complete as well as all sequences would complete their body.

Please help me, in pointing the section of OVM code which has to be edited for this kind of scenario.

Regards,
siva

If you add a raise_objection() and drop_objection() to your test, your test will only end when all of the sequences are completed and the test is ready to finish.

In reply to cgales:

Sorry, I didnt completely understand your question.

From your answer, I understood this i.e. even with mixed sequences (with and without objections) simulation will complete only if all parallel sequences reaches end of body.

Is my understanding is correct?

Thanks.

In reply to SKUPPAM:

That is correct. As long as there is one outstanding objection at the test level, the simulation will continue. When all sequences are completed (and drop their associated objections), the test can drop the final objection and the simulation will complete.

In reply to cgales:

Repeating the question again, for more clarification and to give you more picture i.e.

class seq_obj extends ovm_seq;
task body;
raise objection;
#10;
drop objection;
endtask
endclass

class seq_noobj extends ovm_seq;
task body;
#100;
endtask
endclass

class seq_test extends ovm_seq;
seq_obj with_obj;
seq_noobj with_noobj;
task body
fork
ovm_do(with_obj); ovm_do(with_noobj);
join_none
endtask
endclass

can you explain at what time simulation finishes.
→ top level sequence doesnt have objections
→ both base sequences are called in a fork and join none (top level seq will not wait for the completion of base seq)
→ I know, this might be a wrong way of codding. want to understand the behavior
→ seq_test will complete its operation by 0 time
@0 time seq_obj would have raised obj

Will test complete after 10 units of time or 100 units of time?

Thanks for your reply.

In reply to SKUPPAM:

Simulation completes when the objection counter reaches zero, irrespective of whether the top level sequence/test finishes or not. So, in the above case although seq_test finishes at time 0 itself, your simulation runs till 10 units which is where the objection count reaches zero and then the test gets terminated.

As per the scenario you specified, here are the values of the objection counter at different times.
@ time 0: objection count: 1 (objection raised by seq_obj)
@ time 10: objection count: 0 (objection dropped by seq_obj).

So, its always good to use raise/drop objection in the test, especially when the mixed style sequences (with and without raise/drop_objection) to avoid early termination of your tests.

Responding to your previous post again,
==== From your answer, I understood this i.e. even with mixed sequences (with and without objections) simulation will complete only if all parallel sequences reaches end of body. ====
As cgales mentioned above, your understanding is correct only if you use raise/drop objections at the test level/virtual sequence level too;

In reply to S.P.Rajkumar.V:

Thanks Raj kumar for the confirmation.

Now we are in the same page.

In the above example, if i had objections in the top level test i.e seq_test still the test complete at 10units of time.

I need a solution, on how i can wait for the seq_noobj to complete before test terminate w/o objections?

want to know the code in OVM, which actually calls the stop run phase on seeing the objection count to ‘0’

Thanks.

In reply to SKUPPAM:

If you want to make sure that seq_noobj completes, then you shouldn’t put it inside of a fork/join_none block. You should either call it sequentially using the start() method and wait for it to complete, or call it inside of a fork/join block.

You should ALWAYS use objections in your test, raising the phase objection before starting any sequences and dropping it when all sequences are completed. Why can’t you use objections in your test?

In reply to cgales:

The functionality is such that, i cant wait for it to complete. As there are other tasks to do.

OVM doesnt force to use objections and its says it as a good practice. so some we have some env’s with and w/o objections.

is it possible to point the OVM code, which actually stops the run phase on seeing the objection count == zero???

This will be very helpful.

In reply to SKUPPAM:

I still don’t understand why you can’t raise and drop objections at the test level. This would be significantly easier to do than trying to modify the OVM code base itself. Once you modify OVM, you lose all the benefits of using a vendor provided code base which may have simulator-specific enhancements such as transaction tracing and debugging features.

In reply to cgales:

Now, I understood your problem. Since you are calling the top level sequence “seq_test” from some test (test1) and raising and dropping objections there. In that case, your test still ends at 10units because,

  1. Your top level sequence ends at #10units because of fork/join_none usage.
  2. Then test objection will be dropped immediately and objection_count reaches zero.

The solution is

  1. to use fork/join in the toplevel sequence instead of fork/join_none, if the scenario permits you do. (as cgales suggested)
    or
  2. to edit the noobj sequence to add raise/drop objections if you can.

I am not sure about where the relevant OVM code of your interest exists, but I think it is better to choose option (2) rather than going and updating the source code of OVM to stop the test termination.

Or, let us wait and here from the experts if there is any other elegant way to resolve this issue w/o editing the base sequences.

In reply to S.P.Rajkumar.V:

Thank you guys for understanding and provide your comments.

There are multiple sequences from different IPs not using objections and so, it is not easy to force them to add objections.

So looking for a global solution.

I would say this is a bug in OVM i.e. not supporting mixed style of codding or it should explicitly mention that all sequences should have objections.

In reply to SKUPPAM:

It has never been recommended to use objections in sequences for the exact reason that you are encountering. I would recommend removing the objections from all of your IP sequences and utilize them at the test level as they are designed to be used.

In reply to cgales:

The OVM and now UVM methodologies are great for providing coding patterns that reduce the amount of code you need to write yourself, but they will never get to the point where there is exactly one way to do every task. We are all designing and verifying hardware with different requirements, and the UVM keeps coming out with new and better ways of accomplishing the tasks to meet those requirements. Some will say that there are too many features in the UVM, and that is exactly why we have the OVM/UVM cookbooks to provide the extra guidelines to help you avoid the complexity when it is not needed.

Dave

In reply to dave_59:

Absolutely no comments on the methodology and kind of ease it brings to the verification is awesome.

I never recommend not follow this, i am always for for it.

Sorry, if my statements that “OVM has a Bug” hurts you, but this what is it looks at least to me.

My recommendation is, run phase should complete only if all objections are dropped and after all sequences completes their body execution.