SyoSil ApS UVM Scoreboard  1.0.3.0
cl_scb_test_ooo_std_max_search_window.svh
1 /// Simple OOO compare test using the function based API and the max_search_window knob to control
2 /// OOO compare searches
3 class cl_scb_test_ooo_std_max_search_window extends cl_scb_test_single_scb;
4  //-------------------------------------
5  // UVM Macros
6  //-------------------------------------
7  `uvm_component_utils(cl_scb_test_ooo_std_max_search_window)
8 
9  //-------------------------------------
10  // Constructor
11  //-------------------------------------
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();
14  //-------------------------------------
15  // UVM Phase methods
16  //-------------------------------------
17  extern task run_phase(uvm_phase phase);
18  extern virtual function void check_phase(uvm_phase phase);
20 
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);
24 endfunction : new
25 
26 function void cl_scb_test_ooo_std_max_search_window::pre_build();
27  super.pre_build();
28 
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();
34 
35 endfunction : pre_build
36 
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);
40 
41  //Push in a number of transactions that we wish to match on
42  for(int unsigned i=0; i<10; i++) begin
43  cl_tb_seq_item item1;
44  item1 = cl_tb_seq_item::type_id::create("item1");
45  item1.int_a = i;
46  scb_env.syoscb[0].add_item("Q1", "P1", item1);
47  end
48 
49  //Push in transactions to Q2 which should not match in Q1
50  //Since we're pushing them in reverse order, no matches should be found
51  //Q1: 0 1 2 3 4 5 6 7 8 9
52  //Q2: 9 8 7 6 5 4 3 2 1 0
53  //msw: -------^
54  for(int i=9; i>=0; i--) begin
55  cl_tb_seq_item item2;
56  item2 = cl_tb_seq_item::type_id::create("item2");
57  item2.int_a = i;
58  scb_env.syoscb[0].add_item("Q2", "P1", item2);
59  end
60 
61  //At this point, we expect there to have been 0 matches, 20 insertions
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()),
65  UVM_LOW)
66 
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()))
69  end
70 
71  this.syoscb_cfgs.syoscb_cfg[0].set_max_search_window(0, {});
72  //By setting max_search_window == 0, the remaining transactions will be removed in cl_syoscb_compare::extract_phase
73 
74  phase.drop_objection(this);
75 endtask: run_phase
76 
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()));
80  end
81 endfunction: check_phase
Simple OOO compare test using the function based API and the max_search_window knob to control OOO co...

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