SyoSil ApS UVM Scoreboard  1.0.3.0
cl_scb_test_iop_std_msw.svh
1 /// This test ensures that IOP compares correctly search through the primary queue,
2 /// comparing not only the first item but also subsequent items for matches.
3 class cl_scb_test_iop_std_msw extends cl_scb_test_single_scb;
4  //-------------------------------------
5  // Non randomizable variables
6  //-------------------------------------
7 
8 
9  //-------------------------------------
10  // UVM Macros
11  //-------------------------------------
12  `uvm_component_utils_begin(cl_scb_test_iop_std_msw)
13 
14  `uvm_component_utils_end
15 
16  //-------------------------------------
17  // Constructor
18  //-------------------------------------
19  function new(string name = "cl_scb_test_iop_std_msw", uvm_component parent = null);
20  super.new(name, parent);
21  endfunction: new
22 
23  //-------------------------------------
24  // Functions
25  //-------------------------------------
26  extern function void pre_build();
27  extern task run_phase(uvm_phase phase);
28 
29 
31 
32 function void cl_scb_test_iop_std_msw::pre_build();
33  super.pre_build();
34 
35  this.syoscb_cfgs.syoscb_cfg[0].set_compare_type(pk_syoscb::SYOSCB_COMPARE_IOP);
36  if(!this.syoscb_cfgs.syoscb_cfg[0].set_primary_queue("Q2")) begin
37  `uvm_fatal("cl_scb_test_iop_std_msw", "Unable to set primary queue")
38  end
39 endfunction: pre_build
40 
41 task cl_scb_test_iop_std_msw::run_phase(uvm_phase phase);
42  uvm_report_server rs;
43 
44  cl_tb_seq_item ctsi1, ctsi2, ctsi3;
45  phase.raise_objection(this);
46  super.run_phase(phase);
47 
48  ctsi1 = cl_tb_seq_item::type_id::create("ctsi1");
49  ctsi2 = cl_tb_seq_item::type_id::create("ctsi2");
50  ctsi3 = cl_tb_seq_item::type_id::create("ctsi3");
51 
52  if(!ctsi1.randomize()) begin
53  `uvm_fatal("RAND", "Unable to randomize ctsi1")
54  end
55 
56  if(!ctsi2.randomize()) begin
57  `uvm_fatal("RAND", "Unable to randomize ctsi2")
58  end
59 
60  if(!ctsi3.randomize()) begin
61  `uvm_fatal("RAND", "Unable to randomize ctsi3")
62  end
63 
64  ctsi1.int_a = 1;
65  ctsi2.int_a = 2;
66  ctsi3.int_a = 3;
67 
68  //Insert items into Q1 in order P1,P2
69  //Insert items into Q2 in order P3,P1
70  //Once all are inserted, we expect P1/P1 to match and P2/P3 to still be in queue
71  this.scb_env.syoscb[0].add_item("Q1", "P1", ctsi1);
72  this.scb_env.syoscb[0].add_item("Q1", "P2", ctsi2);
73 
74  this.scb_env.syoscb[0].add_item("Q2", "P3", ctsi3);
75  this.scb_env.syoscb[0].add_item("Q2", "P1", ctsi1);
76 
77  if(!(this.scb_env.syoscb[0].get_total_cnt_add_items() == 4
78  && this.scb_env.syoscb[0].get_total_queue_size() == 2)) begin
79  `uvm_error("TEST", "Did not generate a match with ctsi1 in both queues");
80  end else begin
81  //No error, add remaining items to make test pass
82  this.scb_env.syoscb[0].add_item("Q1", "P3", ctsi3);
83  this.scb_env.syoscb[0].add_item("Q2", "P2", ctsi2);
84  end
85 
86  phase.drop_objection(this);
87 endtask: run_phase
This test ensures that IOP compares correctly search through the primary queue, comparing not only th...

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