SyoSil ApS UVM Scoreboard  1.0.3.0
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
cl_syoscb Class Reference

Top level class implementing the root of the SyoSil UVM scoreboard. More...

Inherits uvm_scoreboard, and uvm_scoreboard.

+ Collaboration diagram for cl_syoscb:

Public Member Functions

void build_phase (uvm_phase phase)
 UVM build phase. More...
 
void end_of_elaboration_phase (uvm_phase phase)
 UVM end of elaboration phase. More...
 
void check_phase (uvm_phase phase)
 UVM check phase. More...
 
void report_phase (uvm_phase phase)
 UVM report phase. Prints the status of the scoreboard instance.
 
void final_phase (uvm_phase phase)
 UVM final phase. Prints in the file called dump.txt the information about the shadow queue of all the queues.
 
virtual void add_item (string queue_name, string producer, uvm_sequence_item item)
  Scoreboard API: Adds a uvm_sequence_item to a given queue for a given producer. More...
 
virtual task add_item_mutexed (string queue_name, string producer, uvm_sequence_item item)
  Scoreboard API: Add an item to the scoreboard, using a mutex to ensure than no more than one item is ever added to the SCB at the same time. More...
 
virtual void compare_trigger (string queue_name="", cl_syoscb_item item=null)
  Scoreboard API: Invokes the scoreboard's compare strategy
 
virtual void dump ()
  Scoreboard API: Dump items to files if cl_syoscb_cfg::full_scb_dump is enabled
 
virtual void flush_queues_all ()
 Scoreboard API: Shorthand for flushing all queues
 
virtual void flush_queues (string queue_name="")
  Scoreboard API: Flushes the contents of either all queues or a specific queue. More...
 
virtual bit empty_queues (string queue_name="")
 Returns whether all queues or a specific queue is empty or not: More...
 
virtual bit insert_queues (string queue_name="")
 Returns whether at least one element has been inserted in all queues or in a specific queue. More...
 
virtual void compare_control (bit cc)
  Scoreboard API: Toggles the scoreboard's comparison control. More...
 
virtual string create_total_stats (int unsigned offset, int unsigned first_column_width)
 Scoreboard API: Returns a table line summarising the insert/match/flush/orphan stats over all queues in the SCB. More...
 
virtual string create_report (bit end_of_sim=0b1)
 Scoreboard API: Creates a report containing information about this scoreboard. More...
 
virtual int unsigned get_total_cnt_add_items ()
 Scoreboard API: Returns the number of elements that have been inserted into the scoreboard
 
virtual int unsigned get_total_cnt_flushed_items ()
 Scoreboard API: Returns the number of elements that have been flushed out of the scoreboard
 
virtual int unsigned get_total_queue_size ()
 Scoreboard API: Returns the number of elements that the scoreboard currently contains
 
virtual string get_failed_checks ()
 Scoreboard API: Returns a string with information on which checks the scoreboard has failed (e.g. More...
 
virtual cl_syoscb_subscriber get_subscriber (string queue_name, string producer)
 Scoreboard API: Returns a UVM subscriber for a given combination of queue and producer. More...
 
virtual cl_syoscb_cfg get_cfg ()
 Gets the configuration for this scoreboard.
 
virtual string create_report_contents (int unsigned offset, int unsigned first_column_width)
 Scoreboard API: Returns a string with all queue's statistics, to be inserted into the final report generated by create_report. More...
 
virtual void pre_abort ()
 UVM pre_abort hook. More...
 

Protected Member Functions

virtual void dump_txt ()
 Dumps the shadow queue into text files. More...
 
virtual void dump_xml ()
 Dump the shadow queue into XML files. More...
 
virtual void dump_split_txt ()
 Dumps the shadow queue into separate text files for each queue. More...
 
virtual void dump_join_txt ()
 Dumps the shadow queue into one combined text file called [scoreboard_name]. More...
 
virtual void dump_split_xml ()
 Dumps the shadow queue into separate XML files for each queue. More...
 
virtual void dump_join_xml ()
 Dumps the shadow queue into one combined XML file called [scoreboard_name]. More...
 
virtual string print_header (string queue_name)
 Gets a header string to print into a shadow queue dump file. More...
 
virtual string create_queues_stats (int unsigned offset, int unsigned first_column_width)
 Returns a table with per-queue statistics for all queues of the scoreboard. More...
 
virtual string get_queue_failed_checks ()
 Returns a string with information on which checks the different queues have failed (e.g. More...
 
virtual void override_queue_type ()
 Performs a factory override of the queue type to be used, based on the value of the cl_syoscb_cfg::queue_type cfg. More...
 
virtual void override_compare_type ()
 Performs a factory override of the compare type to be used, based on the value of this scoreboard's cl_syoscb_cfg::compare_type.
 
virtual void config_validation ()
 Validates that the current scoreboard configuration is not invalid. More...
 
virtual void intermediate_queue_stat_dump (string queue_name)
 Prints the current queue statistics for a queue. More...
 

Private Attributes

cl_syoscb_cfg cfg
 Handle to the global UVM scoreboard configuration.
 
cl_syoscb_queue_base queues []
 Array holding handles to all queues.
 
cl_syoscb_compare compare_strategy
 Handle to the compare strategy.
 
cl_syoscb_subscriber subscribers [string]
 Associative array holding a uvm_subscriber for each queue.
 
bit header_dumped [string]
 Flag indicating if a scoreboard header has been dumped when dumping shadow queues.
 
string failed_checks [string]
 AA containing failed scoreboard check (e.g. no items inserted))
 
semaphore add_item_mutex
 Mutex to be used when calls to add_item should be mutexed.
 

Detailed Description

Top level class implementing the root of the SyoSil UVM scoreboard.

Definition at line 2 of file cl_syoscb.svh.

Member Function Documentation

◆ add_item()

void cl_syoscb::add_item ( string  queue_name,
string  producer,
uvm_sequence_item  item 
)
virtual

Scoreboard API: Adds a uvm_sequence_item to a given queue for a given producer.

The method will check if the queue and producer exists before adding it to the queue.

Parameters
queue_nameThe name of the queue the item should be added to
producerThe name of the producer that generated this item
itemThe sequence item that should be added to the queue

Definition at line 237 of file cl_syoscb.svh.

References cl_syoscb_queue_base::add_item(), cfg, compare_trigger(), create_report(), dump(), cl_syoscb_cfg::exist_producer(), cl_syoscb_cfg::exist_queue(), cl_syoscb_queue_base::get_cnt_add_item(), cl_syoscb_cfg::get_disable_clone(), cl_syoscb_cfg::get_full_scb_dump(), cl_syoscb_cfg::get_full_scb_max_queue_size(), cl_syoscb_queue_base::get_last_inserted_item(), cl_syoscb_cfg::get_max_queue_size(), cl_syoscb_cfg::get_queue(), cl_syoscb_cfg::get_queue_stat_interval(), cl_syoscb_cfg::get_scb_name(), cl_syoscb_cfg::get_scb_stat_interval(), cl_syoscb_queue_base::get_size(), get_total_cnt_add_items(), intermediate_queue_stat_dump(), and cl_syoscb_queue_base::shadow_items.

Referenced by add_item_mutexed(), and cl_syoscb_subscriber::write().

◆ add_item_mutexed()

task cl_syoscb::add_item_mutexed ( string  queue_name,
string  producer,
uvm_sequence_item  item 
)
virtual

Scoreboard API: Add an item to the scoreboard, using a mutex to ensure than no more than one item is ever added to the SCB at the same time.

For additional details on adding items to the SCB, see add_item

Parameters
queue_nameThe name of the queue the item should be added to
producerThe name of the producer that generated this item
itemThe sequence item that should be added to the queue

Definition at line 314 of file cl_syoscb.svh.

References add_item(), add_item_mutex, cfg, and cl_syoscb_cfg::get_mutexed_add_item_enable().

Referenced by cl_syoscb_subscriber::write().

◆ build_phase()

void cl_syoscb::build_phase ( uvm_phase  phase)

UVM build phase.

Gets the scoreboard configuration and forwards it to the child components (cl_syoscb_queue and cl_syoscb_compare). Additionally, it creates all of the queues defined in the configuration object. Finally, it also creates the compare strategy via a factory create call.

Definition at line 112 of file cl_syoscb.svh.

References add_item_mutex, cfg, compare_strategy, cl_syoscb_cfg::get_mutexed_add_item_enable(), cl_syoscb_cfg::get_print_cfg(), cl_syoscb_cfg::get_producer(), cl_syoscb_cfg::get_producers(), cl_syoscb_cfg::get_scb_name(), cl_syoscb_cfg_pl::list, override_compare_type(), override_queue_type(), queues, cl_syoscb_subscriber::set_mutexed_add_item_enable(), cl_syoscb_subscriber::set_producer(), cl_syoscb_subscriber::set_queue_name(), cl_syoscb_cfg::set_scb_name(), cl_syoscb_cfg::size_queues(), and subscribers.

◆ check_phase()

void cl_syoscb::check_phase ( uvm_phase  phase)

UVM check phase.

Checks if the SCB is empty. If true and cl_syoscb_cfg::enable_no_insert_check is true, a UVM error is issued.

Definition at line 182 of file cl_syoscb.svh.

References cfg, empty_queues(), failed_checks, cl_syoscb_cfg::get_enable_no_insert_check(), cl_syoscb_cfg::get_scb_name(), and insert_queues().

◆ compare_control()

void cl_syoscb::compare_control ( bit  cc)
virtual

Scoreboard API: Toggles the scoreboard's comparison control.

Parameters
ccCompare control bit. If 1, comparisons are enabled, if 0 they are disabled

Definition at line 429 of file cl_syoscb.svh.

References cl_syoscb_compare::compare_control(), and compare_strategy.

◆ config_validation()

void cl_syoscb::config_validation ( )
protectedvirtual

Validates that the current scoreboard configuration is not invalid.

If the configuration is invalid, raises a UVM_FATAL If the configuration is not recommended but still valid, prints a UVM_INFO message

Definition at line 515 of file cl_syoscb.svh.

References cfg, cl_syoscb_cfg::get_compare_type(), cl_syoscb_cfg::get_ordered_next(), cl_syoscb_cfg::get_queue_type(), cl_syoscb_cfg::get_queues(), and cl_syoscb_cfg::get_scb_name().

Referenced by end_of_elaboration_phase().

◆ create_queues_stats()

string cl_syoscb::create_queues_stats ( int unsigned  offset,
int unsigned  first_column_width 
)
protectedvirtual

Returns a table with per-queue statistics for all queues of the scoreboard.

Parameters
offsetThe x-offset to used when printing items in the first column of the table
first_column_widthThe width of the first column of the table

Definition at line 716 of file cl_syoscb.svh.

References cfg, cl_syoscb_queue_base::create_queue_report(), cl_syoscb_cfg::get_disable_report(), cl_syoscb_cfg::get_queue(), cl_syoscb_cfg::get_queues(), and cl_syoscb_string_library::scb_separator_str().

Referenced by create_report_contents().

◆ create_report()

string cl_syoscb::create_report ( bit  end_of_sim = 0b1)
virtual

Scoreboard API: Creates a report containing information about this scoreboard.

The report contains information about the number of insertions, matches, flushed items and orphaned items.

Parameters
end_of_simA bit to indicate whether this is called at the } of simulation or not. This changes the name used to refer to items remaining in the queue when the function is called (orphans vs. remaining)
Returns
That report

Definition at line 555 of file cl_syoscb.svh.

References cfg, create_report_contents(), cl_syoscb_cfg::get_max_length_producer(), cl_syoscb_cfg::get_max_length_queue_name(), cl_syoscb_string_library::scb_header_str(), and cl_syoscb_string_library::scb_separator_str().

Referenced by add_item(), and report_phase().

◆ create_report_contents()

string cl_syoscb::create_report_contents ( int unsigned  offset,
int unsigned  first_column_width 
)
virtual

Scoreboard API: Returns a string with all queue's statistics, to be inserted into the final report generated by create_report.

Parameters
offsetThe x-offset to used when printing items in the first column of the table
first_column_widthThe width of the first column of the table

Definition at line 613 of file cl_syoscb.svh.

References cfg, create_queues_stats(), create_total_stats(), and cl_syoscb_cfg::get_disable_report().

Referenced by create_report(), and cl_syoscbs_base::create_scb_stats().

◆ create_total_stats()

string cl_syoscb::create_total_stats ( int unsigned  offset,
int unsigned  first_column_width 
)
virtual

Scoreboard API: Returns a table line summarising the insert/match/flush/orphan stats over all queues in the SCB.

Parameters
offsetThe x-offset to used when printing items in the first column of the table
first_column_widthThe width of the first column of the table

Definition at line 581 of file cl_syoscb.svh.

References cfg, cl_syoscb_cfg::get_disable_report(), cl_syoscb_cfg::get_scb_name(), get_total_cnt_add_items(), get_total_cnt_flushed_items(), get_total_queue_size(), and cl_syoscb_string_library::pad_str().

Referenced by create_report_contents(), and cl_syoscbs_base::create_scb_stats().

◆ dump_join_txt()

void cl_syoscb::dump_join_txt ( )
protectedvirtual

Dumps the shadow queue into one combined text file called [scoreboard_name].

[full_scb_dump_file_name].txt

Definition at line 815 of file cl_syoscb.svh.

References cfg, cl_syoscb_queue_base::dump(), cl_syoscb_cfg::get_full_scb_dump_file_name(), cl_syoscb_cfg::get_queues(), cl_syoscb_string_library::pad_str(), print_header(), and queues.

Referenced by dump_txt().

◆ dump_join_xml()

void cl_syoscb::dump_join_xml ( )
protectedvirtual

Dumps the shadow queue into one combined XML file called [scoreboard_name].

[full_scb_dump_file_name].xml

Definition at line 891 of file cl_syoscb.svh.

References cfg, cl_syoscb_queue_base::dump(), cl_syoscb_cfg::get_full_scb_dump_file_name(), cl_syoscb_cfg::get_queues(), and queues.

Referenced by dump_xml().

◆ dump_split_txt()

void cl_syoscb::dump_split_txt ( )
protectedvirtual

Dumps the shadow queue into separate text files for each queue.

The text files are named [scoreboard_name].[queue_name].[full_scb_dump_file_name].txt

Definition at line 774 of file cl_syoscb.svh.

References cfg, cl_syoscb_queue_base::dump(), cl_syoscb_cfg::get_full_scb_dump_file_name(), cl_syoscb_cfg::get_queues(), header_dumped, cl_syoscb_string_library::pad_str(), print_header(), and queues.

Referenced by dump_txt().

◆ dump_split_xml()

void cl_syoscb::dump_split_xml ( )
protectedvirtual

Dumps the shadow queue into separate XML files for each queue.

The files are named [scoreboard_name].[queue_name].[full_scb_dump_file_name].xml

Definition at line 841 of file cl_syoscb.svh.

References cfg, cl_syoscb_queue_base::dump(), cl_syoscb_cfg::get_full_scb_dump_file_name(), cl_syoscb_cfg::get_queues(), header_dumped, cl_syoscb_string_library::pad_str(), print_header(), and queues.

Referenced by dump_xml().

◆ dump_txt()

void cl_syoscb::dump_txt ( )
protectedvirtual

Dumps the shadow queue into text files.

Will either dump shadow items into one or more files depending on cl_syoscb_cfg::full_scb_dump_split

Definition at line 754 of file cl_syoscb.svh.

References cfg, dump_join_txt(), dump_split_txt(), and cl_syoscb_cfg::get_full_scb_dump_split().

Referenced by dump().

◆ dump_xml()

void cl_syoscb::dump_xml ( )
protectedvirtual

Dump the shadow queue into XML files.

Will either dump shadow items into one or more files depending on cl_syoscb_cfg::full_scb_dump_split

Definition at line 764 of file cl_syoscb.svh.

References cfg, dump_join_xml(), dump_split_xml(), and cl_syoscb_cfg::get_full_scb_dump_split().

Referenced by dump().

◆ empty_queues()

bit cl_syoscb::empty_queues ( string  queue_name = "")
virtual

Returns whether all queues or a specific queue is empty or not:

Parameters
queue_nameThe queue that should be checked for emptiness. If "" is passed, checks all queues
Returns
1 if the given queue (or all queues) are empty, 0 otherwise

Definition at line 372 of file cl_syoscb.svh.

References cfg, cl_syoscb_queue_base::empty(), cl_syoscb_cfg::exist_queue(), cl_syoscb_cfg::get_queue(), cl_syoscb_cfg::get_scb_name(), and queues.

Referenced by check_phase().

◆ end_of_elaboration_phase()

void cl_syoscb::end_of_elaboration_phase ( uvm_phase  phase)

UVM end of elaboration phase.

Validate the scb configuration before proceding forward. Generate a UVM_FATAL for configuration combinations which are not allowed, or a warning if the combination has been internally evaluated as not recommended.

Definition at line 174 of file cl_syoscb.svh.

References config_validation().

◆ flush_queues()

void cl_syoscb::flush_queues ( string  queue_name = "")
virtual

Scoreboard API: Flushes the contents of either all queues or a specific queue.

Parameters
queue_nameThe name of the queue to flush. If "" is passed, flushes all queues

Definition at line 349 of file cl_syoscb.svh.

References cfg, cl_syoscb_cfg::exist_queue(), cl_syoscb_queue_base::flush_queue(), cl_syoscb_cfg::get_queue(), and queues.

Referenced by flush_queues_all().

◆ get_failed_checks()

string cl_syoscb::get_failed_checks ( )
virtual

Scoreboard API: Returns a string with information on which checks the scoreboard has failed (e.g.

any queues non-empty, any queues with no insertions) This report also contains the per-queue information generated by get_queue_failed_checks

Definition at line 694 of file cl_syoscb.svh.

References failed_checks, and get_queue_failed_checks().

Referenced by cl_syoscbs_base::get_scb_failed_checks().

◆ get_queue_failed_checks()

string cl_syoscb::get_queue_failed_checks ( )
protectedvirtual

Returns a string with information on which checks the different queues have failed (e.g.

not empty at end of sim, no insertions). If they are not empty it also shows the number of orphans.

Definition at line 680 of file cl_syoscb.svh.

References failed_checks, cl_syoscb_queue_base::get_failed_checks(), and queues.

Referenced by get_failed_checks(), and report_phase().

◆ get_subscriber()

cl_syoscb_subscriber cl_syoscb::get_subscriber ( string  queue_name,
string  producer 
)
virtual

Scoreboard API: Returns a UVM subscriber for a given combination of queue and producer.

The returned UVM subscriber can then be connected to a UVM monitor or similar which produces transactions which should be scoreboarded.

Parameters
queue_nameThe name of the queue that items should be added to
producerThe name of the producer that should add items to the queue
Returns
A handle to a uvm_subscriber that will insert items into the given queue with that producers name

Definition at line 741 of file cl_syoscb.svh.

References cfg, cl_syoscb_cfg::get_scb_name(), and subscribers.

◆ insert_queues()

bit cl_syoscb::insert_queues ( string  queue_name = "")
virtual

Returns whether at least one element has been inserted in all queues or in a specific queue.

Parameters
queue_nameThe queue to check for insertions. If "" is passed, checks all queues
Returns
1 if the given queue (or all queues) has had at least one insertion, 0 otherwise

Definition at line 400 of file cl_syoscb.svh.

References cfg, cl_syoscb_cfg::exist_queue(), cl_syoscb_queue_base::get_cnt_add_item(), cl_syoscb_cfg::get_queue(), cl_syoscb_cfg::get_scb_name(), and queues.

Referenced by check_phase().

◆ intermediate_queue_stat_dump()

void cl_syoscb::intermediate_queue_stat_dump ( string  queue_name)
protectedvirtual

Prints the current queue statistics for a queue.

This can be used to get queue statistics throughout simulation.

Parameters
queue_nameThe name of the queue to dump statistics for.

Definition at line 928 of file cl_syoscb.svh.

References cfg, cl_syoscb_queue_base::create_queue_report(), cl_syoscb_cfg::exist_queue(), cl_syoscb_queue_base::get_cnt_add_item(), cl_syoscb_cfg::get_max_length_producer(), cl_syoscb_cfg::get_max_length_queue_name(), cl_syoscb_cfg::get_queue(), cl_syoscb_string_library::scb_header_str(), and cl_syoscb_string_library::scb_separator_str().

Referenced by add_item().

◆ override_queue_type()

void cl_syoscb::override_queue_type ( )
protectedvirtual

Performs a factory override of the queue type to be used, based on the value of the cl_syoscb_cfg::queue_type cfg.

knob. Once factory override has been performed, creates all queues in this scoreboard and forwards the configuration object to them

Definition at line 437 of file cl_syoscb.svh.

References cfg, cl_syoscb_cfg::get_queue_type(), cl_syoscb_cfg::get_queues(), cl_syoscb_cfg::get_scb_name(), queues, and cl_syoscb_cfg::set_queue().

Referenced by build_phase().

◆ pre_abort()

void cl_syoscb::pre_abort ( )
virtual

UVM pre_abort hook.

Ensures that all shadow items are dumped if a UVM_ERROR is about to stop simulation

Definition at line 955 of file cl_syoscb.svh.

References cfg, dump(), and cl_syoscb_cfg::get_full_scb_dump().

◆ print_header()

string cl_syoscb::print_header ( string  queue_name)
protectedvirtual

Gets a header string to print into a shadow queue dump file.

Parameters
queue_nameThe header for that queue

Definition at line 963 of file cl_syoscb.svh.

References cfg, and cl_syoscb_cfg::get_full_scb_dump_type().

Referenced by dump_join_txt(), dump_split_txt(), and dump_split_xml().


The documentation for this class was generated from the following files:

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