13 typedef enum {Q1FULL,Q1COMPLEX} t_scenario;
14 typedef enum {SMALL,LARGE} t_size;
28 extern function new(
string name =
"cl_scb_test_ooo_heavy_base", uvm_component parent = null);
33 extern virtual function void pre_build();
34 extern function void build_phase(uvm_phase phase);
35 extern task run_phase(uvm_phase phase);
37 extern function void do_q1full();
41 function cl_scb_test_ooo_heavy_base::new(
string name =
"cl_scb_test_ooo_heavy_base",
42 uvm_component parent = null);
43 super.new(name, parent);
46 function void cl_scb_test_ooo_heavy_base::pre_build();
49 this.syoscb_cfgs.syoscb_cfg[0].set_compare_type(pk_syoscb::SYOSCB_COMPARE_OOO);
50 endfunction: pre_build
52 function void cl_scb_test_ooo_heavy_base::build_phase(uvm_phase phase);
57 super.build_phase(phase);
58 void'(uvm_config_db#(uvm_bitstream_t)::get(this,"","events",this.N)); 59 void'(uvm_config_db#(uvm_bitstream_t)::
get(
this,
"",
"size",size));
60 void'(uvm_config_db#(uvm_bitstream_t)::get(this,"","sc",sc)); 61 this.item_size = t_size'(size);
62 this.scenario = t_scenario
'(sc); 63 endfunction: build_phase 65 task cl_scb_test_ooo_heavy_base::run_phase(uvm_phase phase); 66 phase.raise_objection(this); 68 super.run_phase(phase); 75 `uvm_fatal("SCENARIO_ERROR", $sformatf("Unknown scenario:%s",this.scenario.name())); 79 phase.drop_objection(this); 82 function void cl_scb_test_ooo_heavy_base::do_q1full(); 83 cl_tb_seq_item items[]; 85 cl_tb_seq_item cur_item; 91 cur_item = cl_tb_seq_item::type_id::create("cur_item"); 93 if (item_size == SMALL) begin 94 cur_item.use_data = 0; 96 cur_item.use_data = 1; 99 for(int i=0; i<this.N; i++) begin 100 cl_tb_seq_item item_clone; 102 if(!cur_item.randomize()) begin 103 `uvm_fatal("QUEUE_ERROR", $sformatf("Randomization fail for item %d",i)); 107 `uvm_info("Inserts", $sformatf("%d: ", i), UVM_NONE); 110 if(!$cast(item_clone, cur_item.clone())) begin 111 `uvm_fatal("QUEUE_ERROR", $sformatf("[%d]: Unable to cast cloned item to uvm_sequence_item",i)); 114 scb_env.syoscb[0].add_item("Q1", "P1", cur_item); 121 for(int i=0; i<this.N ; i++) begin 123 if(!idx_q2.randomize() with {int_a>=0; 124 int_a<local::this.N;}) begin 125 `uvm_fatal("QUEUE_ERROR", $sformatf("Randomization fail for index of item %d",i)); 128 scb_env.syoscb[0].add_item("Q2", "P1", items[idx_q2.int_a]); 131 `uvm_info("Compares",$sformatf("%d: ", i), UVM_NONE); 135 endfunction : do_q1full Heavy OOO compare test using the function based API.