SyoSil ApS UVM Scoreboard  1.0.3.0
cl_syoscbs_cfg.svh
1 /// Configuration object for the cl_syoscbs_base scoreboard wrapper.
2 class cl_syoscbs_cfg extends uvm_object;
3  /// Array holding handles to all the UVM scoreboard configurations
4  local cl_syoscb_cfg cfgs[];
5 
6  /// Scoreboard wrapper name
7  local string scbs_name;
8 
9  /// Number of scoreboards
10  local int unsigned no_scbs;
11 
12  /// Whether to disable report printing in the report_phase.
13  /// - 0 => Reports are enabled
14  /// - 1 => Reports are disabled
15  local bit disable_report;
16 
17  /// Enable/disable the printing of scb statistics per queue by each scb
18  local bit enable_scb_stats[];
19 
20  /// Whether to print scoreboard wrapper configuration in the UVM build_phase
21  /// - 0 => Disable print of scb wrapper configuration
22  /// - 1 => Enable print of scb wrapper configuration
23  local bit print_cfg = 1'b1;
24 
25  //-------------------------------------
26  // UVM_Macros
27  //-------------------------------------
28  `uvm_object_utils_begin(cl_syoscbs_cfg)
29  `uvm_field_array_object(cfgs, UVM_DEFAULT | UVM_NOPRINT | UVM_REFERENCE)
30  `uvm_field_string(scbs_name, UVM_DEFAULT)
31  `uvm_field_int(no_scbs, UVM_DEFAULT | UVM_DEC)
32  `uvm_field_int(disable_report, UVM_DEFAULT)
33  `uvm_field_array_int(enable_scb_stats, UVM_DEFAULT)
34  `uvm_field_int(print_cfg, UVM_DEFAULT)
35  `uvm_object_utils_end
36 
37  //-------------------------------------
38  // Constructor
39  //-------------------------------------
40  extern function new(string name = "cl_syoscbs_cfg");
41 
42  //-------------------------------------
43  // Configuration API
44  //-------------------------------------
45  extern virtual function void init(string scbs_name="",
46  int unsigned no_scbs,
47  string scb_names[],
48  string queues[],
49  string producers[]);
50  extern virtual function void set_cfg(cl_syoscb_cfg cfg, int unsigned idx);
51  extern virtual function cl_syoscb_cfg get_cfg(int unsigned idx);
52  extern virtual function void set_no_scbs(int unsigned no_scbs);
53  extern virtual function int unsigned get_no_scbs();
54  extern virtual function void set_scbs_name(string scbs_name);
55  extern virtual function string get_scbs_name();
56  extern virtual function void set_scb_names(string scb_names[], int unsigned idxs[] = {});
57  extern virtual function void get_scb_names(output string scb_names[],
58  input int unsigned idxs[] = {});
59  extern virtual function void set_queues(string queues[], int unsigned idxs[] = {});
60  extern virtual function void get_queues(output string queues[], input int unsigned idx);
61  extern virtual function void set_producers(string producer, string queues[] = {},
62  int unsigned idxs[] = {});
63  extern virtual function void set_queue_type(t_scb_queue_type queue_types[],
64  int unsigned idxs[] = {});
65  extern virtual function void set_compare_type(t_scb_compare_type compare_types[],
66  int unsigned idxs[] = {});
67  extern virtual function int get_scb_index_by_name(string scb_name);
68  extern virtual function void set_scb_trigger_greediness(int unsigned idxs[] = {},
69  t_scb_compare_greed tg[]);
70  extern virtual function void get_scb_trigger_greediness(output t_scb_compare_greed tg[],
71  input int unsigned idxs[] = {});
72  extern virtual function void set_scb_end_greediness(int unsigned idxs[] = {},
73  t_scb_compare_greed eg[]);
74  extern virtual function void get_scb_end_greediness(output t_scb_compare_greed eg[],
75  input int unsigned idxs[] = {});
76  extern virtual function void set_disable_report(bit dr);
77  extern virtual function bit get_disable_report();
78  extern virtual function void set_enable_scb_stats(input int unsigned idxs[] = {}, bit ess);
79  extern virtual function bit get_enable_scb_stats(int unsigned idx);
80  extern virtual function int unsigned get_max_length_scb_name();
81  extern virtual function int unsigned get_max_length_queue_name();
82  extern virtual function int unsigned get_max_length_producer();
83  extern virtual function void set_print_cfg(bit pc);
84  extern virtual function bit get_print_cfg();
85  extern virtual function void do_print(uvm_printer printer);
86 
87  //-------------------------------------
88  // Misc. functions for internal usage
89  //-------------------------------------
90  extern protected virtual function bit is_scb_names_unique(input string scb_name);
91 
92 endclass: cl_syoscbs_cfg
93 
94 function cl_syoscbs_cfg::new(string name = "cl_syoscbs_cfg");
95  super.new(name);
96 endfunction: new
97 
98 /// <b>Configuration API:</b> Initializes the scoreboard wrapper and all contained scoreboards.
99 /// See #set_scb_names for important restrictions on the values of parameter \c scb_names
100 
101 /// \param scbs_name The name of the scoreboard wrapper
102 /// \param no_scbs Number of scoreboards to wrap
103 /// \param scb_names Names of the scoreboards that should be wrapped.
104 /// \param queues Names of the queues that should be created in *all* scoreboards given by scb_names
105 /// \param producers Names of the produceres that should be created for *all* queues in *all* scoreboards
106 function void cl_syoscbs_cfg::init(string scbs_name = "",
107  int unsigned no_scbs,
108  string scb_names[],
109  string queues[],
110  string producers[]);
111  this.set_no_scbs(no_scbs);
112  this.set_scbs_name(scbs_name);
113  this.set_scb_names(scb_names);
114  if(queues.size()!= 0) begin
115  this.set_queues(queues);
116  end
117  foreach (producers[i]) begin
118  this.set_producers(producers[i]);
119  end
120 endfunction: init
121 
122 /// <b>Configuration API:</b> Sets the configuration object for the scoreboard at a given index
123 /// \param cfg The scoreboard configuration to set
124 /// \param idx The index of the scoreboard config to set
125 /// \note If the index is invalid, throws a UVM_FATAL
126 function void cl_syoscbs_cfg::set_cfg(cl_syoscb_cfg cfg, int unsigned idx);
127  if(idx >= this.cfgs.size()) begin
128  `uvm_fatal("CFG_ERROR",
129  $sformatf("No set_cfg possible at index %0d. Allowed range is between 0 and %0d",
130  idx, this.cfgs.size()-1))
131  return;
132  end
133 
134  this.cfgs[idx] = cfg;
135 
136  // Report for the SCB is handled by the wrapper
137  this.cfgs[idx].set_disable_report(1'b1);
138 
139  // Print for the cfgs is handled by wrapper
140  this.cfgs[idx].set_print_cfg(1'b0);
141 endfunction: set_cfg
142 
143 /// <b>Configuration API:</b> Returns the configuration object of the scoreboard with a given index
144 /// \param idx The index of the scoreboard configuration to retrieve
145 /// \return That scoreboard configuration, or null if none could be found
146 /// \note If the index is invalid, throws a UVM_FATAL
147 function cl_syoscb_cfg cl_syoscbs_cfg::get_cfg(int unsigned idx);
148  if(idx >= this.cfgs.size()) begin
149  `uvm_fatal("CFG_ERROR",
150  $sformatf("No get_cfg possible at index %0d. Allowed range is between 0 and %0d",
151  idx, this.cfgs.size()-1))
152  return null;
153  end
154 
155  return this.cfgs[idx];
156 endfunction: get_cfg
157 
158 /// <b>Configuration API:</b> Sets the number of scoreboards that should be wrapped.
159 /// Creates an empty scoreboard configuration for each scoreboard.
160 /// If this has previously been called, previously existing scoreboard configs are preserved.
161 /// If the new number of scoreboards is greater than the old, additional configs are created.
162 /// If the new number of scoreboards is smaller than the old, some of the old configs are discarded.
163 /// \param no_scbs The number of scoreboards
164 function void cl_syoscbs_cfg::set_no_scbs(int unsigned no_scbs);
165  this.no_scbs = no_scbs;
166 
167  // Potentially resize but preserve what was there
168  this.cfgs = new[this.no_scbs](this.cfgs);
169 
170  this.enable_scb_stats = new[this.no_scbs](this.enable_scb_stats);
171 
172  foreach (this.cfgs[i]) begin
173  if(this.cfgs[i] == null) begin
174  this.set_cfg(pk_syoscb::cl_syoscb_cfg::type_id::create($sformatf("scb[%0d]_cfg", i)), i);
175  end
176 
177  this.enable_scb_stats[i] = 1'b0;
178  end
179 endfunction: set_no_scbs
180 
181 /// <b>Configuration API:</b> Returns the number of scoreboards wrapped by this wrapper.
182 function int unsigned cl_syoscbs_cfg::get_no_scbs();
183  return this.no_scbs;
184 endfunction: get_no_scbs
185 
186 /// <b>Configuration API:</b> Sets the name of this scoreboard wrapper
187 function void cl_syoscbs_cfg::set_scbs_name(string scbs_name);
188  this.scbs_name = scbs_name;
189 endfunction: set_scbs_name
190 
191 /// <b>Configuration API:</b> Returns the name of this scoreboard wrapper
193  return this.scbs_name;
194 endfunction: get_scbs_name
195 
196 /// <b>Configuration API:</b> Sets the scoreboard name of all scoreboards under this wrapper.
197 /// - If the 'names' and 'idxs' arguments are empty, scoreboards are given auto-generated name: (scb[x])
198 /// - If the 'names' argument has exactly one entry and 'idxs' is empty, scoreboards are named: (<names[0]>[x])
199 /// - If the 'names' argument and 'idxs' argument both have the same number of entries, scoreboards are given
200 /// names based on the idxs: scb[idxs[i]].name = scb_names[i]
201 /// \note If multiple SCB names are passed, these must be unique. Otherwise, a UVM_FATAL is issued
202 /// \note If the parameters do not follow one of the three structures presented, a UVM_FATAL is issued
203 /// \param scb_names The names that scoreboards should be assigned.
204 /// \param idxs The indexes at which a given scoreboard name should be given.
205 function void cl_syoscbs_cfg::set_scb_names(string scb_names[], int unsigned idxs[] = {});
206  // Set all SCB names to an unique default
207  if(scb_names.size() == 0 && idxs.size() == 0) begin
208  foreach (this.cfgs[i]) begin
209  this.cfgs[i].set_scb_name($sformatf("scb[%0d]", i));
210  end
211 
212  return;
213  end
214 
215  // Set the same name for all or specific indexes
216  if(scb_names.size() == 1) begin
217  if(idxs.size() == 0) begin
218  // Unique name made by <scb_names[0]> root, followed by a progressive index
219  foreach (this.cfgs[i]) begin
220  this.cfgs[i].set_scb_name($sformatf("%s[%0d]", scb_names[0], i));
221  end
222  end
223  else begin
224  // Names might not be unique, depending on the values inside idxs. Need to check for unicity
225  foreach (idxs[i]) begin
226  string l_scb_name;
227 
228  l_scb_name = $sformatf("%s[%0d]", scb_names[0], idxs[i]);
229 
230  if(!this.is_scb_names_unique(l_scb_name)) begin
231  `uvm_fatal("CFG_ERROR", $sformatf("the provided scb name '%0s' is not unique", l_scb_name))
232  end
233  else begin
234  this.cfgs[idxs[i]].set_scb_name(l_scb_name);
235  end
236  end
237  end
238 
239  return;
240  end
241 
242  // Set specific names for specific indexes
243  if(scb_names.size()>0 && idxs.size()>0 && scb_names.size() == idxs.size()) begin
244  // Names might not be unique, depending on the values in both arrays. Need to check for unicity
245  foreach (idxs[i]) begin
246  string l_scb_name;
247 
248  l_scb_name = scb_names[idxs[i]];
249 
250  if(!this.is_scb_names_unique(l_scb_name)) begin
251  `uvm_fatal("CFG_ERROR", $sformatf("the provided scb name '%0s' is not unique", l_scb_name))
252  end
253  else begin
254  this.cfgs[idxs[i]].set_scb_name(l_scb_name);
255  end
256  end
257 
258  return;
259  end
260 
261  `uvm_fatal("CFG_ERROR", "set_scb_names invoked with unsupported args")
262 endfunction: set_scb_names
263 
264 /// <b>Configuration API:</b> Returns the names of some or all scoreboards wrapped by this wrapper.
265 /// If \c idxs is empty, all names are returned. Otherwise, only the names at the requested indexes are returned.
266 /// \param scb_names Handle to a string array where scoreboard names are returned. Should not point to an
267 /// existing array, as a new array is allocated
268 /// \param idxs The indexes of the scoreboard names that should be returned. If empty, all names are returned
269 /// such that scb_names[i] corresponds to scb[i]. Otherwise, scb_names[i] = scbs[idxs[i]]
270 function void cl_syoscbs_cfg::get_scb_names(output string scb_names[], input int unsigned idxs[] = {});
271  scb_names = new[idxs.size() == 0 ? this.no_scbs : idxs.size()];
272 
273  foreach (scb_names[i]) begin
274  scb_names[i] = this.cfgs[idxs.size() == 0 ? i : idxs[i]].get_scb_name();
275  end
276 endfunction: get_scb_names
277 
278 /// <b>Configuration API:</b> Sets the legal queue names for the scoreboards indicated by the idxs argument.
279 /// If idxs is empty, the given queue names are set for all scoreboards
280 /// \param queues The queue names that should be used for the given scoreboards
281 /// \param idxs The indexes of the scoreboards that should have these names. If empty, all scoreboards get these queue names.
282 /// or for the scoreboards specified in the idxs argument.
283 function void cl_syoscbs_cfg::set_queues(string queues[], int unsigned idxs[] = {});
284  // Generate a fatal if queues doesn't contain elements
285  if(queues.size() == 0) begin
286  `uvm_fatal("CFG_ERROR",
287  "cl_syoscbs_cfg::set_queues has been called with empty queues argument")
288  end
289 
290  if(idxs.size() == 0) begin
291  foreach (this.cfgs[i]) begin
292  this.cfgs[i].set_queues(queues);
293  end
294  end else begin
295  foreach (idxs[i]) begin
296  this.cfgs[idxs[i]].set_queues(queues);
297  end
298  end
299 endfunction: set_queues
300 
301 /// <b>Configuration API:</b> Returns the names of the queues for the scoreboard with a given index
302 /// \param queues Handle to an array where queue names are returned. Should not point to an existing array,
303 /// as a new array is allocated
304 /// \param ids The index of the scoreboard to get queue names for
305 /// \note If idx >= the number of scoreboards, a UVM_FATAL is issued
306 function void cl_syoscbs_cfg::get_queues(output string queues[], input int unsigned idx);
307  if(idx >= this.cfgs.size()) begin
308  `uvm_fatal("CFG_ERROR",
309  $sformatf("No get_queue possible at index %0d. Allowed range is between 0 and %0d",
310  idx, this.cfgs.size()-1))
311  queues = {};
312  end
313 
314  this.cfgs[idx].get_queues(queues);
315 endfunction: get_queues
316 
317 /// <b>Configuration API:</b> Sets the producer for the specified queues of the scoreboards with given indexes
318 /// If no queues are specified, the producer is set for all the queues.
319 /// If no indicies are specifies, the producer is set for the queues of all scoreboards.
320 /// \param producer The name of the producer that should be associated with some queues
321 /// \param queues The names of the queues that the producer can generate for
322 /// \note If idx >= the number of scoreboards, a UVM_FATAL is issued
323 function void cl_syoscbs_cfg::set_producers(string producer, string queues[] = {}, int unsigned idxs[] = {});
324  if(idxs.size() == 0) begin
325  foreach (this.cfgs[i]) begin
326  if(queues.size() == 0) begin
327  this.cfgs[i].get_queues(queues);
328  end
329 
330  if(!this.cfgs[i].set_producer(producer, queues)) begin
331  `uvm_fatal("CFG_ERROR",
332  $sformatf("[%0s]: Unable to set producer %0s for the given queues",
333  this.cfgs[i].get_name(), producer))
334  return;
335  end
336  end
337  end else begin
338  foreach (idxs[i]) begin
339  // Execute index check
340  if(idxs[i] >= this.cfgs.size()) begin
341  `uvm_fatal("CFG_ERROR",
342  $sformatf("No set_producers not possible at index %0d. Allowed range is between 0 and %0d",
343  idxs[i], this.cfgs.size()-1))
344  return;
345  end
346  if(queues.size() == 0) begin
347  this.cfgs[idxs[i]].get_queues(queues);
348  end
349 
350  if(!this.cfgs[idxs[i]].set_producer(producer, queues)) begin
351  `uvm_fatal("CFG_ERROR",
352  $sformatf("[%0s]: Unable to set producer %0s for the given queues",
353  this.cfgs[idxs[i]].get_name(), producer))
354  return;
355  end
356  end
357  end
358 endfunction: set_producers
359 
360 /// <b>Configuration API:</b> Sets the queue types for the given scoreboards inside the wrapper.
361 /// \param queue_types The queue type that should be used for a scoreboard.
362 /// \param idxs The indexes of the scoreboards that should have their queue type set. If idxs is empty,
363 /// queue_types[i] is applied to scb[i]. Otherwise, queue_types[i] is applied to scb[idxs[i]]
364 function void cl_syoscbs_cfg::set_queue_type(t_scb_queue_type queue_types[], int unsigned idxs[] = {});
365  if(idxs.size() == 0) begin
366  foreach (this.cfgs[i]) begin
367  this.cfgs[i].set_queue_type(queue_types[i]);
368  end
369  end else begin
370  foreach (idxs[i]) begin
371  this.cfgs[idxs[i]].set_queue_type(queue_types[i]);
372  end
373  end
374 endfunction: set_queue_type
375 
376 /// <b>Configuration API:</b> Sets the compare strategy for the given scoreboards inside the wrapper
377 /// \param compare_types The compare type that should be used for a scoreboard.
378 /// \param idxs The indexes of the scoreboards that should have their queue type set. If idxs is empty,
379 /// compare_types[i] is applied to scb[i]. Otherwise, compare_types[i] is applied to scb[idxs[i]]
380 function void cl_syoscbs_cfg::set_compare_type(t_scb_compare_type compare_types[],
381  int unsigned idxs[] = {});
382  if(idxs.size() == 0) begin
383  foreach (this.cfgs[i]) begin
384  this.cfgs[i].set_compare_type(compare_types[i]);
385  end
386  end else begin
387  foreach (idxs[i]) begin
388  this.cfgs[idxs[i]].set_compare_type(compare_types[i]);
389  end
390  end
391 endfunction: set_compare_type
392 
393 
394 // Implementation notes:
395 //
396 // * This just returns the first match and does not check for dublets
397 // * Can be optimized using a hash which is updated on insertion. Then the search can be avoided completely
398 // * Consider flagging error if not found?
399 /// <b>Configuration API:</b> Gets the index of a scoreboard with a given name
400 /// \param scb_name The name of the scoreboard to find the index of
401 /// \return The index of that scoreboard, -1 if the name did not match any scoreboard
402 function int cl_syoscbs_cfg::get_scb_index_by_name(string scb_name);
403  int scb_idxs[$];
404 
405  scb_idxs = this.cfgs.find_first_index() with (item.get_scb_name() == scb_name);
406 
407  return scb_idxs.size() > 0 ? scb_idxs[0] : -1;
408 endfunction: get_scb_index_by_name
409 
410 /// <b>Configuration API:</b> Sets trigger greediness status for all or a subset of the scoreboards.
411 /// \param idxs The indexes of the scoreboards that should have their trigger greed level set. If idxs is empty,
412 /// tg[i] is applied to scb[i]. Otherwise, tg[i] is applied to scb[idxs[i]]
413 /// \param tg The trigger greed level that should be used for a scoreboard.
414 function void cl_syoscbs_cfg::set_scb_trigger_greediness(int unsigned idxs[] = {},
415  t_scb_compare_greed tg[]);
416  if(idxs.size() == 0) begin
417  foreach (this.cfgs[i]) begin
418  this.cfgs[i].set_trigger_greediness(tg[0]);
419  end
420  end else begin
421  foreach (idxs[i]) begin
422  this.cfgs[idxs[i]].set_trigger_greediness(tg[i]);
423  end
424  end
425 endfunction: set_scb_trigger_greediness
426 
427 /// <b>Configuration API:</b> Gets the trigger greediness status for all or a subset of the scoreboards.
428 /// \param tg The trigger greediness levels of the requested scoreboards. If idxs is empty,
429 /// tg[i] is the trigger greediness of scb[i]. Otherwise, tg[i] is the trigger greedines of scb[idxs[i]]
430 /// \param idxs The indexes of the scoreboards for which to get the trigger greed level. If empty, all greed
431 /// levels are returned.
432 function void cl_syoscbs_cfg::get_scb_trigger_greediness(output t_scb_compare_greed tg[],
433  input int unsigned idxs[] = {});
434  if(idxs.size() == 0) begin
435  tg = new[this.cfgs.size()];
436  foreach (this.cfgs[i]) begin
437  tg[i] = this.cfgs[i].get_trigger_greediness();
438  end
439  end else begin
440  tg = new[idxs.size()];
441  foreach (idxs[i]) begin
442  tg[idxs[i]] = this.cfgs[idxs[i]].get_trigger_greediness();
443  end
444  end
445 endfunction: get_scb_trigger_greediness
446 
447 /// <b>Configuration API:</b> Sets the end greediness status for all or a subset of the scoreboards.
448 /// \param idxs The indexes of the scoreboards that should have their end greed level set. If idxs is empty,
449 /// eg[i] is applied to scb[i]. Otherwise, eg[i] is applied to scb[idxs[i]]
450 /// \param eg The end greed level that should be used for a scoreboard.
451 function void cl_syoscbs_cfg::set_scb_end_greediness(int unsigned idxs[] = {},
452  t_scb_compare_greed eg[]);
453  if(idxs.size() == 0) begin
454  foreach (this.cfgs[i]) begin
455  this.cfgs[i].set_end_greediness(eg[0]);
456  end
457  end else begin
458  foreach (idxs[i]) begin
459  this.cfgs[idxs[i]].set_end_greediness(eg[i]);
460  end
461  end
462 endfunction: set_scb_end_greediness
463 
464 /// <b>Configuration API:</b> Gets the end greediness status for all or a subset of the scoreboards.
465 /// \param eg The end greediness levels of the requested scoreboards. If idxs is empty,
466 /// eg[i] is the end greediness of scb[i]. Otherwise, eg[i] is the end greedines of scb[idxs[i]]
467 /// \param idxs The indexes of the scoreboards for which to get the end greed level. If empty, all greed
468 /// levels are returned.
469 function void cl_syoscbs_cfg::get_scb_end_greediness(output t_scb_compare_greed eg[],
470  input int unsigned idxs[] = {});
471  if(idxs.size() == 0) begin
472  eg = new[this.cfgs.size()];
473  foreach (this.cfgs[i]) begin
474  eg[i] = this.cfgs[i].get_end_greediness();
475  end
476  end else begin
477  eg = new[idxs.size()];
478  foreach (idxs[i]) begin
479  eg[idxs[i]] = this.cfgs[idxs[i]].get_end_greediness();
480  end
481  end
482 endfunction: get_scb_end_greediness
483 
484 /// <b>Configuration API:</b> Sets the value of the #disable_report member variable
486  this.disable_report = dr;
487 endfunction: set_disable_report
488 
489 /// <b>Configuration API:</b> Returns the value of the #disable_report member variable
491  return this.disable_report;
492 endfunction: get_disable_report
493 
494 /// <b>Configuration API:</b> Sets the value of the #enable_scb_stats flag for all or a subset of scoreboards
495 /// \param idxs The indexes of the scoreboards to set the value of the flag for.
496 /// If empty, the value is set for all scoreboards.
497 /// \param ess The value to set the flag to
498 function void cl_syoscbs_cfg::set_enable_scb_stats(input int unsigned idxs[] = {}, bit ess);
499  if(idxs.size() == 0) begin
500  foreach (this.enable_scb_stats[i]) begin
501  this.enable_scb_stats[i] = ess;
502  end
503  end else begin
504  foreach (idxs[i]) begin
505  this.enable_scb_stats[idxs[i]] = ess;
506  end
507  end
508 endfunction: set_enable_scb_stats
509 
510 /// <b>Configuration API:</b> Returns the value of the #enable_scb_stats member variable for the
511 /// scoreboard at the given index
512 function bit cl_syoscbs_cfg::get_enable_scb_stats(int unsigned idx);
513  if(idx >= this.enable_scb_stats.size()) begin
514  `uvm_fatal("CFG_ERROR",
515  $sformatf("No get_enable_scb_stats not possible at index %0d. Allowed range is between 0 and %0d",
516  idx, this.enable_scb_stats.size()-1))
517  return 0;
518  end
519 
520  return this.enable_scb_stats[idx];
521 endfunction: get_enable_scb_stats
522 
523 /// Returns the length of the longest scoreboard name that is wrapped by this
525  string scb_names[];
526  int unsigned max_length_scb_name;
527 
528  this.get_scb_names(scb_names);
529 
530  foreach (scb_names[i]) begin
531  if(scb_names[i].len() > max_length_scb_name) begin
532  max_length_scb_name = scb_names[i].len();
533  end
534  end
535 
536  return max_length_scb_name;
537 endfunction: get_max_length_scb_name
538 
539 /// Returns the length of the longest queue name that is wrapped by this
541  int unsigned max_length_queue_name;
542 
543  foreach (this.cfgs[i]) begin
544  if(this.cfgs[i].get_max_length_queue_name() > max_length_queue_name) begin
545  max_length_queue_name = this.cfgs[i].get_max_length_queue_name();
546  end
547  end
548 
549  return max_length_queue_name;
550 endfunction: get_max_length_queue_name
551 
552 /// Returns the length of the producer name with maximum length
554  int unsigned max_length_producer;
555 
556  foreach (this.cfgs[i]) begin
557  if(this.cfgs[i].get_max_length_producer() > max_length_producer) begin
558  max_length_producer = this.cfgs[i].get_max_length_producer();
559  end
560  end
561 
562  return max_length_producer;
563 endfunction: get_max_length_producer
564 
565 /// <b>Configuration API:</b> Sets the value of the #print_cfg member variable
566 function void cl_syoscbs_cfg::set_print_cfg(bit pc);
567  this.print_cfg = pc;
568 endfunction: set_print_cfg
569 
570 /// Gets the value of the #print_cfg member variable
572  return this.print_cfg;
573 endfunction:get_print_cfg
574 
575 /// Custom do_print implementation. Print only the wrapped configuration objects which have #print_cfg == 1
576 function void cl_syoscbs_cfg::do_print(uvm_printer printer);
577  foreach (this.cfgs[i]) begin
578  printer.print_object(.name($sformatf("cfgs[%0d]", i)), .value(this.cfgs[i]));
579  end
580 
581  super.do_print(printer);
582 endfunction: do_print
583 
584 /// Checks if a given name is not yet used by a scoreboard under this wrapper
585 /// \param scb_name The name that should be checked against all other scoreboard names
586 function bit cl_syoscbs_cfg::is_scb_names_unique(input string scb_name);
587  string l_scb_names[];
588  string duplicate_names[$];
589 
590  this.get_scb_names(l_scb_names);
591 
592  duplicate_names = l_scb_names.find(x) with(x == scb_name);
593 
594  // If the return queue has size zero, i don't have dublicate names for the given argument
595  return duplicate_names.size() == 0;
596 endfunction: is_scb_names_unique
cl_syoscb_cfg cfgs[]
Array holding handles to all the UVM scoreboard configurations.
virtual void set_scb_end_greediness(int unsigned idxs[]={}, t_scb_compare_greed eg[])
Configuration API: Sets the end greediness status for all or a subset of the scoreboards.
int unsigned no_scbs
Number of scoreboards.
virtual cl_syoscb_cfg get_cfg(int unsigned idx)
Configuration API: Returns the configuration object of the scoreboard with a given index ...
virtual int get_scb_index_by_name(string scb_name)
Configuration API: Gets the index of a scoreboard with a given name
virtual void set_no_scbs(int unsigned no_scbs)
Configuration API: Sets the number of scoreboards that should be wrapped.
virtual void set_scbs_name(string scbs_name)
Configuration API: Sets the name of this scoreboard wrapper
bit print_cfg
Whether to print scoreboard wrapper configuration in the UVM build_phase.
virtual void do_print(uvm_printer printer)
Custom do_print implementation. Print only the wrapped configuration objects which have print_cfg == ...
virtual int unsigned get_max_length_queue_name()
Returns the length of the longest queue name that is wrapped by this.
Configuration object for the cl_syoscbs_base scoreboard wrapper.
virtual void set_queue_type(t_scb_queue_type qt)
Configuration API: Set the value of the queue_type member variable
virtual int unsigned get_no_scbs()
Configuration API: Returns the number of scoreboards wrapped by this wrapper.
virtual string get_scbs_name()
Configuration API: Returns the name of this scoreboard wrapper
virtual void set_enable_scb_stats(input int unsigned idxs[]={}, bit ess)
Configuration API: Sets the value of the enable_scb_stats flag for all or a subset of scoreboards ...
bit enable_scb_stats[]
Enable/disable the printing of scb statistics per queue by each scb.
virtual void set_cfg(cl_syoscb_cfg cfg, int unsigned idx)
Configuration API: Sets the configuration object for the scoreboard at a given index ...
virtual void set_trigger_greediness(t_scb_compare_greed tg)
Configuration API: Set the value of the trigger_greediness member variable
bit disable_report
Whether to disable report printing in the report_phase.
virtual void set_producers(string producer, string queues[]={}, int unsigned idxs[]={})
Configuration API: Sets the producer for the specified queues of the scoreboards with given indexes I...
virtual int unsigned get_max_length_scb_name()
Returns the length of the longest scoreboard name that is wrapped by this.
virtual void set_end_greediness(t_scb_compare_greed eg)
Configuration API: Set the value of the end_greediness member variable
virtual int unsigned get_max_length_producer()
Configuration API: Returns the length of the producer name with maximum length
virtual void set_print_cfg(bit pc)
Configuration API: Sets the value of the print_cfg member variable
virtual bit get_print_cfg()
Gets the value of the print_cfg member variable.
string scbs_name
Scoreboard wrapper name.
virtual int unsigned get_max_length_queue_name()
Configuration API: Returns the length of the queue name with maximum length
virtual void get_queues(output string queues[], input int unsigned idx)
Configuration API: Returns the names of the queues for the scoreboard with a given index ...
virtual t_scb_compare_greed get_end_greediness()
Configuration API: Get the value of the end_greediness member variable
virtual void get_scb_trigger_greediness(output t_scb_compare_greed tg[], input int unsigned idxs[]={})
Configuration API: Gets the trigger greediness status for all or a subset of the scoreboards.
virtual bit get_enable_scb_stats(int unsigned idx)
Configuration API: Returns the value of the enable_scb_stats member variable for the scoreboard at th...
virtual void get_scb_end_greediness(output t_scb_compare_greed eg[], input int unsigned idxs[]={})
Configuration API: Gets the end greediness status for all or a subset of the scoreboards.
virtual void set_disable_report(bit dr)
Configuration API: Sets the value of the disable_report member variable
virtual bit is_scb_names_unique(input string scb_name)
Checks if a given name is not yet used by a scoreboard under this wrapper.
virtual void set_compare_type(t_scb_compare_type compare_types[], int unsigned idxs[]={})
Configuration API: Sets the compare strategy for the given scoreboards inside the wrapper ...
virtual void set_scb_names(string scb_names[], int unsigned idxs[]={})
Configuration API: Sets the scoreboard name of all scoreboards under this wrapper.
virtual void init(string scbs_name="", int unsigned no_scbs, string scb_names[], string queues[], string producers[])
Configuration API: Initializes the scoreboard wrapper and all contained scoreboards.
virtual void set_queues(string queues[], int unsigned idxs[]={})
Configuration API: Sets the legal queue names for the scoreboards indicated by the idxs argument...
virtual void get_scb_names(output string scb_names[], input int unsigned idxs[]={})
Configuration API: Returns the names of some or all scoreboards wrapped by this wrapper.
virtual bit get_disable_report()
Configuration API: Returns the value of the disable_report member variable
virtual void set_queue_type(t_scb_queue_type queue_types[], int unsigned idxs[]={})
Configuration API: Sets the queue types for the given scoreboards inside the wrapper.
virtual void set_compare_type(t_scb_compare_type ct)
Configuration API: Set the value of the compare_type member variable
virtual void set_scb_trigger_greediness(int unsigned idxs[]={}, t_scb_compare_greed tg[])
Configuration API: Sets trigger greediness status for all or a subset of the scoreboards.
virtual void get_queues(output string queue_names[])
Configuration API: Returns all queue names as a string list
virtual int unsigned get_max_length_producer()
Returns the length of the producer name with maximum length.
Configuration class for the SyoSil UVM scoreboard.
virtual t_scb_compare_greed get_trigger_greediness()
Configuration API: Get the value of the trigger_greediness member variable

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