1 @page pAPI API Descriptions
3 The scoreboard presents several APIs that user-facing code can leverage. These APIs have been grouped based on their functionality, and are described in further detail in the sections below.
5 In general, all methods which are labeled with <b>API</b> are OK to call from user code. The only exception to this rule is methods labeled with <b>Compare Strategy API</b>.
6 These methods should not be called from outside of a compare strategy, but they are labeled as a separate API to simplify custom compare strategy implementations. See also \ref sCompareStrategyAPI and the included figure of the comparison flowchart.
8 In the sections below, a brief overview of the APIs is presented.
9 Selected methods from each API are listed here, but more exist. Follow the links to view each class' full list of methods.
10 All methods labeled with <b>API</b> are part of the user-facing API, and have more in-depth explanations of their functionality, parameters and return values. On the class reference pages, all internal methods are also described in detail to aid in further extensions, but should not be called outside of the given class.
12 @section sConfigAPI Configuration API
14 The configuration API is accessible in cl_syoscb_cfg and cl_syoscbs_cfg.
15 The methods of the configuration API are used to configure scoreboards and scoreboard wrappers.
16 These methods are generally called in the UVM \c build_phase, setting configuration values before starting simulation.
18 <b> Classes implementing this API </b>
22 <b> Selected methods </b>
24 See \ref pExampleConf for an overview of all configuration knobs in cl_syoscb_cfg. cl_syoscbs_cfg itself does not contain many config knobs, but includes methods for easily modifying all wrapped configuration objects.
26 @section sCompareAPI Compare API
28 The compare API is used to start and control comparisons. The compare API is relatively small, whereas the \ref sCompareStrategyAPI contains the majority of the functions used to implement comparisons.
29 The class cl_syoscb_compare inherits from \c uvm_component and is used to instantiate the desired compare strategy which inherits from cl_syoscb_compare_base.
31 <b> Classes implementing this API </b>
33 -# cl_syoscb_compare_base
34 -# cl_syoscb_compare_io
35 -# cl_syoscb_compare_iop
36 -# cl_syoscb_compare_io_2hp
37 -# cl_syoscb_compare_ooo
39 <b> Selected methods </b>
47 <td>cl_syoscb_compare_base#compare_trigger</td>
48 <td>Initiates a comparison when an item has been inserted. If cl_syoscb_compare_base.disable_compare is set, the comparison is not performed </td>
51 <td>cl_syoscb_compare_base#compare_main</td>
52 <td>Initiates a comparison, bypassing the check of \c disable_compare </td>
55 <td>cl_syoscb_compare_base#compare_control</td>
56 <td>Disable or enable comparisons by calling this method</td>
60 @section sQueueAPI Queue API
61 The queue API is primarily used to insert items in queues. When an item has been added to the scoreboard via either the function-based API or a TLM connection, the scoreboard adds the item to a queue through the queue API. If other types of queues than the std. queues and hash queues are desired, these should also implement this API.
63 <b>Classes implementing this API </b>
64 -# cl_syoscb_queue_base
65 -# cl_syoscb_queue_std
66 -# cl_syoscb_queue_hash
67 -# cl_syoscb_queue_hash_md5
69 <b> Selected methods </b>
76 <td>cl_syoscb_queue_base#add_item</td>
77 <td>Adds an item to the queue, placing it at the end of the queue. </td>
80 <td>cl_syoscb_queue_base#insert_item</td>
81 <td>Inserts an item at a specified index instead of placing it at the end of the queue. </td>
84 <td>cl_syoscb_queue_base#flush_queue</td>
85 <td>Flushes the queue, removing all items that previously occupied the queue</td>
88 <td>cl_syoscb_queue_base#create_iterator</td>
89 <td>Creates an iterator over this queue. See \ref sIteratorAPI for information on how iterators are used to traverse queues.
92 <td>cl_syoscb_queue_base#get_item </td>
93 <td> Takes a proxy item as input, and uses this proxy item to return a specific item from the queue </td>
98 @section sHashAPI Hash API
99 The hash API is used by hash algorithms to hash sequence items for use in hash queues.
101 <b>Classes implementing this API </b>
103 -# cl_syoscb_hash_base
104 -# cl_syoscb_hash_md5
106 <b> Selected methods </b>
114 <td>cl_syoscb_hash_base#hash</td>
115 <td>Hashes a cl_syoscb_item using the specified hash algorithm, returning the bitstream representing that hash </td>
118 <td>cl_syoscb_hash_base#hash_str</td>
119 <td>Hashes a string using the specified hash algorithm </td>
122 <td>cl_syoscb_hash_base#do_hash</td>
123 <td>The underlying method which implements hashing of a bitstream. Can be used to hash items which are not strings or objects that extend cl_syoscb_item</td>
127 @section sItemAPI Item API
129 The SyoSCB leverages multiple types of wrapper items to manage separation of concerns. The item API encompasses three different items' APIs, all of which are used to wrap sequence items when stored inside the scoreboard.
132 <b>Classes implementing this API </b>
135 - Wraps a \c uvm_sequence_item generated by the DUT or a reference model with additional metadata used for comparisons.
136 -# cl_syoscb_hash_item
137 - Used in hash queues to ensure that hash collisions, although unlikely, do not overwrite items in the underlying datastructure.
138 -# cl_syoscb_proxy_item_base
139 - cl_syoscb_proxy_item_std
140 - cl_syoscb_proxy_item_hash
141 - Used with iterators and locators to separate the underlying queue's implementation and the act of iterating over it.
143 <b> Selected methods </b>
151 <td>cl_syoscb_item#get_item</td>
152 <td>Gets the \c uvm_sequence_item wrapped by this scoreboard item </td>
155 <td>cl_syoscb_hash_item#get_item</td>
156 <td>Gets the first of possibly multiple items that have the same hash </td>
159 <td>cl_syoscb_proxy_item_base#get_item</td>
160 <td>Gets the item which this proxy item represents. The proxy item contains a handle to the queue, and the queue knows how to parse proxy items (see \ref sQueueAPI)</td>
164 @section sIteratorAPI Iterator API
166 Iterators are used to iterate over queues in an implementation-agnostic manner. To iterate over all items in a queue,
167 a loop of the following kind may be used:
170 if(iter.first()) begin //Reset the iterator, returns false if the queue is empty
171 while(!iter.is_done()) begin
178 <b>Classes implementing this API</b>
179 -# cl_syoscb_queue_iterator_base
180 -# cl_syoscb_queue_iterator_std
181 -# cl_syoscb_queue_iterator_hash
182 -# cl_syoscb_queue_iterator_hash_md5
184 <b> Selected methods </b>
192 <td>cl_syoscb_queue_iterator_base#next</td>
193 <td>Moves the iterator one item forward</td>
196 <td>cl_syoscb_queue_iterator_base#get_item_proxy</td>
197 <td>Gets a cl_syoscb_proxy_item_base representing the item that the iterator currently points to </td>
200 <td>cl_syoscb_queue_iterator_base#is_done</td>
201 <td>Checks whether the iterator has reached the end of the queue. </td>
205 @section sLocatorAPI Locator API
207 Locators are used to find a specific item in a queue in an implementation-agnostic manner. Locators are primarily used for the OOO compare algorithm, where the item being searched for may exist anywhere in the queue.
210 <b>Classes implementing this API</b>
211 -# cl_syoscb_queue_locator_base
212 -# cl_syoscb_queue_locator_std
213 -# cl_syoscb_queue_locator_hash
214 -# cl_syoscb_queue_locator_hash_md5
216 <b> Selected methods </b>
224 <td>cl_syoscb_queue_locator_base#search</td>
225 <td>Searches the underlying queue for an item which matches the argument.</td>
228 <td>cl_syoscb_queue_locator_base#get_queue</td>
229 <td>Gets a handle to the queue that this locator is operating on </td>
232 <td>cl_syoscb_queue_locator_base#set_queue</td>
233 <td>Sets the queue over which a locator should operate </td>
237 @section sScoreboardAPI Scoreboard API
239 The scoreboard API is used to insert items, either through the function-based API or through a TLM-based connection. Once inserted, the scoreboard contains a number of functions that can be used to generate statistics or dump items to log files.
241 <b>Classes implementing this API</b>
244 <b> Selected methods </b>
252 <td>cl_syoscb#add_item</td>
253 <td>Adds an item to the scoreboard through the function based API. The item is inserted in a specific queue based on the arguments passed to the function. </td>
256 <td>cl_syoscb#get_subscriber</td>
257 <td>Gets a handle to a cl_syoscb_subscriber for a given queue/producer combination.
258 Items written to this subscriber are added to the specified queue, tagged with the specified producer. </td>
261 <td>cl_syoscb#add_item_mutexed</td>
262 <td>Adds an item to the scoreboard, but acquires a mutex before doing so, ensuring that at most one insertion is ever taking place at once. Can only be used if cl_syoscb_cfg#mutexed_add_item_enable is set.</td>
265 <td>cl_syoscb#flush_queues</td>
266 <td>Flushes one or all queues of the scoreboard </td>
270 @section sWrapperAPI Scoreboard Wrapper API
272 The scoreboard wrapper API is primarily used to easily manage and configure multiple identical scoreboards inside of a wrapper. The API is similar to the one presented for scoreboards, but may affect all scoreboards at the same time.
274 The wrapper API does not support adding items directly via the function based API.
275 Instead, filter transforms are connected to agents as described in \ref sMultipleSCBintances, or a handle to specific scoreboard may be extracted.
277 <b>Classes implementing this API</b>
281 <b> Selected methods </b>
289 <td>cl_syoscbs#get_scb</td>
290 <td>Gets a handle to the scoreboard with index <i>i</i>. </td>
293 <td>cl_syoscbs#get_filter_trfm_base</td>
294 <td>Gets a filter transform component used to transform inputs to a specific queue from a specific producer. </td>
297 <td>cl_syoscb#flush_queues_all</td>
298 <td>Flushes all queues in all scoreboards at the same time</td>
303 @section sCompareStrategyAPI Compare Strategy API
305 The compare strategy API shall be used as a baseline in case custom comparisons must be implemented.
306 By leveraging the compare strategy API, custom compare strategies should be interoperable with the compare strategies shipped with the SyoSil UVM Scoreboard.
308 <b> Classes implementing this API </b>
309 -# cl_syoscb_compare_base
310 -# cl_syoscb_compare_io
311 -# cl_syoscb_compare_iop
312 -# cl_syoscb_compare_io_2hp
313 -# cl_syoscb_compare_ooo
315 <b> Selected methods </b>
322 <td>cl_syoscb_compare_base#primary_loop_do</td>
323 <td>A loop over the primary queue, selecting the item which should be found in all secondary queues</td>
326 <td>cl_syoscb_compare_base#secondary_loop_do</td>
327 <td>A loop over all secondary queues, attempting to find the same item as was selected from the primary queue. The manner of looping and which items are considered is defined by the compare strategy</td>
330 <td>cl_syoscb_compare_base#compare_do_greed</td>
331 <td>Initiates a comparison at the desired greed level. The scoreboard supports greedy comparisons (perform comparisons until a match is no longer found), or non-greedy comparisons (only perform 1 comparison whenever triggered, no matter if the comparison was successful or not)</td>