[go: up one dir, main page]

0% found this document useful (0 votes)
35 views6 pages

Uvm Objection

The UVM objection mechanism is essential for synchronizing and coordinating components in a testbench, allowing for better management of complex verification environments. It operates through raising and dropping objections, which affect an internal counter that determines when the run phase can end. Proper handling of objections is crucial to avoid synchronization issues, and UVM provides tools to assist in tracking and debugging these objections.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views6 pages

Uvm Objection

The UVM objection mechanism is essential for synchronizing and coordinating components in a testbench, allowing for better management of complex verification environments. It operates through raising and dropping objections, which affect an internal counter that determines when the run phase can end. Proper handling of objections is crucial to avoid synchronization issues, and UVM provides tools to assist in tracking and debugging these objections.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

UVM OBJECTION

1) The objection mechanism is a powerful feature in UVM.


2) It provides proper synchronization and coordination among different components of
the testbench and object. And it is easier to manage complex verification
environment.
3) Used in Run phase(in components)
4) It remain in same phase till all the objection are dropped.

1) Uvm_objection class extends from uvm_report_object.


2) Objection deals with the concept of raise and drop objection
Which means internal counter is increment or decrement .
3) Raise and drop objection do asynchronously.
4) When all objection are dropped,the counter value will become zero.
5) Once the activities of run phase are completed the drop objection called.
6) When we start any process- raised objection
When process completed – dropped objection

//OBJECTIONS
--------------------
1) IN COMPONENTS
 Phase.raise_objection(this);
This method tells the UVM that a test is running,UVM will stay in the
run_phase() until the test drops the objection

 Phase.drop_objection(this);
This method tells the UVM that the test has finished & that the run phase can
end

2) IN OBJECT
 Starting_phase.raise_objection(this);
 Staring .phase.drop_objection(this);

Objection in the sequence


The objection can be raised and dropped in body task or pre_body or post_body task.

Drain time:
The amount of wait time between all objection has been dropped and calling all_dropped()
called drain time.

Que) if you have multiple objections and for one drop objection you left
how will you rectify the situation?

1) If we have multiple objection in the UVM and and multiple objection undropped.
It could lead synchronization problem,unintended simulation results.
2) We can handle this situation:
a) Identify the undropped objection
b) Check the objection count
c) Locate the missing drop call
d) Determine appropriate location for drop
e) Fix the code
f) Rerun the simulation
Additionally we can use UVM built in -debug facilities to help us track objection
related issue
UVM provides `uvm_objection_checker.
---------------------------------------------------------------------------------------------------------------------------

Example : Phase and Drop objection

//two objection are raised @0 time unit and one drop objection @10 time unit another
drop objection @100 time unit
//simulator will remains in the run phase till the objections dropped

//hence,the objection mechanism helps the simulator to decide at what point of time it
can proceed to extract phase from run phase

// USE +UVM_OBJECTION_TRACE IN run option we get counter like mechanism

`include "uvm_macros.svh"
import uvm_pkg::*;

class Transmitter extends uvm_component;


`uvm_component_utils(Transmitter)
function new(string name="",uvm_component parent=null);
super.new(name,parent);
endfunction

virtual task run_phase(uvm_phase phase);


phase.raise_objection(this);
#10;
`uvm_info(get_type_name(),"------------Run phase of transmitter-----------",UVM_NONE)
phase.drop_objection(this);
endtask

endclass

class Receiver extends uvm_component;


`uvm_component_utils(Receiver)

function new(string name="",uvm_component parent=null);


super.new(name,parent);
endfunction

virtual task run_phase(uvm_phase phase);


phase.raise_objection(this);
#100;
`uvm_info(get_type_name(),"------------Run phase of Receiver-----------",UVM_NONE)
phase.drop_objection(this);
endtask

endclass
class env extends uvm_env;
`uvm_component_utils(env)

Transmitter Tx;
Receiver Rx;

function new(string name="",uvm_component parent);


super.new(name,parent);
Tx=Transmitter::type_id::create("Tx",this);
Rx=Receiver::type_id::create("Rx",this);
endfunction
endclass

class test extends uvm_test;


`uvm_component_utils(test)

env env_h;
function new(string name="",uvm_component parent);
super.new(name,parent);
endfunction

virtual function void build_phase(uvm_phase phase);


super.build_phase(phase);
env_h=env::type_id::create("env_h",this);
endfunction
endclass

module tb;
initial
begin
run_test("test");
end
endmodule

OUTPUT :
# KERNEL: UVM_INFO @ 0: reporter [RNTST] Running test test...
# KERNEL: UVM_INFO @ 0: run [OBJTN_TRC] Object uvm_test_top.env_h.Tx raised 1 objection(s):
count=1 total=1
# KERNEL: UVM_INFO @ 0: run [OBJTN_TRC] Object uvm_test_top.env_h added 1 objection(s) to its
total (raised from source object ): count=0 total=1
# KERNEL: UVM_INFO @ 0: run [OBJTN_TRC] Object uvm_test_top added 1 objection(s) to its total
(raised from source object uvm_test_top.env_h.Tx): count=0 total=1
# KERNEL: UVM_INFO @ 0: run [OBJTN_TRC] Object uvm_top added 1 objection(s) to its total
(raised from source object uvm_test_top.env_h.Tx): count=0 total=1
# KERNEL: UVM_INFO @ 0: run [OBJTN_TRC] Object uvm_test_top.env_h.Rx raised 1 objection(s):
count=1 total=1
# KERNEL: UVM_INFO @ 0: run [OBJTN_TRC] Object uvm_test_top.env_h added 1 objection(s) to its
total (raised from source object ): count=0 total=2
# KERNEL: UVM_INFO @ 0: run [OBJTN_TRC] Object uvm_test_top added 1 objection(s) to its total
(raised from source object uvm_test_top.env_h.Rx): count=0 total=2
# KERNEL: UVM_INFO @ 0: run [OBJTN_TRC] Object uvm_top added 1 objection(s) to its total
(raised from source object uvm_test_top.env_h.Rx): count=0 total=2
# KERNEL: UVM_INFO /home/runner/testbench.sv(19) @ 10: uvm_test_top.env_h.Tx [Transmitter]
------------Run phase of transmitter-----------
# KERNEL: UVM_INFO @ 10: run [OBJTN_TRC] Object uvm_test_top.env_h.Tx dropped 1
objection(s): count=0 total=0
# KERNEL: UVM_INFO @ 10: run [OBJTN_TRC] Object uvm_test_top.env_h.Tx all_dropped 1
objection(s): count=0 total=0
# KERNEL: UVM_INFO @ 10: run [OBJTN_TRC] Object uvm_test_top.env_h subtracted 1 objection(s)
from its total (dropped from source object ): count=0 total=1
# KERNEL: UVM_INFO @ 10: run [OBJTN_TRC] Object uvm_test_top subtracted 1 objection(s) from
its total (dropped from source object uvm_test_top.env_h.Tx): count=0 total=1
# KERNEL: UVM_INFO @ 10: run [OBJTN_TRC] Object uvm_top subtracted 1 objection(s) from its
total (dropped from source object uvm_test_top.env_h.Tx): count=0 total=1
# KERNEL: UVM_INFO /home/runner/testbench.sv(35) @ 100: uvm_test_top.env_h.Rx [Receiver]
------------Run phase of Receiver-----------
# KERNEL: UVM_INFO @ 100: run [OBJTN_TRC] Object uvm_test_top.env_h.Rx dropped 1
objection(s): count=0 total=0
# KERNEL: UVM_INFO @ 100: run [OBJTN_TRC] Object uvm_test_top.env_h.Rx all_dropped 1
objection(s): count=0 total=0
# KERNEL: UVM_INFO @ 100: run [OBJTN_TRC] Object uvm_test_top.env_h subtracted 1
objection(s) from its total (dropped from source object ): count=0 total=0
# KERNEL: UVM_INFO @ 100: run [OBJTN_TRC] Object uvm_test_top.env_h subtracted 1
objection(s) from its total (all_dropped from source object ): count=0 total=0
# KERNEL: UVM_INFO @ 100: run [OBJTN_TRC] Object uvm_test_top subtracted 1 objection(s) from
its total (dropped from source object uvm_test_top.env_h.Rx): count=0 total=0
# KERNEL: UVM_INFO @ 100: run [OBJTN_TRC] Object uvm_test_top subtracted 1 objection(s) from
its total (all_dropped from source object uvm_test_top.env_h.Rx): count=0 total=0
# KERNEL: UVM_INFO @ 100: run [OBJTN_TRC] Object uvm_top subtracted 1 objection(s) from its
total (dropped from source object uvm_test_top.env_h.Rx): count=0 total=0
# KERNEL: UVM_INFO @ 100: run [OBJTN_TRC] Object uvm_top subtracted 1 objection(s) from its
total (all_dropped from source object uvm_test_top.env_h.Rx): count=0 total=0
# KERNEL: UVM_INFO /home/build/vlib1/vlib/uvm-1.2/src/base/uvm_objection.svh(1271) @ 100:
reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
# KERNEL: UVM_INFO /home/build/vlib1/vlib/uvm-1.2/src/base/uvm_report_server.svh(869) @ 100:
reporter [UVM/REPORT/SERVER]

Output : https://www.edaplayground.com/x/JAFw

You might also like