10 `uvm_component_utils(cl_scb_test_io_std_simple_mutexed)
15 extern function new(string name = "cl_scb_test_io_std_simple_mutexed", uvm_component parent = null);
20 extern function void pre_build();
21 extern function void build_phase(uvm_phase phase);
22 extern task main_phase(uvm_phase phase);
23 extern task access_queue(string queue, string producer, int start);
26 function cl_scb_test_io_std_simple_mutexed::new(string name = "cl_scb_test_io_std_simple_mutexed",
27 uvm_component parent = null);
28 super.new(name, parent);
31 function void cl_scb_test_io_std_simple_mutexed::pre_build();
33 this.syoscb_cfgs.syoscb_cfg[0].set_mutexed_add_item_enable(1'b1);
34 endfunction: pre_build
36 function void cl_scb_test_io_std_simple_mutexed::build_phase(uvm_phase phase);
38 super.build_phase(phase);
39 endfunction: build_phase
41 task cl_scb_test_io_std_simple_mutexed::main_phase(uvm_phase phase);
42 phase.raise_objection(this);
44 super.main_phase(phase);
47 for(int i=0; i<100; i++) begin
48 this.access_queue("Q1", "P1", i*1000);
51 for(int i=0; i<100; i++) begin
52 this.access_queue("Q2", "P1", i*1000);
56 phase.drop_objection(this);
61 task cl_scb_test_io_std_simple_mutexed::access_queue(string queue, string producer, int start);
63 for(int i=0; i<100; i++) begin
65 void'(std::randomize(w) with {
66 w inside {0, 1000, 2000};
69 item = cl_tb_seq_item::type_id::create("item");
70 item.int_a = i + start;
72 this.scb_env.syoscb[0].add_item_mutexed(queue, producer, item);
Simple IO compare test using the function based API and mutexed add_item calls.