SyoSil ApS UVM Scoreboard  1.0.3.0
cl_scb_test_double_scb.svh
1 /// Base class for all SCB tests usings two scoreboards
2 
4  //-------------------------------------
5  // Non randomizable variables
6  //-------------------------------------
7 
8 
9  //-------------------------------------
10  // UVM Macros
11  //-------------------------------------
12  `uvm_component_utils(cl_scb_test_double_scb)
13 
14  //-------------------------------------
15  // Constructor
16  //-------------------------------------
17  extern function new(string name = "cl_scb_test_double_scb",
18  uvm_component parent = null);
19 
20  //-------------------------------------
21  // Class methods
22  //-------------------------------------
23  extern virtual function void pre_build();
24 
25  //-------------------------------------
26  // UVM Phase methods
27  //-------------------------------------
28  extern virtual function void build_phase(uvm_phase phase);
29 endclass : cl_scb_test_double_scb
30 
31 function cl_scb_test_double_scb::new(string name = "cl_scb_test_double_scb",
32  uvm_component parent = null);
33  super.new(name, parent);
34 endfunction : new
35 
36 function void cl_scb_test_double_scb::build_phase(uvm_phase phase);
37  this.pre_build();
38 
39  super.build_phase(phase);
40 
41  uvm_config_db #(cl_syoscb_cfgs)::set(this, "scb_env",
42  "cfg", this.syoscb_cfgs);
43 
44  this.scb_env = cl_tb_env_scb::type_id::create("scb_env", this);
45 endfunction: build_phase
46 
47 // Creates and sets up cfg objects for each scoreboard
48 function void cl_scb_test_double_scb::pre_build();
49  cl_tb_cfg_rnd cfg_rnd[pk_tb::NO_OF_SCB];
50 
51  this.syoscb_cfgs = cl_syoscb_cfgs::type_id::create("syoscb_cfgs");
52  this.syoscb_cfgs.init(pk_tb::NO_OF_SCB);
53 
54  foreach(this.syoscb_cfgs.syoscb_cfg[i]) begin
55  cfg_rnd[i] = this.config_create_and_randomize();
56  this.syoscb_cfgs.syoscb_cfg[i] = cl_syoscb_cfg::type_id::create($sformatf("syoscb_cfg%0d", i));
57 
58  //Init queues: Sets up queue name and producer links,
59  this.syoscb_cfgs.syoscb_cfg[i].init($sformatf("syoscb%0d", i), '{"Q1", "Q2"}, '{"P1", "P2", "P3"});
60 
61  // Set the maximum queue size for Q1 to 100 elements
62  this.syoscb_cfgs.syoscb_cfg[i].set_max_queue_size("Q1", 100);
63 
64  //Set queue type and compare type defaults for all of the included tests
65  this.syoscb_cfgs.syoscb_cfg[i].set_compare_type(pk_syoscb::SYOSCB_COMPARE_IO);
66  this.syoscb_cfgs.syoscb_cfg[i].set_queue_type(pk_syoscb::SYOSCB_QUEUE_STD);
67 
68  // Set the primary queue
69  if (cfg_rnd[i].dynamic_primary_queue == 1'b0) begin
70  if(!this.syoscb_cfgs.syoscb_cfg[i].set_primary_queue("Q1")) begin
71  `uvm_fatal("CFG_ERROR", "syoscb_cfg.set_primary_queue call failed!")
72  end
73  end
74  end
75 endfunction: pre_build
Base class for all SCB tests usings two scoreboards.
Base class for all SCB tests.

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