SyoSil ApS UVM Scoreboard  1.0.3.0
cl_scb_test_base.svh
1 /// Base class for all SCB tests
2 class cl_scb_test_base extends uvm_test;
3  //-------------------------------------
4  // Non randomizable variables
5  //-------------------------------------
6  cl_tb_env_scb scb_env;
7 
8  cl_syoscb_cfgs syoscb_cfgs;
9 
10  //-------------------------------------
11  // UVM Macros
12  //-------------------------------------
13  `uvm_component_utils(cl_scb_test_base)
14 
15  //-------------------------------------
16  // Constructor
17  //-------------------------------------
18  extern function new(string name = "cl_scb_test_base",
19  uvm_component parent = null);
20 
21  //-------------------------------------
22  // Class methods
23  //-------------------------------------
24  extern virtual function void pre_build();
25  extern virtual function cl_tb_cfg_rnd config_create_and_randomize();
26 
27  //-------------------------------------
28  // UVM Phase methods
29  //-------------------------------------
30 endclass : cl_scb_test_base
31 
32 function cl_scb_test_base::new(string name = "cl_scb_test_base",
33  uvm_component parent = null);
34  super.new(name, parent);
35 endfunction : new
36 
37 function void cl_scb_test_base::pre_build();
38  `uvm_fatal("IMPL_ERROR",
39  $sformatf("[%p]: cl_scb_test_base::pre_build() *MUST* be overwritten",
40  this.scb_env.syoscb));
41 endfunction: pre_build
42 
43 // Utility function. Creates and returns a set
44 // of randomized fields for randomizing a configuration
45 function cl_tb_cfg_rnd cl_scb_test_base::config_create_and_randomize();
46  cl_tb_cfg_rnd l_cfg_rnd;
47  l_cfg_rnd = cl_tb_cfg_rnd::type_id::create("l_cfg_rnd");
48 
49  if (!l_cfg_rnd.randomize()) begin
50  `uvm_fatal("ENV_SCB", "randomization of cfg_rnd failed")
51  end
52  else begin
53  return l_cfg_rnd;
54  end
55 endfunction: config_create_and_randomize
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:32
Find a documentation bug? Report bugs to: scoreboard@syosil.com