SyoSil ApS UVM Scoreboard  1.0.3.0
cl_scb_test_io_std_comparer_report.svh
1 /// Illustrates how to use queue/producer-specific comparers instead of a default comparer.
2 // By using set_comparer_verbosity, the comparer report is shown/hidden after the scoreboard's COMPARE_ERROR message
3 class cl_scb_test_io_std_comparer_report extends cl_scb_test_single_scb;
4  //-------------------------------------
5  // UVM Macros
6  //-------------------------------------
7  `uvm_component_utils(cl_scb_test_io_std_comparer_report)
8 
9  //-------------------------------------
10  // Constructor
11  //-------------------------------------
12  extern function new(string name = "cl_scb_test_io_std_comparer_report",
13  uvm_component parent = null);
14 
15  //-------------------------------------
16  // UVM Phase methods
17  //-------------------------------------
18  extern task run_phase(uvm_phase phase);
19 
20  //Adds some items where they match
21  task add_match(string producer);
22  cl_tb_seq_item item1;
23  cl_tb_seq_item item2;
24  fork
25  for(int i=0; i<2; i++) begin
26  item1 = cl_tb_seq_item::type_id::create("item1");
27  item1.int_a = i;
28  this.scb_env.syoscb[0].add_item("Q1", producer, item1);
29  end
30  for(int i=0; i<2; i++) begin
31  item2 = cl_tb_seq_item::type_id::create("item2");
32  item2.int_a = i;
33  this.scb_env.syoscb[0].add_item("Q2", producer, item2);
34  end
35  join
36  endtask: add_match
37 
38  //Adds some items where they don't match
39  task add_nomatch(string producer);
40  cl_tb_seq_item item1;
41  cl_tb_seq_item item2;
42  fork
43  begin
44  item1 = cl_tb_seq_item::type_id::create("item1");
45  item1.int_a = 4;
46  this.scb_env.syoscb[0].add_item("Q1", producer, item1);
47  end
48  begin
49  item2 = cl_tb_seq_item::type_id::create("item2");
50  item2.int_a = 44;
51  this.scb_env.syoscb[0].add_item("Q2", producer, item2);
52  end
53  join
54  endtask: add_nomatch
55 endclass: cl_scb_test_io_std_comparer_report
56 
57 function cl_scb_test_io_std_comparer_report::new(string name = "cl_scb_test_io_std_comparer_report",
58  uvm_component parent = null);
59  super.new(name, parent);
60 endfunction: new
61 
62 task cl_scb_test_io_std_comparer_report::run_phase(uvm_phase phase);
63  uvm_comparer q2p1, q2p2;
64 
65  phase.raise_objection(this);
66 
67  super.run_phase(phase);
68 
69  //Constant cfg knob settings
70  uvm_root::get().set_report_severity_id_override(UVM_ERROR, "COMPARE_ERROR", UVM_INFO);
71 
72  //Create comparers and configure them before setting them info config object
73  q2p1 = new;
74  q2p2 = new;
75  this.scb_env.syoscb_cfgs.syoscb_cfg[0].set_enable_comparer_report(1'b0, '{"Q2"}, {"P1"});
76  this.scb_env.syoscb_cfgs.syoscb_cfg[0].set_enable_comparer_report(1'b1, '{"Q2"}, {"P2"});
77 
78  cl_syoscb_comparer_config::set_verbosity(q2p1, UVM_HIGH);
79  cl_syoscb_comparer_config::set_verbosity(q2p2, UVM_HIGH);
80 
81  this.scb_env.syoscb_cfgs.syoscb_cfg[0].set_comparer(q2p1, '{"Q2"}, '{"P1"});
82  this.scb_env.syoscb_cfgs.syoscb_cfg[0].set_comparer(q2p2, '{"Q2"}, '{"P2"});
83 
84  //Add from P1. Since verbosity=UVM_HIGH and comparer report is disabled on P1,
85  // the comparer report is not printed, giving no hints as to where the error occured
86  add_match("P1");
87  add_nomatch("P1");
88  //Flush queue before moving on
89  this.scb_env.syoscb[0].flush_queues();
90 
91  //Add from P2. Now the comparer report is enabled and will be printed
92  add_match("P2");
93  add_nomatch("P2");
94  //Flush queue before finishing
95  this.scb_env.syoscb[0].flush_queues();
96  phase.drop_objection(this);
97 endtask: run_phase
Illustrates how to use queue/producer-specific comparers instead of a default comparer.

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:37:01
Find a documentation bug? Report bugs to: scoreboard@syosil.com