SyoSil ApS UVM Scoreboard
1.0.3.0
|
The UVM scoreboard is easily integrated into your existing testbench environment. The following steps should be followed to start using the UVM scoreboard:
To get the UVM scoreboard compiled you need to add src/pk_syoscb.sv to your list of files that are complied when compiling your testbench. How this is done is highly dependent on the verification environment since some environments compile everything into different libraries and some do not. Refer to your vendor's manual for further information on how to include packages.
Once the UVM scoreboard is compiled with the verification environment, it is accessible either by explicit scoping:
or by importing the complete package into your scope:
Before instantiating the scoreboard, the desired queue type and compare algorithm need to be set in the scoreboard's configuration object. This is done by factory overrides since the queue type and compare algorithm can be changed on a per-test basis.
NOTE: This MUST be done before creating the scoreboard!
The queue type and compare algorithm should not be overwritten with a call to the UVM configuration databse. Instead, the scoreboard configuration object should be used.
The factory overrides are done in the build phase of the cl_syoscb, depending on the value of the cl_syoscb_cfg.queue_type and cl_syoscb_cfg.compare_type configuration knobs. If no overwriting is performed, the test will fail, as the default queue and comparison types are set to USER_DEFINED
, a placeholder value for user-defined queue types and comparison types.
The scoreboard comes with a number of built-in queue types and comparison algorithms (see Queue implementation notes and Compare implementation notes). The following queue implementations are available:
and the following compare algorithms are available:
Setting the queue topology is done with the method set_queue_type
in cl_syoscb_cfg. For example, the following line shows how to select the MD5 queue topology for a scoreboard.
The following line shows an example of how to change the compare strategy. Here, OOO comparisons are enabled.
All of the enum values used for selecting queue type and compare algorithm can be found in src/syoscb_common.svh.
The UVM scoreboard itself needs to be instantiated along with the configuration object. The simplest way to to this is to add the UVM scoreboard and the configuration object to the UVM environment – note that the configuration object is passed to the scoreboard via the uvm_config_db
.
A default configuration is not created, so a configuration object must be constructed, configured and set in the UVM configuration database for each scoreboard instance to pick it up. One must create a separate scoreboard configuration object for each scoreboard instance. It cannot be reused! The following example shows a scoreboard with two queues, Q1 and Q2, with Q1 as the primary queue. Furthermore, one producer P1 is added to both queues:
For more info about the configuration options, see pConfiguration.
The full build phase of our example environment cl_scbtest_env
is shown here for completeness:
The function based API is very easy to use once you have done the configuration and instantiation of the scoreboard as described above.
Whenever you need to add a UVM sequence item to a queue produced by a specified producer, simply invoke the cl_syoscb::add_item() method:
Invoking the cl_syoscb::add_item() method will wrap the UVM sequence item in a cl_syoscb_item object, add it to the correct queue and finally invoke the configured compare algorithm.
The UVM environment will typically contain a handle to the scoreboard as described above. This can then be utilized if UVM sequence item needs to be added from a test case:
The TLM API is even easier to use than the function based API. The scoreboard provides a generic UVM subscribers for each producer on each queue. This subscriber can cbe onnected to anything which has a UVM analysis port (e.g. a UVM monitor). Typically, the UVM agents inside the UVM environment contain one or more monitors with UVM analysis ports which should be connected to the scoreboard. The following example shows two agents, each of which has a monitor. The monitors are connected to Q1 and Q2 in the scoreboard, acting as producer P1:
The SyoSil UVM scoreboard also comes with a scoreboard wrapper, cl_syoscbs_base, which can be used to instantiate several scoreboards with similar configurations.
A configuration wrapper, cl_syoscbs_cfg, is used to configure the scoreboard wrapper. The configuration wrapper contains N configuration objects, one for each wrapped scoreboard. The wrapped scoreboards may have different queue / producer names and numbers of queues/producers, or they may be the same. See the figure below for a UML diagram of the relationship between individual scoreboards and their configurations, and the scoreboard wrapper and its configuration object.
Since UVM analysis ports are parameterized with the types of items they will accept, and the SyoSil scoreboard's cl_syoscb_subscriber expects input items to be of type uvm_sequence_item
, a transformation must be used to upcast sequence items to this datatype before they are inserted. When using a single scoreboard, this transformation can easily be instantiated manually, or items can be upcast in a monitor before being written to the attached subscriber.
In the case where 100's or 1000's of scoreboards are used, manually instantiating and connecting all of these transforms can become tedious. Instead, the scoreboard wrapper offers filter transforms to automate the process. When creating the scoreboard wrapper cl_syoscbs, it must be parameterized with the type of sequence items that will be input. It then automatically instantiates a transformation object for each subscriber, and connects its output to the input of the subscriber. Now, instead of retrieving the subscribers for each queue/producer, a filter transform for each scoreboard's queue/producer combination should be retrieved.
The default filter transform pk_utils_uvm::filter_trfm, included in lib/pk_utils_uvm.sv, simply upcasts its input to a uvm_sequence_item
before passing it on to the scoreboard. If more complex transforms are required, you can extend cl_syoscbs_base and implement cl_syoscb_base::create_filter to suit your needs.
The class cl_syoscbs_base serves as the base class for the scoreboard wrapper, and a default implementation is included in cl_syoscbs. The default implementation should be enough for most applications
In the example below, a scoreboard wrapper with 10 scoreboards is created. Each scoreboard has two queues, DUT and REF, each of which has two producers, P1 and P2. In the environment's build phase, the scoreboard wrapper and config object are created. After initializing the configuration object, it is passed to the scoreboard wrapper with the UVM configuration database. In the environment's connect phase, each DUT agent is connected to filter transforms associated with their respective scoreboard. The parameter FIN
is the input type to the filter transforms. The filter transforms convert this type to a uvm_sequence_item
which is passed into the scoreboard.
The included testcases also include several tests using the scoreboard wrapper, which can be used as a starting point. See cl_scbs_test_base and cl_tb_env_scbs. See tb/test/scbs/cl_scbs_test_base and tb/cl_tb_env_scbs.
![]() |
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:40:35 |