SyoSil ApS UVM Scoreboard  1.0.3.0
cl_syoscbs_base.svh
1 /// Base class for a wrapper around multiple SyoSil Scoreboards.
2 /// An implementation is found in cl_syoscbs_base
3 class cl_syoscbs_base extends uvm_component;
4  //-------------------------------------
5  // Non randomizable variables
6  //-------------------------------------
7 
8  /// Array holding handles to all scoreboards
9  protected cl_syoscb scbs[];
10 
11  /// Handle to scoreboard wrapper configuration object
12  protected cl_syoscbs_cfg cfg;
13 
14  /// Array holding handles to filter transforms, used to transform inputs of one type
15  /// to outputs of another type, for feeding into the wrapped scoreboards.
16  /// Declared as type \c uvm_component for flexibility. See example of implementation in cl_syoscbs_base.
17  /// AA is indexed by [scb_idx][queue_name][producer_name]
18  protected uvm_component fts[][string][string];
19 
20 
21  //-------------------------------------
22  // UVM Macros
23  //-------------------------------------
24  `uvm_component_utils_begin(cl_syoscbs_base)
25  `uvm_field_object(cfg, UVM_DEFAULT)
26  `uvm_component_utils_end
27 
28  //-------------------------------------
29  // Constructor
30  //-------------------------------------
31  function new(string name = "cl_syoscbs_base", uvm_component parent = null);
32  super.new(name, parent);
33  endfunction: new
34 
35  //-------------------------------------
36  // UVM Phase Methods
37  //-------------------------------------
38  extern virtual function void build_phase(uvm_phase phase);
39  extern virtual function void connect_phase(uvm_phase phase);
40  extern virtual function void report_phase(uvm_phase phase);
41 
42  //-------------------------------------
43  // Function based API
44  //-------------------------------------
45  extern virtual function cl_syoscbs_cfg get_cfg();
46  extern virtual function cl_syoscb get_scb(int unsigned idx);
47  extern virtual function void flush_queues_all();
48  extern virtual function void flush_queues_by_index(int unsigned idxs[] = {},
49  string queue_names[] = {});
50  extern virtual function void flush_queues_by_name(string scb_names[] = {},
51  string queue_names[] = {});
52  extern virtual function void compare_control_all(bit cc);
53  extern virtual function void compare_control_by_index(int unsigned idxs[] = {}, bit cc);
54  extern virtual function void compare_control_by_name(string scb_names[] = {}, bit cc);
55  extern protected virtual function string create_scb_stats(int unsigned offset,
56  int unsigned first_column_width);
57  extern virtual function string create_report(int unsigned offset,
58  int unsigned first_column_width);
59  extern virtual function uvm_component get_filter_trfm_base(string queue_name,
60  string producer_name,
61  int unsigned idx);
62 
63  //-------------------------------------
64  // Misc. Functions for internal usage
65  //-------------------------------------
66  extern virtual protected function void create_filters(int unsigned idx, cl_syoscb_cfg cfg);
67  extern virtual protected function void connect_filters(int unsigned idx, cl_syoscb_cfg cfg);
68  extern virtual protected function void create_filter(string queue_name,
69  string producer_name,
70  int unsigned idx);
71  extern virtual protected function void connect_filter_and_subscriber(string queue_name,
72  string producer_name,
73  int unsigned idx);
74  extern protected virtual function string create_total_stats(int unsigned offset,
75  int unsigned first_column_width);
76  extern virtual protected function string get_scb_failed_checks();
77 
78  extern virtual function void do_print(uvm_printer printer);
79  extern virtual function bit do_compare(uvm_object rhs, uvm_comparer comparer);
80  extern virtual function void do_copy(uvm_object rhs);
81 
82 endclass: cl_syoscbs_base
83 
84 /// UVM build phase.
85 /// Receives a cl_syoscbs_cfg object, creates wrapped scoreboards and their configuration objects,
86 /// forwards configuration objects to each wrapped scoreboard.
87 function void cl_syoscbs_base::build_phase(uvm_phase phase);
88  super.build_phase(phase);
89 
90  if(!uvm_config_db #(cl_syoscbs_cfg)::get(this, "", "cfg", this.cfg)) begin
91  `uvm_fatal("CFG_ERROR", "Configuration object not passed.")
92  end
93 
94  if(this.cfg.get_scbs_name() == "") begin
95  this.cfg.set_scbs_name(this.get_name());
96  end
97 
98  // Print the SCB cfg according to its internal member field knob
99  if(this.cfg.get_print_cfg()) begin
100  this.cfg.print();
101  end
102 
103  //For each scoreboard, create and forward configs and allocate space for filter transforms
104  this.scbs = new[this.cfg.get_no_scbs()];
105  this.fts = new[this.cfg.get_no_scbs()];
106 
107  foreach (this.scbs[i]) begin
108  cl_syoscb_cfg tmp_cfg = this.cfg.get_cfg(i);
109  string scb_name = tmp_cfg.get_scb_name();
110 
111  if(scb_name == "") begin
112  scb_name = $sformatf("scb[%0d]", i);
113  end
114 
115  uvm_config_db #(cl_syoscb_cfg)::set(this, scb_name, "cfg", tmp_cfg);
116 
117  this.scbs[i] = cl_syoscb::type_id::create(scb_name, this);
118  end
119 endfunction: build_phase
120 
121 /// UVM connect phase. syoscbs_base only calls super.connect_phase
122 function void cl_syoscbs_base::connect_phase(uvm_phase phase);
123  super.connect_phase(phase);
124 endfunction: connect_phase
125 
126 /// UVM report_phase.
127 /// Prints the status of all scoreboard instances.
128 function void cl_syoscbs_base::report_phase(uvm_phase phase);
129  let max(a,b) = (a > b) ? a : b;
130  let min_width(sl) = ((sl>pk_syoscb::MIN_FIRST_COLUMN_WIDTH)? sl : pk_syoscb::MIN_FIRST_COLUMN_WIDTH);
131 
132  super.report_phase(phase);
133 
134  if(!this.cfg.get_disable_report()) begin
135  int unsigned offset = 2;
136  int unsigned first_column_width;
137  string stats_str;
138 
139 
140  first_column_width = min_width(max(this.cfg.get_max_length_scb_name(),
141  max(pk_syoscb::GLOBAL_REPORT_INDENTION+this.cfg.get_max_length_queue_name(),
142  (2*pk_syoscb::GLOBAL_REPORT_INDENTION)+this.cfg.get_max_length_producer())));
143 
144  stats_str = cl_syoscb_string_library::scb_header_str("Name", offset+first_column_width, 1'b1);
145 
146  stats_str = { stats_str, this.create_report(offset, first_column_width) };
147 
148  stats_str = { stats_str, cl_syoscb_string_library::scb_separator_str(offset+first_column_width+1) };
149 
150  // *NOTE*: Using this.get_name() is sufficient since the component
151  // instance name is the queue name by definition
152  `uvm_info("QUEUE", $sformatf("[%s]: Statistics summary:%s", this.cfg.get_scbs_name(), stats_str), UVM_NONE)
153  end
154 
155  // Report any errors
156  begin
157  string failed_checks;
158 
159  failed_checks = { failed_checks, this.get_scb_failed_checks() };
160 
161  if(failed_checks != "") begin
162  `uvm_error("SCB_ERROR", $sformatf("[%s]: scb errors:\n%s", this.cfg.get_scbs_name(), failed_checks))
163  end
164  end
165 endfunction: report_phase
166 
167 /// Gets the configuration object associated with this scoreboard wrapper
168 function cl_syoscbs_cfg cl_syoscbs_base::get_cfg();
169  return this.cfg;
170 endfunction: get_cfg
171 
172 /// <b>Scoreboard Wrapper API</b>: Get a handle to a scoreboard inside this wrapper
173 /// \param idx The index of that scoreboard
174 /// \return A handle to scoreboard [idx]. If idx >= number of scoreboards, throws a uvm_fatal error
175 function cl_syoscb cl_syoscbs_base::get_scb(int unsigned idx);
176  if(idx >= this.scbs.size()) begin
177  `uvm_fatal("SCB_ERROR",
178  $sformatf("No scb existing at index %0d. Allowed index range betwen 0 and %0d",
179  idx, this.scbs.size()-1))
180  return null;
181  end
182 
183  return this.scbs[idx];
184 endfunction: get_scb
185 
186 /// <b>Scoreboard Wrapper API</b>: Gets a handle to a filter transform as a uvm_component.
187 /// The end user must typecast this uvm_component to the correct type, based on the kind
188 /// of filter transforms that is implemented
189 /// \param queue_name The name of the queue to connect the filter to
190 /// \param producer_name The name of the producer that produced data going into this filter
191 /// \param fts_idx The index of the scoreboard in which this queue exists
192 /// \return A uvm_component which represents a filter, if all parameters are valid.
193 /// If the parameters do not specify a valid filter, returns null and prints a UVM_INFO/DEBUG message
194 function uvm_component cl_syoscbs_base::get_filter_trfm_base(string queue_name,
195  string producer_name,
196  int unsigned idx);
197  if(idx < this.fts.size()) begin
198  if(this.fts[idx].exists(queue_name)) begin
199  if(this.fts[idx][queue_name].exists(producer_name)) begin
200  return this.fts[idx][queue_name][producer_name];
201  end else begin //Bad producer name
202  `uvm_info("BAD_ARG", $sformatf("Producer name %0s was not valid for idx=%0d, queue_name=%0s", producer_name, idx, queue_name), UVM_DEBUG)
203 
204  end
205  end else begin //Bad queue name
206  `uvm_info("BAD_ARG", $sformatf("Queue name %0s was not valid for idx=%0d", queue_name, idx), UVM_DEBUG)
207 
208  end
209  end else begin //Bad index
210  `uvm_info("BAD_ARG", $sformatf("Index %0d was invalid, must be in range 0 to %0d", 0, this.fts.size()-1), UVM_DEBUG)
211  end
212  return null;
213 endfunction: get_filter_trfm_base
214 
215 /// <b>Scoreboard Wrapper API</b>: Flush all queues of all scoreboards.
216 function void cl_syoscbs_base::flush_queues_all();
217  this.flush_queues_by_index();
218 endfunction: flush_queues_all
219 
220 /// <b>Scoreboard Wrapper API</b>: Flush the queues indicated by queue_names of the scoreboards with indexes idxs.
221 /// If no indexes are specified, all scoreboards will be affected by the flush.
222 /// If no queue names are specified all queues are flushed.
223 /// \param idxs indexes of the scoreboards to flush
224 /// \param queue_names Names of the queues under those scoreboards to flush
225 function void cl_syoscbs_base::flush_queues_by_index(int unsigned idxs[] = {}, string queue_names[] = {});
226  if(idxs.size() == 0) begin
227  if(queue_names.size() == 0) begin
228  foreach (this.scbs[i]) begin
229  this.scbs[i].flush_queues();
230  end
231  end else begin
232  foreach (this.scbs[i]) begin
233  foreach (queue_names[j]) begin
234  this.scbs[i].flush_queues(queue_names[j]);
235  end
236  end
237  end
238  end else begin
239  if(queue_names.size() == 0) begin
240  foreach (idxs[i]) begin
241  this.scbs[idxs[i]].flush_queues();
242  end
243  end else begin
244  foreach (idxs[i]) begin
245  foreach (queue_names[j]) begin
246  this.scbs[idxs[i]].flush_queues(queue_names[j]);
247  end
248  end
249  end
250  end
251 endfunction: flush_queues_by_index
252 
253 /// <b>Scoreboard Wrapper API</b>: Flush the queues indicated by queue_names of the scoreboards with
254 /// names scb_names.
255 /// If no scoreboard names are specified all the scoreboards will be affected by the flush.
256 /// If no queue names are specified all queues are flushed.
257 /// \param scb_names Names of the scoreboards to flush
258 /// \param queue_names Names of the queues under those scoreboards to flush
259 function void cl_syoscbs_base::flush_queues_by_name(string scb_names[] = {}, string queue_names[] = {});
260  if(scb_names.size() == 0) begin
261  this.flush_queues_by_index({}, queue_names);
262  end else begin
263  int unsigned idxs[];
264 
265  idxs = new[scb_names.size()];
266 
267  foreach (scb_names[i]) begin
268  int an_index;
269 
270  an_index = this.cfg.get_scb_index_by_name(scb_names[i]);
271 
272  // Only the existing scb_names[i] will be flushed
273  if(an_index >= 0) begin
274 
275  idxs[i] = an_index;
276  end
277  else begin
278  `uvm_fatal("SCB_ERROR", $sformatf("No scb with name '%0s' found.", scb_names[i]))
279  end
280  end
281 
282  this.flush_queues_by_index(idxs, queue_names);
283  end
284 endfunction: flush_queues_by_name
285 
286 /// <b>Scoreboard Wrapper API</b>: Disable or enable the compare in all scoreboards.
287 /// \param cc Compare control bit. If 1'b1, enables compare in all scoreboards. If 1'b0, disables compare
289  this.compare_control_by_index({}, cc);
290 endfunction: compare_control_all
291 
292 /// <b>Scoreboard Wrapper API</b>: Disable or enable the compare in scoreboards with given indexes.
293 /// If no indexes are specified, all scoreboards are affected.
294 /// \param idxs The indexes of the scoreboards to enable/disable compare control for
295 /// \param cc Compare control bit. If 1'b1, enables compare in all scoreboards. If 1'b0, disables compare
296 function void cl_syoscbs_base::compare_control_by_index(int unsigned idxs[] = {}, bit cc);
297  if(idxs.size() == 0) begin
298  foreach (this.scbs[i]) begin
299  this.scbs[i].compare_control(cc);
300  end
301  end else begin
302  foreach (idxs[i]) begin
303  this.scbs[idxs[i]].compare_control(cc);
304  end
305  end
306 endfunction: compare_control_by_index
307 
308 /// <b>Scoreboard Wrapper API</b>: Disable or enable the compare in scoreboards with given names.
309 /// If no names are specified, all scoreboards are affected.
310 /// \param scb_names The names of the scoreboards to enable/disable compare control for
311 /// \param cc Compare control bit. If 1'b1, enables compare in all scoreboards. If 1'b0, disables compare
312 function void cl_syoscbs_base::compare_control_by_name(string scb_names[] = {}, bit cc);
313  if(scb_names.size() == 0) begin
314  this.compare_control_by_index({}, cc);
315  end else begin
316  int unsigned idxs[];
317 
318  idxs = new[scb_names.size()];
319 
320  foreach (scb_names[i]) begin
321  int an_index;
322 
323  an_index = this.cfg.get_scb_index_by_name(scb_names[i]);
324 
325  // Only the existing scb_names[i] will be affected by compare_control change
326  if(an_index >= 0) begin
327 
328  idxs[i] = an_index;
329  end
330  else begin
331  `uvm_fatal("SCB_ERROR", $sformatf("No scb name '%0s' found.", scb_names[i]))
332  end
333  end
334 
335  this.compare_control_by_index(idxs, cc);
336  end
337 endfunction: compare_control_by_name
338 
339 /// <b>Scoreboard Wrapper API</b>: Creates a summary report once simulation has finished.
340 /// The report contains insert/match/flush/orphan statistics for the wrapped scoreboards.
341 /// If the cl_syoscb_cfg#gen_enable_scb_stats configuration knob is active then the report of the different
342 /// queues in each scoreboard is also included.
343 /// At the end of the report is a table with the statistics of all scoreboards.
344 /// \param offset Horizontal offset at which text should start
345 /// \param first_column_width The width of the first column in the output table
346 /// \return A string containing the entire report, ready to print
347 function string cl_syoscbs_base::create_report(int unsigned offset, int unsigned first_column_width);
348  string stats_str;
349 
350  stats_str = { stats_str, this.create_scb_stats(offset, first_column_width) };
351  stats_str = { stats_str, cl_syoscb_string_library::scb_separator_str(offset+first_column_width+1) };
352  stats_str = { stats_str, this.create_total_stats(offset, first_column_width) };
353 
354  return stats_str;
355 endfunction: create_report
356 
357 
358 /// Returns a table with summed scoreboard statistics for all wrapped scoreboards
359 /// \param offset Horizontal offset at which text should start
360 /// \param first_column_width The width of the first column in the output table
361 /// \return A string containing the table
362 // Total | Inserts | Matches | Flushed | Orphans
363 function string cl_syoscbs_base::create_total_stats(int unsigned offset, int unsigned first_column_width);
364  string total_stats;
365  int unsigned total_cnt_add_item;
366  int unsigned total_cnt_flushed_item;
367  int unsigned total_queue_size;
368 
369  // For now get the numbers here but should be refactored
370  // into individual functions for better reuse
371  foreach (this.scbs[i]) begin
372  total_cnt_add_item += this.scbs[i].get_total_cnt_add_items();
373  total_cnt_flushed_item += this.scbs[i].get_total_cnt_flushed_items();
374  total_queue_size += this.scbs[i].get_total_queue_size();
375  end
376 
377  total_stats = { "\n",
378  $sformatf("%s%s | %8d | %8d | %8d | %8d |",
380  cl_syoscb_string_library::pad_str("Total", first_column_width, " ", 1'b1),
381  total_cnt_add_item,
382  total_cnt_add_item-(total_cnt_flushed_item+total_queue_size),
383  total_cnt_flushed_item,
384  total_queue_size)};
385 
386  return total_stats;
387 endfunction: create_total_stats
388 
389 /// Returns a string containing the tables with statistics of the different scoreboards.
390 /// If the cl_syoscbs_cfg#enable_scb_stats configuration knob is active for a given scoreboard,
391 /// the report of the individual queues of that scoreboard is also included.
392 /// \param offset Horizontal offset at which text should start. Depends on the level of nested calls
393 /// (see cl_syoscbs_base#report_phase implementation)
394 /// \param first_column_width The width of the first column in the output table
395 /// \return A string containing the table
396 function string cl_syoscbs_base::create_scb_stats(int unsigned offset, int unsigned first_column_width);
397  string scb_stats;
398 
399  foreach (this.scbs[i]) begin
400  scb_stats = { scb_stats, this.scbs[i].create_total_stats(offset, first_column_width) };
401 
402  if(this.cfg.get_enable_scb_stats(i) == 1'b1) begin
403  scb_stats = { scb_stats, this.scbs[i].create_report_contents(offset+pk_syoscb::GLOBAL_REPORT_INDENTION, first_column_width-pk_syoscb::GLOBAL_REPORT_INDENTION)};
404 
405  if(i != this.scbs.size()-1) begin
406  scb_stats = { scb_stats, cl_syoscb_string_library::scb_separator_str(offset+first_column_width+1) };
407  end
408  end
409  end
410 
411  return scb_stats;
412 endfunction: create_scb_stats
413 
414 /// Gets information on whether any of the wrapped scoreboards failed to pass error checks.
415 /// These error checks include orphan checking and no-insertion checks.
416 /// \return A string combining the error checks of all queues.
418  string failed_checks;
419 
420  foreach(this.scbs[i]) begin
421  string a_failed_check;
422 
423  a_failed_check = this.scbs[i].get_failed_checks();
424 
425  failed_checks = { failed_checks, a_failed_check, a_failed_check.len()==0 ? "" : "\n" };
426  end
427 
428  return failed_checks;
429 endfunction: get_scb_failed_checks
430 
431 /// Create all filter transforms for the given scoreboard. Should be called in the UVM build phase
432 /// \param idx Index of the scoreboard to create filters for
433 /// \param cfg The configuration object for that scoreboard
434 function void cl_syoscbs_base::create_filters(int unsigned idx,
435  cl_syoscb_cfg cfg);
436  string producer_names[];
437  cfg.get_producers(producer_names);
438  foreach(producer_names[i]) begin
439  cl_syoscb_cfg_pl pl = cfg.get_producer(producer_names[i]);
440  string queue_names[] = pl.list;
441  foreach(queue_names[j]) begin
442  this.create_filter(queue_names[j], producer_names[i], idx);
443  end
444  end
445 endfunction: create_filters
446 
447 /// Connects all filter transforms with their respective subscribers in the scoreboard.
448 /// Should be called in the UVM connect phase
449 /// \param idx Index of the scoreboard for which all filters should be connected
450 /// \param cfg The configuration object for that scoreboard
451 function void cl_syoscbs_base::connect_filters(int unsigned idx, cl_syoscb_cfg cfg);
452  string producer_names[];
453  cfg.get_producers(producer_names);
454  foreach(producer_names[i]) begin
455  cl_syoscb_cfg_pl pl = cfg.get_producer(producer_names[i]);
456  string queue_names[] = pl.list;
457  foreach(queue_names[j]) begin
458  this.connect_filter_and_subscriber(queue_names[j], producer_names[i], idx);
459  end
460  end
461 endfunction: connect_filters
462 
463 /// Creates a filter for given scoreboard/queue name/producer combination
464 /// \param queue_name The name of the queue to connect the filter to
465 /// \param producer_name The name of the producer that produced data going into this filter
466 /// \param idx The index of the scoreboard in which this queue exists
467 /// \note Abstract method. Must override in a child class to create filters of the correct type
468 function void cl_syoscbs_base::create_filter(string queue_name,
469  string producer_name,
470  int unsigned idx);
471  `uvm_fatal("IMPL_ERROR", "create_filter MUST be implemented in a child class")
472 endfunction: create_filter
473 
474 /// Connects a filter's output to a scoreboard's subscriber
475 /// \param queue_name The name of the queue to connect the filter to
476 /// \param producer_name The name of the producer that produced data going into this filter
477 /// \param fts_idx The index of the scoreboard in which this queue exists
478 /// \note Abstract method, will throw UVM_FATAL if called. Must override in a child class
479 function void cl_syoscbs_base::connect_filter_and_subscriber(string queue_name,
480  string producer_name,
481  int unsigned idx);
482  `uvm_fatal("IMPL_ERROR", "connect_filter_and_subscriber() MUST be implemented in a child class")
483 
484 endfunction: connect_filter_and_subscriber
485 
486 /// Implementation of UVM do_print-hmethod
487 /// Prints information of all wrapped scoreboards, as well as all filter transforms
488 /// \param printer The UVM printer to use
489 function void cl_syoscbs_base::do_print(uvm_printer printer);
490  // Print all scb instantiated by the wrapper, if any
491  if(this.scbs.size() != 0) begin
492  printer.print_generic(.name("scbs"),
493  .type_name("-"),
494  .size(this.scbs.size()),
495  .value("-"));
496 
497  foreach(this.scbs[i]) begin
498  printer.print_object(.name($sformatf("scbs[%0d]", i)),
499  .value(scbs[i]));
500  end
501  end
502 
503  // Print all filter transform instances
504  if(this.fts.size() !=0) begin
505  printer.print_generic(.name("fts"),
506  .type_name("-"),
507  .size(this.fts.size()),
508  .value("-"));
509 
510  foreach(this.fts[i,q,p]) begin
511  printer.print_object(.name($sformatf("fts[%0d][%0s][%0d]", i, q, p)), .value(fts[i][q][p]));
512  end
513  end
514 
515  super.do_print(printer);
516 endfunction: do_print
517 
518 // Implementation of UVM do_compare-method
519 // Compares information on all wrapped scoreboards, as well as all filter transforms
520 function bit cl_syoscbs_base::do_compare(uvm_object rhs, uvm_comparer comparer);
521  cl_syoscbs_base rhs_cast;
522  bit compare_result = super.do_compare(rhs, comparer);
523 
524  if(!$cast(rhs_cast, rhs))begin
525  `uvm_fatal("do_compare",
526  $sformatf("The given object argument is not %0p type", rhs_cast.get_type()))
527  return 0;
528  end
529 
530  // Compare scbs
531  if(rhs_cast.scbs.size() != this.scbs.size()) begin
532  return 0;
533  end
534  else begin
535  foreach(this.scbs[i]) begin
536  compare_result &= comparer.compare_object($sformatf("%0s", this.scbs[i].get_name()),
537  this.scbs[i],
538  rhs_cast.scbs[i]);
539  end
540  end
541 
542  //compare fts transform filters
543  if(rhs_cast.fts.size() != this.fts.size()) begin
544  return 0;
545  end
546  else begin
547  foreach(rhs_cast.fts[i,j,k]) begin
548  compare_result &= comparer.compare_object($sformatf("%0s", this.fts[i][j][k].get_name()),
549  this.fts[i][j][k],
550  rhs_cast.fts[i][j][k]);
551  end
552  end
553 
554  return compare_result;
555 endfunction: do_compare
556 
557 // Implementation of UVM do_copy-method
558 // Copies all wrapped scoreboard information, as well as filter transform information
559 function void cl_syoscbs_base::do_copy(uvm_object rhs);
560  cl_syoscbs_base rhs_cast;
561 
562  if(!$cast(rhs_cast, rhs))begin
563  `uvm_fatal("do_copy",
564  $sformatf("The given object argument is not %0p type", rhs_cast.get_type()))
565  end
566 
567  // Clone all scbs contained in rhs_cast.scbs
568  // Delete the this.scbs content before copying
569  this.scbs.delete();
570  this.scbs = new[rhs_cast.scbs.size()];
571 
572  foreach(rhs_cast.scbs[i]) begin
573  cl_syoscb l_scb;
574 
575  // Clone each scb since copying at this level should means create a copy of the entire wrapper
576  if(!$cast(l_scb, rhs_cast.scbs[i].clone())) begin
577  `uvm_fatal("do_copy",
578  $sformatf("Clone of scb: '%0s' failed!", rhs_cast.scbs[i].get_name()))
579  end
580 
581  this.scbs[i] = l_scb;
582  end
583 
584  // Clone all filter transforms inside the wrapper
585  // Delete fts array before copying
586  this.fts.delete();
587  this.fts = new[rhs_cast.fts.size()];
588 
589  foreach(rhs_cast.fts[i,q,p]) begin
590  uvm_component filter_clone;
591  if(!$cast(filter_clone, rhs_cast.fts[i][q][p].clone())) begin
592  `uvm_fatal("DO_COPY", $sformatf("Cloning filter transform %0s failed", rhs_cast.fts[i][q][p].get_name()))
593  end
594  this.fts[i][q][p] = filter_clone;
595  end
596  super.do_copy(rhs);
597 endfunction: do_copy
static string scb_separator_str(int unsigned pre_length)
Creates a new separator string for scoreboard stat tables.
virtual void compare_control_by_index(int unsigned idxs[]={}, bit cc)
Scoreboard Wrapper API: Disable or enable the compare in scoreboards with given indexes.
uvm_component fts[][string][string]
Array holding handles to filter transforms, used to transform inputs of one type to outputs of anothe...
virtual string get_failed_checks()
Scoreboard API: Returns a string with information on which checks the scoreboard has failed (e...
Definition: cl_syoscb.svh:694
virtual int get_scb_index_by_name(string scb_name)
Configuration API: Gets the index of a scoreboard with a given name
virtual string create_total_stats(int unsigned offset, int unsigned first_column_width)
Returns a table with summed scoreboard statistics for all wrapped scoreboards.
virtual int unsigned get_total_cnt_flushed_items()
Scoreboard API: Returns the number of elements that have been flushed out of the scoreboard ...
Definition: cl_syoscb.svh:644
virtual void flush_queues_all()
Scoreboard Wrapper API: Flush all queues of all scoreboards.
virtual string create_report_contents(int unsigned offset, int unsigned first_column_width)
Scoreboard API: Returns a string with all queue&#39;s statistics, to be inserted into the final report ge...
Definition: cl_syoscb.svh:613
virtual void flush_queues_by_index(int unsigned idxs[]={}, string queue_names[]={})
Scoreboard Wrapper API: Flush the queues indicated by queue_names of the scoreboards with indexes idx...
Base class for a wrapper around multiple SyoSil Scoreboards.
virtual void compare_control_by_name(string scb_names[]={}, bit cc)
Scoreboard Wrapper API: Disable or enable the compare in scoreboards with given names.
virtual int unsigned get_total_queue_size()
Scoreboard API: Returns the number of elements that the scoreboard currently contains ...
Definition: cl_syoscb.svh:661
Top level class implementing the root of the SyoSil UVM scoreboard.
Definition: cl_syoscb.svh:2
Configuration object for the cl_syoscbs_base scoreboard wrapper.
virtual int unsigned get_total_cnt_add_items()
Scoreboard API: Returns the number of elements that have been inserted into the scoreboard ...
Definition: cl_syoscb.svh:627
cl_syoscb scbs[]
Array holding handles to all scoreboards.
virtual string get_scbs_name()
Configuration API: Returns the name of this scoreboard wrapper
virtual string get_scb_failed_checks()
Gets information on whether any of the wrapped scoreboards failed to pass error checks.
virtual cl_syoscbs_cfg get_cfg()
Gets the configuration object associated with this scoreboard wrapper.
virtual void do_print(uvm_printer printer)
Implementation of UVM do_print-hmethod Prints information of all wrapped scoreboards, as well as all filter transforms.
static string pad_str(string str, int unsigned max_length, string expand=" ", bit side=0b0)
Pads the input string with another string until it reaches a given length.
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.
virtual void flush_queues_by_name(string scb_names[]={}, string queue_names[]={})
Scoreboard Wrapper API: Flush the queues indicated by queue_names of the scoreboards with names scb_n...
virtual void create_filters(int unsigned idx, cl_syoscb_cfg cfg)
Create all filter transforms for the given scoreboard.
Utility class for capturing the queue names associated with a producer.
virtual void compare_control(bit cc)
Scoreboard API: Toggles the scoreboard&#39;s comparison control.
Definition: cl_syoscb.svh:429
virtual void build_phase(uvm_phase phase)
UVM build phase.
virtual string create_scb_stats(int unsigned offset, int unsigned first_column_width)
Returns a string containing the tables with statistics of the different scoreboards.
virtual void connect_phase(uvm_phase phase)
UVM connect phase. syoscbs_base only calls super.connect_phase.
virtual void create_filter(string queue_name, string producer_name, int unsigned idx)
Creates a filter for given scoreboard/queue name/producer combination.
virtual void compare_control_all(bit cc)
Scoreboard Wrapper API: Disable or enable the compare in all scoreboards.
virtual string create_report(int unsigned offset, int unsigned first_column_width)
Scoreboard Wrapper API: Creates a summary report once simulation has finished.
virtual cl_syoscb get_scb(int unsigned idx)
Scoreboard Wrapper API: Get a handle to a scoreboard inside this wrapper
virtual void connect_filter_and_subscriber(string queue_name, string producer_name, int unsigned idx)
Connects a filter&#39;s output to a scoreboard&#39;s subscriber.
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.
virtual void flush_queues(string queue_name="")
Scoreboard API: Flushes the contents of either all queues or a specific queue.
Definition: cl_syoscb.svh:349
virtual void report_phase(uvm_phase phase)
UVM report_phase.
static string scb_header_str(string hn, int unsigned pre_length, bit side, string col_names[]=(" Inserts ", " Matches ", " Flushed ", " Orphans "))
Creates a new header string for a scoreboard stat table.

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