Raise_objection

In a uvm_component if I call raise objection twice, do i have to call drop_objection twice?.

I ran a simulation, where i called raise objection twice and drop objection once. where the simulation ends immediately after the drop objection is called. Is that expected behavior ?

Regards
Srinivas

In reply to srinivasa.p:

Hi Srinivas,

Could you please share the code snippet where you are raising and dropping the objection?

~Pradeep

In reply to psalla:

Hi Pradeep,
This is my code:

function new(string name=“apb_slavebase_seq”);
super.new(name);
endfunction

`uvm_object_utils(apb_slavebase_seq) //,tvs_arm_generic_master_sequencer)

virtual task pre_body();
if (starting_phase != null)
starting_phase.raise_objection(this, {“Running sequence '”,
get_full_name(), “'”});
//testing purpose I called twice
starting_phase.raise_objection(this, {“Running sequence '”,
get_full_name(), “'”});
endtask

virtual task post_body();
if (starting_phase != null)
starting_phase.drop_objection(this, {“Completed sequence '”,
get_full_name(), “'”});
endtask

Thanks
Srinivas

In reply to srinivasa.p:

Srinivas,

A couple of things. The code snippet looks like it is a base sequence and you have objections in pre & post body task. Are you actually starting this sequence on your sequencer or a sequence derived from this base class? Also, do you have any objections in your uvm components like uvm_test or uvm_env etc?

~Pradeep

In reply to psalla:

Have you tried using +UVM_OBJECTION_TRACE to confirm if two objections are being raised
and one is being dropped?

Hi Srinivas,

You have to make sure that there is one-to-one mapping between the raise and drop objection.

For any associated raise_objection you must have the drop_objection call.

In your code you have called raise_objection two times so you have to call the drop_objection two times.

Thanks,
Vaibhav

In reply to Vaibhav Tekale:

Hi Srinivas,

Even though you call raise_objection twice it is registered only once since raise_objection is called like phase.raise/drop_objection(this).

Thinking logically every phase calls a raise_objection and drop_objection only once so even though you called twice doesn’t matter.

Best thing to experiment is to pass +UVM_OBJECTION_TRACE in your simnulation and see the log. It will only show once.

Thanks
Chaitanya.

In reply to Chaitanya_K:

Each raise_objection does increment the objection counter for that object/instance passed from the argument. So if you call two times it will increment it to 2 and each drop_objection call decrements the objection counter for the object/instance passed from the argument.

If you pass the null object then it increment/decrement the global object (uvm_top) objection counter.

In reply to srinivasa.p:

In a uvm_component if I call raise objection twice, do i have to call drop_objection twice?.
I ran a simulation, where i called raise objection twice and drop objection once. where the simulation ends immediately after the drop objection is called. Is that expected behavior ?
Regards
Srinivas

I think you do not understand the objection mechanism. Calling rais twice in an object or component is useless. Becuase the corresponding object/component can be working only once.
Mabe the second raise is simply ignored. Unfiortunately the standard is saying nothing with respect to this.