8 string suffix =
"") extends cl_scb_test_single_scb;
17 extern function new(
string name =
"cl_scb_test_cmp_base", uvm_component parent = null);
22 extern task run_phase(uvm_phase phase);
23 extern function void end_of_elaboration_phase(uvm_phase phase);
24 extern function void check_phase(uvm_phase phase);
29 typedef cl_tb_arr_wrapper#(ATYPE) stim_wrapper;
34 extern virtual function void drive_stimuli(
string queue,
string producer, stim_wrapper stim);
37 function cl_scb_test_cmp_base::new(
string name =
"cl_scb_test_cmp_base", uvm_component parent = null);
38 super.new(name, parent);
41 function void cl_scb_test_cmp_base::end_of_elaboration_phase(uvm_phase phase);
42 super.end_of_elaboration_phase(phase);
44 this.syoscb_cfgs.syoscb_cfg[0].set_default_enable_comparer_report(1
'b1); 45 endfunction: end_of_elaboration_phase 47 task cl_scb_test_cmp_base::run_phase(uvm_phase phase); 48 stim_wrapper stim1, stim2; 51 phase.raise_objection(this); 52 super.run_phase(phase); 53 //Demote COMPARE_ERROR as we expect to have exactly one of these 54 uvm_root::get().set_report_severity_id_override(UVM_ERROR, "COMPARE_ERROR", UVM_INFO); 56 //Generate randomized stim - we will copy the data from these into the actual transactions (see drive_stimuli) 57 stim1 = stim_wrapper::type_id::create("stim1"); 58 stim2 = stim_wrapper::type_id::create("stim2"); 59 if(!stim1.randomize() with {stim1.items.size() > 10;}) begin 60 `uvm_fatal("RND", "Unable to randomize stimulus wrapper") 63 //We want to ensure that errors are detected, so we make the last items in each stim packet a no-match 64 //Will be an error for IO-compare, will just be a no-match for OOO compare 66 sz = stim2.items.size(); 67 stim2.items[sz-1].ival += 1; 68 stim2.items[sz-2].iobj.ival += 1; 69 stim2.items[sz-3].iobj.iobj.int_a += 1; 70 stim2.items[sz-4].iobj.iobjs[0].int_a += 1; 71 stim2.items[sz-5].iobjs[0].ival += 1; 72 stim2.items[sz-6].iobjs[0].iobj.int_a += 1; 73 stim2.items[sz-7].iobjs[0].iobjs[0].int_a += 1; 76 this.drive_stimuli("Q1", "P1", stim1); 77 this.drive_stimuli("Q2", "P1", stim2); 80 this.scb_env.syoscb[0].flush_queues(); 82 phase.drop_objection(this); 85 function void cl_scb_test_cmp_base::check_phase(uvm_phase phase); 87 super.check_phase(phase); 89 num_flush = this.scb_env.syoscb[0].get_total_cnt_flushed_items(); 91 //We expect to have flushed a total of 14 items 92 if(num_flush != 14) begin 93 `uvm_error("TEST", $sformatf("Number of flushed items was not 14 as expected, flushed %0d items instead", num_flush)) 95 endfunction: check_phase 97 function void cl_scb_test_cmp_base::drive_stimuli(string queue, string producer, stim_wrapper stim); 98 foreach(stim.items[i]) begin 99 scb_env.syoscb[0].add_item(queue, producer, stim.items[i]); Base class for field macro/manual do_compare comparison tests.
A "b" type item which used a field macros instead of manually implementing do_compare.
An "a" type item which used a field macros instead of manually implementing do_compare.