SyoSil ApS UVM Scoreboard
1.0.3.0
|
Class which represents the base concept of a queue. More...
Public Member Functions | |
void | build_phase (uvm_phase phase) |
UVM Build Phase. Gets the scoreboard configuration for this SCB. | |
void | check_phase (uvm_phase phase) |
UVM check phase. More... | |
virtual bit | add_item (string producer, uvm_sequence_item item) |
Queue API: Adds a uvm_sequence_item to this queue. More... | |
virtual bit | delete_item (cl_syoscb_proxy_item_base proxy_item) |
Queue API: Deletes the item indicated by the proxy item from the queue. More... | |
virtual void | dump (uvm_printer printer=null, int fd=UVM_STDOUT) |
Queue API: Loop over all the items in the shadow queue and dump them. More... | |
virtual cl_syoscb_item | get_item (cl_syoscb_proxy_item_base proxy_item) |
Queue API: Gets the item pointed to by the proxy item from the queue. More... | |
virtual int unsigned | get_size () |
Queue API: Returns the current size of the queue. More... | |
virtual bit | empty () |
Queue API: Returns whether or not the queue is empty. More... | |
virtual bit | insert_item (string producer, uvm_sequence_item item, int unsigned idx) |
Queue API: Inserts a uvm_sequence_item at index idx. More... | |
virtual void | flush_queue () |
Queue API: Deletes all elements from the queue. More... | |
virtual cl_syoscb_queue_iterator_base | create_iterator (string name="") |
Queue API: Creates an iterator for this queue. More... | |
virtual cl_syoscb_queue_iterator_base | get_iterator (string name) |
Queue API: Gets the iterator from this queue with a given name. More... | |
virtual bit | delete_iterator (cl_syoscb_queue_iterator_base iterator) |
Queue API: Deletes an iterator from this queue. More... | |
virtual cl_syoscb_queue_locator_base | get_locator () |
Queue API: Creates a locator for this queue. More... | |
virtual bit | exists_cnt_producer (string producer) |
Queue API: Check if a given producer exists in the producer counter for this queue More... | |
virtual int unsigned | get_cnt_producer (string producer) |
Queue API: Get the producer count for a given producer. More... | |
virtual int unsigned | get_cnt_add_item () |
Queue API: Returns the number of items that have been inserted in this queue | |
virtual int unsigned | get_max_items () |
Queue API: Returns the maximum number of elements that have been in the queue. | |
virtual int unsigned | get_cnt_flushed_item () |
Queue API: Returns the total number of elements flushed from this queue. | |
virtual int unsigned | get_cnt_matched_item () |
Queue API: Returns the total number of elements matched in this queue | |
virtual cl_syoscb_item | get_last_inserted_item () |
Queue API: Gets the last inserted item in the queue | |
virtual string | get_failed_checks () |
Queue API: Gets a string containing all queue checks that this queue have failed. More... | |
virtual string | create_queue_report (int unsigned offset, int unsigned first_column_width) |
Queue API: Returns a string with overall queues statistics. More... | |
Public Attributes | |
cl_syoscb_item | shadow_items [$] |
Shadow queue tracking all items inserted into the queue, used for scoreboard dumps. | |
Protected Member Functions | |
virtual cl_syoscb_item | pre_add_item (string producer, uvm_sequence_item item) |
Perform some basic bookkeeping that is the same for all sequence items before insertion. More... | |
virtual void | post_add_item (cl_syoscb_item item) |
Perform some basic bookkeping that is the same for all sequence items after insertion. More... | |
virtual void | do_flush_queue () |
Performs the actual element deletion from the queue when called by flush_queue. | |
virtual void | incr_cnt_producer (string producer) |
Increment the producer counter for a given producer. More... | |
virtual void | decr_cnt_producer (string producer) |
Decrement the producer counter for a given producer. More... | |
virtual void | dump_orphans_to_file () |
Dumps orphans remaining in the queue into a logfile. More... | |
virtual void | dump_orphans_to_stdout () |
Prints orphans remaining in the queue to stdout. More... | |
virtual string | create_producer_stats (int unsigned offset, int unsigned first_column_width) |
Returns a table with statistics for all producers in this queue. More... | |
virtual string | get_dump_extension (t_dump_type dump_type) |
Gets the file extension to be used for a dump file. More... | |
virtual void | print_orphan_xml_header (int fd) |
Prints the header for an XML orphan dump. More... | |
virtual void | print_orphan_xml_footer (int fd) |
Prints the footer for an XML orphan dump. More... | |
Protected Attributes | |
cl_syoscb_cfg | cfg |
Handle to the configuration. | |
cl_syoscb_queue_iterator_base | iterators [cl_syoscb_queue_iterator_base] |
List of iterators registered with this queue. | |
semaphore | iter_sem |
Semaphore guarding exclusive access to the queue when multiple iterators are in play. | |
int unsigned | cnt_producer [string] |
Associative array counting the number of items by a given producer that currently exist in the queue. | |
int unsigned | cnt_add_item = 0 |
Number of items that have been inserted into this queue. | |
int unsigned | max_items = 0 |
Maximum number of items that have been in this queue so far. | |
cl_syoscb_item | last_inserted_item |
The most recently inserted item in this queue. | |
int | num_iters_created = 0 |
The number of iterators that have been created for this queue so far. | |
Private Attributes | |
int unsigned | nbr_items_dumped |
Number of items that have been dumped from this queue when performing a scoreboard dump. | |
int unsigned | total_cnt_producer [string] |
Associative array counting the total number of items by a given producer that have been inserted in the queue. | |
int unsigned | total_cnt_flushed_producer [string] |
Associative array counter the total number of items by a given producer that have been flused form the queue. | |
string | failed_checks [string] |
AA for storing queue debug checks during the UVM check phase. More... | |
Class which represents the base concept of a queue.
All queues must extend this class and implement the queue API.
Definition at line 3 of file cl_syoscb_queue_base.svh.
|
virtual |
Queue API: Adds a uvm_sequence_item to this queue.
The basic job of the add_item method is:
producer | The producer of the sequence item |
item | The item that should be add to the queue |
Reimplemented in cl_syoscb_queue_hash< HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >, cl_syoscb_queue_std, and cl_syoscb_queue_std.
Definition at line 186 of file cl_syoscb_queue_base.svh.
Referenced by cl_syoscb::add_item().
void cl_syoscb_queue_base::check_phase | ( | uvm_phase | phase | ) |
UVM check phase.
Checks if the queue is empty and if it had zero insertions. If either is true, a UVM_ERROR is generated in cl_syoscb
Definition at line 150 of file cl_syoscb_queue_base.svh.
References cfg, dump_orphans_to_file(), dump_orphans_to_stdout(), empty(), failed_checks, cl_syoscb_cfg::get_dump_orphans_to_files(), cl_syoscb_cfg::get_enable_no_insert_check(), cl_syoscb_cfg::get_max_print_orphans(), and get_size().
|
virtual |
Queue API: Creates an iterator for this queue.
Iterators are by default named "[name]_iter[X]", where [name] is the name of the queue, and [X] is the number of iterators that have previusly been created for this queue
name | A name to be used for the iterator. If an iterator with this name already exists, prints a UVM_DEBUG message |
Reimplemented in cl_syoscb_queue_std, cl_syoscb_queue_std, cl_syoscb_queue_hash_md5, and cl_syoscb_queue_hash_md5.
Definition at line 320 of file cl_syoscb_queue_base.svh.
Referenced by cl_scb_test_iterator_unit_tests::check_first(), cl_scb_test_iterator_unit_tests::check_flush(), cl_scb_test_iterator_unit_tests::check_last(), cl_scb_test_iterator_unit_tests::check_names(), cl_scb_test_iterator_unit_tests::check_next(), cl_scb_test_iterator_unit_tests::check_prev(), cl_scb_test_iterator_unit_tests::check_set_queue(), cl_syoscb_compare_base::create_primary_iterator(), dump_orphans_to_file(), dump_orphans_to_stdout(), cl_syoscb_compare_ooo::get_count_producer(), cl_syoscb_compare_iop::get_count_producer(), cl_syoscb_compare_io_2hp::primary_loop_do(), cl_syoscb_compare_io::secondary_loop_do(), and cl_syoscb_compare_iop::secondary_loop_do().
|
protectedvirtual |
Returns a table with statistics for all producers in this queue.
Outputs the number of insertions, matches, flushed items and orphans per-producer.
offset | The x-offset that should be used when printing producer names |
first_column_width | The width of the first column in the table |
Definition at line 597 of file cl_syoscb_queue_base.svh.
References cfg, cnt_producer, cl_syoscb_cfg::get_producers(), cl_syoscb_string_library::pad_str(), total_cnt_flushed_producer, and total_cnt_producer.
Referenced by create_queue_report().
|
virtual |
Queue API: Returns a string with overall queues statistics.
Reports the number of insertions, matches, flushed items and orphans. If cl_syoscb_cfg::enable_queue_stats is 1, also includes per-producer statistics (see create_producer_stats)
offset | The x-offset that should be used when printing the queue name names |
first_column_width | The width of the first column in the table |
Definition at line 638 of file cl_syoscb_queue_base.svh.
References cfg, create_producer_stats(), get_cnt_add_item(), get_cnt_flushed_item(), get_cnt_matched_item(), cl_syoscb_cfg::get_enable_queue_stats(), get_size(), and cl_syoscb_string_library::pad_str().
Referenced by cl_syoscb::create_queues_stats(), and cl_syoscb::intermediate_queue_stat_dump().
|
protectedvirtual |
Decrement the producer counter for a given producer.
producer | The producer to decrement the counter for |
Definition at line 380 of file cl_syoscb_queue_base.svh.
References cnt_producer.
Referenced by cl_syoscb_queue_std::delete_item(), and cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::delete_item().
|
virtual |
Queue API: Deletes the item indicated by the proxy item from the queue.
The basic job of the delete_item method is:
proxy_item | A proxy item indicating which scoreboard item to delete from the queue |
Reimplemented in cl_syoscb_queue_hash< HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >, cl_syoscb_queue_std, and cl_syoscb_queue_std.
Definition at line 200 of file cl_syoscb_queue_base.svh.
Referenced by cl_syoscb_compare_base::delete().
|
virtual |
Queue API: Deletes an iterator from this queue.
iterator | The iterator to delete |
Reimplemented in cl_syoscb_queue_hash< HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >, cl_syoscb_queue_std, and cl_syoscb_queue_std.
Definition at line 345 of file cl_syoscb_queue_base.svh.
Referenced by cl_scb_test_iterator_unit_tests::check_first(), cl_scb_test_iterator_unit_tests::check_flush(), cl_scb_test_iterator_unit_tests::check_last(), cl_scb_test_iterator_unit_tests::check_names(), cl_scb_test_iterator_unit_tests::check_next(), cl_scb_test_iterator_unit_tests::check_prev(), cl_scb_test_iterator_unit_tests::check_set_queue(), dump_orphans_to_file(), and dump_orphans_to_stdout().
|
virtual |
Queue API: Loop over all the items in the shadow queue and dump them.
If a printer has not been passed in the arguments, used cl_syoscb_cfg::get_printer to lookup a printer for each shadow item (which may be quite inefficient). If cl_syoscb_cfg::full_scb_type has been set to XML, the XML printer is used, overriding any specific printers that have been set
printer | The printer to use when dumping items. Defaults to null, getting a queue/producer specific printer for each item |
fd | File descriptor for where to dump items. Defaults to STDOUT |
Definition at line 438 of file cl_syoscb_queue_base.svh.
References cfg, cl_syoscb_item::convert2string(), cl_syoscb_cfg::get_default_printer(), cl_syoscb_cfg::get_enable_c2s_full_scb_dump(), cl_syoscb_cfg::get_full_scb_dump(), cl_syoscb_cfg::get_full_scb_dump_type(), cl_syoscb_cfg::get_printer(), cl_syoscb_item::get_producer(), nbr_items_dumped, cl_syoscb_printer_config::set_file_descriptor(), cl_syoscb_item::set_queue_index(), and shadow_items.
Referenced by cl_syoscb::dump_join_txt(), cl_syoscb::dump_join_xml(), cl_syoscb::dump_split_txt(), and cl_syoscb::dump_split_xml().
|
protectedvirtual |
Dumps orphans remaining in the queue into a logfile.
Assumes that the caller has checked whether cl_syoscb_cfg::dump_orphans_to_files is set
Definition at line 521 of file cl_syoscb_queue_base.svh.
References cfg, create_iterator(), delete_iterator(), cl_syoscb_queue_iterator_base::first(), cl_syoscb_cfg::get_default_printer(), get_dump_extension(), cl_syoscb_proxy_item_base::get_item(), cl_syoscb_cfg::get_max_print_orphans(), cl_syoscb_cfg::get_orphan_dump_file_name(), cl_syoscb_cfg::get_orphan_dump_type(), cl_syoscb_cfg::get_printer(), cl_syoscb_item::get_producer(), cl_syoscb_cfg::get_scb_name(), cl_syoscb_queue_iterator_base::has_next(), cl_syoscb_queue_iterator_base::next(), cl_syoscb_queue_iterator_base::next_index(), cl_syoscb_queue_iterator_base::previous_index(), print_orphan_xml_footer(), print_orphan_xml_header(), cl_syoscb_printer_config::set_file_descriptor(), and cl_syoscb_item::set_queue_index().
Referenced by check_phase().
|
protectedvirtual |
Prints orphans remaining in the queue to stdout.
The number of orphans that are printed depends on cl_syoscb_cfg::max_print_orphans
Definition at line 484 of file cl_syoscb_queue_base.svh.
References cfg, create_iterator(), delete_iterator(), cl_syoscb_queue_iterator_base::first(), cl_syoscb_proxy_item_base::get_item(), cl_syoscb_cfg::get_max_print_orphans(), cl_syoscb_cfg::get_orphans_as_errors(), cl_syoscb_queue_iterator_base::has_next(), cl_syoscb_queue_iterator_base::next(), cl_syoscb_queue_iterator_base::next_index(), cl_syoscb_queue_iterator_base::previous_index(), and cl_syoscb_item::set_queue_index().
Referenced by check_phase().
|
virtual |
Queue API: Returns whether or not the queue is empty.
Reimplemented in cl_syoscb_queue_hash< HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >, cl_syoscb_queue_std, and cl_syoscb_queue_std.
Definition at line 266 of file cl_syoscb_queue_base.svh.
Referenced by check_phase(), cl_syoscb_compare_base::check_queues(), and cl_syoscb::empty_queues().
|
virtual |
Queue API: Check if a given producer exists in the producer counter for this queue
producer | The producer to check for existence 1 if the producer exists, 0 otherwise |
Definition at line 395 of file cl_syoscb_queue_base.svh.
References cnt_producer.
Referenced by cl_syoscb_compare_base::count_producers().
|
virtual |
Queue API: Deletes all elements from the queue.
Updates the flush counter, sets all producer counts to 0 and resets all iterators.
Definition at line 288 of file cl_syoscb_queue_base.svh.
References cfg, cnt_producer, do_flush_queue(), cl_syoscb_cfg::get_producers(), iter_sem, iterators, and total_cnt_flushed_producer.
Referenced by cl_syoscb::flush_queues().
|
virtual |
Queue API: Get the producer count for a given producer.
producer | The producer to get count for |
Definition at line 403 of file cl_syoscb_queue_base.svh.
References cnt_producer.
Referenced by cl_syoscb_compare_base::count_producers().
|
protectedvirtual |
Gets the file extension to be used for a dump file.
dump_type | The type of dump that should be performed. |
Definition at line 659 of file cl_syoscb_queue_base.svh.
Referenced by dump_orphans_to_file().
|
virtual |
Queue API: Gets a string containing all queue checks that this queue have failed.
Failed checks include having orphans at the end of simulation, and not having any insertions
Definition at line 577 of file cl_syoscb_queue_base.svh.
References failed_checks.
Referenced by cl_syoscb::get_queue_failed_checks().
|
virtual |
Queue API: Gets the item pointed to by the proxy item from the queue.
If the proxy item does not specify a valid item in the queue, print a UVM_INFO/DEBUG message
proxy_item | A proxy item indicating which scoreboard item to delete from the queue |
Reimplemented in cl_syoscb_queue_hash< HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >, cl_syoscb_queue_std, and cl_syoscb_queue_std.
Definition at line 248 of file cl_syoscb_queue_base.svh.
Referenced by cl_syoscb_compare_ooo::get_count_producer(), cl_syoscb_compare_iop::get_count_producer(), cl_syoscb_proxy_item_base::get_item(), cl_syoscb_compare_io::primary_loop_do(), cl_syoscb_compare_io_2hp::primary_loop_do(), cl_syoscb_compare_iop::primary_loop_do(), cl_syoscb_compare_io::secondary_loop_do(), and cl_syoscb_compare_iop::secondary_loop_do().
|
virtual |
Queue API: Gets the iterator from this queue with a given name.
If no queue exists with that name, returns null
name | The name of the queue to lookup |
Definition at line 330 of file cl_syoscb_queue_base.svh.
References iterators.
Referenced by cl_syoscb_compare_base::create_primary_iterator(), cl_syoscb_compare_io_2hp::primary_loop_do(), cl_syoscb_compare_io::secondary_loop_do(), and cl_syoscb_compare_iop::secondary_loop_do().
|
virtual |
Queue API: Creates a locator for this queue.
Reimplemented in cl_syoscb_queue_std, cl_syoscb_queue_std, cl_syoscb_queue_hash_md5, and cl_syoscb_queue_hash_md5.
Definition at line 352 of file cl_syoscb_queue_base.svh.
Referenced by cl_syoscb_compare_ooo::secondary_loop_do().
|
virtual |
Queue API: Returns the current size of the queue.
Reimplemented in cl_syoscb_queue_hash< HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >, cl_syoscb_queue_std, and cl_syoscb_queue_std.
Definition at line 257 of file cl_syoscb_queue_base.svh.
Referenced by cl_syoscb::add_item(), cl_scb_test_iterator_unit_tests::check_last(), cl_scb_test_iterator_unit_tests::check_next(), check_phase(), create_queue_report(), cl_syoscb_compare_base::dynamic_queue_split_do(), cl_syoscb_queue_iterator_std::first(), get_cnt_matched_item(), cl_syoscb_compare_base::get_queues_item_cnt(), cl_syoscb::get_total_queue_size(), cl_syoscb_queue_iterator_std::has_next(), cl_syoscb_queue_iterator_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::has_next(), cl_syoscb_queue_iterator_std::last(), and post_add_item().
|
protectedvirtual |
Increment the producer counter for a given producer.
producer | The producer to increment the counter for |
Definition at line 363 of file cl_syoscb_queue_base.svh.
References cnt_producer, total_cnt_flushed_producer, and total_cnt_producer.
Referenced by post_add_item().
|
virtual |
Queue API: Inserts a uvm_sequence_item at index idx.
The method works in the same manner as add_item, by doing the following:
producer | The producer of the sequence item |
item | The item that should be add to the queue |
idx | The index at which the item should be inserted |
Reimplemented in cl_syoscb_queue_hash< HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< HASH_DIGEST_WIDTH >, cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >, cl_syoscb_queue_std, and cl_syoscb_queue_std.
Definition at line 281 of file cl_syoscb_queue_base.svh.
|
protectedvirtual |
Perform some basic bookkeping that is the same for all sequence items after insertion.
item | The scoreboard item that has been inserted into the scoreboard |
Definition at line 230 of file cl_syoscb_queue_base.svh.
References cfg, cnt_add_item, cl_syoscb_cfg::get_full_scb_dump(), cl_syoscb_item::get_producer(), get_size(), incr_cnt_producer(), last_inserted_item, max_items, and shadow_items.
Referenced by cl_syoscb_queue_std::add_item(), cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::add_item(), cl_syoscb_queue_std::insert_item(), and cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::insert_item().
|
protectedvirtual |
Perform some basic bookkeeping that is the same for all sequence items before insertion.
Generates the scoreboard wrapper item
producer | The producer of this item |
item | The item to be inserted into the scoreboard |
Definition at line 210 of file cl_syoscb_queue_base.svh.
References cnt_add_item, cl_syoscb_item::set_insertion_index(), cl_syoscb_item::set_item(), and cl_syoscb_item::set_producer().
Referenced by cl_syoscb_queue_std::add_item(), cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::add_item(), cl_syoscb_queue_std::insert_item(), and cl_syoscb_queue_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::insert_item().
|
protectedvirtual |
Prints the footer for an XML orphan dump.
fd | File descriptor for the file to write the header into |
Definition at line 688 of file cl_syoscb_queue_base.svh.
Referenced by dump_orphans_to_file().
|
protectedvirtual |
Prints the header for an XML orphan dump.
fd | File descriptor for the file to write the header into |
Definition at line 672 of file cl_syoscb_queue_base.svh.
References cfg, and cl_syoscb_cfg::get_scb_name().
Referenced by dump_orphans_to_file().
|
private |
AA for storing queue debug checks during the UVM check phase.
These values are used in cl_syoscb::report_phase and cl_syoscb::check_phase
Definition at line 46 of file cl_syoscb_queue_base.svh.
Referenced by check_phase(), and get_failed_checks().
![]() |
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 Version: 1.8.14 Generated with IDV SV Filter Version: 2.6.3 Fri Sep 2 2022 14:41:08 |