SyoSil ApS UVM Scoreboard  1.0.3.0
cl_syoscb_compare.svh
1 /// Component which instantiates the chosen comparison algorithm.
2 /// Serves to wrap the compare algorithm in a UVM component, as well as triggering
3 /// additional comparisons at the end of the run phase if the greed level prescribes this.
4 class cl_syoscb_compare extends uvm_component;
5  //-------------------------------------
6  // Non randomizable variables
7  //-------------------------------------
8  /// Handle to the configuration
10 
11  /// Handle to the actual compare algorithm to be used
13 
14  //-------------------------------------
15  // UVM Macros
16  //-------------------------------------
17  `uvm_component_utils_begin(cl_syoscb_compare)
18  `uvm_field_object(cfg, UVM_DEFAULT | UVM_REFERENCE)
19  `uvm_field_object(compare_algo, UVM_DEFAULT)
20  `uvm_component_utils_end
21 
22  //-------------------------------------
23  // Constructor
24  //-------------------------------------
25  extern function new(string name, uvm_component parent);
26 
27  //-------------------------------------
28  // UVM Phase methods
29  //-------------------------------------
30  extern function void build_phase(uvm_phase phase);
31  extern function void extract_phase(uvm_phase phase);
32 
33  //-------------------------------------
34  // Compare API
35  //-------------------------------------
36  extern virtual function void compare_trigger(string queue_name = "", cl_syoscb_item item = null);
37  extern virtual function void compare_control(bit cc);
38 endclass : cl_syoscb_compare
39 
40 function cl_syoscb_compare::new(string name, uvm_component parent);
41  super.new(name, parent);
42 endfunction : new
43 
44 /// UVM build phase: Gets the scoreboard's configuration and creates the comparison algorithm
45 function void cl_syoscb_compare::build_phase(uvm_phase phase);
46  if (!uvm_config_db #(cl_syoscb_cfg)::get(this, "", "cfg", this.cfg)) begin
47  `uvm_fatal("CFG_ERROR", $sformatf("[%s]: Configuration object not passed.", this.cfg.get_scb_name()))
48  end
49 
50  this.compare_algo = cl_syoscb_compare_base::type_id::create("compare_algo", this);
51  this.compare_algo.set_cfg(this.cfg);
52 endfunction: build_phase
53 
54 /// UVM extract phase: Check if cl_syoscb_cfg#end_greediness is greedy. If yes, we want to drain all
55 /// the remaining matches from the scb before moving to check_phase
56 function void cl_syoscb_compare::extract_phase(uvm_phase phase);
57  if(this.cfg.get_end_greediness() == pk_syoscb::SYOSCB_COMPARE_GREEDY) begin
58  this.compare_algo.compare_main(this.cfg.get_end_greediness());
59  end
60 endfunction: extract_phase
61 
62 /// <b>Compare API</b>: Starts a comparison by invoking the chosen compare strategy if comparisons are not disabled
63 /// \param queue_name Name of the queue which had an item inserted into it
64 /// \param item The scoreboard wrapper item that was inserted into the SCB
65 function void cl_syoscb_compare::compare_trigger(string queue_name = "", cl_syoscb_item item = null);
66  this.compare_algo.compare_trigger(queue_name, item);
67 endfunction : compare_trigger
68 
69 /// <b>Compare API</b>: Toggle comparisons on or off
70 /// \param cc compare control bit. If 1, comparisons are enabled, if 0, comparisons are disabled
71 function void cl_syoscb_compare::compare_control(bit cc);
73 endfunction: compare_control
virtual void compare_trigger(string queue_name="", cl_syoscb_item item=null)
Compare API: Starts a comparison by invoking the chosen compare strategy if comparisons are not disab...
void extract_phase(uvm_phase phase)
UVM extract phase: Check if cl_syoscb_cfg::end_greediness is greedy.
cl_syoscb_cfg cfg
Handle to the configuration.
Base class for all compare algorithms.
cl_syoscb_compare_base compare_algo
Handle to the actual compare algorithm to be used.
virtual void compare_control(bit cc)
Compare API: Toggle comparisons on or off
void build_phase(uvm_phase phase)
UVM build phase: Gets the scoreboard&#39;s configuration and creates the comparison algorithm.
Component which instantiates the chosen comparison algorithm.
Configuration class for the SyoSil UVM scoreboard.

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