SyoSil ApS UVM Scoreboard  1.0.3.0
cl_scb_test_ooo_std_primary_multiple.svh
1 /// OOO compare test for ensuring that multiple items in the primary queue are checked against the secondary queue.
2 /// If eg. cl_syoscb_cfg#max_search_window = 5, the first 5 items in the primary queue shall be compared
3 /// against the first 5 elements in all secondary queues.
4 class cl_scb_test_ooo_std_primary_multiple extends cl_scb_test_single_scb;
5  //-------------------------------------
6  // Non randomizable variables
7  //-------------------------------------
8 
9 
10  //-------------------------------------
11  // UVM Macros
12  //-------------------------------------
13  `uvm_component_utils_begin(cl_scb_test_ooo_std_primary_multiple)
14 
15  `uvm_component_utils_end
16 
17  //-------------------------------------
18  // Constructor
19  //-------------------------------------
20  function new(string name = "cl_scb_test_ooo_std_primary_multiple", uvm_component parent = null);
21  super.new(name, parent);
22  endfunction: new
23 
24  //-------------------------------------
25  // Functions
26  //-------------------------------------
27  extern virtual function void pre_build();
28  extern task run_phase(uvm_phase phase);
29 
31 
32 function void cl_scb_test_ooo_std_primary_multiple::pre_build();
33  super.pre_build();
34 
35  this.syoscb_cfgs.syoscb_cfg[0].set_compare_type(pk_syoscb::SYOSCB_COMPARE_OOO);
36  void'(this.syoscb_cfgs.syoscb_cfg[0].set_primary_queue("Q1"));
37 endfunction: pre_build
38 
39 task cl_scb_test_ooo_std_primary_multiple::run_phase(uvm_phase phase);
40  phase.raise_objection(this);
41  super.run_phase(phase);
42 
43  //Add items to both queues. First item in Q1 does not match anything, but we will still have matches
44  begin
45  cl_tb_seq_item item = cl_tb_seq_item::type_id::create("item"); //This should not match anything yet
46  item.int_a = 1234;
47  this.scb_env.syoscb[0].add_item("Q1", "P1", item);
48  end
49 
50  //These items should all match
51  fork
52  begin
53  for(int i=0; i<10; i++) begin
54  cl_tb_seq_item item1 = cl_tb_seq_item::type_id::create("item1");
55  item1.int_a = i;
56  this.scb_env.syoscb[0].add_item("Q1", "P1", item1);
57  end
58  end
59 
60  begin
61  for(int i=9; i>=0; i--) begin
62  cl_tb_seq_item item2 = cl_tb_seq_item::type_id::create("item2");
63  item2.int_a = i;
64  this.scb_env.syoscb[0].add_item("Q2", "P1", item2);
65  end
66  end
67  join
68 
69  //Add a final object which matches the initial insertion into Q1
70  begin
71  cl_tb_seq_item item = cl_tb_seq_item::type_id::create("item");
72  item.int_a = 1234;
73  this.scb_env.syoscb[0].add_item("Q2", "P1", item);
74  end
75 
76  //Expect 11 matches and 22 insertions
77  if(this.scb_env.syoscb[0].get_total_cnt_add_items() != 22) begin
78  `uvm_error("TEST_ERROR", $sformatf("Did not have exactly 22 item added to the scb. Total number was %0d", this.scb_env.syoscb[0].get_total_cnt_add_items()))
79  end
80 
81 
82  phase.drop_objection(this);
83 endtask: run_phase
OOO compare test for ensuring that multiple items in the primary queue are checked against the second...

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