SyoSil ApS UVM Scoreboard  1.0.3.0
cl_syoscbs.svh
1 /// Default implementation of a scoreboard wrapper.
2 /// FIN: The type of input transactions. Output transactions will be of type uvm_sequence_item
3 class cl_syoscbs #(type FIN = int) extends cl_syoscbs_base;
4 
5  /// Define the filter transform type for the wrapper
6  typedef pk_utils_uvm::filter_trfm #(FIN, uvm_sequence_item) tp_wrapper_filter_trfm;
7 
8  //-------------------------------------
9  // UVM_Macros
10  //-------------------------------------
11  `uvm_component_param_utils_begin(cl_syoscbs#(FIN))
12 
13  `uvm_component_utils_end
14 
15  //-------------------------------------
16  // Constructor
17  //-------------------------------------
18  extern function new(string name = "cl_syoscbs", uvm_component parent = null);
19 
20  //-------------------------------------
21  // UVM Phase methods
22  //-------------------------------------
23  extern virtual function void build_phase(uvm_phase phase);
24  extern virtual function void connect_phase(uvm_phase phase);
25 
26  //-------------------------------------
27  // Misc. functions for internal usage
28  //-------------------------------------
29  extern virtual protected function void create_filter(input string queue_name,
30  input string producer_name,
31  input int unsigned idx);
32  extern virtual protected function void connect_filter_and_subscriber(input string queue_name,
33  input string producer_name,
34  input int unsigned idx);
35 
36 
37  // *NOTE*: Function has to inline to work across all simulators
38  // Some have problems accepting FIN in the return type, stating that FIN is not defined
39  /// Gets a handle to a filter transform
40  /// This convenience wrapper gets a filter transform and typecasts it to the correct
41  /// type for the user
42  /// \param queue_name The name of the queue to connect the filter to
43  /// \param producer_name The name of the producer that produced data going into this filter
44  /// \param idx The index of the scoreboard in which this queue exists
45  /// \return A filter transform object, if all parameters are valid.
46  /// If the parameters do not specify a valid filter, returns null and prints a UVM_INFO/DEBUG message
47  virtual function cl_syoscbs::tp_wrapper_filter_trfm get_filter_trfm(string queue_name,
48  string producer_name,
49  int unsigned idx);
51  uvm_component ft_orig;
52  ft_orig = this.get_filter_trfm_base(queue_name, producer_name, idx);
53  if(ft_orig == null) begin
54  ft = null;
55  end else begin
56  if(!$cast(ft, ft_orig)) begin
57  `uvm_fatal("TYPECAST",$sformatf("Unable to typecast filter transform from uvm_component to %0p. Type was %0p",ft.get_type(), ft_orig.get_type()))
58  end
59  end
60  return ft;
61 endfunction: get_filter_trfm
62 endclass: cl_syoscbs
63 
64 function cl_syoscbs::new(string name = "cl_syoscbs", uvm_component parent = null);
65  super.new(name, parent);
66 endfunction: new
67 
68 function void cl_syoscbs::build_phase(uvm_phase phase);
69  super.build_phase(phase);
70 
71  foreach (this.scbs[i]) begin
72  cl_syoscb_cfg tmp_cfg = this.cfg.get_cfg(i);
73  this.create_filters(i, tmp_cfg);
74  end
75 endfunction: build_phase
76 
77 function void cl_syoscbs::connect_phase(uvm_phase phase);
78  super.connect_phase(phase);
79 
80  foreach (this.fts[i]) begin
81  cl_syoscb_cfg tmp_cfg = this.cfg.get_cfg(i);
82  this.connect_filters(i, tmp_cfg);
83  end
84 endfunction: connect_phase
85 
86 function void cl_syoscbs::create_filter(input string queue_name,
87  input string producer_name,
88  input int unsigned idx);
89  // ft_name (filter name) = ft_<queue_name>_<producer_name>[<scoreboard index>]
90  string ft_name = $sformatf("ft_%s_%s[%0d]", queue_name, producer_name, idx);
91 
92  this.fts[idx][queue_name][producer_name] = cl_syoscbs::tp_wrapper_filter_trfm::type_id::create(ft_name, this);
93 endfunction: create_filter
94 
95 function void cl_syoscbs::connect_filter_and_subscriber(input string queue_name,
96  input string producer_name,
97  input int unsigned idx);
98  cl_syoscb_subscriber scb_subscriber;
99  uvm_component ft_orig;
101 
102  scb_subscriber = this.scbs[idx].get_subscriber(queue_name, producer_name);
103  ft_orig = this.fts[idx][queue_name][producer_name];
104  if(!$cast(ft, ft_orig)) begin
105  `uvm_fatal("TYPECAST", $sformatf("Unable to typecast filter transform from uvm_component to %p", ft.get_type_name()))
106  end
107 
108  ft.ap.connect(scb_subscriber.analysis_export);
109 endfunction: connect_filter_and_subscriber
uvm_component fts[][string][string]
Array holding handles to filter transforms, used to transform inputs of one type to outputs of anothe...
Base class for a wrapper around multiple SyoSil Scoreboards.
cl_syoscb scbs[]
Array holding handles to all scoreboards.
virtual void build_phase(uvm_phase phase)
UVM build phase.
Definition: cl_syoscbs.svh:68
virtual cl_syoscbs_cfg get_cfg()
Gets the configuration object associated with this scoreboard wrapper.
Generic subscriber for the scoreboard.
virtual void connect_phase(uvm_phase phase)
UVM connect phase. syoscbs_base only calls super.connect_phase.
Definition: cl_syoscbs.svh:77
virtual void connect_filters(int unsigned idx, cl_syoscb_cfg cfg)
Connects all filter transforms with their respective subscribers in the scoreboard.
cl_syoscbs_cfg cfg
Handle to scoreboard wrapper configuration object.
Default implementation of a scoreboard wrapper.
Definition: cl_syoscbs.svh:3
virtual void create_filters(int unsigned idx, cl_syoscb_cfg cfg)
Create all filter transforms for the given scoreboard.
virtual cl_syoscbs::tp_wrapper_filter_trfm get_filter_trfm(string queue_name, string producer_name, int unsigned idx)
Gets a handle to a filter transform This convenience wrapper gets a filter transform and typecasts it...
Definition: cl_syoscbs.svh:47
Configuration class for the SyoSil UVM scoreboard.
virtual uvm_component get_filter_trfm_base(string queue_name, string producer_name, int unsigned idx)
Scoreboard Wrapper API: Gets a handle to a filter transform as a uvm_component.
Base class for a filter transformation.
Definition: pk_utils_uvm.sv:18

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