|
3 | 3 | Scoreboard |
4 | 4 | ================================================================================ |
5 | 5 |
|
| 6 | +Overview |
| 7 | +------------------------------------------------------------------------------- |
| 8 | + |
| 9 | +The scoreboard class is designed for transaction comparison in a verification |
| 10 | +environment. This class extends adi_component and is parameterized by a |
| 11 | +datatype data_type, which allows the verification of different datatypes without |
| 12 | +the need of inheriting this class. The scoreboard class contains an inner class |
| 13 | +subscriber_class which extends adi_subscriber and is responsible for receiving |
| 14 | +and storing data streams. The scoreboard can operate in oneshot or in |
| 15 | +cyclic mode, which allows the verification of repeating sequence verification. |
| 16 | + |
| 17 | +Variables |
| 18 | +------------------------------------------------------------------------------- |
| 19 | + |
| 20 | +The scoreboard class itself has two instances of subscriber_class, named |
| 21 | +subscriber_source and subscriber_sink, which represent the source and sink of |
| 22 | +the data streams. These are subscribed to a publisher, which calls the |
| 23 | +respective functions when new data is available. |
| 24 | + |
| 25 | +Functions |
| 26 | +------------------------------------------------------------------------------- |
| 27 | + |
| 28 | +function new(input string name, input adi_component parent = null); |
| 29 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 30 | + |
| 31 | +Creates the scoreboard object. The name gives the scoreboard a name that is |
| 32 | +relevant in the current environment it is instantiated in and the parent sets |
| 33 | +the parent object in which it resides. |
| 34 | + |
| 35 | +task run(); |
| 36 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 37 | + |
| 38 | +Enables the scoreboard and clears the data streams. |
| 39 | + |
| 40 | +task stop(); |
| 41 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 42 | + |
| 43 | +Disables the scoreboard and clears the data streams. |
| 44 | + |
| 45 | +function void set_sink_type(input bit sink_type); |
| 46 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 47 | + |
| 48 | +Allows the setting of the sink type, which defines if the output data may or may |
| 49 | +not repeat. If set to oneshot, then the source data is verified only once. If |
| 50 | +set to cyclic, then the source data is verified against the sink data as long as |
| 51 | +new data is coming in on the sink side. This value can only be set when the |
| 52 | +scoreboard is disabled. |
| 53 | + |
| 54 | +function bit get_sink_type(); |
| 55 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 56 | + |
| 57 | +Get the sink type. |
| 58 | + |
| 59 | +protected function void clear_streams(); |
| 60 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 61 | + |
| 62 | +Clear the source and sink data streams. |
| 63 | + |
| 64 | +task wait_until_complete(); |
| 65 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 66 | + |
| 67 | +Wait until the source and the sink datastreams are clear of data, which means |
| 68 | +that all source data was verified against all sink data. |
| 69 | + |
| 70 | +virtual function void compare_transaction(); |
| 71 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 72 | + |
| 73 | +Compares the source and the sink datastreams against each other. This method is |
| 74 | +called by the subscriber when new data arrives. If the scoreboard is disabled, |
| 75 | +the comparison is ommited. |
| 76 | + |
| 77 | +Usage and recommendations |
| 78 | +------------------------------------------------------------------------------- |
| 79 | + |
| 80 | +Basic usage of the scoreboard: |
| 81 | + |
| 82 | +* Declare the scoreboard |
| 83 | +* Link the source and sink subscribers to the publishers where you want to |
| 84 | + verify data |
| 85 | +* Optional: set the sink type; default is oneshot |
| 86 | +* Call the run function to start the verification |
| 87 | +* Wait until the scoreboard completes verification |
| 88 | +* Stop the scoreboard |
| 89 | + |
| 90 | +.. important:: |
| 91 | + |
| 92 | + * The scoreboard must be started before the data transmission begins, |
| 93 | + otherwise, data will be lost and the verification will fail! |
| 94 | + |
| 95 | +Other use-cases: |
| 96 | + |
| 97 | +* The scoreboard can be dynamically reconfigured to use other inputs. Stop the |
| 98 | + scoreboard, unsubscribe the subscribers from the publishers and subscribe them |
| 99 | + to the other publisher where you want to verify data. |
| 100 | + |
| 101 | +.. important:: |
| 102 | + |
| 103 | + * The datatype cannot be changed during runtime, only the publisher, to which |
| 104 | + they are subscribed to. |
| 105 | + |
| 106 | +.. include:: ../../../../common/support.rst |
0 commit comments