7 `uvm_component_utils(cl_scb_test_ooo_std_max_search_window)
12 extern function new(string name = "cl_scb_test_ooo_std_max_search_window", uvm_component parent = null);
13 extern
virtual function void pre_build();
17 extern task run_phase(uvm_phase phase);
18 extern
virtual function void check_phase(uvm_phase phase);
21 function cl_scb_test_ooo_std_max_search_window::new(string name = "cl_scb_test_ooo_std_max_search_window",
22 uvm_component parent = null);
23 super.new(name, parent);
26 function void cl_scb_test_ooo_std_max_search_window::pre_build();
29 this.syoscb_cfgs.syoscb_cfg[0].set_compare_type(pk_syoscb::SYOSCB_COMPARE_OOO);
30 this.syoscb_cfgs.syoscb_cfg[0].set_max_search_window(5, {});
31 this.syoscb_cfgs.syoscb_cfg[0].set_max_print_orphans(0);
32 this.syoscb_cfgs.syoscb_cfg[0].set_trigger_greediness(pk_syoscb::SYOSCB_COMPARE_NOT_GREEDY);
33 this.syoscb_cfgs.syoscb_cfg[0].print();
35 endfunction : pre_build
37 task cl_scb_test_ooo_std_max_search_window::run_phase(uvm_phase phase);
38 phase.raise_objection(this);
39 super.run_phase(phase);
42 for(int unsigned i=0; i<10; i++) begin
44 item1 = cl_tb_seq_item::type_id::create("item1");
46 scb_env.syoscb[0].add_item("Q1", "P1", item1);
54 for(int i=9; i>=0; i--) begin
56 item2 = cl_tb_seq_item::type_id::create("item2");
58 scb_env.syoscb[0].add_item("Q2", "P1", item2);
62 `uvm_info("TEST", $sformatf("Total items inserted: %0d. Total items remaining in SCB: %0d",
63 scb_env.syoscb[0].get_total_cnt_add_items(),
64 scb_env.syoscb[0].get_total_queue_size()),
67 if(scb_env.syoscb[0].get_total_queue_size() != 20) begin
68 `uvm_error("TEST", $sformatf("Items have been removed from the SCB. Expected 20 items remaining, found %0d", scb_env.syoscb[0].get_total_queue_size()))
71 this.syoscb_cfgs.syoscb_cfg[0].set_max_search_window(0, {});
74 phase.drop_objection(this);
77 function void cl_scb_test_ooo_std_max_search_window::check_phase(uvm_phase phase);
78 if(scb_env.syoscb[0].get_total_queue_size() != 0) begin
79 `uvm_error("TEST", $sformatf("All queue items have not been drained, %0d items remaining, expected 0", scb_env.syoscb[0].get_total_queue_size()));
81 endfunction: check_phase
Simple OOO compare test using the function based API and the max_search_window knob to control OOO co...