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

Class which implements the in order by producer compare algorithm. More...

+ Inheritance diagram for cl_syoscb_compare_iop:
+ Collaboration diagram for cl_syoscb_compare_iop:

Protected Member Functions

virtual void compare_init ()
 Compare Strategy API: Verifies if the conditions for starting a compare are met. More...
 
virtual void primary_loop_do ()
 Compare Strategy API: Implementation of the in-order by producer comparison. More...
 
virtual void secondary_loop_do ()
 Compare Strategy API: Loop through all secondary queues, attempting to find an item which matches the primary item. More...
 
virtual string get_count_producer ()
 Compare Strategy API: For IOP comparisons, this function returns the producer of the first element (the oldest) inside the primary queue, and not the most recently inserted item. More...
 
virtual void compare_init ()
 Compare Strategy API: Verifies if the conditions for starting a compare are met:

  1. Verify that all queues currently contain at least one element
  2. Verify that all queues have at least one element from the same producer as the producer returned by get_count_producer() (the primary item being searched for) If the conditions are met then go variable is triggered, and the compare process can start.
More...
 
virtual void primary_loop_do ()
 Compare Strategy API: Loop over the primary queue, selecting primary items to compare against items in the secondary queues. More...
 
virtual void secondary_loop_do ()
 Compare Strategy API: Loop over all secondary queues to find a match for the primary item. More...
 
virtual string get_count_producer ()
 Compare Strategy API: Returns the name of the producer that the compare method should evaluate in order to verify if it makes sense to start a comparison. More...
 
- Protected Member Functions inherited from cl_syoscb_compare_base
virtual void init ()
 Compare Strategy API: Executes some preliminary common operations before starting comparisons:

  1. Split queues into primary and secondary
  2. Create iterator for the chosen primary queue

 
virtual void compare_do_greed (t_scb_compare_greed greed)
 Compare Strategy API: Try to remove a match and drain all the potential remaining matches inside the queues according to the greed level given as argument. More...
 
virtual void compare_do ()
 Compare Strategy API: Starts the actual comparison operation

  1. Perform initialization on the primary queue, if necessary
  2. Start the primary queue loop

 
virtual string get_primary_queue_name ()
 Compare Strategy API: Gets the name of this scoreboard's primary queue. More...
 
virtual void split_queues ()
 Compare Strategy API: Splits the scoreboard's queues into 1 primary queue and N-1 secondary queues. More...
 
virtual void check_queues ()
 Compare Strategy API: Check if any queue is empty. More...
 
virtual void count_producers (string producer="")
 Compare Strategy API: Checks if the producer of the current item exists in all other queues, and whether all other queues have at least 1 item from that producer. More...
 
virtual void create_primary_iterator ()
 Compare Strategy API: Creates the iterator for the primary queue and sets the pointer to its first element
 
virtual void primary_loop_init ()
 Compare Strategy API: Contains all the operations to be executed immediately before starting the primary loop. More...
 
virtual void static_queue_split_do ()
 Compare Strategy API: Splits queues into primary and secondary when a primary queue has been specified. More...
 
virtual void dynamic_queue_split_do ()
 Compare Strategy API: Splits queues into primary and secondary when a primary queue has not been specified. More...
 
virtual bit delete ()
 Compare Strategy API: Deletes matched items from the primary and all secondary queues if a match was found. More...
 
virtual int unsigned get_queues_item_cnt ()
 Compare Strategy API: Gets the total number of items in all the queues at the moment of the function call. More...
 

Protected Attributes

cl_syoscb_item primary_item
 Scoreboard wrapper item from the primary queue.
 
cl_syoscb_item secondary_item
 Scoreboard wrapper item from the secondary queue currently being inspected.
 
- Protected Attributes inherited from cl_syoscb_compare_base
cl_syoscb_cfg cfg
 Handle to the configuration object.
 
bit do_split = 0b1
 Indicates how queues should be split into a primary queue and array of secondary queues. More...
 
bit go = 0b1
 Indicates whether a comparison can be started (1) or not (0)
 
bit disable_compare = 0b0
 If set to 1'b1, no comparisons are performed. If 1'b0, comparisons are executed.
 
string primary_queue_name
 Name of primary queue.
 
cl_syoscb_queue_base primary_queue
 Handle to primary queue.
 
string secondary_queue_names []
 Names of secondary queues.
 
cl_syoscb_queue_base secondary_queues []
 Handles to secondary queues.
 
cl_syoscb_proxy_item_base secondary_item_found [string]
 Associative array used to indicate if a matching item was found in a secondary queue. More...
 
cl_syoscb_proxy_item_base primary_item_proxy
 Proxy item for the item being searched for in all secondary queue.
 
cl_syoscb_queue_iterator_base primary_queue_iter
 Iterator into primary queue.
 
string current_queue_name
 Name of the queue currently being searched.
 
cl_syoscb_item current_item
 Handle to the item passed in by cl_syoscb::add_item.
 

Additional Inherited Members

- Public Member Functions inherited from cl_syoscb_compare_base
virtual void compare_control (bit cc)
 Compare API: Toggle comparisons on or off More...
 
virtual void compare_trigger (string queue_name="", cl_syoscb_item item=null)
 Compare API: Starts a comparison by calling compare_main if comparisons are not disabled. More...
 
virtual void compare_main (t_scb_compare_greed greed)
 Compare API: Main function that contains all the actual compare operations requested by the compare algorithm. More...
 
virtual void set_cfg (cl_syoscb_cfg cfg)
 Set the scoreboard configuration associated with this comparer's scoreboard. More...
 
virtual cl_syoscb_cfg get_cfg ()
 Gets the scoreboard configuration object associated with this scoreboard.
 
virtual string generate_miscmp_table (cl_syoscb_item primary_item, cl_syoscb_item secondary_item, string sec_queue_name, uvm_comparer comparer, string cmp_name)
 Generates a side-by-side comparison of the seq. More...
 
virtual void do_copy (uvm_object rhs)
 Custom do_dopy implementation for secondary queues.
 

Detailed Description

Class which implements the in order by producer compare algorithm.

Definition at line 2 of file cl_syoscb_compare_iop.svh.

Member Function Documentation

◆ compare_init() [1/2]

void cl_syoscb_compare_iop::compare_init ( )
protectedvirtual

Compare Strategy API: Verifies if the conditions for starting a compare are met.

For IOP comparison, we only check whether all queues have at least one item in them, but do not check if primary queue's oldest item's producer exists in all queues. Checking if all queues have an item from the same producer is moved to primary_loop_do

Reimplemented from cl_syoscb_compare_base.

Definition at line 39 of file cl_syoscb_compare_iop.svh.

References cl_syoscb_compare_base::check_queues().

◆ compare_init() [2/2]

virtual void cl_syoscb_compare_iop::compare_init ( )
protectedvirtual

Compare Strategy API: Verifies if the conditions for starting a compare are met:

  1. Verify that all queues currently contain at least one element
  2. Verify that all queues have at least one element from the same producer as the producer returned by get_count_producer() (the primary item being searched for) If the conditions are met then go variable is triggered, and the compare process can start.

Reimplemented from cl_syoscb_compare_base.

◆ get_count_producer() [1/2]

string cl_syoscb_compare_iop::get_count_producer ( )
protectedvirtual

Compare Strategy API: For IOP comparisons, this function returns the producer of the first element (the oldest) inside the primary queue, and not the most recently inserted item.

Reimplemented from cl_syoscb_compare_base.

Definition at line 165 of file cl_syoscb_compare_iop.svh.

References cl_syoscb_queue_base::create_iterator(), cl_syoscb_queue_iterator_base::first(), cl_syoscb_queue_base::get_item(), cl_syoscb_item::get_producer(), cl_syoscb_queue_iterator_base::next(), cl_syoscb_compare_base::primary_queue, and cl_syoscb_compare_base::primary_queue_iter.

◆ get_count_producer() [2/2]

virtual string cl_syoscb_compare_iop::get_count_producer ( )
protectedvirtual

Compare Strategy API: Returns the name of the producer that the compare method should evaluate in order to verify if it makes sense to start a comparison.

Note
This needs to be overridden by the derived compare methods in order to change the behaviour accordingly to the requested needs. By default, the function returns the producer of current_item.
Returns
The name producer which should be evaluated

Reimplemented from cl_syoscb_compare_base.

◆ primary_loop_do() [1/2]

void cl_syoscb_compare_iop::primary_loop_do ( )
protectedvirtual

Compare Strategy API: Implementation of the in-order by producer comparison.

The algorithm gets the primary queue, extracting the oldest element. It then checks if all other queues also contain an element from this element's producer. If true, it attempts to find a match for the primary item in all secondary queues. If false, extracts the second-oldest element from primary, checking if this item's producer has at least one item in all other queues. Continues performing this loop over items in primary queue until one of three things happen:

  1. A match is found for the item from the primary queue, the item and matches are removed from their queues.
  2. An item from a secondary queue has the same producer but does not match primary item. This generates a miscompare and raises a UVM_ERROR.
  3. No matches are found. Will search over at most cl_syoscb_cfg::max_search_window elements in the primary and secondary queues. Does not raise a UVM_ERROR Note that this may leave the queues non_empty at the end of simulation without triggering any errors. These orphaned items in queues are caught in the check_phase.

Reimplemented from cl_syoscb_compare_base.

Definition at line 59 of file cl_syoscb_compare_iop.svh.

References cl_syoscb_compare_base::cfg, cl_syoscb_compare_base::count_producers(), cl_syoscb_queue_iterator_base::first(), cl_syoscb_queue_base::get_item(), cl_syoscb_cfg::get_max_search_window(), cl_syoscb_item::get_producer(), cl_syoscb_cfg::get_scb_name(), cl_syoscb_compare_base::go, cl_syoscb_queue_iterator_base::has_next(), cl_syoscb_queue_iterator_base::next(), cl_syoscb_queue_iterator_base::next_index(), primary_item, cl_syoscb_compare_base::primary_item_proxy, cl_syoscb_compare_base::primary_queue, cl_syoscb_compare_base::primary_queue_iter, cl_syoscb_compare_base::primary_queue_name, cl_syoscb_compare_base::secondary_item_found, secondary_loop_do(), and cl_syoscb_string_library::sprint_item().

◆ primary_loop_do() [2/2]

virtual void cl_syoscb_compare_iop::primary_loop_do ( )
protectedvirtual

Compare Strategy API: Loop over the primary queue, selecting primary items to compare against items in the secondary queues.

Note
Abstract method. This method must be implemented in a subclass.

Reimplemented from cl_syoscb_compare_base.

◆ secondary_loop_do() [1/2]

void cl_syoscb_compare_iop::secondary_loop_do ( )
protectedvirtual

◆ secondary_loop_do() [2/2]

virtual void cl_syoscb_compare_iop::secondary_loop_do ( )
protectedvirtual

Compare Strategy API: Loop over all secondary queues to find a match for the primary item.

Note
Abstract method. This method must be implemented in a subclass.

Reimplemented from cl_syoscb_compare_base.


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