SyoSil ApS UVM Scoreboard  1.0.3.0
cl_scb_test_ooo_std_dump_orphans.svh
1 /// This test uses the dump_orphans_to_files configuration knob
2 class cl_scb_test_ooo_std_dump_orphans extends cl_scb_test_single_scb;
3  //-------------------------------------
4  // Non randomizable variables
5  //-------------------------------------
6 
7 
8  //-------------------------------------
9  // UVM Macros
10  //-------------------------------------
11  `uvm_component_utils_begin(cl_scb_test_ooo_std_dump_orphans)
12 
13  `uvm_component_utils_end
14 
15  //-------------------------------------
16  // Constructor
17  //-------------------------------------
18  extern function new(string name = "cl_scb_test_ooo_std_dump_orphans", uvm_component parent = null);
19 
20  //-------------------------------------
21  // Functions
22  //-------------------------------------
23  extern task run_phase(uvm_phase phase);
24  extern virtual function void pre_build();
25 
26 
28 
29 function cl_scb_test_ooo_std_dump_orphans::new(string name = "cl_scb_test_ooo_std_dump_orphans", uvm_component parent = null);
30  super.new(name, parent);
31 endfunction: new
32 
33 function void cl_scb_test_ooo_std_dump_orphans::pre_build();
34  uvm_printer tree_printer;
35  super.pre_build();
36 
37  //Using OOO compare to avoid errors on the known miscompares
38  this.syoscb_cfgs.syoscb_cfg[0].set_compare_type(pk_syoscb::SYOSCB_COMPARE_OOO);
39  tree_printer = cl_syoscb_printer_config::get_printer_of_type(pk_syoscb::SYOSCB_PRINTER_TREE);
40  this.syoscb_cfgs.syoscb_cfg[0].set_printer(tree_printer, '{"Q2"}, '{"P1"});
41 
42  this.syoscb_cfgs.syoscb_cfg[0].set_dump_orphans_to_files(1'b1); //Print to file
43  this.syoscb_cfgs.syoscb_cfg[0].set_max_print_orphans(0); //Print all orphans (5 in Q1, 2 in Q2)
44 endfunction : pre_build
45 
46 task cl_scb_test_ooo_std_dump_orphans::run_phase(uvm_phase phase);
47  phase.raise_objection(this);
48 
49  super.run_phase(phase);
50  this.scb_env.syoscb[0].set_report_severity_id_override(UVM_ERROR, "QUEUE_ERROR", UVM_INFO); //Demote the error that is triggered due to orphans
51 
52  //Add items
53  fork
54  for(int unsigned i=0; i<10; i++) begin
55  cl_tb_seq_item item1;
56  item1 = cl_tb_seq_item::type_id::create("item1");
57  item1.int_a = i;
58  this.scb_env.syoscb[0].add_item("Q1", "P1", item1);
59  end
60 
61  for(int unsigned i=0; i<5; i++) begin //Only match the first 5 items in Q1, leaving 5 orphans in Q1
62  cl_tb_seq_item item1;
63  item1 = cl_tb_seq_item::type_id::create("item1");
64  item1.int_a = i;
65  this.scb_env.syoscb[0].add_item("Q2", "P1", item1);
66  end
67 
68  for(int unsigned i=10; i<12; i++) begin //Add another 2 items to Q2 which will be orphaned
69  cl_tb_seq_item item1;
70  item1 = cl_tb_seq_item::type_id::create("item1");
71  item1.int_a = i;
72  this.scb_env.syoscb[0].add_item("Q2", "P1", item1);
73  end
74  join
75 
76  phase.drop_objection(this);
77 endtask: run_phase
static uvm_printer get_printer_of_type(t_printer_type ptype)
Generates a new printer of the correct type.
This test uses the dump_orphans_to_files configuration knob.

Project: SyoSil ApS UVM Scoreboard, Revision: 1.0.3.0

Copyright 2014-2022 SyoSil ApS
All Rights Reserved Worldwide

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
doxygen
Doxygen Version: 1.8.14
Generated with IDV SV Filter Version: 2.6.3
Fri Sep 2 2022 14:38:05
Find a documentation bug? Report bugs to: scoreboard@syosil.com