28 `uvm_object_utils_begin(cl_syoscbs_cfg)
29 `uvm_field_array_object(cfgs, UVM_DEFAULT | UVM_NOPRINT | UVM_REFERENCE)
30 `uvm_field_string(scbs_name, UVM_DEFAULT)
31 `uvm_field_int(no_scbs, UVM_DEFAULT | UVM_DEC)
32 `uvm_field_int(disable_report, UVM_DEFAULT)
33 `uvm_field_array_int(enable_scb_stats, UVM_DEFAULT)
34 `uvm_field_int(print_cfg, UVM_DEFAULT)
40 extern function new(string name = "cl_syoscbs_cfg");
45 extern
virtual function void
init(string scbs_name="",
50 extern
virtual function void
set_cfg(cl_syoscb_cfg cfg, int unsigned idx);
52 extern
virtual function void
set_no_scbs(int unsigned no_scbs);
56 extern
virtual function void
set_scb_names(string scb_names[], int unsigned idxs[] = {});
57 extern
virtual function void
get_scb_names(output string scb_names[],
58 input int unsigned idxs[] = {});
59 extern
virtual function void
set_queues(string queues[], int unsigned idxs[] = {});
60 extern
virtual function void
get_queues(output string queues[], input int unsigned idx);
61 extern
virtual function void
set_producers(string producer, string queues[] = {},
62 int unsigned idxs[] = {});
63 extern
virtual function void
set_queue_type(t_scb_queue_type queue_types[],
64 int unsigned idxs[] = {});
65 extern
virtual function void
set_compare_type(t_scb_compare_type compare_types[],
66 int unsigned idxs[] = {});
69 t_scb_compare_greed tg[]);
71 input int unsigned idxs[] = {});
73 t_scb_compare_greed eg[]);
75 input int unsigned idxs[] = {});
85 extern
virtual function void
do_print(uvm_printer printer);
94 function cl_syoscbs_cfg::new(string name = "cl_syoscbs_cfg");
107 int unsigned no_scbs,
114 if(queues.size()!= 0) begin
117 foreach (producers[i]) begin
127 if(idx >= this.
cfgs.size()) begin
128 `uvm_fatal("CFG_ERROR",
129 $sformatf("No set_cfg possible at index %0d. Allowed range is between 0 and %0d",
130 idx, this.cfgs.size()-1))
134 this.
cfgs[idx] = cfg;
148 if(idx >= this.
cfgs.size()) begin
149 `uvm_fatal("CFG_ERROR",
150 $sformatf("No get_cfg possible at index %0d. Allowed range is between 0 and %0d",
151 idx, this.cfgs.size()-1))
155 return this.
cfgs[idx];
172 foreach (this.cfgs[i]) begin
173 if(this.cfgs[i] == null) begin
174 this.
set_cfg(pk_syoscb::cl_syoscb_cfg::type_id::create($sformatf("scb[%0d]_cfg", i)), i);
207 if(scb_names.size() == 0 && idxs.size() == 0) begin
208 foreach (this.cfgs[i]) begin
209 this.
cfgs[i].set_scb_name($sformatf("scb[%0d]", i));
216 if(scb_names.size() == 1) begin
217 if(idxs.size() == 0) begin
219 foreach (this.cfgs[i]) begin
220 this.
cfgs[i].set_scb_name($sformatf("%s[%0d]", scb_names[0], i));
225 foreach (idxs[i]) begin
228 l_scb_name = $sformatf("%s[%0d]", scb_names[0], idxs[i]);
230 if(!this.is_scb_names_unique(l_scb_name)) begin
231 `uvm_fatal("CFG_ERROR", $sformatf("the provided scb name '%0s' is not unique", l_scb_name))
234 this.
cfgs[idxs[i]].set_scb_name(l_scb_name);
243 if(scb_names.size()>0 && idxs.size()>0 && scb_names.size() == idxs.size()) begin
245 foreach (idxs[i]) begin
248 l_scb_name = scb_names[idxs[i]];
250 if(!this.is_scb_names_unique(l_scb_name)) begin
251 `uvm_fatal("CFG_ERROR", $sformatf("the provided scb name '%0s' is not unique", l_scb_name))
254 this.
cfgs[idxs[i]].set_scb_name(l_scb_name);
261 `uvm_fatal("CFG_ERROR", "set_scb_names invoked with unsupported args")
271 scb_names = new[idxs.size() == 0 ? this.
no_scbs : idxs.size()];
273 foreach (scb_names[i]) begin
274 scb_names[i] = this.
cfgs[idxs.size() == 0 ? i : idxs[i]].get_scb_name();
285 if(queues.size() == 0) begin
286 `uvm_fatal("CFG_ERROR",
287 "cl_syoscbs_cfg::set_queues has been called with empty queues argument")
290 if(idxs.size() == 0) begin
291 foreach (this.cfgs[i]) begin
295 foreach (idxs[i]) begin
307 if(idx >= this.
cfgs.size()) begin
308 `uvm_fatal("CFG_ERROR",
309 $sformatf("No get_queue possible at index %0d. Allowed range is between 0 and %0d",
310 idx, this.cfgs.size()-1))
315 endfunction: get_queues
324 if(idxs.size() == 0) begin
325 foreach (this.cfgs[i]) begin
326 if(queues.size() == 0) begin
327 this.cfgs[i].get_queues(queues);
330 if(!this.cfgs[i].set_producer(producer, queues)) begin
331 `uvm_fatal(
"CFG_ERROR",
332 $sformatf(
"[%0s]: Unable to set producer %0s for the given queues",
333 this.cfgs[i].get_name(), producer))
338 foreach (idxs[i]) begin
340 if(idxs[i] >= this.cfgs.size()) begin
341 `uvm_fatal(
"CFG_ERROR",
342 $sformatf(
"No set_producers not possible at index %0d. Allowed range is between 0 and %0d",
343 idxs[i], this.cfgs.size()-1))
346 if(queues.size() == 0) begin
347 this.cfgs[idxs[i]].get_queues(queues);
350 if(!this.cfgs[idxs[i]].set_producer(producer, queues)) begin
351 `uvm_fatal(
"CFG_ERROR",
352 $sformatf(
"[%0s]: Unable to set producer %0s for the given queues",
353 this.cfgs[idxs[i]].get_name(), producer))
358 endfunction: set_producers
365 if(idxs.size() == 0) begin
366 foreach (this.cfgs[i]) begin
370 foreach (idxs[i]) begin
374 endfunction: set_queue_type
381 int unsigned idxs[] = {});
382 if(idxs.size() == 0) begin
383 foreach (this.cfgs[i]) begin
387 foreach (idxs[i]) begin
391 endfunction: set_compare_type
405 scb_idxs = this.cfgs.find_first_index() with (item.get_scb_name() == scb_name);
407 return scb_idxs.size() > 0 ? scb_idxs[0] : -1;
408 endfunction: get_scb_index_by_name
415 t_scb_compare_greed tg[]);
416 if(idxs.size() == 0) begin
417 foreach (this.cfgs[i]) begin
421 foreach (idxs[i]) begin
425 endfunction: set_scb_trigger_greediness
433 input
int unsigned idxs[] = {});
434 if(idxs.size() == 0) begin
435 tg =
new[this.cfgs.size()];
436 foreach (this.cfgs[i]) begin
440 tg =
new[idxs.size()];
441 foreach (idxs[i]) begin
445 endfunction: get_scb_trigger_greediness
452 t_scb_compare_greed eg[]);
453 if(idxs.size() == 0) begin
454 foreach (this.cfgs[i]) begin
458 foreach (idxs[i]) begin
462 endfunction: set_scb_end_greediness
470 input
int unsigned idxs[] = {});
471 if(idxs.size() == 0) begin
472 eg =
new[this.cfgs.size()];
473 foreach (this.cfgs[i]) begin
477 eg =
new[idxs.size()];
478 foreach (idxs[i]) begin
482 endfunction: get_scb_end_greediness
486 this.disable_report = dr;
487 endfunction: set_disable_report
491 return this.disable_report;
492 endfunction: get_disable_report
499 if(idxs.size() == 0) begin
500 foreach (this.enable_scb_stats[i]) begin
501 this.enable_scb_stats[i] = ess;
504 foreach (idxs[i]) begin
505 this.enable_scb_stats[idxs[i]] = ess;
508 endfunction: set_enable_scb_stats
513 if(idx >= this.enable_scb_stats.size()) begin
514 `uvm_fatal(
"CFG_ERROR",
515 $sformatf(
"No get_enable_scb_stats not possible at index %0d. Allowed range is between 0 and %0d",
516 idx, this.enable_scb_stats.size()-1))
520 return this.enable_scb_stats[idx];
521 endfunction: get_enable_scb_stats
526 int unsigned max_length_scb_name;
528 this.get_scb_names(scb_names);
530 foreach (scb_names[i]) begin
531 if(scb_names[i].len() > max_length_scb_name) begin
532 max_length_scb_name = scb_names[i].len();
536 return max_length_scb_name;
537 endfunction: get_max_length_scb_name
541 int unsigned max_length_queue_name;
543 foreach (this.cfgs[i]) begin
544 if(this.cfgs[i].get_max_length_queue_name() > max_length_queue_name) begin
549 return max_length_queue_name;
550 endfunction: get_max_length_queue_name
554 int unsigned max_length_producer;
556 foreach (this.cfgs[i]) begin
557 if(this.cfgs[i].get_max_length_producer() > max_length_producer) begin
562 return max_length_producer;
563 endfunction: get_max_length_producer
568 endfunction: set_print_cfg
572 return this.print_cfg;
573 endfunction:get_print_cfg
577 foreach (this.cfgs[i]) begin
578 printer.print_object(.name($sformatf(
"cfgs[%0d]", i)), .value(this.cfgs[i]));
581 super.do_print(printer);
582 endfunction: do_print
587 string l_scb_names[];
588 string duplicate_names[$];
590 this.get_scb_names(l_scb_names);
592 duplicate_names = l_scb_names.find(x) with(x == scb_name);
595 return duplicate_names.size() == 0;
596 endfunction: is_scb_names_unique
cl_syoscb_cfg cfgs[]
Array holding handles to all the UVM scoreboard configurations.
virtual void set_scb_end_greediness(int unsigned idxs[]={}, t_scb_compare_greed eg[])
Configuration API: Sets the end greediness status for all or a subset of the scoreboards.
int unsigned no_scbs
Number of scoreboards.
virtual cl_syoscb_cfg get_cfg(int unsigned idx)
Configuration API: Returns the configuration object of the scoreboard with a given index ...
virtual int get_scb_index_by_name(string scb_name)
Configuration API: Gets the index of a scoreboard with a given name
virtual void set_no_scbs(int unsigned no_scbs)
Configuration API: Sets the number of scoreboards that should be wrapped.
virtual void set_scbs_name(string scbs_name)
Configuration API: Sets the name of this scoreboard wrapper
bit print_cfg
Whether to print scoreboard wrapper configuration in the UVM build_phase.
virtual void do_print(uvm_printer printer)
Custom do_print implementation. Print only the wrapped configuration objects which have print_cfg == ...
virtual int unsigned get_max_length_queue_name()
Returns the length of the longest queue name that is wrapped by this.
Configuration object for the cl_syoscbs_base scoreboard wrapper.
virtual void set_queue_type(t_scb_queue_type qt)
Configuration API: Set the value of the queue_type member variable
virtual int unsigned get_no_scbs()
Configuration API: Returns the number of scoreboards wrapped by this wrapper.
virtual string get_scbs_name()
Configuration API: Returns the name of this scoreboard wrapper
virtual void set_enable_scb_stats(input int unsigned idxs[]={}, bit ess)
Configuration API: Sets the value of the enable_scb_stats flag for all or a subset of scoreboards ...
bit enable_scb_stats[]
Enable/disable the printing of scb statistics per queue by each scb.
virtual void set_cfg(cl_syoscb_cfg cfg, int unsigned idx)
Configuration API: Sets the configuration object for the scoreboard at a given index ...
virtual void set_trigger_greediness(t_scb_compare_greed tg)
Configuration API: Set the value of the trigger_greediness member variable
bit disable_report
Whether to disable report printing in the report_phase.
virtual void set_producers(string producer, string queues[]={}, int unsigned idxs[]={})
Configuration API: Sets the producer for the specified queues of the scoreboards with given indexes I...
virtual int unsigned get_max_length_scb_name()
Returns the length of the longest scoreboard name that is wrapped by this.
virtual void set_end_greediness(t_scb_compare_greed eg)
Configuration API: Set the value of the end_greediness member variable
virtual int unsigned get_max_length_producer()
Configuration API: Returns the length of the producer name with maximum length
virtual void set_print_cfg(bit pc)
Configuration API: Sets the value of the print_cfg member variable
virtual bit get_print_cfg()
Gets the value of the print_cfg member variable.
string scbs_name
Scoreboard wrapper name.
virtual int unsigned get_max_length_queue_name()
Configuration API: Returns the length of the queue name with maximum length
virtual void get_queues(output string queues[], input int unsigned idx)
Configuration API: Returns the names of the queues for the scoreboard with a given index ...
virtual t_scb_compare_greed get_end_greediness()
Configuration API: Get the value of the end_greediness member variable
virtual void get_scb_trigger_greediness(output t_scb_compare_greed tg[], input int unsigned idxs[]={})
Configuration API: Gets the trigger greediness status for all or a subset of the scoreboards.
virtual bit get_enable_scb_stats(int unsigned idx)
Configuration API: Returns the value of the enable_scb_stats member variable for the scoreboard at th...
virtual void get_scb_end_greediness(output t_scb_compare_greed eg[], input int unsigned idxs[]={})
Configuration API: Gets the end greediness status for all or a subset of the scoreboards.
virtual void set_disable_report(bit dr)
Configuration API: Sets the value of the disable_report member variable
virtual bit is_scb_names_unique(input string scb_name)
Checks if a given name is not yet used by a scoreboard under this wrapper.
virtual void set_compare_type(t_scb_compare_type compare_types[], int unsigned idxs[]={})
Configuration API: Sets the compare strategy for the given scoreboards inside the wrapper ...
virtual void set_scb_names(string scb_names[], int unsigned idxs[]={})
Configuration API: Sets the scoreboard name of all scoreboards under this wrapper.
virtual void init(string scbs_name="", int unsigned no_scbs, string scb_names[], string queues[], string producers[])
Configuration API: Initializes the scoreboard wrapper and all contained scoreboards.
virtual void set_queues(string queues[], int unsigned idxs[]={})
Configuration API: Sets the legal queue names for the scoreboards indicated by the idxs argument...
virtual void get_scb_names(output string scb_names[], input int unsigned idxs[]={})
Configuration API: Returns the names of some or all scoreboards wrapped by this wrapper.
virtual bit get_disable_report()
Configuration API: Returns the value of the disable_report member variable
virtual void set_queue_type(t_scb_queue_type queue_types[], int unsigned idxs[]={})
Configuration API: Sets the queue types for the given scoreboards inside the wrapper.
virtual void set_compare_type(t_scb_compare_type ct)
Configuration API: Set the value of the compare_type member variable
virtual void set_scb_trigger_greediness(int unsigned idxs[]={}, t_scb_compare_greed tg[])
Configuration API: Sets trigger greediness status for all or a subset of the scoreboards.
virtual void get_queues(output string queue_names[])
Configuration API: Returns all queue names as a string list
virtual int unsigned get_max_length_producer()
Returns the length of the producer name with maximum length.
Configuration class for the SyoSil UVM scoreboard.
virtual t_scb_compare_greed get_trigger_greediness()
Configuration API: Get the value of the trigger_greediness member variable