SyoSil ApS UVM Scoreboard  1.0.3.0
cl_syoscb_cfg.svh
1 /// Configuration class for the SyoSil UVM scoreboard
2 class cl_syoscb_cfg extends uvm_object;
3  //---------------------------------
4  // Non randomizable member variables
5  //---------------------------------
6  /// Associative array holding handles to each queue. Indexed by queue name.
7  local cl_syoscb_queue_base queues[string];
8 
9  /// Associative array indexed by producer name. Returns the list of queues which
10  /// this producer is related to.
11  local cl_syoscb_cfg_pl producers[string];
12 
13  /// Name of the primary queue used in this scoreboard. If set to an empty string,
14  /// the primary queue is dynamically selected when performing comparions (takes the shortest queue)
15  local string primary_queue;
16 
17  /// The name of the SCB. Default will be the instance name of the SCB component if the name is not set explicitly
18  local string scb_name;
19 
20  /// Queue topology used in the SCB. Defaults to \c pk_syoscb::SYOSCB_QUEUE_USER_DEFINED.
21  local t_scb_queue_type queue_type = pk_syoscb::SYOSCB_QUEUE_USER_DEFINED;
22 
23  /// Compare strategy used in the SCB. Defaults to \c pk_syoscb::SYOSCB_COMPARE_IO
24  local t_scb_compare_type compare_type = pk_syoscb::SYOSCB_COMPARE_USER_DEFINED;
25 
26  /// Defines the greed level for comparison operations. Defaults to \c pk_syoscb::SYOSCB_COMPARE_NOT_GREEDY
27  /// The greed level controls whether a comparison trigger will attempt to drain the SCB
28  /// by performing additional comparisons if the previous comparison was successful (greedy)
29  /// or if only a single comparison is performed when triggered (not greedy)
30  local t_scb_compare_greed trigger_greediness = pk_syoscb::SYOSCB_COMPARE_NOT_GREEDY;
31 
32  /// See \c trigger_greediness for description. Defaults to \c pk_syoscb::SYOSCB_COMPARE_GREEDY
33  /// This greed level is used in the cl_syoscb_compare::extract_phase() to drain remaining matches if they exist.
34  local t_scb_compare_greed end_greediness = pk_syoscb::SYOSCB_COMPARE_GREEDY;
35 
36  /// Enable/disable insertion checking on queues. Defaults to 1'b1.
37  /// - 1'b1 => Enables the check. If a queue has not had any insertions at the end of simulation, a UVM_ERROR is raised
38  /// - 1'b0 => Disables the insertion check. No error is raised if a queue did not have any insertions.
39  local bit enable_no_insert_check = 1'b1;
40 
41  /// Controls whether calls to cl_syoscb::add_item will clone the given uvm_sequence_item or reuse the handle. Defaults to 1'b0
42  /// - 1'b0 => Calls to cl_syoscb::add_item will clone the uvm_sequence_item
43  /// - 1'b1 => Calls to cl_syoscb::add_item will not clone the uvm_sequence_item
44  local bit disable_clone = 1'b0;
45 
46  /// Controls whether comparisons should be disabled after the first UVM_ERROR is raised. Defaults to 1'b0.
47  /// - 1'b0 => Comparions are not disabled after the first UVM_ERROR
48  /// - 1'b1 => Comparisons are disabled after the first UVM_ERROR
49  local bit disable_compare_after_error = 1'b0;
50 
51  /// Maximum number of elements in each queue before an error is signaled. 0 means no limit (default).
52  /// Indexed by queue name.
53  local int unsigned max_queue_size[string];
54 
55  /// Controls whether orphaned items in the queues should be treated as errors when printing at the end of simulation. Defaults to 1'b0.
56  /// -1'b0 => Orphans are printed with UVM_INFO
57  /// -1'b1 => Orphans are printed as UVM_ERRORs
58  local bit print_orphans_as_errors = 1'b0;
59 
60  /// Select the maximum number of orphaned elements to print if any orphans are left in a queue after simulation. Defaults to 0 (print everything).
61  /// If set to -1, no orphans are printed. If set to 0, all orphans are printed.
62  /// If set to a positive value N, prints up to N orphans from each queue.
63  /// See also #dump_orphans_to_files for the ability to log orphans into a file
64  local int max_print_orphans = 0;
65 
66  /// Controls whether all orphaned items should be dumped to queue-specific files at the end of simulation. Defaults to 1'b0.
67  /// If set, a number of files named <scb_name>.<orphan_dump_file_name>.<queue_name>_orphans.log are generated at the end of simulation.
68  /// The number of orphans that are printed is controlled by the knob #max_print_orphans
69  /// The value of <orphan_dump_file_name> is set by #orphan_dump_file_name
70  /// - 1'b0 => Orphans are not dumped to files at the end of simulation
71  /// - 1'b1 => Orphans are dumped to files at the end of simulation
72  local bit dump_orphans_to_files = 1'b0;
73 
74  /// Controls whether a report should be generated in the report_phase. Defaults to 1'b0
75  /// Used when e.g. this scb is wrapped by cl_syoscbs wrapper.
76  /// - 1'b0 => Report is not disabled
77  /// - 1'b1 => Report is disabled
78  local bit disable_report = 1'b0;
79 
80  /// Enable/disable the printing of queue's statistics per producer. Defaults to 1'b0.
81  /// Indexed by queue name.
82  /// - 1'b0 => Queue's producer-specific stats are disabled
83  /// - 1'b1 => Queue's producer-specific stats are enabled
84  local bit enable_queue_stats[string];
85 
86  /// Controls whether all transactions going into the SCB should be dumped to a logfile. Defaults to 1'b0 (off).
87  /// - 1'b0 => Disables dumping all transactions to a logfile
88  /// - 1'b1 => Enables dumping all transactions to a logfile
89  local bit full_scb_dump = 1'b0;
90 
91  /// Controls whether items in the full scoreboard dump should be dumped using print() or convert2string().
92  /// Defaults to 1'b0 (using object.print()).
93  /// If enabled and #full_scb_dump_type is set to TXT, the convert2string()-implementation of the wrapped object
94  /// is used when dumping. The output of convert2string must be one line, otherwise a UVM_WARNING is raised.
95  /// - 1'b0 => Items are dumped using their .print()-representation
96  /// - 1'b1 >= Items are dumped using their .convert2string()-representation
97  local bit enable_c2s_full_scb_dump = 1'b0;
98 
99  /// Controls whether SCB dumps (controlled by \c full_scb_dump) print all transactions in the same file,
100  /// or if separate files are used for each queue. Defaults to 1'b0
101  /// - 1'b0 => Dump the transactions of all the queues into the same file.
102  /// - 1'b1 => Dump the transactions of each queue in separate file.
103  local bit full_scb_dump_split = 1'b0;
104 
105  /// Controls the number of elements that a queue in the SCB can receive before transaction dumping starts.
106  /// Defaults to 0 (items are logged every time they are added to the SCB)
107  local int unsigned full_scb_max_queue_size[string];
108 
109  /// File format used when dumping SCB contents to a logfile. Defaults to TXT.
110  /// Valid values are pk_syoscb::TXT and pk_syoscb::XML.
111  local t_dump_type full_scb_dump_type = pk_syoscb::TXT;
112 
113  /// File format used when dumping orphans to logfiles. Default to TXT
114  /// Valid values are pk_syoscb::TXT and pk_syoscb::XML
115  /// If set to XML, orphan dump logfiles will use .xml extension instead of .log
116  local t_dump_type orphan_dump_type = pk_syoscb::TXT;
117 
118  /// Base file name used when dumping SCB contents to a logfile.
120 
121  /// Base file name used when dumping orphans to a logfile
122  local string orphan_dump_file_name = "orphan_dump";
123 
124  /// Controls whether a strict item ordering should be used in assoc. arrays in hash-based queue. Defaults to 1'b1.
125  /// - 1'b0 => Use the SystemVerilog implementation of the next() function for associative arrays
126  /// in the hash queue implementations. This does not guarantee the order to insertion order
127  /// For OOO compares using the hash queues this is an option
128  /// which makes the OOO compare perform at its maximum
129  /// - 1'b1 => Guarantee the order of insertions by maintaining some metadata. The OOO compare with
130  /// hashed queues take a minor performance hit when this is enabled.
131  /// Only valid for hash based queue implementations. Defaults to 1'b1 (guaranteed order of insertions)
132  local bit ordered_next = 1'b1;
133 
134  /// Controls sanity check comparisons on hash queues.
135  /// - NO_VALIDATION => Does not perform any additional validations after finding an item
136  /// in the secondary queue which matches the digest of the primary item.
137  /// - VALIDATE_MATCH => If an item is found in the secondary queue, compares the fields of the
138  /// primary item to those of the secondary to validate the match.
139  /// - VALIDATE_NO_MATCH => If a match is not found in the secondary queue, performs ordinary
140  /// comparison of the primary item to all items in the secondary queue.
141  /// This may incur a significant performance hit due to the many additional comparisons.
142  /// - VALIDATE_ALL => Performs validation when matches are found and when matches are not found.
143  /// Only used for hash-based queue implementations. Defaults to SYOSCB_HASH_COMPARE_NO_VALIDATION.
144  local t_hash_compare_check hash_compare_check = pk_syoscb::SYOSCB_HASH_COMPARE_NO_VALIDATION;
145 
146  /// Controls whether the scoreboard's configuration values should be printed in the cl_syoscb::build_phase().
147  /// Defaults to 1'b0 (disable).
148  /// - 1'b0 => Disable print of cfg configuration in cl_syoscb::build_phase()
149  /// - 1'b1 => Enable print of cfg configuration in cl_syoscb::build_phase()
150  local bit print_cfg = 1'b0;
151 
152  /// Associative array holding the bit enabling the comparer report for a specific queue/producer combination.
153  /// The comparer report contains information on the specific fields where a miscompare happens.
154  /// If no value has been set the value of #default_enable_comparer_report is used.
155  /// - 1'b0 => Disable comparer report.
156  /// - 1'b1 => Enable comparer report.
157  local bit enable_comparer_report[string][string]; //First index is the producer, second index is the queue
158 
159  /// The default comparer report toggle for a uvm_comparer that can be used when no other verbosity has been assigned to a queue's comparer.
160  /// Defaults to 1'b1 (comparer report is enabled) for IO, IOP and IO-2HP comparisons.
161  /// Defaults to 1'b0 (comparer report is disabled) for OOO and User Defned comparisons.
162  /// See #enable_comparer_report for additional details.
163  local bit default_enable_comparer_report = 1'b1; //Value modified in set_compare_type() based on input compare strategy
164 
165  /// Associative array holding handles to comparers used for a specific queue/producer combination.
166  /// If no comparer has been set for a given queue/producer combination, the #default_comparer is used.
167  local uvm_comparer comparers[string][string]; //First index is the producer, second index is the queue
168 
169  /// The default uvm_comparer that can be used when no other comparer has been assigned to a queue/producer.
170  /// By default, this comparer has a verbosity of UVM_LOW, causing miscompare information to be printed when performing OOO compares.
171  /// To change this, use cl_syoscb_comparer_config::set_verbosity to change the verbosity level
172  local uvm_comparer default_comparer;
173 
174  /// Associative array holding the printer verbosity bit for a specific queue/producer combination.
175  /// This verbosity bit controls the number of elements to be printed at the start/end of a list in a tx item.
176  /// If no entry has been set for a specific queue/producer combination the value of #default_printer_verbosity is used.
177  /// - 1'b0 => Number of elements at the head and at the end of a list is 5 (unless changed with cl_syoscb_printer_config::set_printer_begin/end_elements)
178  /// - 1'b1 => No maximum number of elements (the entire list contents are printed)
179  local bit printer_verbosity[string][string]; //First index is producer, second index is queue
180 
181  /// Default printer verbosity bit. Controls the number of array elements to output when printing a tx item.
182  /// See field #printer_verbosity for value descriptions. Defaults to 1'b0 (5 elements are printed at the head/tail of lists)
183  local bit default_printer_verbosity = 1'b0;
184 
185  /// Associative array holding handles to printers used for a specific queue/producer combination.
186  /// If no printer has been set for a specific queue/producer combination, uses the printer set in #default_printer.
187  local uvm_printer printers[string][string]; //First index is the producer, second index is the queue
188 
189  /// The default printer used for all printing purposes if no specific printer has been associated with a queue.
190  /// Defaults to being a uvm_default_printer
191  local uvm_printer default_printer;
192 
193  /// The maximum number of entries to iterate through in a queue when performing OOO compare.
194  /// If no matches are found within the search window, it is registered as no match occuring.
195  /// If max_search_window == 0, all items in a given queue are searched.
196  /// The maximum search window can be set on a per-queue basis using set_max_search_window()
197  /// Defaults to 0 (search everything)
198  local int unsigned max_search_window[string]; //indexed by queue name
199 
200  /// Controls whether cl_syoscb::add_item() should be mutexed or not. Defaults to 1'b0 (not mutexed).
201  /// When enabled, whenever an item is added to the SCB, the mutex cl_syoscb#add_item_mutex must be acquired.
202  /// This ensures that no other items are added while scanning for a match, preserving queue order when iterating.
203  /// - 1'b0 => Adding items is not mutexed
204  /// - 1'b1 => Adding items is mutexed
205  local bit mutexed_add_item_enable = 1'b0;
206 
207  /// Defines an interval value N for each queue, such that the queue's statistics are printed on every N'th insertion.
208  /// All entries default to 0 (stat printouts disabled)
209  /// - 0 => Printing stats are disabled for the given queue
210  /// - N>0 => The given queue's stats are printed every N insertions into the queue.
211  local int unsigned queue_stat_interval[string]; //indexed by queue name
212 
213  /// Defines an interval value N, similar to #queue_stat_interval, causing a printout of all queue stats in the SCB on every N'th insertion.
214  /// Default value is 0 (stat printout disabled)
215  /// - 0 => Printing SCB stats is disabled
216  /// - N>0 => The SCB stats are printed after every N insertions into the SCB.
217  local int unsigned scb_stat_interval = 0;
218 
219  //-------------------------------------
220  // UVM Macros
221  //-------------------------------------
222  // Note: fields 'queues' and 'primary_queues' have a manual print implementation in do_print
223  // field 'queues' is not copied, since the actual queue handles are generated by cl_syoscb in its build_phase
224  // 'default_comparer' and 'default_printer' are not field macro-enabled and are manually copied in do_copy
225  `uvm_object_utils_begin(cl_syoscb_cfg)
226  `uvm_field_aa_object_string(queues, UVM_DEFAULT | UVM_NOPRINT | UVM_NOCOPY | UVM_NOPACK)
227  `uvm_field_aa_object_string(producers, UVM_DEFAULT)
228  `uvm_field_string(primary_queue, UVM_DEFAULT | UVM_NOPRINT)
229  `uvm_field_enum(t_scb_queue_type, queue_type, UVM_DEFAULT)
230  `uvm_field_enum(t_scb_compare_type, compare_type, UVM_DEFAULT)
231  `uvm_field_enum(t_scb_compare_greed, trigger_greediness, UVM_DEFAULT)
232  `uvm_field_enum(t_scb_compare_greed, end_greediness, UVM_DEFAULT)
233  `uvm_field_int(enable_no_insert_check, UVM_DEFAULT)
234  `uvm_field_int(disable_clone, UVM_DEFAULT)
235  `uvm_field_int(disable_compare_after_error, UVM_DEFAULT)
236  `uvm_field_aa_int_string(max_queue_size, UVM_DEFAULT | UVM_DEC)
237  `uvm_field_int(print_orphans_as_errors, UVM_DEFAULT)
238  `uvm_field_int(max_print_orphans, UVM_DEFAULT | UVM_DEC)
239  `uvm_field_int(disable_report, UVM_DEFAULT)
240  `uvm_field_aa_int_string(enable_queue_stats, UVM_DEFAULT)
241  `uvm_field_int(full_scb_dump, UVM_DEFAULT)
242  `uvm_field_int(full_scb_dump_split, UVM_DEFAULT)
243  `uvm_field_aa_int_string(full_scb_max_queue_size, UVM_DEFAULT)
244  `uvm_field_enum(t_dump_type, full_scb_dump_type, UVM_DEFAULT)
245  `uvm_field_string(full_scb_dump_file_name, UVM_DEFAULT)
246  `uvm_field_string(scb_name, UVM_DEFAULT)
247  `uvm_field_int(ordered_next, UVM_DEFAULT)
248  `uvm_field_enum(t_hash_compare_check, hash_compare_check, UVM_DEFAULT)
249  `uvm_field_int(print_cfg, UVM_DEFAULT)
250  `uvm_field_int(default_enable_comparer_report, UVM_DEFAULT)
251  `uvm_field_int(default_printer_verbosity, UVM_DEFAULT)
252  `uvm_field_aa_int_string(max_search_window, UVM_DEFAULT | UVM_DEC)
253  `uvm_field_int(dump_orphans_to_files, UVM_DEFAULT)
254  `uvm_field_string(orphan_dump_file_name, UVM_DEFAULT)
255  `uvm_field_enum(t_dump_type, orphan_dump_type, UVM_DEFAULT)
256  `uvm_field_int(mutexed_add_item_enable, UVM_DEFAULT)
257  `uvm_field_aa_int_string(queue_stat_interval, UVM_DEFAULT)
258  `uvm_field_int(scb_stat_interval, UVM_DEFAULT)
259  `uvm_object_utils_end
260 
261 
262  //-------------------------------------
263  // Constructor
264  //-------------------------------------
265  function new(string name = "cl_syoscb_cfg");
266  super.new(name);
267  endfunction: new
268 
269  //-------------------------------------
270  // Configuration API
271  //-------------------------------------
272  extern virtual function void init(string scb_name, string queues[],
273  string producers[]);
274  extern virtual function cl_syoscb_queue_base get_queue(string queue_name);
275  extern virtual function void set_queue(string queue_name,
276  cl_syoscb_queue_base queue);
277  extern virtual function void get_queues(output string queue_names[]);
278  extern virtual function void set_queues(string queue_names[]);
279  extern virtual function bit exist_queue(string queue_name);
280  extern virtual function int unsigned size_queues();
281  extern virtual function cl_syoscb_cfg_pl get_producer(string producer);
282  extern virtual function bit set_producer(string producer, queue_names[]);
283  extern virtual function bit exist_producer(string producer);
284  extern virtual function void get_producers(output string producers[]);
285  extern virtual function string get_primary_queue();
286  extern virtual function bit set_primary_queue(string primary_queue_name);
287  extern virtual function void set_queue_type(t_scb_queue_type qt);
288  extern virtual function t_scb_queue_type get_queue_type();
289  extern virtual function void set_compare_type(t_scb_compare_type ct);
290  extern virtual function t_scb_compare_type get_compare_type();
291  extern virtual function void set_trigger_greediness(t_scb_compare_greed tg);
292  extern virtual function t_scb_compare_greed get_trigger_greediness();
293  extern virtual function void set_end_greediness(t_scb_compare_greed eg);
294  extern virtual function t_scb_compare_greed get_end_greediness();
295  extern virtual function void set_disable_clone(bit dc);
296  extern virtual function bit get_disable_clone();
297  extern virtual function void set_disable_compare_after_error(bit dcae);
298  extern virtual function bit get_disable_compare_after_error();
299  extern virtual function void set_max_queue_size(string queue_name, int unsigned mqs);
300  extern virtual function int unsigned get_max_queue_size(string queue_name);
301  extern virtual function void set_orphans_as_errors(oae);
302  extern virtual function bit get_orphans_as_errors();
303  extern virtual function void set_max_print_orphans(int mpo);
304  extern virtual function int get_max_print_orphans();
305  extern virtual function void set_disable_report(bit dr);
306  extern virtual function bit get_disable_report();
307  extern virtual function void set_enable_queue_stats(string queue_name, bit eqs);
308  extern virtual function bit get_enable_queue_stats(string queue_name);
309  extern virtual function string get_scb_name();
310  extern virtual function void set_scb_name(string scb_name);
311  extern virtual function bit get_ordered_next();
312  extern virtual function void set_ordered_next(bit ordered_next);
313  extern virtual function t_hash_compare_check get_hash_compare_check();
314  extern virtual function void set_hash_compare_check(t_hash_compare_check hcc);
315  extern virtual function bit get_print_cfg();
316  extern virtual function void set_print_cfg(bit pc);
317  extern virtual function bit dynamic_primary_queue();
318  extern virtual function void set_full_scb_dump(bit fsd);
319  extern virtual function bit get_full_scb_dump();
320  extern virtual function void set_enable_c2s_full_scb_dump(bit ecfsd);
321  extern virtual function bit get_enable_c2s_full_scb_dump();
322  extern virtual function void set_full_scb_dump_type(t_dump_type fsdt);
323  extern virtual function t_dump_type get_full_scb_dump_type();
324  extern virtual function string get_full_scb_dump_file_name();
325  extern virtual function void set_full_scb_dump_file_name(string full_scb_dump_file_name);
326  extern virtual function bit set_full_scb_dump_split(bit fsds);
327  extern virtual function bit get_full_scb_dump_split();
328  extern virtual function void set_full_scb_max_queue_size(string queue_name,
329  int unsigned fsmqs);
330  extern virtual function int unsigned get_full_scb_max_queue_size(string queue_name);
331  extern virtual function int unsigned get_max_length_queue_name();
332  extern virtual function int unsigned get_max_length_producer();
333  extern virtual function void set_enable_comparer_report(bit ecr, string queue_names[], string producer_names[]);
334  extern virtual function bit get_enable_comparer_report(string queue_name, string producer_name);
335  extern virtual function void set_default_enable_comparer_report(bit ecr);
336  extern virtual function bit get_default_enable_comparer_report();
337  extern virtual function void set_comparer(uvm_comparer comparer, string queue_names[], string producer_names[]);
338  extern virtual function uvm_comparer get_comparer(string queue_name, string producer_name);
339  extern virtual function void set_default_comparer(uvm_comparer comparer);
340  extern virtual function uvm_comparer get_default_comparer();
341  extern virtual function void set_printer_verbosity(bit pv, string queue_names[], string producer_names[]);
342  extern virtual function bit get_printer_verbosity(string queue_name, string producer_name);
343  extern virtual function void set_default_printer_verbosity(bit pv);
344  extern virtual function bit get_default_printer_verbosity();
345  extern virtual function void set_printer(uvm_printer printer, string queue_names[], string producer_names[]);
346  extern virtual function uvm_printer get_printer(string queue_name, string producer_name);
347  extern virtual function uvm_printer get_default_printer();
348  extern virtual function void set_default_printer(uvm_printer printer);
349  extern virtual function void set_enable_no_insert_check(bit enic);
350  extern virtual function bit get_enable_no_insert_check();
351  extern virtual function void do_print(uvm_printer printer);
352  extern virtual function void do_copy(uvm_object rhs);
353  extern virtual function void set_max_search_window(int unsigned sw, string queue_names[]);
354  extern virtual function int unsigned get_max_search_window(string queue_name);
355  extern virtual function void do_pack(uvm_packer packer);
356  extern virtual function void do_unpack(uvm_packer packer);
357  extern virtual function bit get_dump_orphans_to_files();
358  extern virtual function void set_dump_orphans_to_files(bit dotf);
359  extern virtual function string get_orphan_dump_file_name();
360  extern virtual function void set_orphan_dump_file_name(string odfn);
361  extern virtual function void set_mutexed_add_item_enable(bit maie);
362  extern virtual function bit get_mutexed_add_item_enable();
363  extern virtual function void set_queue_stat_interval(string queue_name, int unsigned qsi);
364  extern virtual function int unsigned get_queue_stat_interval(string queue_name);
365  extern virtual function void set_scb_stat_interval(int unsigned ssi);
366  extern virtual function int unsigned get_scb_stat_interval();
367  extern virtual function void set_orphan_dump_type(t_dump_type odt);
368  extern virtual function t_dump_type get_orphan_dump_type();
369 endclass: cl_syoscb_cfg
370 
371 /// <b>Configuration API:</b> Initializes the scoreboard's cfg with the given input parameters.
372 /// \param scb_name The name of the SCB that this cfg is related to
373 /// \param queues Names of all queues used in this SCB
374 /// \param producers Names of all producers used in this scb
375 function void cl_syoscb_cfg::init(string scb_name, string queues[], string producers[]);
376  uvm_comparer comparer;
377 
378  this.set_scb_name(scb_name);
379  this.set_queues(queues);
380 
381  foreach(producers[i]) begin
382  if (!this.set_producer(producers[i], queues)) begin
383  `uvm_fatal("CFG_ERROR",
384  $sformatf("[%s]: Unable to set producer %s for queues.", this.scb_name,
385  producers[i]));
386  end
387  end
388 
389  //Mute the miscompare output of default comparer - it will be printed into miscmp tables
390  comparer = this.get_default_comparer();
391  cl_syoscb_comparer_config::set_verbosity(comparer, UVM_HIGH);
392  this.set_default_comparer(comparer);
393 endfunction: init
394 
395 /// <b>Configuration API:</b> Returns a queue handle for the specificed queue.
396 /// \param queue_name The name of the queue to get a handle for
397 /// \return A handle to the requested queue, null if no queue with that name exists
398 function cl_syoscb_queue_base cl_syoscb_cfg::get_queue(string queue_name);
399  // If queue does not exist then return NULL
400  if(!this.exist_queue(queue_name)) begin
401  `uvm_info("CFG_ERROR", $sformatf("[%s]: Queue: %0s is not found", this.scb_name, queue_name), UVM_DEBUG);
402  return null;
403  end
404 
405  return this.queues[queue_name];
406 endfunction: get_queue
407 
408 /// <b>Configuration API:</b> Sets the queue object for a given queue.
409 /// Also sets the values of #max_queue_size and #enable_queue_stats for the given queue to 0
410 /// \param queue_name The name of the queue
411 /// \param queue The queue object to set the queue name to point to
412 function void cl_syoscb_cfg::set_queue(string queue_name, cl_syoscb_queue_base queue);
413  this.queues[queue_name] = queue;
414 
415  // Set default max queue size to no limit
416  this.max_queue_size[queue_name] = 0;
417 
418  // Set default enable_queue_stats to 0 (Off)
419  this.enable_queue_stats[queue_name] = 1'b0;
420 endfunction: set_queue
421 
422 /// <b>Configuration API:</b> Returns all queue names as a string list
423 /// \param queue_names A handle to a dynamic string array where all queue names will be returned.
424 /// If this handle already points to an allocated array, that array will be lost.
425 function void cl_syoscb_cfg::get_queues(output string queue_names[]);
426  string queue_name;
427  int unsigned idx = 0;
428 
429  queue_names = new[this.queues.size()];
430 
431  while(this.queues.next(queue_name)) begin
432  queue_names[idx++] = queue_name;
433  end
434 endfunction: get_queues
435 
436 /// <b>Configuration API:</b> Will set the legal queues when provided with a list of queue names.
437 /// An example could be: set_queues('{"Q1", "Q2"})
438 /// \param queue_names The legal queue names to use for this SCB.
439 /// \note Throws a UVM_FATAL if queue_names is empty
440 function void cl_syoscb_cfg::set_queues(string queue_names[]);
441  // Generate a fatal if queue_names doesn't contain element
442  if(queue_names.size() == 0) begin
443  `uvm_fatal("CFG_ERROR",
444  "cl_syoscb_cfg::set_queues has been called with empty queue_names argument")
445  end
446  foreach(queue_names[i]) begin
447  this.set_queue(queue_names[i], null);
448  end
449 endfunction: set_queues
450 
451 /// <b>Configuration API:</b> Checks if a queue with a given name exists.
452 /// \param queue_name The name of the queue to check
453 /// \return 1'b1 if a queue with that name exists, 1'b0 if not
454 function bit cl_syoscb_cfg::exist_queue(string queue_name);
455  return this.queues.exists(queue_name)==0 ? 1'b0 : 1'b1;
456 endfunction
457 
458 /// <b>Configuration API:</b> Returns the number of queues in this SCB
459 /// \return That value
460 function int unsigned cl_syoscb_cfg::size_queues();
461  return this.queues.size();
462 endfunction: size_queues
463 
464 /// <b>Configuration API:</b> Gets the producer object for a specified producer.
465 /// \param producer The name of the producer to get the producer object for
466 /// \return The producer object for the requested producer, null if no producer has that name
468  if(this.exist_producer(producer)) begin
469  return this.producers[producer];
470  end else begin
471  `uvm_info("CFG_ERROR", $sformatf("[%s]: Unable to get producer: %s", this.scb_name, producer), UVM_DEBUG);
472  return null;
473  end
474 endfunction: get_producer
475 
476 /// <b>Configuration API:</b> Sets the given producer for the listed queues
477 /// If any errors occur, information about this is printed as a UVM_DEBUG message
478 /// If a list of queues has already been set for a given producer, overrides that list.
479 /// \param producer The name of the producer
480 /// \param queue_names Array of queue names which the producer should be associated with
481 /// \return 1'b1 if everything works correctly, 1'b0 if an errors occurs
482 function bit cl_syoscb_cfg::set_producer(string producer, queue_names[]);
483  cl_syoscb_cfg_pl prod_list;
484 
485  // Check that all queues exists
486  begin
487  bit unique_queue_name[string];
488 
489  foreach (queue_names[i]) begin
490  if(!unique_queue_name.exists(queue_names[i])) begin
491  unique_queue_name[queue_names[i]] = 1'b1;
492  end else begin
493  `uvm_info("CFG_ERROR", $sformatf("[%s]: Unable to set producer: %s. List of queue names contains dublicates", this.scb_name, producer), UVM_DEBUG);
494  return 1'b0;
495  end
496 
497  // If queue does not exist then return 1'b0
498  if(!this.exist_queue(queue_names[i])) begin
499  `uvm_info("CFG_ERROR", $sformatf("[%s]: Queue: %0s is not found", this.scb_name, queue_names[i]), UVM_DEBUG);
500  return 1'b0;
501  end
502  end
503  end
504 
505  // All queues exist -> set the producer
506  prod_list = new(); // Create producer list
507  prod_list.set_list(queue_names); // Set queue names in producer list
508  this.producers[producer] = prod_list; // Set producer list for producer
509 
510  // Return 1'b1 since all is good
511  return 1'b1;
512 endfunction: set_producer
513 
514 /// <b>Configuration API:</b> Checks if a given producer exists.
515 /// \param producer The name of the producer to check
516 /// \return 1'b1 if that producer exists, 1'b0 otherwise
517 function bit cl_syoscb_cfg::exist_producer(string producer);
518  return this.producers.exists(producer)==0 ? 1'b0 : 1'b1;
519 endfunction: exist_producer
520 
521 /// <b>Configuration API:</b> Returns the names of all producers
522 /// \param producers Handle to dynamic string array in which producer names are returned.
523 /// If the handle already points to an allocated array, that handle is overwritten.
524 function void cl_syoscb_cfg::get_producers(output string producers[]);
525  string producer;
526  int unsigned idx = 0;
527 
528  producers = new[this.producers.size()];
529 
530  while(this.producers.next(producer)) begin
531  producers[idx++] = producer;
532  end
533 endfunction: get_producers
534 
535 /// <b>Configuration API:</b> Gets the name of primary queue for this SCB.
536 /// The primary queue is used by the compare algorithms to select which queue to use as the primary one.
537 /// \return The name of the primary queue. If no primary queue has been set, returns an empty string
539  return(this.primary_queue);
540 endfunction: get_primary_queue
541 
542 /// <b>Configuration API:</b> Sets the primary queue.
543 /// The primary queue is used by the compare algorithms to select which queue to use as the primary one.
544 /// If the given name does not match an existing queue's name, prints a UVM_DEBUG message.
545 /// \param primary_queue_name The name of the queue to make the primary queue
546 /// \return 1'b1 if the primary queue was successfully set, 1'b0 if the input queue name does not match a valid queue name
547 function bit cl_syoscb_cfg::set_primary_queue(string primary_queue_name);
548  // If queue does not exist then return 1'b0
549  if(!this.exist_queue(primary_queue_name)) begin
550  `uvm_info("CFG_ERROR", $sformatf("[%s]: Queue: %0s is not found", this.scb_name, primary_queue_name), UVM_DEBUG);
551  return 1'b0;
552  end
553 
554  // Set the primary queue
555  this.primary_queue = primary_queue_name;
556 
557  // Return 1'b1 since all is good
558  return 1'b1;
559 endfunction: set_primary_queue
560 
561 /// <b>Configuration API:</b> Set the value of the #queue_type member variable
562 function void cl_syoscb_cfg::set_queue_type(t_scb_queue_type qt);
563  this.queue_type = qt;
564 endfunction: set_queue_type
565 
566 /// <b>Configuration API:</b> Get the value of the #queue_type member variable
567 function t_scb_queue_type cl_syoscb_cfg::get_queue_type();
568  return this.queue_type;
569 endfunction: get_queue_type
570 
571 /// <b>Configuration API:</b> Set the value of the #compare_type member variable
572 function void cl_syoscb_cfg::set_compare_type(t_scb_compare_type ct);
573  this.compare_type = ct;
574  //If we're performing OOO or UD comparisons, we generally don't want to print a miscompare report
575  //If we're performing IO, IOP or IO2HP comparisons, we generally want it
576  case (this.compare_type)
577  pk_syoscb::SYOSCB_COMPARE_OOO,
578  pk_syoscb::SYOSCB_COMPARE_USER_DEFINED: this.default_enable_comparer_report = 1'b0;
579 
580  default: this.default_enable_comparer_report = 1'b1;
581  endcase
582 endfunction: set_compare_type
583 
584 /// <b>Configuration API:</b> Get the value of the #compare_type member variable
585 function t_scb_compare_type cl_syoscb_cfg::get_compare_type();
586  return this.compare_type;
587 endfunction: get_compare_type
588 
589 /// <b>Configuration API:</b> Set the value of the #trigger_greediness member variable
590 function void cl_syoscb_cfg::set_trigger_greediness(t_scb_compare_greed tg);
591  this.trigger_greediness = tg;
592 endfunction: set_trigger_greediness
593 
594 /// <b>Configuration API:</b> Get the value of the #trigger_greediness member variable
595 function t_scb_compare_greed cl_syoscb_cfg::get_trigger_greediness();
596  return this.trigger_greediness;
597 endfunction: get_trigger_greediness
598 
599 /// <b>Configuration API:</b> Set the value of the #end_greediness member variable
600 function void cl_syoscb_cfg::set_end_greediness(t_scb_compare_greed eg);
601  this.end_greediness = eg;
602 endfunction: set_end_greediness
603 
604 /// <b>Configuration API:</b> Get the value of the #end_greediness member variable
605 function t_scb_compare_greed cl_syoscb_cfg::get_end_greediness();
606  return this.end_greediness;
607 endfunction: get_end_greediness
608 
609 /// <b>Configuration API:</b> Set the value of the #disable_clone member variable
610 function void cl_syoscb_cfg::set_disable_clone(bit dc);
611  this.disable_clone = dc;
612 endfunction: set_disable_clone
613 
614 /// <b>Configuration API:</b> Get the value of the #disable_clone member variable
616  return this.disable_clone;
617 endfunction: get_disable_clone
618 
619 /// <b>Configuration API:</b> Set the value of the #disable_compare_after_error member variable
621  this.disable_compare_after_error = dcae;
623 
624 /// <b>Configuration API:</b> Get the value of the #disable_compare_after_error member variable
626  return this.disable_compare_after_error;
628 
629 /// <b>Configuration API:</b> Set the maximum number of items allowed in a given queue.
630 /// Defaults to 0 (no maximum number of items).
631 /// If no queue exists with that name, throws a UVM_FATAL
632 /// \param queue_name The name of the queue to modify
633 /// \param mqs The maximum number of items allowed in that queue
634 function void cl_syoscb_cfg::set_max_queue_size(string queue_name, int unsigned mqs);
635  if(this.exist_queue(queue_name)) begin
636  this.max_queue_size[queue_name] = mqs;
637  end else begin
638  `uvm_fatal("CFG_ERROR", $sformatf("[%s]: Queue: %s not found when trying to set max_queue_size", this.scb_name, queue_name))
639  end
640 endfunction: set_max_queue_size
641 
642 /// <b>Configuration API:</b> Returns the maximum number of items allowed in a given queue.
643 /// If no queue exists with that name, throws a UVM_FATAL
644 /// \param queue_name The name of the queue to get the maximum size for
645 function int unsigned cl_syoscb_cfg::get_max_queue_size(string queue_name);
646  if(this.exist_queue(queue_name)) begin
647  return(this.max_queue_size[queue_name]);
648  end else begin
649  `uvm_fatal("CFG_ERROR", $sformatf("[%s]: Queue: %s not found when trying to get max_queue_size", this.scb_name, queue_name))
650  return(0);
651  end
652 endfunction: get_max_queue_size
653 
654 /// <b>Configuration API:</b> Set the value of the #print_orphans_as_errors member variable
656  this.print_orphans_as_errors = oae;
657 endfunction: set_orphans_as_errors
658 
659 /// <b>Configuration API:</b> Get the value of the #print_orphans_as_errors member variable
661  return this.print_orphans_as_errors;
662 endfunction: get_orphans_as_errors
663 
664 /// <b>Configuration API:</b> Set the value of the #max_print_orphans member variable
665 /// Not that if mpo < -1 throws a UVM_FATAL
667  if(mpo < -1) begin
668  `uvm_fatal("CFG_ERROR", $sformatf("[%s] Input to set_max_print_orphans was illegal value (%0d). See field documentation for legal values", this.scb_name, mpo));
669  end
670  this.max_print_orphans = mpo;
671 endfunction: set_max_print_orphans
672 
673 /// <b>Configuration API:</b> Get the value of the #max_print_orphans member variable
674 function int cl_syoscb_cfg::get_max_print_orphans();
675  return this.max_print_orphans;
676 endfunction: get_max_print_orphans
677 
678 /// <b>Configuration API:</b> Set the value of the #disable_report member variable
679 function void cl_syoscb_cfg::set_disable_report(bit dr);
680  this.disable_report = dr;
681 endfunction: set_disable_report
682 
683 /// <b>Configuration API:</b> Get the value of the #disable_report member variable
684 function bit cl_syoscb_cfg::get_disable_report();
685  return this.disable_report;
686 endfunction: get_disable_report
687 
688 /// <b>Configuration API:</b> Set the value of #enable_queue_stats for a given queue
689 /// If no queue exists with that name, throws a UVM_FATAL
690 /// \param queue_name The name of the queue to set the value of enable_queue_stats for
691 /// \param eqs The new value of enable_queue_stats for that queue
692 function void cl_syoscb_cfg::set_enable_queue_stats(string queue_name, bit eqs);
693  if(this.exist_queue(queue_name)) begin
694  this.enable_queue_stats[queue_name] = eqs;
695  end else begin
696  `uvm_fatal("CFG_ERROR", $sformatf("[%s]: Queue: %s not found when trying to set enable_queue_stats", this.scb_name, queue_name))
697  end
698 endfunction: set_enable_queue_stats
699 
700 /// <b>Configuration API:</b> Get the value of #enable_queue_stats for a given queue
701 /// If no queue exists with that name, throws a UVM_FATAL
702 /// \param queue_name The name of the queue to get the value of enable_queue_stats for
703 function bit cl_syoscb_cfg::get_enable_queue_stats(string queue_name);
704  if(this.exist_queue(queue_name)) begin
705  return this.enable_queue_stats[queue_name];
706  end else begin
707  `uvm_fatal("CFG_ERROR", $sformatf("[%s]: Queue: %s not found when trying to get enable_queue_stats", this.scb_name, queue_name))
708  return 1'b0;
709  end
710 endfunction: get_enable_queue_stats
711 
712 /// <b>Configuration API:</b> Get the name of the SCB that this cfg is related to
713 function string cl_syoscb_cfg::get_scb_name();
714  return this.scb_name;
715 endfunction: get_scb_name
716 
717 /// <b>Configuration API:</b> Set the name of the SCB that this cfg is related to
718 function void cl_syoscb_cfg::set_scb_name(string scb_name);
719  this.scb_name = scb_name;
720 endfunction: set_scb_name
721 
722 /// <b>Configuration API:</b> Get the value of the #ordered_next member variable.
723 function bit cl_syoscb_cfg::get_ordered_next();
724  return this.ordered_next;
725 endfunction: get_ordered_next
726 
727 /// <b>Configuration API:</b> Set the value of the #ordered_next member variable.
728 function void cl_syoscb_cfg::set_ordered_next(bit ordered_next);
729  this.ordered_next = ordered_next;
730 endfunction: set_ordered_next
731 
732 /// <b>Configuration API:</b> Get the value of the #hash_compare_check member variable
733 function t_hash_compare_check cl_syoscb_cfg::get_hash_compare_check();
734  return this.hash_compare_check;
735 endfunction: get_hash_compare_check
736 
737 /// <b>Configuration API:</b> Set the value of the #hash_compare_check member variable
738 function void cl_syoscb_cfg::set_hash_compare_check(t_hash_compare_check hcc);
739  this.hash_compare_check = hcc;
740 endfunction: set_hash_compare_check
741 
742 /// <b>Configuration API:</b> Get the value of the #print_cfg member variable
743 function bit cl_syoscb_cfg::get_print_cfg();
744  return this.print_cfg;
745 endfunction: get_print_cfg
746 
747 /// <b>Configuration API:</b> Set the value of the #print_cfg member variable
748 function void cl_syoscb_cfg::set_print_cfg(bit pc);
749  this.print_cfg = pc;
750 endfunction: set_print_cfg
751 
752 /// <b>Configuration API:</b> Checks whether this SCB uses a dynamic or static primary queue.
753 /// \return 1'b1 if the primary queue is dynamic, 1'b0 if it is static
754 function bit cl_syoscb_cfg::dynamic_primary_queue();
755  return this.get_primary_queue() == "";
756 endfunction: dynamic_primary_queue
757 
758 /// <b>Configuration API:</b> Set the value of the #full_scb_dump member variable
759 function void cl_syoscb_cfg::set_full_scb_dump(bit fsd);
760  this.full_scb_dump = fsd;
761 endfunction: set_full_scb_dump
762 
763 /// <b>Configuration API:</b> Get the value of the #full_scb_dump member variable
764 function bit cl_syoscb_cfg::get_full_scb_dump();
765  return this.full_scb_dump;
766 endfunction: get_full_scb_dump
767 
768 /// <b>Configuration API:</b> Get the value of the #enable_c2s_full_scb_dump member variable
769 function void cl_syoscb_cfg::set_enable_c2s_full_scb_dump(bit ecfsd);
770  this.enable_c2s_full_scb_dump = ecfsd;
771 endfunction: set_enable_c2s_full_scb_dump
772 
773 /// <b>Configuration API:</b> Set the value of the #enable_c2s_full_scb_dump member variable
774 function bit cl_syoscb_cfg::get_enable_c2s_full_scb_dump();
775  return this.enable_c2s_full_scb_dump;
776 endfunction: get_enable_c2s_full_scb_dump
777 
778 /// <b>Configuration API:</b> Set the value of the full_scb_dump_type member variable
779 function void cl_syoscb_cfg::set_full_scb_dump_type(t_dump_type fsdt);
780  this.full_scb_dump_type = fsdt;
781 endfunction: set_full_scb_dump_type
782 
783 /// <b>Configuration API:</b> Get the value of the full_scb_dump_type member variable
784 function t_dump_type cl_syoscb_cfg::get_full_scb_dump_type();
785  return this.full_scb_dump_type;
786 endfunction: get_full_scb_dump_type
787 
788 /// <b>Configuration API:</b> Get the value of the #full_scb_dump_file_name member variable
789 function string cl_syoscb_cfg::get_full_scb_dump_file_name();
790  return(this.full_scb_dump_file_name);
791 endfunction: get_full_scb_dump_file_name
792 
793 /// <b>Configuration API:</b> Set the value of the #full_scb_dump_file_name member variable
794 function void cl_syoscb_cfg::set_full_scb_dump_file_name(string full_scb_dump_file_name);
795  this.full_scb_dump_file_name = full_scb_dump_file_name;
796 endfunction: set_full_scb_dump_file_name
797 
798 /// <b>Configuration API:</b> Set the value of the #full_scb_dump_split member variable
799 /// Note that setting #full_scb_max_queue_size > 0 for any queue in the SCB will
800 /// make it impossible to set fsds=0. A UVM_DEBUG message is printed if this happens.
801 /// \return 1'b1 if the value was successfully set, 1'b0 otherwise
802 function bit cl_syoscb_cfg::set_full_scb_dump_split(bit fsds);
803  string queue_names[];
804 
805  this.get_queues(queue_names);
806 
807  foreach (queue_names[i]) begin
808  if(fsds == 0 && this.get_full_scb_max_queue_size(queue_names[i]) > 0) begin
809  `uvm_info("CFG_ERROR", $sformatf("[%s]: Queue: %0s. Disabling full_scb_dump_split when full_scb_max_queue_size enabled is not supported.",this.scb_name, queue_names[i]),UVM_DEBUG);
810  return 1'b0;
811  end
812  end
813 
814  this.full_scb_dump_split = fsds;
815  return 1'b1;
816 endfunction: set_full_scb_dump_split
817 
818 /// <b>Configuration API:</b> Get the value of the #full_scb_dump_split member variable
820  return this.full_scb_dump_split;
821 endfunction: get_full_scb_dump_split
822 
823 /// <b>Configuration API:</b> Set the value of the #full_scb_max_queue_size member variable.
824 /// #full_scb_dump_split must be enabled before setting this value. If not, a UVM_DEBUG message is printed and the call fails
825 /// If no queue exists with that name, throws a UVM_FATAL
826 /// \param queue_name The name of the queue for which to set the value of full_scb_max_queue_size
827 /// \param fsmqs The new value of full_scb_max_queue_size
828 function void cl_syoscb_cfg::set_full_scb_max_queue_size(string queue_name,int unsigned fsmqs);
829  if(fsmqs > 0 && this.get_full_scb_dump_split() == 0) begin
830  `uvm_info("CFG_ERROR", $sformatf("[%s]: Queue: %0s. Cannot set full_scb_max_queue_size when full_scb_dump_split is 0. Must set to 1 beforehand.",this.scb_name, queue_name),UVM_DEBUG);
831  end else begin
832  if(!this.exist_queue(queue_name)) begin
833  `uvm_fatal("CFG_ERROR", $sformatf("[%s]: Queue: %0s is not found", this.scb_name, queue_name));
834  end
835  this.full_scb_max_queue_size[queue_name] = fsmqs;
836  end
837 endfunction: set_full_scb_max_queue_size
838 
839 /// <b>Configuration API:</b> Get the value of the #full_scb_max_queue_size member variable for a given queue.
840 /// If no queue exists with that name, prints a UVM_DEBUG message
841 /// \return The value of full_scb_max_queue_size if the queue name is valid, 0 otherwise
842 function int unsigned cl_syoscb_cfg::get_full_scb_max_queue_size(string queue_name);
843  if(!this.exist_queue(queue_name)) begin
844  `uvm_info("CFG_ERROR", $sformatf("[%s]: Queue: %0s is not found", this.scb_name, queue_name), UVM_DEBUG);
845  return 0;
846  end
847 
848  if(this.full_scb_max_queue_size.exists(queue_name)) begin
849  return this.full_scb_max_queue_size[queue_name];
850  end else begin
851  return 0;
852  end
853 endfunction: get_full_scb_max_queue_size
854 
855 /// <b>Configuration API:</b> Returns the length of the queue name with maximum length
857  int unsigned max_length_queue_name;
858 
859  foreach (this.queues[name]) begin
860  if(name.len() > max_length_queue_name) begin
861  max_length_queue_name = name.len();
862  end
863  end
864 
865  return max_length_queue_name;
866 endfunction: get_max_length_queue_name
867 
868 /// <b>Configuration API:</b> Returns the length of the producer name with maximum length
870  int unsigned max_length_producer;
871 
872  foreach (this.producers[name]) begin
873  if(name.len() > max_length_producer) begin
874  max_length_producer = name.len();
875  end
876  end
877 
878  return max_length_producer;
879 endfunction: get_max_length_producer
880 
881 /// <b>Configuration API:</b> Enables or disables the comparer report for a number of comparers.
882 /// If both "queue_names" and "producer_names" are empty, sets the comparer report enable bit for all queue/producer combinations
883 /// If an invalid/non-existent queue or producer name is passed, a DEBUG message is printed,
884 ///
885 /// \param ecr: The value of the comparer report enable/disable flag. See #enable_comparer_report for value descriptions.
886 /// \param queue_names: Names of the queues for which the designated comparers should use this comparer report enable bit
887 /// \param producer_names: Names of the producers for which all associated queues' comparers should use the given value
888 function void cl_syoscb_cfg::set_enable_comparer_report(bit ecr, string queue_names[], string producer_names[]);
889  //If no queues or producers are given, set all comparer reports
890  if(queue_names.size() == 0 && producer_names.size() == 0) begin
891  this.get_queues(queue_names);
892  this.get_producers(producer_names);
893  end
894 
895  //For each producer, get their list of queues. Then, check if that list also contains a given queue
896  //If it does, set that producer/queue combination
897  foreach(producer_names[i]) begin
898  if(!this.exist_producer(producer_names[i])) begin
899  `uvm_info("CFG_ERROR", $sformatf("[%s]: Producer %0s does not exist", this.scb_name, producer_names[i]), UVM_DEBUG)
900  end else begin
901  cl_syoscb_cfg_pl prod_list;
902 
903  prod_list = this.get_producer(producer_names[i]);
904  foreach(queue_names[j]) begin
905  if(!this.exist_queue(queue_names[j])) begin
906  `uvm_info("CFG_ERROR", $sformatf("[%s]: Queue: %0s was not found", this.scb_name, queue_names[i]), UVM_DEBUG)
907  end else begin
908  string f[$];
909 
910  f = prod_list.list.find(x) with (x == queue_names[j]);
911  if(f.size() == 1) begin //We only expect exactly one match
912  this.enable_comparer_report[producer_names[i]][queue_names[j]] = ecr;
913  end
914  end
915  end
916  end
917  end
918 endfunction: set_enable_comparer_report
919 
920 /// <b>Configuration API:</b> Returns the comparer report enable bit associated with a given queue/producer combination.
921 /// If no bit has been set for a given queue's comparer by using #set_enable_comparer_report,
922 /// returns #default_enable_comparer_report
923 ///
924 /// \param queue_name Name of the queue for which the designated comparer's enable report bit should be returned
925 /// \param producer_name Name of the producer for which the associated queue's comparer's enable report bit should be returned
926 /// \return The given queue/producer combination's comparer enable report bit, or the default value if none has been set
927 /// for this specific queue/producer combination
928 function bit cl_syoscb_cfg::get_enable_comparer_report(string queue_name, string producer_name);
929  if(!this.exist_producer(producer_name)) begin
930  `uvm_info("CFG_ERROR", $sformatf("[%s]: Producer %0s does not exist", this.scb_name, producer_name), UVM_DEBUG)
931  end else if(!this.exist_queue(queue_name)) begin
932  `uvm_info("CFG_ERROR", $sformatf("[%s]: Queue: %0s was not found", this.scb_name, queue_name), UVM_DEBUG)
933  end else if(this.enable_comparer_report.exists(producer_name) && this.enable_comparer_report[producer_name].exists(queue_name)) begin
934  return this.enable_comparer_report[producer_name][queue_name];
935  end
936 
937  //Explicitly returns default value if no entry exists for the given producer/queue combo
938  return this.default_enable_comparer_report;
939 endfunction: get_enable_comparer_report
940 
941 /// <b>Configuration API:</b> Set the value of the #default_enable_comparer_report member variable.
942 /// See #enable_comparer_report for legal values.
946 
947 /// <b>Configuration API:</b> Get the value of the #default_enable_comparer_report member variable
949  return this.default_enable_comparer_report;
951 
952 /// <b>Configuration API:</b> Sets the comparer to be used for a number of queues.
953 /// If both "queue_names" and "producer_names" are empty, sets the given comparer for all queue/producer combinations.
954 /// If an invalid/non-existent queue or producer name is passed, a DEBUG message is printed.
955 ///
956 /// \param comparer The comparer to be used for the given queues and producers.
957 /// \param queue_names Names of the queues for which the given comparer should be used.
958 /// \param producer_names Names of the producers for which all associated queues' should use the given comparer.
959 function void cl_syoscb_cfg::set_comparer(uvm_comparer comparer, string queue_names[], string producer_names[]);
960  //If no queues or producers are given, set all comparers
961  if(queue_names.size() == 0 && producer_names.size() == 0) begin
962  this.get_queues(queue_names);
963  this.get_producers(producer_names);
964  end
965 
966  //For each producer, get their list of queues. Then, check if that list also contains a given queue
967  //If it does, set that producer/queue combination
968  foreach(producer_names[i]) begin
969  if(!this.exist_producer(producer_names[i])) begin
970  `uvm_info("CFG_ERROR", $sformatf("[%s]: Producer %0s does not exist", this.scb_name, producer_names[i]), UVM_DEBUG)
971  end else begin
972  cl_syoscb_cfg_pl prod_list;
973 
974  prod_list = this.get_producer(producer_names[i]);
975  foreach(queue_names[j]) begin
976  if(prod_list.exists(queue_names[j])) begin //We only expect exactly one match
977  this.comparers[producer_names[i]][queue_names[j]] = comparer;
978  end else begin
979  `uvm_info("CFG_ERROR", $sformatf("[%s]: Queue: %0s was not found", this.scb_name, queue_names[i]), UVM_DEBUG)
980  end
981  end
982  end
983  end
984 endfunction: set_comparer
985 
986 /// <b>Configuration API:</b> Returns the comparer associated with a given queue and producer.
987 /// \param queue_name Name of the queue for which the comparer should be returned
988 /// \param producer_name Name of the producer for which the associated queue's comparer should be returned
989 /// \return The requested comparer. If no comparer has been set for a given queue/producer, returns null.
990 /// Also returns null if either of the input parameters are invalid.
991 function uvm_comparer cl_syoscb_cfg::get_comparer(string queue_name, string producer_name);
992  if(!this.exist_producer(producer_name)) begin
993  `uvm_info("CFG_ERROR", $sformatf("[%s]: Producer %0s does not exist", this.scb_name, producer_name), UVM_DEBUG)
994  end else if(!this.get_producer(producer_name).exists(queue_name)) begin
995  `uvm_info("CFG_ERROR", $sformatf("[%s]: Queue: %0s was not found", this.scb_name, queue_name), UVM_DEBUG)
996  end else if(this.comparers.exists(producer_name) && this.comparers[producer_name].exists(queue_name)) begin
997  return this.comparers[producer_name][queue_name];
998  end
999 
1000  //Explicitly returns null if producer/queue name does not exist,
1001  //or if no entry exists for the given producer / for the given queue under that producer
1002  return null;
1003 endfunction: get_comparer
1004 
1005 /// <b>Configuration API:</b> Set the value of the #default_comparer member variable
1006 function void cl_syoscb_cfg::set_default_comparer(uvm_comparer comparer);
1007  this.default_comparer = comparer;
1008 endfunction: set_default_comparer
1009 
1010 /// <b>Configuration API:</b> Get the value of the #default_comparer member variable
1011 function uvm_comparer cl_syoscb_cfg::get_default_comparer();
1012  if(this.default_comparer == null) begin
1013  `ifdef UVM_VERSION
1014  this.default_comparer = uvm_comparer::get_default();
1015  `else
1016  this.default_comparer = uvm_default_comparer;
1017  `endif
1018  //Set default verbosity to UVM_HIGH, as we generally don't want to print MISCMP messages
1019  cl_syoscb_comparer_config::set_verbosity(this.default_comparer, UVM_HIGH);
1020  end
1021 
1022  return this.default_comparer;
1023 endfunction: get_default_comparer
1024 
1025 
1026 /// <b>Configuration API:</b> Sets the verbosity level to be used for a number of printers.
1027 /// If both "queue_names" and "producer_names" are empty, sets the verbosity bit for all queue/producer combinations
1028 /// If an invalid/non-existent queue or producer name is passed, a DEBUG message is printed,
1029 ///
1030 /// \param pv The value of the verbosity bit to set. See #printer_verbosity for value descriptions
1031 /// \param queue_names Names of the queues for which the designated printers should use this verbosity bit
1032 /// \param producer_names Names of the producers for which all associated queues' printers should use the given verbosity bit.
1033 function void cl_syoscb_cfg::set_printer_verbosity(bit pv, string queue_names[], string producer_names[]);
1034  //If no queues or producers are given, set all verbosity bits
1035  if(queue_names.size() == 0 && producer_names.size() == 0) begin
1036  this.get_queues(queue_names);
1037  this.get_producers(producer_names);
1038  end
1039 
1040  //For each producer, get their list of queues. Then, check if that list also contains a given queue
1041  //If it does, set that producer/queue combination
1042  foreach(producer_names[i]) begin
1043  if(!this.exist_producer(producer_names[i])) begin
1044  `uvm_info("CFG_ERROR", $sformatf("[%s]: Producer %0s does not exist", this.scb_name, producer_names[i]), UVM_DEBUG)
1045  end else begin
1046  cl_syoscb_cfg_pl prod_list;
1047 
1048  prod_list = this.get_producer(producer_names[i]);
1049  foreach(queue_names[j]) begin
1050  if(!this.exist_queue(queue_names[j])) begin
1051  `uvm_info("CFG_ERROR", $sformatf("[%s]: Queue: %0s was not found", this.scb_name, queue_names[i]), UVM_DEBUG)
1052  end else begin
1053  string f[$];
1054 
1055  f = prod_list.list.find(x) with (x == queue_names[j]);
1056  if(f.size() == 1) begin //We only expect exactly one match
1057  this.printer_verbosity[producer_names[i]][queue_names[j]] = pv;
1058  end
1059  end
1060  end
1061  end
1062  end
1063 endfunction: set_printer_verbosity
1064 
1065 /// <b>Configuration API:</b> Returns the verbosity bit associated with a given queue/producer combination.
1066 /// \param queue_name Name of the queue for which the designated printers's verbosity bit should be returned
1067 /// \param producer_name Name of the producer for which the associated queue's printers's verbosity bit should be returned
1068 /// \return That queue/producer combination's printer verbosity bit. If none has been set, or either argument is invalid,
1069 /// returns #default_printer_verbosity.
1070 function bit cl_syoscb_cfg::get_printer_verbosity(string queue_name, string producer_name);
1071  if(!this.exist_producer(producer_name)) begin
1072  `uvm_info("CFG_ERROR", $sformatf("[%s]: Producer %0s does not exist", this.scb_name, producer_name), UVM_DEBUG)
1073  end else if(!this.exist_queue(queue_name)) begin
1074  `uvm_info("CFG_ERROR", $sformatf("[%s]: Queue: %0s was not found", this.scb_name, queue_name), UVM_DEBUG)
1075  end else if(this.printer_verbosity.exists(producer_name) && this.printer_verbosity[producer_name].exists(queue_name)) begin
1076  return this.printer_verbosity[producer_name][queue_name];
1077  end
1078 
1079  //Always return default verbosity in case queue/producer name does not exist or no other verbosity is set
1080  return this.default_printer_verbosity;
1081 endfunction: get_printer_verbosity
1082 
1083 /// <b>Configuration API:</b> Set the value of the #default_printer_verbosity member variable.
1084 /// See #printer_verbosity for legal values
1086  this.default_printer_verbosity = pv;
1087 endfunction: set_default_printer_verbosity
1088 
1089 /// <b>Configuration API:</b> Get the value of the #default_printer_verbosity member variable
1091  return this.default_printer_verbosity;
1092 endfunction: get_default_printer_verbosity
1093 
1094 /// <b>Configuration API:</b> Sets the given uvm_printer to be used for some queue/producer-combinations.
1095 /// If both "queue_names" and "producer_names" are empty, sets that printer to be used for all queue/producers
1096 /// If an invalid/non-existent queue or producer name is passed, a DEBUG message is printed,
1097 ///
1098 /// \param printer: The printer to be used for the given queues and producers
1099 /// \param queue_names: Names of the queues which should use the printer.
1100 /// \param producer_names: Names of the producers for which all associated queues should use the given printer.
1101 function void cl_syoscb_cfg::set_printer(uvm_printer printer, string queue_names[], string producer_names[]);
1102 
1103  //If no queues or producers are given, set all printers
1104  if(queue_names.size() == 0 && producer_names.size() == 0) begin
1105  this.get_queues(queue_names);
1106  this.get_producers(producer_names);
1107  end
1108 
1109  //For each producer, get their list of queues. Then, check if that list also contains a given queue
1110  //If it does, set that producer/queue combination
1111  foreach(producer_names[i]) begin
1112  if(!this.exist_producer(producer_names[i])) begin
1113  `uvm_info("CFG_ERROR", $sformatf("[%s]: Producer %0s does not exist", this.scb_name, producer_names[i]), UVM_DEBUG)
1114  end else begin
1115  cl_syoscb_cfg_pl prod_list;
1116 
1117  prod_list = this.get_producer(producer_names[i]);
1118  foreach(queue_names[j]) begin
1119  if(prod_list.exists(queue_names[j])) begin //We only expect exactly one match
1120  this.printers[producer_names[i]][queue_names[j]] = printer;
1121  end else begin
1122  `uvm_info("CFG_ERROR", $sformatf("[%s]: Queue: %0s was not found", this.scb_name, queue_names[i]), UVM_DEBUG)
1123  end
1124  end
1125  end
1126  end
1127 endfunction: set_printer
1128 
1129 /// <b>Configuration API:</b> Returns the printer associated with a given producer/queue combination.
1130 /// \param queue_name: Name of the queue for which the printer should be returned
1131 /// \param producer_name: Name of the producer for which the associated queue's printer should be returned
1132 /// \return That queue/producer combination's printer. If none has been set, or either argument is invalid,
1133 /// returns null.
1134 function uvm_printer cl_syoscb_cfg::get_printer(string queue_name, string producer_name);
1135  if(!this.exist_producer(producer_name)) begin
1136  `uvm_info("CFG_ERROR", $sformatf("[%s]: Producer %0s does not exist", this.scb_name, producer_name), UVM_DEBUG)
1137  end else if(!this.get_producer(producer_name).exists(queue_name)) begin
1138  `uvm_info("CFG_ERROR", $sformatf("[%s]: Queue: %0s was not found", this.scb_name, queue_name), UVM_DEBUG)
1139  end else if(this.printers.exists(producer_name) && this.printers[producer_name].exists(queue_name)) begin
1140  return this.printers[producer_name][queue_name];
1141  end
1142 
1143  //Explicitly returns null if producer/queue name does not exist,
1144  //or if no entry exists for the given producer / for the given queue under that producer
1145  return null;
1146 endfunction: get_printer
1147 
1148 /// <b>Configuration API:</b> Get the value of the #default_printer member variable
1149 function uvm_printer cl_syoscb_cfg::get_default_printer();
1150  if(this.default_printer == null) begin
1151  `ifdef UVM_VERSION
1152  this.default_printer = uvm_printer::get_default();
1153  `else
1154  this.default_printer = uvm_default_printer;
1155  `endif
1156  end
1157  return this.default_printer;
1158 endfunction: get_default_printer
1159 
1160 /// <b>Configuration API:</b> Set the value of the #default_printer member variable
1161 function void cl_syoscb_cfg::set_default_printer(uvm_printer printer);
1162  this.default_printer = printer;
1163 endfunction: set_default_printer
1164 
1165 /// <b>Configuration API:</b> Set the value of the #enable_no_insert_check member variable.
1167  this.enable_no_insert_check = enic;
1168 endfunction: set_enable_no_insert_check
1169 
1170 /// <b>Configuration API:</b> Gets the values of the #enable_no_insert_check member variable
1172  return this.enable_no_insert_check;
1173 endfunction: get_enable_no_insert_check
1174 
1175 /// <b>Configuration API:</b> Sets the maximum search window when performing OOO, IOP or user defined comparison operations.
1176 /// If the current comparison type is not \c SYOSCB_COMPARE_OOO, \c SYOSCB_COMPARE_IOP or \c SYOSCB_COMPARE_USER_DEFINED,
1177 /// a uvm_fatal is generated.
1178 /// All other comparison types expect matching items to be at the head of their respective queues, so these
1179 /// comparisons are the only place where the notion of a maximum search window makes sense.
1180 /// Will also throw a fatal if the given queue's type is not one of \c SYOSCB_QUEUE_STD or \c SYOSCB_QUEUE_USER_DEFINED.
1181 /// A maximum search window does not make sense when using MD5-queues,
1182 /// as all lookups are performed in O(1) time, independent of the number of elements in the queue.
1183 ///
1184 /// \param sw: The maximum search window the for given queues. If set to 0, all items in the given queues are searched
1185 /// \param queue_names: Names of the queues to set the maximum search window for. If an empty array is given, the maximum search window for all queues is set to \c sw.
1186 /// If an invalid queue name is passed, a UVM_FATAL is raised.
1187 function void cl_syoscb_cfg::set_max_search_window(int unsigned sw, string queue_names[]);
1188  //If no queue names are given, act on all queues
1189  if(queue_names.size() == 0) begin
1190  this.get_queues(queue_names);
1191  end
1192 
1193  foreach(queue_names[i]) begin
1194  if(!this.exist_queue(queue_names[i])) begin
1195  `uvm_fatal("CFG_ERROR", $sformatf("[%s]: Queue %0s was not found", this.scb_name, queue_names[i]))
1196  end else if((this.compare_type != pk_syoscb::SYOSCB_COMPARE_OOO && this.compare_type != pk_syoscb::SYOSCB_COMPARE_USER_DEFINED)) begin
1197  `uvm_fatal("CFG_ERROR", $sformatf("Can only set max search window if compare type is OOO or USER_DEFINED. Got %0s", this.compare_type.name()));
1198  end else if (this.queue_type != pk_syoscb::SYOSCB_QUEUE_STD && this.queue_type != pk_syoscb::SYOSCB_QUEUE_USER_DEFINED) begin
1199  `uvm_fatal("CFG_ERROR", $sformatf("Can only set max search window when queue type is STD or USER_DEFINED. Got %0s", this.queue_type.name()));
1200  end else begin
1201  //Queue name exists and everything is valid
1202  this.max_search_window[queue_names[i]] = sw;
1203  end
1204  end
1205 endfunction: set_max_search_window
1206 
1207 /// <b>Configuration API:</b> Returns the value of #max_search_window for a given queue.
1208 /// If an invalid queue name is passed, prints a UVM_DEBUG message
1209 /// \param queue_name: The queue for which to get the maximum search window.
1210 /// \return That queue's max. search window. If no maximum search window has been set, returns 0
1211 function int unsigned cl_syoscb_cfg::get_max_search_window(string queue_name);
1212  if(!this.exist_queue(queue_name)) begin
1213  `uvm_info("CFG_ERROR", $sformatf("[%s] Cannot get max search window for queue named '%0s'. No queue with this name.", this.scb_name, queue_name), UVM_DEBUG)
1214  return 0;
1215  end else if(!this.max_search_window.exists(queue_name)) begin
1216  this.max_search_window[queue_name] = 0;
1217  end
1218 
1219  return this.max_search_window[queue_name];
1220 endfunction: get_max_search_window
1221 
1222 /// <b>Configuration API:</b> Sets the value of the #mutexed_add_item_enable member variable.
1224  this.mutexed_add_item_enable = maie;
1225 endfunction: set_mutexed_add_item_enable
1226 
1227 /// <b>Configuration API:</b> Gets the value of the #mutexed_add_item_enable member variable.
1229  return this.mutexed_add_item_enable;
1230 endfunction: get_mutexed_add_item_enable
1231 
1232 /// <b>Configuration API:</b> Sets the value of the #dump_orphans_to_files member variable.
1233 /// \note If dotf == 1'b1 and #max_print_orphans < 0, a UVM_FATAL is thrown as it
1234 /// does not make sense to dump orphans when no orphans are printed.
1236  if(this.max_print_orphans < 0 && dotf == 1'b1) begin
1237  `uvm_fatal("CFG_ERROR", $sformatf("[%s]: Enabling dump_orphans_to_files while max_print_orphans < 0 will cause nothing to be dumped. Ensure that max_print_orphans >= 0 before enabling dumping.", this.scb_name))
1238  end
1239  this.dump_orphans_to_files = dotf;
1240 endfunction: set_dump_orphans_to_files
1241 
1242 /// <b>Configuration API:</b> Gets the value of the #dump_orphans_to_files member variable
1243 function bit cl_syoscb_cfg::get_dump_orphans_to_files();
1244  return this.dump_orphans_to_files;
1245 endfunction: get_dump_orphans_to_files
1246 
1247 /// <b>Configuration API:</b> Sets the value of the #orphan_dump_type member variable
1248 function void cl_syoscb_cfg::set_orphan_dump_type(t_dump_type odt);
1249  this.orphan_dump_type = odt;
1250 endfunction: set_orphan_dump_type
1251 
1252 /// <b>Configuration API:</b> Get the value of the #orphan_dump_type member variable
1253 function t_dump_type cl_syoscb_cfg::get_orphan_dump_type();
1254  return this.orphan_dump_type;
1255 endfunction: get_orphan_dump_type
1256 
1257 /// <b>Configuration API:</b> Sets the value of the #orphan_dump_file_name member variable
1258 function void cl_syoscb_cfg::set_orphan_dump_file_name(string odfn);
1259  this.orphan_dump_file_name = odfn;
1260 endfunction: set_orphan_dump_file_name
1261 
1262 /// <b>Configuration API:</b> Gets the value of the #orphan_dump_file_name member variable
1263 function string cl_syoscb_cfg::get_orphan_dump_file_name();
1264  return this.orphan_dump_file_name;
1265 endfunction: get_orphan_dump_file_name
1266 
1267 /// <b>Configuration API:</b> Sets the value of the #queue_stat_interval member variable for the given queue.
1268 /// If the given queue name does not match an existing queue, throws a UVM_FATAL.
1269 /// \param queue_name The name of the queue for which to set the value
1270 /// \param qsi The new value of the queue's statistic printout interval
1271 function void cl_syoscb_cfg::set_queue_stat_interval(string queue_name, int unsigned qsi);
1272  if(!this.exist_queue(queue_name)) begin
1273  `uvm_fatal("CFG_ERROR", $sformatf("[%s] Queue %0s was not found", this.scb_name, queue_name))
1274  end
1275  this.queue_stat_interval[queue_name] = qsi;
1276 
1277 endfunction: set_queue_stat_interval
1278 
1279 /// <b>Configuration API:</b> Gets the value of the #queue_stat_interval member variable for the given queue.
1280 /// If the given queue name does not match an existing queue, throws a UVM_FATAL.
1281 /// If no stat interval has been set for the given queue yet, returns 0
1282 /// \param queue_name The name of the queue for which to get the value
1283 function int unsigned cl_syoscb_cfg::get_queue_stat_interval(string queue_name);
1284  if(!this.exist_queue(queue_name)) begin
1285  `uvm_fatal("CFG_ERRO", $sformatf("[%s] Queue %0s was not found", this.scb_name, queue_name))
1286  end else if(!this.queue_stat_interval.exists(queue_name)) begin
1287  this.queue_stat_interval[queue_name] = 0;
1288  end
1289  return this.queue_stat_interval[queue_name];
1290 endfunction: get_queue_stat_interval
1291 
1292 /// <b>Configuration API:</b> Sets the value of the #scb_stat_interval member variable
1293 /// \param ssi The new value of the field
1294 function void cl_syoscb_cfg::set_scb_stat_interval(int unsigned ssi);
1295  this.scb_stat_interval = ssi;
1296 endfunction: set_scb_stat_interval
1297 
1298 /// <b>Configuration API:</b> Gets the value of the #scb_stat_interval member variable
1299 function int unsigned cl_syoscb_cfg::get_scb_stat_interval();
1300  return this.scb_stat_interval;
1301 endfunction: get_scb_stat_interval
1302 
1303 
1304 // Custom do_print implementation.
1305 // Primarily used to print queue names and static/dynamic primary queue
1306 function void cl_syoscb_cfg::do_print(uvm_printer printer);
1307  string queue_name;
1308 
1309  if(this.queues.first(queue_name)) begin
1310  int unsigned idx = 0;
1311 
1312  printer.print_generic(.name("queues"),
1313  .type_name("-"),
1314  .size(this.queues.size()),
1315  .value("-"));
1316  do begin
1317  printer.print_generic(.name($sformatf(" [%0d]", idx++)),
1318  .type_name(" "),
1319  .size(queue_name.len()),
1320  .value(queue_name));
1321  end
1322  while(this.queues.next(queue_name));
1323  end
1324 
1325  printer.print_string(.name("primary_queue"),
1326  .value(this.dynamic_primary_queue() == 1'b1 ? "<dynamic>" :
1327  $sformatf("<static: %0s>",
1328  primary_queue)));
1329 
1330  super.do_print(printer);
1331 endfunction: do_print
1332 
1333 // The implementation of do_copy for cfg objects is used
1334 // in order to copy printer and comparer handles as these cannot be registered
1335 // with the uvm macros
1336 function void cl_syoscb_cfg::do_copy(uvm_object rhs);
1337  cl_syoscb_cfg rhs_cast;
1338  uvm_comparer comparer;
1339  uvm_printer printer;
1340  uvm_printer new_printer;
1341  string queue_names[];
1342  string producer_names[];
1343  bit verbosity;
1344 
1345  if(!$cast(rhs_cast, rhs))begin
1346  `uvm_fatal("do_copy",
1347  $sformatf("the given object argument is not %0p type", rhs_cast.get_type()))
1348  end
1349 
1350  rhs_cast.get_queues(queue_names);
1351  rhs_cast.get_producers(producer_names);
1352 
1353  //Copy RHS default and queue-specific comparers
1354  comparer = this.get_default_comparer();
1355  cl_syoscb_comparer_config::copy_comparer(rhs_cast.get_default_comparer(), comparer);
1356  this.set_default_comparer(comparer);
1357 
1358  verbosity = rhs_cast.get_default_enable_comparer_report();
1359  this.set_default_enable_comparer_report(verbosity);
1360 
1361  foreach(producer_names[i]) begin
1362  foreach(queue_names[j]) begin
1363  uvm_comparer new_comparer;
1364  bit new_ecr;
1365  comparer = rhs_cast.get_comparer(queue_names[j], producer_names[i]);
1366  if(comparer != null) begin
1367  $cast(new_comparer, comparer);
1368  cl_syoscb_comparer_config::copy_comparer(comparer, new_comparer);
1369  this.set_comparer(new_comparer, '{queue_names[j]}, '{producer_names[i]});
1370 
1371  new_ecr = rhs_cast.get_enable_comparer_report(queue_names[j], producer_names[i]);
1372  this.set_enable_comparer_report(new_ecr, '{queue_names[j]}, '{producer_names[i]});
1373  end
1374  end
1375  end
1376 
1377  //Copy RHS default and queue-specific printers
1378  printer = rhs_cast.get_default_printer();
1379  $cast(new_printer, printer);
1380  cl_syoscb_printer_config::copy_printer(new_printer, printer);
1381  this.set_default_printer(new_printer);
1382 
1383  verbosity = rhs_cast.get_default_printer_verbosity();
1384  this.set_default_printer_verbosity(verbosity);
1385 
1386  foreach(producer_names[i]) begin
1387  foreach(queue_names[j]) begin
1388  bit new_verbosity;
1389  printer = rhs_cast.get_printer(queue_names[j], producer_names[i]);
1390 
1391  if(printer != null) begin
1392  $cast(new_printer, printer);
1393  cl_syoscb_printer_config::copy_printer(printer, new_printer);
1394  this.set_printer(new_printer, '{queue_names[j]}, '{producer_names[i]});
1395 
1396  new_verbosity = rhs_cast.get_printer_verbosity(queue_names[j], producer_names[i]);
1397  this.set_printer_verbosity(new_verbosity, '{queue_names[j]}, '{producer_names[i]});
1398  end
1399  end
1400  end
1401 
1402  super.do_copy(rhs);
1403 endfunction: do_copy
1404 
1405 // The implementation of do_pack is primarily used to pack information
1406 // about printers and comparers as these are not automatically packed.
1407 function void cl_syoscb_cfg::do_pack(uvm_packer packer);
1408  string queue_names[];
1409  string producer_names[];
1410  cl_syoscb_cfg_pl prod_list;
1411  bit printer_verbosity;
1412  uvm_printer printer;
1413  uvm_comparer comparer;
1414  bit ecr;
1415 
1416  super.do_pack(packer);
1417  this.get_producers(producer_names);
1418 
1419  //Ensure that we are using metadata when packing
1420  //Start by packing the number of producers
1421  packer.pack_field_int(this.producers.size(), $bits(this.producers.size()));
1422  foreach(producer_names[i]) begin
1423  // Using producer list to get queue names since this.get_queues returns an
1424  // empty list if this cfg was generated by copying another cfg
1425  prod_list = this.get_producer(producer_names[i]);
1426  queue_names = prod_list.list;
1427 
1428  //Pack producer name, number of queues and iteratively pack queue names and queue-specific values
1429  packer.pack_string(producer_names[i]);
1430  packer.pack_field_int(queue_names.size(), $bits(queue_names.size()));
1431 
1432  foreach(queue_names[j]) begin
1433  printer = this.get_printer(queue_names[j], producer_names[i]);
1434  comparer = this.get_comparer(queue_names[j], producer_names[i]);
1435  ecr = this.get_enable_comparer_report(queue_names[j], producer_names[i]);
1436  printer_verbosity = this.get_printer_verbosity(queue_names[j], producer_names[i]);
1437 
1438  packer.pack_string(queue_names[j]);
1439  cl_syoscb_comparer_config::do_help_pack(comparer, packer);
1440  cl_syoscb_printer_config::do_help_pack(printer, packer);
1441  packer.pack_field_int(printer_verbosity, $bits(printer_verbosity));
1442  packer.pack_field_int(ecr, $bits(ecr));
1443  end
1444  end
1445 
1446  cl_syoscb_comparer_config::do_help_pack(this.get_default_comparer(), packer);
1447  cl_syoscb_printer_config::do_help_pack(this.get_default_printer(), packer);
1448  packer.pack_field_int(this.default_printer_verbosity, $bits(this.default_printer_verbosity));
1449  packer.pack_field_int(this.default_enable_comparer_report, $bits(this.default_enable_comparer_report));
1450 endfunction: do_pack
1451 
1452 // The implementation of do_unpack ensures that printers and comparers
1453 // are correctly unpacked and new objects instantiated
1454 function void cl_syoscb_cfg::do_unpack(uvm_packer packer);
1455  string queue_names[];
1456  string producer_names[];
1457  bit printer_verbosity;
1458  bit ecr;
1459  int num_producers;
1460  int num_queues;
1461  uvm_comparer comparer;
1462  uvm_printer printer;
1463 
1464  super.do_unpack(packer);
1465 
1466  //Get number of producers to loop through
1467  num_producers = packer.unpack_field_int($bits(num_producers));
1468  for(int i=0; i<num_producers; i++) begin
1469  string producer_name;
1470 
1471  //Get producer name and associated number of queues, generate producer list
1472  producer_name = packer.unpack_string();
1473  num_queues = packer.unpack_field_int($bits(num_queues));
1474  this.producers[producer_name] = new;
1475  this.producers[producer_name].list = new[num_queues];
1476  for(int j=0; j<num_queues; j++) begin
1477 
1478  //Get queue name and associated printers/comparers
1479  string queue_name;
1480 
1481  queue_name = packer.unpack_string();
1482 
1483  this.producers[producer_name].list[j] = queue_name;
1484  comparer = cl_syoscb_comparer_config::do_help_unpack(packer);
1485  printer = cl_syoscb_printer_config::do_help_unpack(packer);
1486  printer_verbosity = packer.unpack_field_int($bits(printer_verbosity));
1487  ecr = packer.unpack_field_int($bits(ecr));
1488 
1489  this.set_comparer(comparer, '{queue_name}, '{producer_name});
1490  this.set_printer(printer, '{queue_name}, '{producer_name});
1491  this.set_printer_verbosity(printer_verbosity, '{queue_name}, '{producer_name});
1492  this.set_enable_comparer_report(ecr, '{queue_name}, '{producer_name});
1493  end
1494  end
1495  comparer = cl_syoscb_comparer_config::do_help_unpack(packer);
1496  printer = cl_syoscb_printer_config::do_help_unpack(packer);
1497  this.set_default_comparer(comparer);
1498  this.set_default_printer(printer);
1499  printer_verbosity = packer.unpack_field_int($bits(printer_verbosity));
1500  ecr = packer.unpack_field_int($bits(ecr));
1501 endfunction: do_unpack
virtual void set_dump_orphans_to_files(bit dotf)
Configuration API: Sets the value of the dump_orphans_to_files member variable.
virtual bit get_print_cfg()
Configuration API: Get the value of the print_cfg member variable
uvm_printer printers[string][string]
Associative array holding handles to printers used for a specific queue/producer combination.
virtual int unsigned get_max_search_window(string queue_name)
Configuration API: Returns the value of max_search_window for a given queue.
string full_scb_dump_file_name
Base file name used when dumping SCB contents to a logfile.
t_dump_type full_scb_dump_type
File format used when dumping SCB contents to a logfile.
virtual void set_print_cfg(bit pc)
Configuration API: Set the value of the print_cfg member variable
bit disable_report
Controls whether a report should be generated in the report_phase.
virtual bit set_full_scb_dump_split(bit fsds)
Configuration API: Set the value of the full_scb_dump_split member variable Note that setting full_sc...
int unsigned max_queue_size[string]
Maximum number of elements in each queue before an error is signaled.
virtual uvm_printer get_printer(string queue_name, string producer_name)
Configuration API: Returns the printer associated with a given producer/queue combination.
string orphan_dump_file_name
Base file name used when dumping orphans to a logfile.
virtual void set_max_search_window(int unsigned sw, string queue_names[])
Configuration API: Sets the maximum search window when performing OOO, IOP or user defined comparison...
virtual uvm_comparer get_comparer(string queue_name, string producer_name)
Configuration API: Returns the comparer associated with a given queue and producer.
virtual string get_full_scb_dump_file_name()
Configuration API: Get the value of the full_scb_dump_file_name member variable
int unsigned full_scb_max_queue_size[string]
Controls the number of elements that a queue in the SCB can receive before transaction dumping starts...
int unsigned max_search_window[string]
The maximum number of entries to iterate through in a queue when performing OOO compare.
virtual int get_max_print_orphans()
Configuration API: Get the value of the max_print_orphans member variable
virtual void set_hash_compare_check(t_hash_compare_check hcc)
Configuration API: Set the value of the hash_compare_check member variable
static void set_verbosity(uvm_comparer comparer, int unsigned cv=UVM_DEBUG)
Sets the verbosity level of a given comparer.
virtual void set_full_scb_dump_type(t_dump_type fsdt)
Configuration API: Set the value of the full_scb_dump_type member variable
virtual uvm_comparer get_default_comparer()
Configuration API: Get the value of the default_comparer member variable
bit enable_comparer_report[string][string]
Associative array holding the bit enabling the comparer report for a specific queue/producer combinat...
bit full_scb_dump
Controls whether all transactions going into the SCB should be dumped to a logfile.
virtual void set_default_comparer(uvm_comparer comparer)
Configuration API: Set the value of the default_comparer member variable
string primary_queue
Name of the primary queue used in this scoreboard.
bit enable_c2s_full_scb_dump
Controls whether items in the full scoreboard dump should be dumped using print() or convert2string()...
virtual bit dynamic_primary_queue()
Configuration API: Checks whether this SCB uses a dynamic or static primary queue.
t_scb_compare_greed trigger_greediness
Defines the greed level for comparison operations.
virtual void set_enable_comparer_report(bit ecr, string queue_names[], string producer_names[])
Configuration API: Enables or disables the comparer report for a number of comparers.
virtual void init(string scb_name, string queues[], string producers[])
Configuration API: Initializes the scoreboard&#39;s cfg with the given input parameters.
virtual int unsigned get_queue_stat_interval(string queue_name)
Configuration API: Gets the value of the queue_stat_interval member variable for the given queue...
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_scb_stat_interval()
Configuration API: Gets the value of the scb_stat_interval member variable
virtual t_dump_type get_full_scb_dump_type()
Configuration API: Get the value of the full_scb_dump_type member variable
virtual void set_disable_compare_after_error(bit dcae)
Configuration API: Set the value of the disable_compare_after_error member variable ...
uvm_comparer default_comparer
The default uvm_comparer that can be used when no other comparer has been assigned to a queue/produce...
virtual bit get_dump_orphans_to_files()
Configuration API: Gets the value of the dump_orphans_to_files member variable
virtual void set_max_print_orphans(int mpo)
Configuration API: Set the value of the max_print_orphans member variable Not that if mpo < -1 throws...
virtual void set_disable_clone(bit dc)
Configuration API: Set the value of the disable_clone member variable
t_scb_compare_greed end_greediness
See trigger_greediness for description.
bit enable_no_insert_check
Enable/disable insertion checking on queues.
virtual bit exist_producer(string producer)
Configuration API: Checks if a given producer exists.
uvm_printer default_printer
The default printer used for all printing purposes if no specific printer has been associated with a ...
virtual void get_producers(output string producers[])
Configuration API: Returns the names of all producers
virtual bit get_disable_report()
Configuration API: Get the value of the disable_report member variable
bit print_orphans_as_errors
Controls whether orphaned items in the queues should be treated as errors when printing at the end of...
virtual void set_printer(uvm_printer printer, string queue_names[], string producer_names[])
Configuration API: Sets the given uvm_printer to be used for some queue/producer-combinations.
virtual void set_trigger_greediness(t_scb_compare_greed tg)
Configuration API: Set the value of the trigger_greediness member variable
bit ordered_next
Controls whether a strict item ordering should be used in assoc.
virtual t_dump_type get_orphan_dump_type()
Configuration API: Get the value of the orphan_dump_type member variable
virtual uvm_printer get_default_printer()
Configuration API: Get the value of the default_printer member variable
local t_scb_queue_type queue_type
Queue topology used in the SCB. Defaults to pk_syoscb::SYOSCB_QUEUE_USER_DEFINED. ...
virtual bit exist_queue(string queue_name)
Configuration API: Checks if a queue with a given name exists.
int unsigned queue_stat_interval[string]
Defines an interval value N for each queue, such that the queue&#39;s statistics are printed on every N&#39;t...
virtual bit get_default_printer_verbosity()
Configuration API: Get the value of the default_printer_verbosity member variable ...
virtual void set_full_scb_max_queue_size(string queue_name, int unsigned fsmqs)
Configuration API: Set the value of the full_scb_max_queue_size member variable.
int unsigned scb_stat_interval
Defines an interval value N, similar to queue_stat_interval, causing a printout of all queue stats in...
bit printer_verbosity[string][string]
Associative array holding the printer verbosity bit for a specific queue/producer combination...
virtual bit get_full_scb_dump_split()
Configuration API: Get the value of the full_scb_dump_split member variable
virtual bit get_full_scb_dump()
Configuration API: Get the value of the full_scb_dump member variable
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 string get_primary_queue()
Configuration API: Gets the name of primary queue for this SCB.
uvm_comparer comparers[string][string]
Associative array holding handles to comparers used for a specific queue/producer combination...
virtual void set_full_scb_dump(bit fsd)
Configuration API: Set the value of the full_scb_dump member variable
virtual void set_orphan_dump_file_name(string odfn)
Configuration API: Sets the value of the orphan_dump_file_name member variable
virtual bit get_mutexed_add_item_enable()
Configuration API: Gets the value of the mutexed_add_item_enable member variable. ...
virtual void set_default_printer(uvm_printer printer)
Configuration API: Set the value of the default_printer member variable
virtual void set_scb_stat_interval(int unsigned ssi)
Configuration API: Sets the value of the scb_stat_interval member variable
virtual bit get_disable_clone()
Configuration API: Get the value of the disable_clone member variable
bit default_enable_comparer_report
The default comparer report toggle for a uvm_comparer that can be used when no other verbosity has be...
virtual t_hash_compare_check get_hash_compare_check()
Configuration API: Get the value of the hash_compare_check member variable
string scb_name
The name of the SCB. Default will be the instance name of the SCB component if the name is not set ex...
virtual cl_syoscb_cfg_pl get_producer(string producer)
Configuration API: Gets the producer object for a specified producer.
virtual int unsigned get_max_length_queue_name()
Configuration API: Returns the length of the queue name with maximum length
virtual t_scb_queue_type get_queue_type()
Configuration API: Get the value of the queue_type member variable
virtual void set_ordered_next(bit ordered_next)
Configuration API: Set the value of the ordered_next member variable.
virtual void set_enable_queue_stats(string queue_name, bit eqs)
Configuration API: Set the value of enable_queue_stats for a given queue If no queue exists with that...
virtual bit get_enable_no_insert_check()
Configuration API: Gets the values of the enable_no_insert_check member variable
virtual string get_orphan_dump_file_name()
Configuration API: Gets the value of the orphan_dump_file_name member variable
virtual bit get_default_enable_comparer_report()
Configuration API: Get the value of the default_enable_comparer_report member variable ...
bit disable_clone
Controls whether calls to cl_syoscb::add_item will clone the given uvm_sequence_item or reuse the han...
virtual void set_max_queue_size(string queue_name, int unsigned mqs)
Configuration API: Set the maximum number of items allowed in a given queue.
t_dump_type orphan_dump_type
File format used when dumping orphans to logfiles.
virtual t_scb_compare_greed get_end_greediness()
Configuration API: Get the value of the end_greediness member variable
bit disable_compare_after_error
Controls whether comparisons should be disabled after the first UVM_ERROR is raised.
virtual bit get_enable_comparer_report(string queue_name, string producer_name)
Configuration API: Returns the comparer report enable bit associated with a given queue/producer comb...
Class which represents the base concept of a queue.
virtual void set_queue(string queue_name, cl_syoscb_queue_base queue)
Configuration API: Sets the queue object for a given queue.
virtual void set_orphan_dump_type(t_dump_type odt)
Configuration API: Sets the value of the orphan_dump_type member variable
bit dump_orphans_to_files
Controls whether all orphaned items should be dumped to queue-specific files at the end of simulation...
virtual bit get_ordered_next()
Configuration API: Get the value of the ordered_next member variable.
Utility class for capturing the queue names associated with a producer.
virtual void set_disable_report(bit dr)
Configuration API: Set the value of the disable_report member variable
local t_scb_compare_type compare_type
Compare strategy used in the SCB. Defaults to pk_syoscb::SYOSCB_COMPARE_IO.
bit mutexed_add_item_enable
Controls whether cl_syoscb::add_item() should be mutexed or not.
virtual bit get_enable_queue_stats(string queue_name)
Configuration API: Get the value of enable_queue_stats for a given queue If no queue exists with that...
virtual bit get_printer_verbosity(string queue_name, string producer_name)
Configuration API: Returns the verbosity bit associated with a given queue/producer combination...
virtual bit get_disable_compare_after_error()
Configuration API: Get the value of the disable_compare_after_error member variable ...
cl_syoscb_cfg_pl producers[string]
Associative array indexed by producer name.
virtual void set_default_enable_comparer_report(bit ecr)
Configuration API: Set the value of the default_enable_comparer_report member variable.
bit enable_queue_stats[string]
Enable/disable the printing of queue&#39;s statistics per producer.
virtual void set_orphans_as_errors(oae)
Configuration API: Set the value of the print_orphans_as_errors member variable
virtual int unsigned get_max_queue_size(string queue_name)
Configuration API: Returns the maximum number of items allowed in a given queue.
virtual void set_mutexed_add_item_enable(bit maie)
Configuration API: Sets the value of the mutexed_add_item_enable member variable. ...
virtual int unsigned size_queues()
Configuration API: Returns the number of queues in this SCB
virtual bit set_primary_queue(string primary_queue_name)
Configuration API: Sets the primary queue.
bit full_scb_dump_split
Controls whether SCB dumps (controlled by full_scb_dump) print all transactions in the same file...
virtual t_scb_compare_type get_compare_type()
Configuration API: Get the value of the compare_type member variable
virtual void set_enable_no_insert_check(bit enic)
Configuration API: Set the value of the enable_no_insert_check member variable.
int max_print_orphans
Select the maximum number of orphaned elements to print if any orphans are left in a queue after simu...
virtual int unsigned get_full_scb_max_queue_size(string queue_name)
Configuration API: Get the value of the full_scb_max_queue_size member variable for a given queue...
virtual void set_full_scb_dump_file_name(string full_scb_dump_file_name)
Configuration API: Set the value of the full_scb_dump_file_name member variable
virtual bit set_producer(string producer, queue_names[])
Configuration API: Sets the given producer for the listed queues If any errors occur, information about this is printed as a UVM_DEBUG message If a list of queues has already been set for a given producer, overrides that list.
virtual void set_compare_type(t_scb_compare_type ct)
Configuration API: Set the value of the compare_type member variable
virtual void set_enable_c2s_full_scb_dump(bit ecfsd)
Configuration API: Get the value of the enable_c2s_full_scb_dump member variable
virtual void set_scb_name(string scb_name)
Configuration API: Set the name of the SCB that this cfg is related to
virtual void set_default_printer_verbosity(bit pv)
Configuration API: Set the value of the default_printer_verbosity member variable.
virtual void set_comparer(uvm_comparer comparer, string queue_names[], string producer_names[])
Configuration API: Sets the comparer to be used for a number of queues.
virtual void get_queues(output string queue_names[])
Configuration API: Returns all queue names as a string list
virtual bit get_orphans_as_errors()
Configuration API: Get the value of the print_orphans_as_errors member variable
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
cl_syoscb_queue_base queues[string]
Associative array holding handles to each queue. Indexed by queue name.
virtual string get_scb_name()
Configuration API: Get the name of the SCB that this cfg is related to
virtual void set_printer_verbosity(bit pv, string queue_names[], string producer_names[])
Configuration API: Sets the verbosity level to be used for a number of printers.
bit print_cfg
Controls whether the scoreboard&#39;s configuration values should be printed in the cl_syoscb::build_phas...
virtual bit get_enable_c2s_full_scb_dump()
Configuration API: Set the value of the enable_c2s_full_scb_dump member variable
t_hash_compare_check hash_compare_check
Controls sanity check comparisons on hash queues.
virtual void set_queue_stat_interval(string queue_name, int unsigned qsi)
Configuration API: Sets the value of the queue_stat_interval member variable for the given queue...
bit default_printer_verbosity
Default printer verbosity bit.
virtual cl_syoscb_queue_base get_queue(string queue_name)
Configuration API: Returns a queue handle for the specificed queue.
virtual void set_queues(string queue_names[])
Configuration API: Will set the legal queues when provided with a list of queue names.

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