11 `uvm_component_utils_begin(cl_scb_test_ooo_std_trigger_greed)
13 `uvm_component_utils_end
18 function new(string name = "cl_scb_test_ooo_std_trigger_greed", uvm_component parent = null);
19 super.new(name, parent);
25 extern function void pre_build();
26 extern function void add_19();
27 extern task main_phase(uvm_phase phase);
28 extern function void report_phase(uvm_phase phase);
33 function void cl_scb_test_ooo_std_trigger_greed::pre_build();
36 this.syoscb_cfgs.syoscb_cfg[0].set_compare_type(pk_syoscb::SYOSCB_COMPARE_OOO);
38 this.syoscb_cfgs.syoscb_cfg[0].set_end_greediness(pk_syoscb::SYOSCB_COMPARE_NOT_GREEDY);
39 this.syoscb_cfgs.syoscb_cfg[0].set_max_print_orphans(-1);
41 endfunction: pre_build
44 function void cl_scb_test_ooo_std_trigger_greed::add_19();
46 this.scb_env.syoscb[0].compare_control(1'b0);
47 for(int i=0; i<10; i++) begin
48 cl_tb_seq_item ctsi = cl_tb_seq_item::type_id::create("ctsi");
50 this.scb_env.syoscb[0].add_item("Q1", "P1", ctsi);
54 for(int i=8; i>=0; i--) begin
55 cl_tb_seq_item ctsi = cl_tb_seq_item::type_id::create("ctsi");
57 this.scb_env.syoscb[0].add_item("Q2", "P1", ctsi);
60 if(this.scb_env.syoscb[0].get_total_queue_size() != 19) begin
61 `uvm_fatal("TEST", $sformatf("Did not have 19 items total in queues, have %0d", this.scb_env.syoscb[0].get_total_queue_size()))
65 this.scb_env.syoscb[0].compare_control(1'b1);
68 task cl_scb_test_ooo_std_trigger_greed::main_phase(uvm_phase phase);
69 phase.raise_objection(this);
70 super.main_phase(phase);
73 this.scb_env.syoscb[0].set_report_severity_id_override(UVM_ERROR, "QUEUE_ERROR", UVM_INFO);
76 this.syoscb_cfgs.syoscb_cfg[0].set_trigger_greediness(pk_syoscb::SYOSCB_COMPARE_GREEDY);
81 cl_tb_seq_item ctsi = cl_tb_seq_item::type_id::create("ctsi");
83 this.scb_env.syoscb[0].add_item("Q2", "P1", ctsi);
87 if(this.scb_env.syoscb[0].get_total_queue_size() != 0) begin
88 `uvm_error("TEST", $sformatf("After GREEDY, SCB now has %0d items", this.scb_env.syoscb[0].get_total_queue_size()))
93 this.syoscb_cfgs.syoscb_cfg[0].set_trigger_greediness(pk_syoscb::SYOSCB_COMPARE_NOT_GREEDY);
98 cl_tb_seq_item ctsi = cl_tb_seq_item::type_id::create("ctsi");
100 this.scb_env.syoscb[0].add_item("Q2", "P1", ctsi);
103 if(this.scb_env.syoscb[0].get_total_queue_size() != 18) begin
104 `uvm_warning("TEST", $sformatf("After NOT_GREEDY, SCB now has %0d items", this.scb_env.syoscb[0].get_total_queue_size()))
107 phase.drop_objection(this);
110 function void cl_scb_test_ooo_std_trigger_greed::report_phase(uvm_phase phase);
111 int queue_size, id_count;
112 super.report_phase(phase);
114 queue_size = this.scb_env.syoscb[0].get_total_queue_size();
115 id_count = uvm_report_server::get_server().get_id_count("QUEUE_ERROR");
118 if(queue_size != 18) begin
119 `uvm_error("TEST", $sformatf("There were not 18 orphans total as expected, have %0d", queue_size))
120 end else if(id_count != 1) begin
121 `uvm_error("TEST", $sformatf("Did not generate a QUEUE_ERROR message. count=%0d", id_count))
123 `uvm_info("TEST", "All good", UVM_LOW)
125 endfunction: report_phase
OOO Compare test for validating that OOO compares respect the current greed level.