00001 class cl_syoscb extends uvm_scoreboard; 00002 00003 cl_syoscb_cfg cfg; 00004 cl_syoscb_queue queues[]; 00005 cl_syoscb_compare compare_strategy; 00006 00007 `uvm_component_utils_begin(cl_syoscb) 00008 `uvm_field_object(cfg, UVM_ALL_ON) 00009 `uvm_field_array_object(queues, UVM_ALL_ON) 00010 `uvm_field_object(compare_strategy, UVM_ALL_ON) 00011 `uvm_component_utils_end 00012 00013 extern function new(string name, uvm_component parent); 00014 extern function void build_phase(uvm_phase phase); 00015 extern function void check_phase(uvm_phase phase); 00016 extern function void report_phase(uvm_phase phase); 00017 extern function bit compare(); 00018 extern function void add_item(string queue_name, string producer, uvm_sequence_item item); 00019 endclass: cl_syoscb 00020 00021 function cl_syoscb::new(string name, uvm_component parent); 00022 super.new(name, parent); 00023 endfunction : new 00024 00025 function void cl_syoscb::build_phase(uvm_phase phase); 00026 // TBD: This contradicts the paper. It states that a default one is created 00027 // TBD push config further down? 00028 if (!uvm_config_db #(cl_syoscb_cfg)::get(this, "", "cfg", this.cfg)) 00029 `uvm_fatal("CFG", "Configuration object not passed.") 00030 // TBD: This is snooping directly in the CFG - use get/set functions instead? 00031 this.queues = new[this.cfg.queues.size()]; 00032 begin 00033 int unsigned idx = 0; 00034 foreach(this.cfg.queues[queue_name]) begin 00035 this.queues[idx] = cl_syoscb_queue::type_id::create({"queue", $psprintf("%0d",idx)}, this); 00036 this.cfg.queues[queue_name] = this.queues[idx++]; 00037 end 00038 end 00039 this.compare_strategy = new(.name("compare_strategy"), .parent(this)); 00040 00041 // TBD: This should either be passed as args to constructor 00042 // or the objects should query the CFG DB directly if possible 00043 // The parent path is not available anymore after we changed to uvm_object 00044 this.compare_strategy.compare_algo.set_cfg(this.cfg); 00045 00046 begin 00047 cl_syoscb_report_catcher catcher = new(); 00048 uvm_report_cb::add(null, catcher); 00049 end 00050 endfunction : build_phase 00051 00052 function bit cl_syoscb::compare(); 00053 return(this.compare_strategy.compare()); 00054 endfunction: compare 00055 00056 /////////////////////////////////////// 00057 // Function based API 00058 /////////////////////////////////////// 00059 function void cl_syoscb::add_item(string queue_name, string producer, uvm_sequence_item item); 00060 // TBD: Add checks of correct queue and producer 00061 if(!this.cfg.queues[queue_name].add_item(producer, item)) begin 00062 `uvm_fatal("QUEUE_ERROR", $sformatf("Unable to add item to queue: %s", queue_name)); 00063 end 00064 00065 // TBD: This should be revised according to how it was in the old SCB 00066 // TBD: Return value from compare() should also be handled 00067 void'(this.compare()); 00068 endfunction : add_item 00069 00070 /////////////////////////////////////// 00071 // Transaction based API 00072 /////////////////////////////////////// 00073 // TBD 00074 00075 function void cl_syoscb::check_phase(uvm_phase phase); 00076 string queue_names[]; 00077 cl_syoscb_queue_std queue; 00078 super.check_phase(phase); 00079 00080 this.cfg.get_queues(queue_names); 00081 foreach (queue_names[i]) begin 00082 $cast(queue, this.cfg.queues[queue_names[i]]); 00083 if (queue.items.size()!=0) begin 00084 string firstitem = queue.items[0].sprint(); 00085 `uvm_error("SYOSCB", $psprintf("Queue %s not empty, entries : %d, first element : \n%s", queue_names[i], queue.items.size(), firstitem)); 00086 // TBD dump first parts of each queue ! 00087 // will we use std UVM report mechanisms or a special channel we can redirect ? 00088 end 00089 end 00090 endfunction : check_phase 00091 00092 function void cl_syoscb::report_phase(uvm_phase phase); 00093 super.report_phase(phase); 00094 // TBD this should NOT call the report phase of the compare method ! 00095 // as cl_syoscb_compare_base extends uvm_component the compare method should just perform its end of test checks in 00096 // uvm_check_phase, from the UVM 1.1 class ref manual: 00097 // uvm_build_phase Create and configure of testbench structure 00098 // uvm_connect_phase Establish cross-component connections. 00099 // uvm_end_of_elaboration_phase Fine-tune the testbench. 00100 // uvm_start_of_simulation_phase Get ready for DUT to be simulated. 00101 // uvm_run_phase Stimulate the DUT. 00102 // uvm_extract_phase Extract data from different points of the verficiation environment. 00103 // uvm_check_phase Check for any unexpected conditions in the verification environment. 00104 // uvm_report_phase Report results of the test. 00105 // uvm_final_phase Tie up loose ends. 00106 endfunction : report_phase
|
Project: SyoSil ApS UVM Scoreboard, Revision: 1.0.0.0 |
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 Thu Oct 30 05:34:49 2014 |