语法是:uvm_callbacks#(t<object type in which CB is used>,cb<user defined callback class type>)::add(T,CB). add除了T和CB还有一个参数叫<type: uvm_apprepend> ordering,默认值是UVM_APPEND,代表如果之前也有添加过callback,本次添加的会在之前添加的callback之后执行。
此时的完整test代码应该是这样的:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class user_callback_test extends basic_test; user_callback callback_1;
`uvm_component_utils(user_callback_test)
function new(string name ="user_callback_test", uvm_component parent=null); super.new(name, parent); endfunction
function void build_phase(uvm_phase phase); super.build_phase(phase); callback_1 = user_callback::type_id::create("callback_1", this);
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Jan 25 18:28 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
** Report counts by severity UVM_INFO : 2 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [DRIVER] 1 [RNTST] 1 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 0 V C S S i m u l a t i o n R e p o r t Time: 0 CPU Time: 0.300 seconds; Data structure size: 0.4Mb Sun Jan 25 18:28:48 2026
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Jan 25 18:28 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
** Report counts by severity UVM_INFO : 4 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [DRIVER] 1 [RNTST] 1 [USER_CALLBACK] 2 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 0 V C S S i m u l a t i o n R e p o r t Time: 0 CPU Time: 0.330 seconds; Data structure size: 0.4Mb Sun Jan 25 18:28:48 2026
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Jan 25 22:26 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
** Report counts by severity UVM_INFO : 6 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [DRIVER] 1 [RNTST] 1 [USER_CALLBACK-1] 2 [USER_CALLBACK-2] 2 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 0 V C S S i m u l a t i o n R e p o r t Time: 0 CPU Time: 0.270 seconds; Data structure size: 0.4Mb Sun Jan 25 22:26:40 2026
import uvm_pkg::*; `include "uvm_macros.svh" class mem_seq_item extends uvm_sequence_item; rand bit [3:0] addr; rand bit wr_en; rand bit rd_en; rand bit [7:0] wdata; bit [7:0] rdata;
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 1 20:48 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running test mem_test... -------------------------------------------------------------- Name Type Size Value -------------------------------------------------------------- uvm_test_top mem_test - @469 env mem_model_env - @477 mem_agnt mem_agent - @489 driver mem_driver - @501 rsp_port uvm_analysis_port - @518 seq_item_port uvm_seq_item_pull_port - @509 sequencer mem_sequencer - @527 rsp_export uvm_analysis_export - @535 seq_item_export uvm_seq_item_pull_imp - @641 arbitration_queue array 0 - lock_queue array 0 - num_last_reqs integral 32 'd1 num_last_rsps integral 32 'd1 -------------------------------------------------------------- UVM_INFO mem_driver.sv(25) @ 0: uvm_test_top.env.mem_agnt.driver [mem_driver] received Drive packet ---------------------------------- Name Type Size Value ---------------------------------- req mem_seq_item - @658 addr integral 4 'hb wr_en integral 1 'h0 rd_en integral 1 'h1 wdata integral 8 'h19 ---------------------------------- UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 50: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 3 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [mem_driver] 1 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 50 V C S S i m u l a t i o n R e p o r t Time: 50 CPU Time: 0.270 seconds; Data structure size: 0.4Mb Sun Feb 1 20:48:33 2026
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 1 20:48 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running test user_callback_test... -------------------------------------------------------------- Name Type Size Value -------------------------------------------------------------- uvm_test_top user_callback_test - @469 env mem_model_env - @477 mem_agnt mem_agent - @490 driver mem_driver - @502 rsp_port uvm_analysis_port - @519 seq_item_port uvm_seq_item_pull_port - @510 sequencer mem_sequencer - @528 rsp_export uvm_analysis_export - @536 seq_item_export uvm_seq_item_pull_imp - @642 arbitration_queue array 0 - lock_queue array 0 - num_last_reqs integral 32 'd1 num_last_rsps integral 32 'd1 -------------------------------------------------------------- UVM_INFO user_callback.sv(9) @ 0: reporter [USER_CALLBACK] [update_pkt] before packet modification ---------------------------------- Name Type Size Value ---------------------------------- req mem_seq_item - @660 addr integral 4 'hb wr_en integral 1 'h0 rd_en integral 1 'h1 wdata integral 8 'h19 ---------------------------------- UVM_INFO user_callback.sv(13) @ 0: reporter [USER_CALLBACK] [update_pkt] after packet modification ---------------------------------- Name Type Size Value ---------------------------------- req mem_seq_item - @660 addr integral 4 'h4 wr_en integral 1 'h0 rd_en integral 1 'h1 wdata integral 8 'h19 ---------------------------------- UVM_INFO mem_driver.sv(25) @ 0: uvm_test_top.env.mem_agnt.driver [mem_driver] received Drive packet ---------------------------------- Name Type Size Value ---------------------------------- req mem_seq_item - @660 addr integral 4 'h4 wr_en integral 1 'h0 rd_en integral 1 'h1 wdata integral 8 'h19 ---------------------------------- UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 50: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 5 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [USER_CALLBACK] 2 [mem_driver] 1 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 50 V C S S i m u l a t i o n R e p o r t Time: 50 CPU Time: 0.330 seconds; Data structure size: 0.4Mb Sun Feb 1 20:48:33 2026
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 2 15:26 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
0 Waiting for the event to be triggered 40 Triggering the event 40 event triggered V C S S i m u l a t i o n R e p o r t Time: 40 CPU Time: 0.220 seconds; Data structure size: 0.1Mb Mon Feb 2 15:26:10 2026
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 2 16:12 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
0 Triggering the event 0 Waiting for the event to trigger 0 Event triggered 100 Ending simulation V C S S i m u l a t i o n R e p o r t Time: 100 CPU Time: 0.200 seconds; Data structure size: 0.1Mb Mon Feb 2 16:12:28 2026
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 2 16:15 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
0 Triggering the event 0 Waiting for the event to trigger 100 Ending simulation V C S S i m u l a t i o n R e p o r t Time: 100 CPU Time: 0.220 seconds; Data structure size: 0.1Mb Mon Feb 2 16:15:17 2026
ev=uvm_event_pool::get_global("ev_ab"); `uvm_info(get_type_name(), $sformatf(" before triggering the event"),UVM_LOW) #10;
ev.trigger(); `uvm_info(get_type_name(),$sformatf(" after triggering the event"),UVM_LOW) phase.drop_objection(this); endtask:run_phase endclass:component_a
comp_b.sv:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
class component_b extends uvm_component; `uvm_component_utils(component_b) uvm_event ev;
function new(string name, uvm_component parent); super.new(name, parent); endfunction:new
virtual task run_phase(uvm_phase phase); phase.raise_objection(this); ev = uvm_event_pool::get_global("ev_ab"); `uvm_info(get_type_name(), $sformatf(" waiting for the event trigger"),UVM_LOW) ev.wait_trigger(); `uvm_info(get_type_name(), $sformatf(" event got triggered"),UVM_LOW) phase.drop_objection(this); endtask:run_phase endclass:component_b
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 2 17:46 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... -------------------------------------- Name Type Size Value -------------------------------------- uvm_test_top test - @455 comp_a component_a - @463 comp_b component_b - @471 -------------------------------------- UVM_INFO comp_a.sv(16) @ 0: uvm_test_top.comp_a [component_a] before triggering the event UVM_INFO comp_b.sv(14) @ 0: uvm_test_top.comp_b [component_b] waiting for the event trigger UVM_INFO comp_a.sv(20) @ 10: uvm_test_top.comp_a [component_a] after triggering the event UVM_INFO comp_b.sv(16) @ 10: uvm_test_top.comp_b [component_b] event got triggered UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 10: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 6 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 2 [component_b] 2 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 10 V C S S i m u l a t i o n R e p o r t Time: 10 CPU Time: 0.260 seconds; Data structure size: 0.4Mb Mon Feb 2 17:46:46 2026
观查到:
1 2 3 4 5
UVM_INFO comp_a.sv(16) @ 0: uvm_test_top.comp_a [component_a] before triggering the event UVM_INFO comp_b.sv(14) @ 0: uvm_test_top.comp_b [component_b] waiting for the event trigger UVM_INFO comp_a.sv(20) @ 10: uvm_test_top.comp_a [component_a] after triggering the event UVM_INFO comp_b.sv(16) @ 10: uvm_test_top.comp_b [component_b] event got triggered UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 10: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
ev.trigger(trans) // triggers an event and send transaction. ev.wait_trigger // wait for an event trigger. ev.get_trigger_data() // retrive data from event trigger. $cast(trans, ev.get_trigger_data()) // return type of get_trigger_data is object, $cast used for assignment.
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 2 21:04 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... -------------------------------------- Name Type Size Value -------------------------------------- uvm_test_top test - @455 comp_a component_a - @463 comp_b component_b - @471 -------------------------------------- UVM_INFO comp_b.sv(17) @ 0: uvm_test_top.comp_b [component_b] waiting for the event trigger UVM_INFO comp_a.sv(23) @ 10: uvm_test_top.comp_a [component_a] randomized trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @481 addr integral 4 'h9 wr_rd integral 1 'h0 wdata integral 8 'hf5 --------------------------------- UVM_INFO comp_a.sv(26) @ 10: uvm_test_top.comp_a [component_a] before triggering the event UVM_INFO comp_a.sv(29) @ 10: uvm_test_top.comp_a [component_a] after triggering the event UVM_INFO comp_b.sv(21) @ 10: uvm_test_top.comp_b [component_b] event got triggered UVM_INFO comp_b.sv(24) @ 10: uvm_test_top.comp_b [component_b] trans received, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @481 addr integral 4 'h9 wr_rd integral 1 'h0 wdata integral 8 'hf5 ---------------------------------
UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 10: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 8 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 3 [component_b] 3 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 10 V C S S i m u l a t i o n R e p o r t Time: 10 CPU Time: 0.220 seconds; Data structure size: 0.4Mb Mon Feb 2 21:04:53 2026
event_callback ev_cb; //create a event_callback ev_cb=new("ev_cb");
ev.add_callback(ev_cb); // add ev_cb to event ev
user defined event_callback.sv:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
import uvm_pkg::*; `include "uvm_macros.svh" class event_callback extends uvm_event_callback; `uvm_object_utils(event_callback)
function new(string name="event_callback"); super.new(name); endfunction
virtual function bit pre_trigger(uvm_event e, uvm_object data); `uvm_info(get_type_name(),$sformatf(" [Callback]Inside event pre_trigger callback"),UVM_LOW) endfunction
virtual function void post_trigger(uvm_event e, uvm_object data); `uvm_info(get_type_name(), $sformatf(" [Callback]Inside event post_trigger callback"), UVM_LOW) endfunction
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 3 15:35 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... -------------------------------------- Name Type Size Value -------------------------------------- uvm_test_top test - @455 comp_a component_a - @463 comp_b component_b - @471 -------------------------------------- UVM_INFO comp_a.sv(18) @ 0: uvm_test_top.comp_a [component_a] Before triggering the event UVM_INFO comp_b.sv(17) @ 0: uvm_test_top.comp_b [component_b] waiting for the event trigger UVM_INFO event_callback.sv(11) @ 10: reporter [event_callback] [Callback]Inside event pre_trigger callback UVM_INFO event_callback.sv(15) @ 10: reporter [event_callback] [Callback]Inside event post_trigger callback UVM_INFO comp_a.sv(23) @ 10: uvm_test_top.comp_a [component_a] after triggering the event UVM_INFO comp_b.sv(21) @ 10: uvm_test_top.comp_b [component_b] event got triggerd UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 10: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 8 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 2 [component_b] 2 [event_callback] 2 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 10 V C S S i m u l a t i o n R e p o r t Time: 10 CPU Time: 0.280 seconds; Data structure size: 0.4Mb Tue Feb 3 15:35:35 2026
可以发现成功在event trigger中插入了callback.
register two callbacks to a same event
我们可以给同一个event添加多个callback. event_callback_0.sv:
1 2 3 4 5 6 7 8 9 10 11
class event_callback_0 extends uvm_event_callback; `uvm_object_utils(event_callback_0)
function new(string name = "event_callback_0"); super.new(name); endfunction
virtual function void post_trigger(uvm_event e, uvm_object data); `uvm_info(get_type_name(), $sformatf(" [Callback 0] inside event post_trigger callback"),UVM_LOW) endfunction endclass
event_callback_1.sv:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
class event_callback_1 extends uvm_event_callback; `uvm_object_utils(event_callback_1)
function new(string name="event_callback_1"); super.new(name); endfunction
virtual function bit pre_trigger(uvm_event e, uvm_object data); `uvm_info(get_type_name(), $sformatf(" [Callback 1]inside event pre_trigger callback"),UVM_LOW) endfunction
virtual function void post_trigger(uvm_event e, uvm_object data); `uvm_info(get_type_name(),$sformatf(" [callback 1]inside event post_trigger callback"),UVM_LOW) endfunction endclass
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 3 17:20 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... -------------------------------------- Name Type Size Value -------------------------------------- uvm_test_top test - @455 comp_a component_a - @463 comp_b component_b - @471 -------------------------------------- UVM_INFO comp_a.sv(22) @ 0: uvm_test_top.comp_a [component_a] before triggering the event UVM_INFO comp_b.sv(17) @ 0: uvm_test_top.comp_b [component_b] waiting for the event trigger UVM_INFO event_callback_1.sv(10) @ 10: reporter [event_callback_1] [Callback 1]inside event pre_trigger callback UVM_INFO event_callback_0.sv(11) @ 10: reporter [event_callback_0] [Callback 0] inside event post_trigger callback UVM_INFO event_callback_1.sv(14) @ 10: reporter [event_callback_1] [callback 1]inside event post_trigger callback UVM_INFO comp_a.sv(27) @ 10: uvm_test_top.comp_a [component_a] after triggering the event UVM_INFO comp_b.sv(21) @ 10: uvm_test_top.comp_b [component_b] event got triggerd UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 10: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 9 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 2 [component_b] 2 [event_callback_0] 1 [event_callback_1] 2 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 10 V C S S i m u l a t i o n R e p o r t Time: 10 CPU Time: 0.330 seconds; Data structure size: 0.4Mb Tue Feb 3 17:20:54 2026
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 3 18:00 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... -------------------------------------- Name Type Size Value -------------------------------------- uvm_test_top test - @455 comp_a component_a - @463 comp_b component_b - @471 -------------------------------------- UVM_INFO comp_a.sv(17) @ 0: uvm_test_top.comp_a [component_a] Before triggering the event UVM_INFO comp_b.sv(17) @ 0: uvm_test_top.comp_b [component_b] waiting for the event trigger UVM_INFO event_callback.sv(12) @ 10: reporter [event_callback] [Callback]Inside event pre_trigger callback UVM_INFO event_callback.sv(16) @ 10: reporter [event_callback] [Callback]Inside event post_trigger callback UVM_INFO comp_a.sv(22) @ 10: uvm_test_top.comp_a [component_a] After triggering the event UVM_INFO comp_b.sv(21) @ 10: uvm_test_top.comp_b [component_b] event got triggerd UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 10: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 8 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 2 [component_b] 2 [event_callback] 2 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 10 V C S S i m u l a t i o n R e p o r t Time: 10 CPU Time: 0.260 seconds; Data structure size: 0.4Mb Tue Feb 3 18:00:54 2026
`uvm_info(get_type_name(), $sformatf(" before calling port put method"),UVM_LOW) trans_out.put(trans); `uvm_info(get_type_name(), $sformatf(" after calling port put method"), UVM_LOW) phase.drop_objection(this); endtask:run_phase endclass:component_a
component_b.sv:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
class component_b extends uvm_component; transaction trans;
function new(string name, uvm_component parent); super.new(name, parent); trans_in=new("trans_in", this); endfunction:new
virtual task put(transaction trans); `uvm_info(get_type_name(), $sformatf(" received trans on imp port"), UVM_LOW) `uvm_info(get_type_name(), $sformatf(" printing trans \n%s",trans.sprint()),UVM_LOW) endtask:put endclass:component_b
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 6 23:15 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... --------------------------------------------------- Name Type Size Value --------------------------------------------------- uvm_test_top test - @455 env environment - @463 comp_a component_a - @471 trans_out uvm_blocking_put_port - @479 comp_b component_b - @488 trans_in uvm_blocking_put_imp - @496 --------------------------------------------------- UVM_INFO comp_a.sv(18) @ 0: uvm_test_top.env.comp_a [component_a] transaction randomized --------------------------------- Name Type Size Value --------------------------------- trans transaction - @505 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 4 'h9 --------------------------------- UVM_INFO comp_a.sv(21) @ 0: uvm_test_top.env.comp_a [component_a] before calling port put method UVM_INFO comp_b.sv(15) @ 0: uvm_test_top.env.comp_b [component_b] received trans on imp port UVM_INFO comp_b.sv(16) @ 0: uvm_test_top.env.comp_b [component_b] printing trans --------------------------------- Name Type Size Value --------------------------------- trans transaction - @505 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 4 'h9 ---------------------------------
UVM_INFO comp_a.sv(23) @ 0: uvm_test_top.env.comp_a [component_a] after calling port put method UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 0: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 7 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 3 [component_b] 2 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 0 V C S S i m u l a t i o n R e p o r t Time: 0 CPU Time: 0.410 seconds; Data structure size: 0.4Mb Fri Feb 6 23:15:07 2026
为了证明这个过程是阻塞的,可以在comp_b.sv中添加一段延时:
1 2 3 4 5 6 7 8 9 10
virtual task put(transaction trans); `uvm_info(get_type_name(), $sformatf(" received trans on IMP port"),UVM_LOW) `uvm_info(get_type_name(), $sformatf(" before injecting delay"),UVM_LOW)
#100;
`uvm_info(get_type_name(), $sformatf(" after injecting delay"),UVM_LOW)
`uvm_info(get_type_name(), $sformatf(" printing trans \n%s", trans.sprint()),UVM_LOW) endtask:put
UVM_INFO @ 0: reporter [RNTST] Running testtest... --------------------------------------------------- Name Type Size Value --------------------------------------------------- uvm_test_top test - @455 env environment - @463 comp_a component_a - @471 trans_out uvm_blocking_put_port - @479 comp_b component_b - @488 trans_in uvm_blocking_put_imp - @496 --------------------------------------------------- UVM_INFO comp_a.sv(18) @ 0: uvm_test_top.env.comp_a [component_a] transaction randomized --------------------------------- Name Type Size Value --------------------------------- trans transaction - @505 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 4 'h9 --------------------------------- UVM_INFO comp_a.sv(21) @ 0: uvm_test_top.env.comp_a [component_a] before calling port put method UVM_INFO comp_b.sv(16) @ 0: uvm_test_top.env.comp_b [component_b] received trans on IMP port UVM_INFO comp_b.sv(17) @ 0: uvm_test_top.env.comp_b [component_b] before injecting delay UVM_INFO comp_b.sv(21) @ 100: uvm_test_top.env.comp_b [component_b] after injecting delay UVM_INFO comp_b.sv(23) @ 100: uvm_test_top.env.comp_b [component_b] printing trans --------------------------------- Name Type Size Value --------------------------------- trans transaction - @505 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 4 'h9 ---------------------------------
UVM_INFO comp_a.sv(23) @ 100: uvm_test_top.env.comp_a [component_a] after calling port put method UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 100: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
我们可以看到com_a收到信息完成输出uvm_test_top.env.comp_a [component_a] after calling port put method是在仿真时间100,也就是证明他是被阻塞的。
virtual function try_put(transaction trans); `uvm_info(get_type_name(), $sformatf(" inside try_put method"),UVM_LOW) `uvm_info(get_type_name(), $sformatf(" received trans on IMP port"),UVM_LOW) `uvm_info(get_type_name(), $sformatf(" printing trans \n%s", trans.sprint()),UVM_LOW) endfunction:try_put
`uvm_info(get_type_name(), $sformatf(" before calling port put method"),UVM_LOW) trans_out.try_put(trans); `uvm_info(get_type_name(), $sformatf(" after calling port put method"),UVM_LOW)
class component_b extends uvm_component; transaction trans; uvm_nonblocking_put_imp#(transaction,component_b) trans_in;
`uvm_component_utils(component_b)
function new(string name, uvm_component parent); super.new(name,parent); trans_in=new("trans_in",this); endfunction:new
virtual function bit try_put(transaction trans); `uvm_info(get_type_name(), $sformatf(" inside try_put method"),UVM_LOW) `uvm_info(get_type_name(), $sformatf(" received trans on IMP port"),UVM_LOW) `uvm_info(get_type_name(), $sformatf(" printing trans, \n%s",trans.sprint()),UVM_LOW)
endfunction:try_put
virtual function bit can_put(); endfunction endclass:component_b
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 7 22:37 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... ------------------------------------------------------ Name Type Size Value ------------------------------------------------------ uvm_test_top test - @455 env environment - @463 comp_a component_a - @471 trans_out uvm_nonblocking_put_port - @479 comp_b component_b - @488 trans_in uvm_nonblocking_put_imp - @496 ------------------------------------------------------ UVM_INFO comp_a.sv(19) @ 0: uvm_test_top.env.comp_a [component_a] transaction randomized UVM_INFO comp_a.sv(20) @ 0: uvm_test_top.env.comp_a [component_a] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @505 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 4 'h9 --------------------------------- UVM_INFO comp_a.sv(22) @ 0: uvm_test_top.env.comp_a [component_a] before calling port put method UVM_INFO comp_b.sv(14) @ 0: uvm_test_top.env.comp_b [component_b] inside try_put method UVM_INFO comp_b.sv(15) @ 0: uvm_test_top.env.comp_b [component_b] received trans on IMP port UVM_INFO comp_b.sv(16) @ 0: uvm_test_top.env.comp_b [component_b] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @505 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 4 'h9 ---------------------------------
UVM_INFO comp_a.sv(24) @ 0: uvm_test_top.env.comp_a [component_a] after calling port put method UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 0: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 9 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 4 [component_b] 3 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 0 V C S S i m u l a t i o n R e p o r t Time: 0 CPU Time: 0.280 seconds; Data structure size: 0.4Mb Sat Feb 7 22:37:39 2026
`uvm_info(get_type_name(),$sformatf(" Before calling port put method"),UVM_LOW) trans_out.put(trans); `uvm_info(get_type_name(),$sformatf(" After calling port put method"),UVM_LOW)
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 9 22:18 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... ------------------------------------------------------ Name Type Size Value ------------------------------------------------------ uvm_test_top test - @455 env environment - @463 comp_a component_a - @471 trans_out uvm_blocking_put_port - @479 comp_b component_b - @488 sub_comp_b sub_component_b - @505 trans_in uvm_blocking_put_imp - @513 trans_in uvm_blocking_put_export - @496 ------------------------------------------------------ UVM_INFO comp_a.sv(19) @ 0: uvm_test_top.env.comp_a [component_a] transaction randomized UVM_INFO comp_a.sv(20) @ 0: uvm_test_top.env.comp_a [component_a] Printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @522 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 --------------------------------- UVM_INFO comp_a.sv(22) @ 0: uvm_test_top.env.comp_a [component_a] Before calling port put method UVM_INFO sub_comp_b.sv(14) @ 0: uvm_test_top.env.comp_b.sub_comp_b [sub_component_b] received trans On IMP Port UVM_INFO sub_comp_b.sv(16) @ 100: uvm_test_top.env.comp_b.sub_comp_b [sub_component_b] Printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @522 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 ---------------------------------
UVM_INFO comp_a.sv(24) @ 100: uvm_test_top.env.comp_a [component_a] After calling port put method UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 100: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 8 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 4 [sub_component_b] 2 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 100 V C S S i m u l a t i o n R e p o r t Time: 100 CPU Time: 0.290 seconds; Data structure size: 0.4Mb Mon Feb 9 22:18:46 2026
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 10 22:56 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... --------------------------------------------------- Name Type Size Value --------------------------------------------------- uvm_test_top test - @455 env environment - @463 comp_a component_a - @471 trans_out uvm_blocking_get_imp - @479 comp_b component_b - @488 trans_in uvm_blocking_get_port - @496 --------------------------------------------------- UVM_INFO comp_b.sv(15) @ 0: uvm_test_top.env.comp_b [component_b] requesting transaction. UVM_INFO comp_b.sv(16) @ 0: uvm_test_top.env.comp_b [component_b] before calling port get method. UVM_INFO comp_a.sv(12) @ 0: uvm_test_top.env.comp_a [component_a] received transaction imp port get request UVM_INFO comp_a.sv(17) @ 0: uvm_test_top.env.comp_a [component_a] tranaction randomized UVM_INFO comp_a.sv(18) @ 0: uvm_test_top.env.comp_a [component_a] Printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @505 addr integral 4 'h4 wr_rd integral 1 'h0 wdata integral 8 'hd0 --------------------------------- UVM_INFO comp_a.sv(20) @ 0: uvm_test_top.env.comp_a [component_a] Sendting trans packet UVM_INFO comp_b.sv(18) @ 0: uvm_test_top.env.comp_b [component_b] after calling port get method. --------------------------------- Name Type Size Value --------------------------------- trans transaction - @505 addr integral 4 'h4 wr_rd integral 1 'h0 wdata integral 8 'hd0 --------------------------------- UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 0: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 9 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 4 [component_b] 3 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 0 V C S S i m u l a t i o n R e p o r t Time: 0 CPU Time: 0.300 seconds; Data structure size: 0.4Mb Tue Feb 10 22:56:35 2026
if(trans_in.try_get(trans)) begin `uvm_info(get_type_name(),$sformatf("received transaction."),UVM_LOW) `uvm_info(get_type_name(),$sformatf("printing trans \n%s",trans.sprint()),UVM_LOW)
end else `uvm_info(get_type_name(), $sformatf("not received transaction."),UVM_LOW)
class component_a extends uvm_component; uvm_nonblocking_get_imp#(transaction,component_a) trans_out; `uvm_component_utils(component_a)
function new(string name, uvm_component parent); super.new(name, parent); trans_out=new("trans_out",this); endfunction:new
virtual function bit try_get(output transaction trans); `uvm_info(get_type_name(), $sformatf("received transaction imp port get request."),UVM_LOW) trans=transaction::type_id::create("trans",this); void'(trans.randomize());
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 12 21:02 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... ------------------------------------------------------ Name Type Size Value ------------------------------------------------------ uvm_test_top test - @455 env environment - @463 comp_a component_a - @471 trans_out uvm_nonblocking_get_imp - @479 comp_b component_b - @488 trans_in uvm_nonblocking_get_port - @496 ------------------------------------------------------ UVM_INFO comp_b.sv(15) @ 0: uvm_test_top.env.comp_b [component_b] requesting transaction. UVM_INFO comp_b.sv(16) @ 0: uvm_test_top.env.comp_b [component_b] before calling try_get method. UVM_INFO comp_a.sv(12) @ 0: uvm_test_top.env.comp_a [component_a] received transaction imp port get request. UVM_INFO comp_a.sv(16) @ 0: uvm_test_top.env.comp_a [component_a] transaction randomized. UVM_INFO comp_a.sv(17) @ 0: uvm_test_top.env.comp_a [component_a] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @505 addr integral 4 'h4 wr_rd integral 1 'h0 wdata integral 8 'hd0 --------------------------------- UVM_INFO comp_a.sv(18) @ 0: uvm_test_top.env.comp_a [component_a] sending trans. UVM_INFO comp_b.sv(19) @ 0: uvm_test_top.env.comp_b [component_b] received transaction. UVM_INFO comp_b.sv(20) @ 0: uvm_test_top.env.comp_b [component_b] printing trans --------------------------------- Name Type Size Value --------------------------------- trans transaction - @505 addr integral 4 'h4 wr_rd integral 1 'h0 wdata integral 8 'hd0 ---------------------------------
UVM_INFO comp_b.sv(26) @ 0: uvm_test_top.env.comp_b [component_b] after calling try_get method. UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 0: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 11 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 4 [component_b] 5 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 0 V C S S i m u l a t i o n R e p o r t Time: 0 CPU Time: 0.340 seconds; Data structure size: 0.4Mb Thu Feb 12 21:02:40 2026
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 12 23:30 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... --------------------------------------------------------- Name Type Size Value --------------------------------------------------------- uvm_test_top test - @455 env environment - @463 comp_a component_a - @471 trans_out uvm_blocking_put_port - @479 comp_b component_b - @488 trans_in uvm_blocking_get_port - @496 fifo_ab uvm_tlm_fifo #(T) - @505 get_ap uvm_analysis_port - @540 get_peek_export uvm_get_peek_imp - @522 put_ap uvm_analysis_port - @531 put_export uvm_put_imp - @513 --------------------------------------------------------- UVM_INFO comp_a.sv(17) @ 0: uvm_test_top.env.comp_a [component_a] transaction randomized. UVM_INFO comp_a.sv(18) @ 0: uvm_test_top.env.comp_a [component_a] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @549 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 --------------------------------- UVM_INFO comp_a.sv(19) @ 0: uvm_test_top.env.comp_a [component_a] before calling put method. UVM_INFO comp_a.sv(21) @ 0: uvm_test_top.env.comp_a [component_a] after calling port put method. UVM_INFO comp_b.sv(14) @ 0: uvm_test_top.env.comp_b [component_b] before calling port get method. UVM_INFO comp_b.sv(16) @ 0: uvm_test_top.env.comp_b [component_b] after calling port get method. UVM_INFO comp_b.sv(17) @ 0: uvm_test_top.env.comp_b [component_b] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @549 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 ---------------------------------
UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 0: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 9 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 4 [component_b] 3 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 0 V C S S i m u l a t i o n R e p o r t Time: 0 CPU Time: 0.200 seconds; Data structure size: 0.4Mb Thu Feb 12 23:30:07 2026
`uvm_info(get_type_name(), $sformatf("before calling port get method."),UVM_LOW) trans_in.get(trans); `uvm_info(get_type_name(), $sformatf("after calling port get method."),UVM_LOW) `uvm_info(get_type_name(), $sformatf("printing trans, \n%s", trans.sprint()),UVM_LOW)
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 12 23:39 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... --------------------------------------------------------- Name Type Size Value --------------------------------------------------------- uvm_test_top test - @455 env environment - @463 comp_a component_a - @471 trans_out uvm_blocking_put_port - @479 comp_b component_b - @488 trans_in uvm_blocking_get_port - @496 fifo_ab uvm_tlm_fifo #(T) - @505 get_ap uvm_analysis_port - @540 get_peek_export uvm_get_peek_imp - @522 put_ap uvm_analysis_port - @531 put_export uvm_put_imp - @513 --------------------------------------------------------- UVM_INFO comp_a.sv(18) @ 0: uvm_test_top.env.comp_a [component_a] transaction randomized. UVM_INFO comp_a.sv(19) @ 0: uvm_test_top.env.comp_a [component_a] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @549 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 --------------------------------- UVM_INFO comp_a.sv(20) @ 0: uvm_test_top.env.comp_a [component_a] before calling put method. UVM_INFO comp_a.sv(22) @ 0: uvm_test_top.env.comp_a [component_a] after calling port put method. UVM_INFO comp_a.sv(24) @ 0: uvm_test_top.env.comp_a [component_a] randomize again. UVM_INFO comp_a.sv(25) @ 0: uvm_test_top.env.comp_a [component_a] printing transs, --------------------------------- Name Type Size Value --------------------------------- transs transaction - @553 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'h60 ---------------------------------
UVM_INFO comp_a.sv(26) @ 0: uvm_test_top.env.comp_a [component_a] before calling put method. UVM_INFO comp_b.sv(15) @ 50: uvm_test_top.env.comp_b [component_b] before calling port get method. UVM_INFO comp_b.sv(17) @ 50: uvm_test_top.env.comp_b [component_b] after calling port get method. UVM_INFO comp_b.sv(18) @ 50: uvm_test_top.env.comp_b [component_b] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @549 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 --------------------------------- UVM_INFO comp_a.sv(28) @ 50: uvm_test_top.env.comp_a [component_a] after calling port put method. UVM_INFO comp_b.sv(21) @ 150: uvm_test_top.env.comp_b [component_b] get again. UVM_INFO comp_b.sv(23) @ 150: uvm_test_top.env.comp_b [component_b] before calling port get method. UVM_INFO comp_b.sv(25) @ 150: uvm_test_top.env.comp_b [component_b] after calling port get method. UVM_INFO comp_b.sv(26) @ 150: uvm_test_top.env.comp_b [component_b] printing trans, --------------------------------- Name Type Size Value --------------------------------- transs transaction - @553 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'h60 ---------------------------------
UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 150: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 17 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 8 [component_b] 7 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 150 V C S S i m u l a t i o n R e p o r t Time: 150 CPU Time: 0.300 seconds; Data structure size: 0.4Mb Thu Feb 12 23:39:15 2026
end else begin `uvm_info(get_type_name(), $sformatf("no entry, not able to get the trans."),UVM_LOW) end phase.drop_objection(this); endtask:run_phase endclass:component_b
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 15 21:11 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... ------------------------------------------------------------ Name Type Size Value ------------------------------------------------------------ uvm_test_top test - @455 env environment - @463 comp_a component_a - @471 trans_out uvm_nonblocking_put_port - @479 comp_b component_b - @488 trans_in uvm_nonblocking_get_port - @496 fifo_ab uvm_tlm_fifo #(T) - @505 get_ap uvm_analysis_port - @540 get_peek_export uvm_get_peek_imp - @522 put_ap uvm_analysis_port - @531 put_export uvm_put_imp - @513 ------------------------------------------------------------ UVM_INFO comp_b.sv(23) @ 0: uvm_test_top.env.comp_b [component_b] no entry, not able to get the trans. UVM_INFO comp_a.sv(18) @ 100: uvm_test_top.env.comp_a [component_a] transaction randomized. UVM_INFO comp_a.sv(19) @ 100: uvm_test_top.env.comp_a [component_a] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @549 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 --------------------------------- UVM_INFO comp_a.sv(21) @ 100: uvm_test_top.env.comp_a [component_a] before calling try_put method. UVM_INFO comp_a.sv(23) @ 100: uvm_test_top.env.comp_a [component_a] after calling try_put method. UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 100: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase --- UVM Report Summary --- ** Report counts by severity UVM_INFO : 7 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 4 [component_b] 1 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 100 V C S S i m u l a t i o n R e p o r t Time: 100 CPU Time: 0.370 seconds; Data structure size: 0.4Mb Sun Feb 15 21:11:27 2026
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 15 21:14 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... ------------------------------------------------------------ Name Type Size Value ------------------------------------------------------------ uvm_test_top test - @455 env environment - @463 comp_a component_a - @471 trans_out uvm_nonblocking_put_port - @479 comp_b component_b - @488 trans_in uvm_nonblocking_get_port - @496 fifo_ab uvm_tlm_fifo #(T) - @505 get_ap uvm_analysis_port - @540 get_peek_export uvm_get_peek_imp - @522 put_ap uvm_analysis_port - @531 put_export uvm_put_imp - @513 ------------------------------------------------------------ UVM_INFO comp_a.sv(18) @ 100: uvm_test_top.env.comp_a [component_a] transaction randomized. UVM_INFO comp_a.sv(19) @ 100: uvm_test_top.env.comp_a [component_a] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @549 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 --------------------------------- UVM_INFO comp_a.sv(21) @ 100: uvm_test_top.env.comp_a [component_a] before calling try_put method. UVM_INFO comp_a.sv(23) @ 100: uvm_test_top.env.comp_a [component_a] after calling try_put method. UVM_INFO comp_b.sv(17) @ 200: uvm_test_top.env.comp_b [component_b] before calling get methond. UVM_INFO comp_b.sv(19) @ 200: uvm_test_top.env.comp_b [component_b] after calling get method. UVM_INFO comp_b.sv(20) @ 200: uvm_test_top.env.comp_b [component_b] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @549 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 ---------------------------------
UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 200: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 9 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 4 [component_b] 3 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 200 V C S S i m u l a t i o n R e p o r t Time: 200 CPU Time: 0.240 seconds; Data structure size: 0.4Mb Sun Feb 15 21:14:53 2026
class component_b extends uvm_component; transaction trans; uvm_analysis_imp_port_a#(transaction,component_b) analysis_imp_a; uvm_analysis_imp_port_b#(transaction,component_b) analysis_imp_b;
`uvm_component_utils(component_b)
function new(string name, uvm_component parent); super.new(name, parent); analysis_imp_a=new("analysis_imp_a",this); analysis_imp_b=new("analysis_imp_b",this); endfunction:new
virtual function void write_port_a(transaction trans); `uvm_info(get_type_name(),$sformatf("inside write_port_a. received trans on analysis imp port"),UVM_LOW) `uvm_info(get_type_name(),$sformatf("printing trans, \n%s",trans.sprint()),UVM_LOW)
endfunction:write_port_a
virtual function void write_port_b(transaction trans);
`uvm_info(get_type_name(),$sformatf("inside write_port_b. received trans on analysis imp port"),UVM_LOW) `uvm_info(get_type_name(),$sformatf("printing trans, \n%s",trans.sprint()),UVM_LOW)
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 15 23:33 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... ---------------------------------------------------------- Name Type Size Value ---------------------------------------------------------- uvm_test_top test - @455 env environment - @463 comp_a component_a - @471 analysis_port uvm_analysis_port - @479 comp_b component_b - @488 analysis_imp_a uvm_analysis_imp_port_a - @496 analysis_imp_b uvm_analysis_imp_port_b - @505 ---------------------------------------------------------- UVM_INFO comp_a.sv(16) @ 0: uvm_test_top.env.comp_a [component_a] transaction randomized. UVM_INFO comp_a.sv(17) @ 0: uvm_test_top.env.comp_a [component_a] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @514 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 --------------------------------- UVM_INFO comp_a.sv(18) @ 0: uvm_test_top.env.comp_a [component_a] before calling write method. UVM_INFO comp_b.sv(20) @ 0: uvm_test_top.env.comp_b [component_b] inside write_port_a. received trans on analysis imp port UVM_INFO comp_b.sv(21) @ 0: uvm_test_top.env.comp_b [component_b] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @514 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 ---------------------------------
UVM_INFO comp_b.sv(28) @ 0: uvm_test_top.env.comp_b [component_b] inside write_port_b. received trans on analysis imp port UVM_INFO comp_b.sv(29) @ 0: uvm_test_top.env.comp_b [component_b] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @514 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 --------------------------------- UVM_INFO comp_a.sv(22) @ 0: uvm_test_top.env.comp_a [component_a] after calling write method. UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 0: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase --- UVM Report Summary --- ** Report counts by severity UVM_INFO : 10 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 4 [component_b] 4 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 0 V C S S i m u l a t i o n R e p o r t Time: 0 CPU Time: 0.240 seconds; Data structure size: 0.4Mb Sun Feb 15 23:33:18 2026
可以发现comp_b的两个端口都接收到了trans.
这里是一个组件中的多个端口(single subscriber + multi ports),我们也可以看一下多个组件,每个组件一个端口(multi subscribers with each single port)。 comp_a由于是发布广播的,就和之前的一样;上面之所以需要写uvm_analysis_imp_decl,是因为在同一个组件中,所有的analysis_imp都会默认调用同一个(同名函数)write,会导致混乱,就需要进行多端口的声明,如果每个组件只有一个imp,就不需要这样做了。
comp_b.sv:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
class component_b extends uvm_component; uvm_analysis_imp#(transaction,component_b) analysis_imp; `uvm_component_utils(component_b)
function new(string name,uvm_component parent); super.new(name,parent); analysis_imp=new("analysis_imp",this); endfunction:new
virtual function void write(transaction trans); `uvm_info(get_type_name(),$sformatf("inside write method. trans on analysis imp port."),UVM_LOW) `uvm_info(get_type_name(),$sformatf("printing trans, \n%s",trans.sprint()),UVM_LOW) endfunction:write endclass:component_b
comp_c.sv:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
class component_c extends uvm_component; uvm_analysis_imp#(transaction,component_c) analysis_imp; `uvm_component_utils(component_c)
function new(string name,uvm_component parent); super.new(name,parent); analysis_imp=new("analysis_imp",this); endfunction:new
virtual function void write(transaction trans); `uvm_info(get_type_name(),$sformatf("inside write method. trans on analysis imp port."),UVM_LOW) `uvm_info(get_type_name(),$sformatf("printing trans, \n%s",trans.sprint()),UVM_LOW) endfunction:write endclass:component_c
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 15 23:51 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... --------------------------------------------------- Name Type Size Value --------------------------------------------------- uvm_test_top test - @455 env environment - @463 comp_a component_a - @471 analysis_port uvm_analysis_port - @479 comp_b component_b - @488 analysis_imp uvm_analysis_imp - @496 comp_c component_c - @505 analysis_imp uvm_analysis_imp - @513 --------------------------------------------------- UVM_INFO comp_a.sv(16) @ 0: uvm_test_top.env.comp_a [component_a] transaction randomized. UVM_INFO comp_a.sv(17) @ 0: uvm_test_top.env.comp_a [component_a] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @522 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 --------------------------------- UVM_INFO comp_a.sv(18) @ 0: uvm_test_top.env.comp_a [component_a] before calling write method. UVM_INFO comp_b.sv(12) @ 0: uvm_test_top.env.comp_b [component_b] inside write method. trans on analysis imp port. UVM_INFO comp_b.sv(13) @ 0: uvm_test_top.env.comp_b [component_b] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @522 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 ---------------------------------
UVM_INFO comp_c.sv(12) @ 0: uvm_test_top.env.comp_c [component_c] inside write method. trans on analysis imp port. UVM_INFO comp_c.sv(13) @ 0: uvm_test_top.env.comp_c [component_c] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @522 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 --------------------------------- UVM_INFO comp_a.sv(22) @ 0: uvm_test_top.env.comp_a [component_a] after calling write method. UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 0: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase --- UVM Report Summary --- ** Report counts by severity UVM_INFO : 10 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 4 [component_b] 2 [component_c] 2 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 0 V C S S i m u l a t i o n R e p o r t Time: 0 CPU Time: 0.260 seconds; Data structure size: 0.4Mb Sun Feb 15 23:51:35 2026
最后是multi subscribers + multi ports的情况。 comp_a依旧不做改变,在comp_b和comp_c中都各自设置多个analysis imp port:
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 17 00:47 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... ----------------------------------------------------------- Name Type Size Value ----------------------------------------------------------- uvm_test_top test - @455 env environment - @463 comp_a component_a - @471 analysis_port uvm_analysis_port - @479 comp_b component_b - @488 analysis_imp_a uvm_analysis_imp_port_ba - @496 analysis_imp_b uvm_analysis_imp_port_bb - @505 comp_c component_c - @514 analysis_imp_a uvm_analysis_imp_port_ca - @522 analysis_imp_b uvm_analysis_imp_port_cb - @531 ----------------------------------------------------------- UVM_INFO comp_a.sv(16) @ 0: uvm_test_top.env.comp_a [component_a] transaction randomized. UVM_INFO comp_a.sv(17) @ 0: uvm_test_top.env.comp_a [component_a] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @540 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 --------------------------------- UVM_INFO comp_a.sv(18) @ 0: uvm_test_top.env.comp_a [component_a] before calling write method. UVM_INFO comp_b.sv(18) @ 0: uvm_test_top.env.comp_b [component_b] inside write_port_ba, received trans. UVM_INFO comp_b.sv(19) @ 0: uvm_test_top.env.comp_b [component_b] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @540 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 ---------------------------------
UVM_INFO comp_b.sv(24) @ 0: uvm_test_top.env.comp_b [component_b] inside write_port_bb, received trans. UVM_INFO comp_b.sv(25) @ 0: uvm_test_top.env.comp_b [component_b] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @540 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 --------------------------------- UVM_INFO comp_c.sv(18) @ 0: uvm_test_top.env.comp_c [component_c] inside write_port_ca, received trans. UVM_INFO comp_c.sv(19) @ 0: uvm_test_top.env.comp_c [component_c] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @540 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 ---------------------------------
UVM_INFO comp_c.sv(24) @ 0: uvm_test_top.env.comp_c [component_c] inside write_port_cb, received trans. UVM_INFO comp_c.sv(25) @ 0: uvm_test_top.env.comp_c [component_c] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @540 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 --------------------------------- UVM_INFO comp_a.sv(22) @ 0: uvm_test_top.env.comp_a [component_a] after calling write method. UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 0: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase --- UVM Report Summary --- ** Report counts by severity UVM_INFO : 14 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 4 [component_b] 4 [component_c] 4 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 0 V C S S i m u l a t i o n R e p o r t Time: 0 CPU Time: 0.400 seconds; Data structure size: 0.4Mb Tue Feb 17 00:47:29 2026
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 17 11:01 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running testtest... ---------------------------------------------------------------- Name Type Size Value ---------------------------------------------------------------- uvm_test_top test - @455 env environment - @463 comp_a component_a - @471 analysis_port uvm_analysis_port - @479 comp_b component_b - @488 analysis_fifo uvm_tlm_analysis_fifo #(T) - @496 analysis_export uvm_analysis_imp - @540 get_ap uvm_analysis_port - @531 get_peek_export uvm_get_peek_imp - @513 put_ap uvm_analysis_port - @522 put_export uvm_put_imp - @504 ---------------------------------------------------------------- UVM_INFO comp_a.sv(16) @ 0: uvm_test_top.env.comp_a [component_a] transaction randomized. UVM_INFO comp_a.sv(17) @ 0: uvm_test_top.env.comp_a [component_a] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @549 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 --------------------------------- UVM_INFO comp_a.sv(18) @ 0: uvm_test_top.env.comp_a [component_a] before calling write method. UVM_INFO comp_a.sv(22) @ 0: uvm_test_top.env.comp_a [component_a] after calling write method. UVM_INFO comp_b.sv(15) @ 100: uvm_test_top.env.comp_b [component_b] before calling get method. UVM_INFO comp_b.sv(17) @ 100: uvm_test_top.env.comp_b [component_b] printing trans, --------------------------------- Name Type Size Value --------------------------------- trans transaction - @549 addr integral 4 'hf wr_rd integral 1 'h0 wdata integral 8 'he9 ---------------------------------
UVM_INFO comp_b.sv(18) @ 100: uvm_test_top.env.comp_b [component_b] after calling get method. UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 100: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 9 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [RNTST] 1 [TEST_DONE] 1 [component_a] 4 [component_b] 3 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 100 V C S S i m u l a t i o n R e p o r t Time: 100 CPU Time: 0.290 seconds; Data structure size: 0.4Mb Tue Feb 17 11:01:32 2026
一个uvm_reg_block包含:uvm_mem(memory),uvm_reg_map(address map),uvm_reg_file(register file). uvm_reg_file可以包含一个或多个uvm_reg(register),一个uvm_reg内部又可以包含多个uvm_reg_field(fields in a register).
因为一个设计中,寄存器数量一般很多,所以需要通过register model generator进行spcialization(指把通用的register变成各种具体专用的register).
register model generator
register model generator本身是UVM library外部的东西,用来实现register model的自动spcialization.
通过使用register model generator,可以自动实现reg name, width, register fields, access permission等的指定。
一般来讲,front door的访问路线是:reg model -> bus transaction -> driver -> DUT,backdoor就可以直接通过HDL修改。
需要这两个不同的值是因为,当以front door access的形式对DUT的值进行修改的时候,有两个问题,一是不确定是否真的按照意愿成功修改,二是修改需要消耗仿真时间,并不是立即修改的。所以当进行front door access的时候,mirror value不会再发起bus transaction的时候立马修改,而是等monitor观察到总线操作确认更新以后,predictor进行对mirror value的更新;back door access就可以直接在进行修改的时候立刻更新mirror value.
write method要做的事情是,首先发起写操作来修改DUT中的寄存器值,然后更新DUT寄存器的值如果是front door access,就会等predictor修改mirror value, 如果是back door access就会立刻更新。
需要这两个不同的值是因为,当以front door access的形式对DUT的值进行修改的时候,有两个问题,一是不确定是否真的按照意愿成功修改,二是修改需要消耗仿真时间,并不是立即修改的。所以当进行front door access的时候,mirror value不会再发起bus transaction的时候立马修改,而是等monitor观察到总线操作确认更新以后,predictor进行对mirror value的更新;back door access就可以直接在进行修改的时候立刻更新mirror value.
基于bit定义,同样可以同时开启多个模型。用于UVM内置的寄存器和内存的built-in sequences,可以通过这个枚举实现自动的硬件检查等任务。 UVM_DO_REG_HW_RESET: 运行序列uvm_reg_hw_reset_seq,复位后立即读取所有寄存器,检查读取值是否和模型中定义的reset_value一致。 UVM_DO_REG_BIT_BASH: 运行序列uvm_reg_bit_bash_seq,对寄存器每个可写bit依次写入1和0,然后读出,检查是否成功/有没有影响其他不相关的位。 UVM_DO_REG_ACCESS: 运行序列uvm_reg_access_seq,通过front door write + back door read或者是back door write + front door read交叉验证路径的正确性。 UVM_DO_MEM_ACCESS: 运行序列uvm_mem_access_seq,对于内存,通过不同的路径进行读写验证。 UVM_DO_SHARED_ACCESS: 运行序列uvm_reg_mem_shared_access_seq,如果寄存器可以在多个总线上被访问,他会测试从一个总线写入后,另一个总线读出是否正确。 UVM_DO_MEM_WALK: 运行序列uvm_mem_walk_seq,对整个内存执行walk测试。 UVM_DO_ALL_REG_MEM_TESTS: 做所有的测试。
import uvm_pkg::*; `include"uvm_macros.svh" class dma_seq_item extends uvm_sequence_item; rand bit [31:0] addr; rand bit wr_en; rand bit [31:0] wdata; bit [31:0] rdata;
function new(string name, uvm_component parent); super.new(name, parent); endfunction:new
function void build_phase(uvm_phase phase); super.build_phase(phase);
if(!uvm_config_db#(virtual dma_if)::get(this,"","vif",vif)) `uvm_fatal("NO_VIF",{"virtual interface must be set for:",get_full_name(), ".vif"}); endfunction:build_phase
virtual task run_phase(uvm_phase phase); forever begin seq_item_port.get_next_item(req); drive(); seq_item_port.item_done(); end endtask:run_phase
if(req.wr_en) begin `DRIV_IF.wdata<=req.wdata; @(posedge vif.DRIVER.clk); end else begin @(posedge vif.DRIVER.clk); `DRIV_IF.wr_en<=0; @(posedge vif.DRIVER.clk); req.rdata=`DRIV_IF.rdata; end
function new(string name, uvm_component parent); super.new(name, parent); trans_collected=new(); item_collected_port=new("item_collected_port",this); endfunction:new
function void build_phase(uvm_phase phase); super.build_phase(phase); if(!uvm_config_db#(virtual dma_if)::get(this,"","vif",vif)) `uvm_fatal("NO VIF", {"virtual interface must be set for:",get_full_name(), ".vif"}); endfunction:build_phase
class dma_agent extends uvm_agent; dma_driver driver; dma_sequencer sequencer; dma_monitor monitor;
`uvm_component_utils(dma_agent)
function new(string name, uvm_component parent); super.new(name, parent); endfunction:new
function void build_phase(uvm_phase phase); super.build_phase(phase); monitor=dma_monitor::type_id::create("monitor",this);
if(get_is_active() == UVM_ACTIVE)begin driver=dma_driver::type_id::create("driver",this); sequencer=dma_sequencer::type_id::create("sequencer",this); end endfunction:build_phase
function void connect_phase(uvm_phase phase); if(get_is_active()==UVM_ACTIVE) begin driver.seq_item_port.connect(sequencer.seq_item_export); end endfunction:connect_phase endclass:dma_agent
完成env.sv:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
class dma_model_env extends uvm_env; dma_agent dma_agnt;
`uvm_component_utils(dma_model_env)
function new(string name, uvm_component parent); super.new(name, parent); endfunction:new
function void build_phase(uvm_phase phase); super.build_phase(phase); dma_agnt=dma_agent::type_id::create("dma_agnt",this); endfunction:build_phase endclass:dma_model_env
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Feb 28 00:38 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running test dma_reg_test... ---------------------------------------------------------------- Name Type Size Value ---------------------------------------------------------------- uvm_test_top dma_reg_test - @460 env dma_model_env - @468 dma_agnt dma_agent - @484 driver dma_driver - @517 rsp_port uvm_analysis_port - @534 seq_item_port uvm_seq_item_pull_port - @525 monitor dma_monitor - @496 item_collected_port uvm_analysis_port - @508 sequencer dma_sequencer - @543 rsp_export uvm_analysis_export - @551 seq_item_export uvm_seq_item_pull_imp - @657 arbitration_queue array 0 - lock_queue array 0 - num_last_reqs integral 32 'd1 num_last_rsps integral 32 'd1 ---------------------------------------------------------------- UVM_INFO dma_reg_test.sv(25) @ 0: uvm_test_top [TEST] Objection Raised! UVM_INFO dma_driver.sv(27) @ 0: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO dma_driver.sv(27) @ 15: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO dma_driver.sv(27) @ 35: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO dma_driver.sv(27) @ 55: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO dma_driver.sv(27) @ 75: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO dma_driver.sv(27) @ 105: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO dma_driver.sv(27) @ 135: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO dma_driver.sv(27) @ 165: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 195: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 11 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [DRV_RUN] 8 [RNTST] 1 [TEST] 1 [TEST_DONE] 1 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 195 V C S S i m u l a t i o n R e p o r t Time: 195 CPU Time: 0.370 seconds; Data structure size: 0.5Mb Sat Feb 28 00:38:23 2026
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Mar 3 15:29 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
UVM_INFO @ 0: reporter [RNTST] Running test dma_reg_test... ---------------------------------------------------------------- Name Type Size Value ---------------------------------------------------------------- uvm_test_top dma_reg_test - @460 env dma_model_env - @468 dma_agnt dma_agent - @480 driver dma_driver - @535 rsp_port uvm_analysis_port - @552 seq_item_port uvm_seq_item_pull_port - @543 monitor dma_monitor - @514 item_collected_port uvm_analysis_port - @526 sequencer dma_sequencer - @561 rsp_export uvm_analysis_export - @569 seq_item_export uvm_seq_item_pull_imp - @675 arbitration_queue array 0 - lock_queue array 0 - num_last_reqs integral 32 'd1 num_last_rsps integral 32 'd1 ---------------------------------------------------------------- UVM_INFO dma_driver.sv(27) @ 0: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO dma_driver.sv(27) @ 15: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO dma_driver.sv(27) @ 35: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO dma_driver.sv(27) @ 55: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO dma_driver.sv(27) @ 75: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO dma_driver.sv(27) @ 105: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO dma_driver.sv(27) @ 135: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO dma_driver.sv(27) @ 165: uvm_test_top.env.dma_agnt.driver [DRV_RUN] Driving one item UVM_INFO /opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_objection.svh(1273) @ 245: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase UVM_INFO dma_model_base_test.sv(30) @ 245: uvm_test_top [dma_reg_test] --------------------------------------- UVM_INFO dma_model_base_test.sv(31) @ 245: uvm_test_top [dma_reg_test] ---- TEST PASS ---- UVM_INFO dma_model_base_test.sv(32) @ 245: uvm_test_top [dma_reg_test] ---------------------------------------
--- UVM Report Summary ---
** Report counts by severity UVM_INFO : 13 UVM_WARNING : 0 UVM_ERROR : 0 UVM_FATAL : 0 ** Report counts by id [DRV_RUN] 8 [RNTST] 1 [TEST_DONE] 1 [dma_reg_test] 3 $finish called from file "/opt/Synopsys/VCS2018/vcs/O-2018.09-SP2/etc/uvm/base/uvm_root.svh", line 439. $finish at simulation time 245 V C S S i m u l a t i o n R e p o r t Time: 245 CPU Time: 0.350 seconds; Data structure size: 0.5Mb Tue Mar 3 15:29:35 2026
fork begin $display($time, "inside process a."); #20; $display($time, "process a completed."); $display($time,"process a waiting for barrier."); barrier.wait_for(); $display($time, "process a after the wait_for."); end
begin $display($time,"inside process b."); #10; $display($time,"process b completed."); $display($time,"process b waiting for barrier."); barrier.wait_for(); $display($time,"process b after the wait_for."); end
begin $display($time,"inside process c."); #30; $display($time,"process c completed."); $display($time,"process c waiting for barrier."); barrier.wait_for(); $display($time,"process c after wait_for"); end
begin $display($time,"inside process d."); #5; $display($time,"process d completed."); $display($time,"process d waiting for barrier."); barrier.wait_for(); $display($time,"process d after wait_for"); end join end endmodule
run.sh:
1 2
vcs -full64 -sverilog -ntb_opts uvm uvm_barrier_ex.sv -debug_access+all 2>&1 | tee compile.log ./simv 2>&1 | tee result.log
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Mar 3 17:46 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
0inside process a. 0inside process b. 0inside process c. 0inside process d. 5process d completed. 5process d waiting for barrier. 10process b completed. 10process b waiting for barrier. 20process a completed. 20process a waiting for barrier. 20process d after wait_for 20process b after the wait_for. 20process a after the wait_for. 30process c completed. 30process c waiting for barrier. V C S S i m u l a t i o n R e p o r t Time: 30 CPU Time: 0.240 seconds; Data structure size: 0.4Mb Tue Mar 3 17:46:50 2026
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Mar 3 21:06 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
0 [A] starting the progress 0 [A] injecting th delay of 30 0 [B] starting the progress 0 [B] injecting th delay of 10 0 [C] starting the progress 0 [C] injecting th delay of 20 0 [D] starting the progress 0 [D] injecting th delay of 5 5 [D] before the wait_for 10 [B] before the wait_for 20 [C] before the wait_for 20 [D] after the wait_for 20 [B] after the wait_for 20 [C] after the wait_for 30 [A] before the wait_for V C S S i m u l a t i o n R e p o r t Time: 30 CPU Time: 0.320 seconds; Data structure size: 0.4Mb Tue Mar 3 21:06:15 2026
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Mar 3 21:23 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
0 [A] starting the progress 0 [A] injecting th delay of 30 0 [B] starting the progress 0 [B] injecting th delay of 10 0 [C] starting the progress 0 [C] injecting th delay of 20 0 [D] starting the progress 0 [D] injecting th delay of 5 5 [D] before the wait_for 10 [B] before the wait_for 10 [D] after the wait_for 10 [B] after the wait_for 20 [C] before the wait_for 30 [A] before the wait_for 30 [C] after the wait_for 30 [A] after the wait_for V C S S i m u l a t i o n R e p o r t Time: 30 CPU Time: 0.320 seconds; Data structure size: 0.4Mb Tue Mar 3 21:23:56 2026
task automatic process(input string p_name, int delay); $display($time, " [%s] starting the progress",p_name); $display($time, " [%s] injecting th delay of %0d",p_name, delay); #delay; $display($time, " [%s] before the wait_for",p_name); barrier.wait_for(); $display($time, " [%s] after the wait_for",p_name); endtask
task monitor_process(); #15; $display($time, " [monitor] threshold value of barrier is %0d",barrier.get_threshold()); $display($time, " [monitor] number of process waiting are %0d", barrier.get_num_waiters()); endtask
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Mar 3 21:31 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
0 [A] starting the progress 0 [A] injecting th delay of 30 0 [B] starting the progress 0 [B] injecting th delay of 10 0 [C] starting the progress 0 [C] injecting th delay of 20 0 [D] starting the progress 0 [D] injecting th delay of 5 5 [D] before the wait_for 10 [B] before the wait_for 15 [monitor] threshold value of barrier is 3 15 [monitor] number of process waiting are 2 20 [C] before the wait_for 20 [D] after the wait_for 20 [B] after the wait_for 20 [C] after the wait_for 30 [A] before the wait_for V C S S i m u l a t i o n R e p o r t Time: 30 CPU Time: 0.200 seconds; Data structure size: 0.4Mb Tue Mar 3 21:31:34 2026
(Specify +UVM_NO_RELNOTES to turn off this notice)
0 [A] starting the progress 0 [A] injecting th delay of 30 0 [B] starting the progress 0 [B] injecting th delay of 10 0 [C] starting the progress 0 [C] injecting th delay of 20 0 [D] starting the progress 0 [D] injecting th delay of 5 5 [D] before the wait_for 5 [monitor] threshold value of barrier is 3 5 [monitor] number of process waiting are 1 10 [B] before the wait_for 20 [C] before the wait_for 20 [D] after the wait_for 20 [B] after the wait_for 20 [C] after the wait_for 30 [A] before the wait_for V C S S i m u l a t i o n R e p o r t
task automatic process(input string p_name,int delay); $display($time, " [%s] starting the process",p_name); $display($time, " [%s] injecting the delay of %0d",p_name,delay); #delay; $display($time," [%s] before the wait_for",p_name); barrier.wait_for(); $display($time, " [%s] after the wait_for",p_name); endtask
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Mar 3 23:58 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
0 [A] starting the process 0 [A] injecting the delay of 30 0 [B] starting the process 0 [B] injecting the delay of 10 0 [C] starting the process 0 [C] injecting the delay of 20 0 [D] starting the process 0 [D] injecting the delay of 5 5 [D] before the wait_for 10 [B] before the wait_for 20 [C] before the wait_for 20 [D] after the wait_for 20 [B] after the wait_for 20 [C] after the wait_for 30 [A] before the wait_for 32 [A] after the wait_for V C S S i m u l a t i o n R e p o r t Time: 32 CPU Time: 0.310 seconds; Data structure size: 0.4Mb Tue Mar 3 23:58:25 2026
task automatic process(input string p_name,int delay); $display($time, " [%s] starting the process",p_name); $display($time, " [%s] injecting the delay of %0d",p_name,delay); #delay; $display($time," [%s] before the wait_for",p_name); barrier.wait_for(); $display($time, " [%s] after the wait_for",p_name); endtask
task info(); #50; $display($time, " threshold value is %0d",barrier.get_threshold()); $display($time," number of waiters is %0d", barrier.get_num_waiters()); endtask
initial begin barrier=new("barrier"); barrier.set_threshold(3);
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Mar 4 00:11 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
0 [A] starting the process 0 [A] injecting the delay of 30 0 [B] starting the process 0 [B] injecting the delay of 10 0 [C] starting the process 0 [C] injecting the delay of 20 0 [D] starting the process 0 [D] injecting the delay of 5 5 [D] before the wait_for 10 [B] before the wait_for 20 [C] before the wait_for 30 [A] before the wait_for 50 threshold value is 3 50 number of waiters is 2 V C S S i m u l a t i o n R e p o r t Time: 50 CPU Time: 0.210 seconds; Data structure size: 0.4Mb Wed Mar 4 00:11:16 2026
task automatic process(input string p_name,int delay); $display($time, " [%s] starting the process",p_name); $display($time, " [%s] injecting the delay of %0d",p_name,delay); #delay; $display($time," [%s] before the wait_for",p_name); barrier.wait_for(); $display($time, " [%s] after the wait_for",p_name); endtask
initial begin barrier=new("barrier"); barrier.set_threshold(3); barrier.set_auto_reset(0);
fork process("A",30); process("B",10); process("C",20); process("D",5); join end endmodule
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Mar 4 16:14 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
0 [A] starting the process 0 [A] injecting the delay of 30 0 [B] starting the process 0 [B] injecting the delay of 10 0 [C] starting the process 0 [C] injecting the delay of 20 0 [D] starting the process 0 [D] injecting the delay of 5 5 [D] before the wait_for 10 [B] before the wait_for 20 [C] before the wait_for 20 [D] after the wait_for 20 [B] after the wait_for 20 [C] after the wait_for 30 [A] before the wait_for 30 [A] after the wait_for V C S S i m u l a t i o n R e p o r t Time: 30 CPU Time: 0.270 seconds; Data structure size: 0.4Mb Wed Mar 4 16:14:00 2026
task automatic process(input string p_name,int delay); $display($time, " [%s] starting the process",p_name); $display($time, " [%s] injecting the delay of %0d",p_name,delay); #delay; $display($time," [%s] before the wait_for",p_name); barrier.wait_for(); $display($time, " [%s] after the wait_for",p_name); endtask
task cancel_process(); #19; $display($time, " before cancel, the number of waiters is %0d", barrier.get_num_waiters()); barrier.cancel();
$display($time, " after cancel, the number of waiters is %0d", barrier.get_num_waiters());
endtask initial begin barrier=new("barrier"); barrier.set_threshold(2);
fork process("A",30); process("B",10); process("C",20); process("D",5); join end endmodule
Chronologic VCS simulator copyright 1991-2018 Contains Synopsys proprietary information. Compiler version O-2018.09-SP2_Full64; Runtime version O-2018.09-SP2_Full64; Mar 4 16:22 2026 ---------------------------------------------------------------- UVM-1.1d.Synopsys (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp. ----------------------------------------------------------------
*********** IMPORTANT RELEASE NOTES ************
You are using a version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined. See http://www.eda.org/svdb/view.php?id=3313 for more details.
You are using a version of the UVM library that has been compiled with `UVM_OBJECT_MUST_HAVE_CONSTRUCTOR undefined. See http://www.eda.org/svdb/view.php?id=3770 for more details.
(Specify +UVM_NO_RELNOTES to turn off this notice)
0 [A] starting the process 0 [A] injecting the delay of 30 0 [B] starting the process 0 [B] injecting the delay of 10 0 [C] starting the process 0 [C] injecting the delay of 20 0 [D] starting the process 0 [D] injecting the delay of 5 5 [D] before the wait_for 10 [B] before the wait_for 10 [D] after the wait_for 10 [B] after the wait_for 20 [C] before the wait_for 30 [A] before the wait_for 30 [C] after the wait_for 30 [A] after the wait_for V C S S i m u l a t i o n R e p o r t Time: 30 CPU Time: 0.260 seconds; Data structure size: 0.4Mb Wed Mar 4 16:22:23 2026