The UVM scorebaord is easily integrated into your existing testbench environment.
To get the UVM scoreboard compiled you need to add src/pk_syoscb.sv to your list of files that are compliled when compiling your testbench. How this is done is highly dependent on the verification environment since some environemnts compile everything into different libraries and some do not etc.
Once the UVM scoreboard is compiled with the veritication environment then it is accessible either by explicit scoping:
class myclass; pk_syoscb::cl_syoscb my_new_scb; ...
or by importing the complte package into your scope:
import pk_syoscb::*; class myclass; cl_syoscb my_new_scb; ...
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 config_db:
import pk_syoscb::*; class cl_scbtest_env extends uvm_env; cl_syoscb syoscb; cl_syoscb_cfg syoscb_cfg; `uvm_component_utils_begin(cl_scbtest_env) `uvm_field_object(syoscb, UVM_ALL_ON) `uvm_field_object(syoscb_cfg, UVM_ALL_ON) `uvm_component_utils_end ... endclass: cl_scbtest_env function void cl_scbtest_env::build_phase(uvm_phase phase); super.build_phase(phase); // Create the scoreboard configuration object this.syoscb_cfg = cl_syoscb_cfg::type_id::create("syoscb_cfg"); // Pass the scoreboard configuration object to the config_db uvm_config_db #(cl_syoscb_cfg)::set(this, "syoscb", "cfg", this.syoscb_cfg); // Create the scoreaboard this.syoscb = cl_syoscb::type_id::create("syoscb", this); ... endfunction: build_phase
The UVM scoreboard ocnfiguration object needs to be configured after it has been created. The following example shows how two queues Q1 and Q2 wit Q1 as the primary queue. Futhermore one producer P1 is added to both queues:
function void cl_scbtest_env::build_phase(uvm_phase phase); super.build_phase(phase); // Create the scoreboard configuration object this.syoscb_cfg = cl_syoscb_cfg::type_id::create("syoscb_cfg"); // Configure the scoreboard this.syoscb_cfg.set_queues({"Q1", "Q2"}); void'(this.syoscb_cfg.set_primary_queue("Q1")); void'(this.syoscb_cfg.set_producer("P1", {"Q1", "Q2"})); // Pass the scoreboard configuration object to the config_db uvm_config_db #(cl_syoscb_cfg)::set(this, "syoscb", "cfg", this.syoscb_cfg); // Create the scoreaboard this.syoscb = cl_syoscb::type_id::create("syoscb", this); ... endfunction: build_phase
Finally, the wanted queue and compare algorithm implementation needs to be selected. This is done by facotry overwrites since they can be changed test etc.
NOTE: This MUST be done before creating the scoreboard!
The following queue implemenations are available:
and the following compare alorithms are available:
The following example shows how they are configured:
cl_syoscb_queue::set_type_override_by_type(cl_syoscb_queue::get_type(),
cl_syoscb_queue_std::get_type(),
"*");
factory.set_type_override_by_type(cl_syoscb_compare_base::get_type(),
cl_syoscb_compare_ooo::get_type(),
"*");
The full build phase, including the factory overwrites, of cl_scbtest_env is shown here for completeness:
function void cl_scbtest_env::build_phase(uvm_phase phase); super.build_phase(phase); // USe the standard SV queue implementation as scoreboard queue cl_syoscb_queue::set_type_override_by_type(cl_syoscb_queue::get_type(), cl_syoscb_queue_std::get_type(), "*"); // Set the compare strategy to be OOO factory.set_type_override_by_type(cl_syoscb_compare_base::get_type(), cl_syoscb_compare_ooo::get_type(), "*"); // Create the scoreboard configuration object this.syoscb_cfg = cl_syoscb_cfg::type_id::create("syoscb_cfg"); // Configure the scoreboard this.syoscb_cfg.set_queues({"Q1", "Q2"}); void'(this.syoscb_cfg.set_primary_queue("Q1")); void'(this.syoscb_cfg.set_producer("P1", {"Q1", "Q2"})); // Pass the scoreboard configuration object to the config_db uvm_config_db #(cl_syoscb_cfg)::set(this, "syoscb", "cfg", this.syoscb_cfg); // Create the scoreaboard this.syoscb = cl_syoscb::type_id::create("syoscb", this); ... endfunction: build_phase
|
Project: SyoSil ApS UVM Scoreboard, Revision: 1.0.0.2 |
Copyright 2014 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.6.1 IDV SV Filter Version: 2.6.2 Wed Feb 25 04:01:41 2015 |