00001 class cl_syoscb_queue_iterator_std extends cl_syoscb_queue_iterator_base; 00002 00003 `uvm_object_utils(cl_syoscb_queue_iterator_std) 00004 00005 extern virtual function bit next(); 00006 extern virtual function bit previous(); 00007 extern virtual function bit first(); 00008 extern virtual function bit last(); 00009 extern virtual function int unsigned get_idx(); 00010 extern virtual function uvm_sequence_item get_item(); 00011 extern virtual function bit is_done(); 00012 extern virtual function bit set_queue(cl_syoscb_queue owner); 00013 00014 endclass : cl_syoscb_queue_iterator_std 00015 00016 00017 function bit cl_syoscb_queue_iterator_std::next(); 00018 cl_syoscb_queue qh = this.get_queue(); 00019 00020 if(this.position < qh.get_size()) begin 00021 this.position++; 00022 return 1; 00023 end else begin 00024 // Debug print when unable to advance to the next element (When at the end of the queue) 00025 `uvm_info("OUT_OF_BOUNDS", $sformatf("Not possible to increment position of queue %s: at end of queue", 00026 qh.get_name()), UVM_DEBUG); 00027 return 0; 00028 end 00029 endfunction : next 00030 00031 00032 function bit cl_syoscb_queue_iterator_std::previous(); 00033 if(this.position != 0) begin 00034 this.position--; 00035 return 1; 00036 end else begin 00037 cl_syoscb_queue qh = this.get_queue(); 00038 00039 // Debug print when unable to advance to the previous element (When at the beginning of the queue) 00040 `uvm_info("OUT_OF_BOUNDS", $sformatf("Not possible to decrement position of queue %s: at end of queue", 00041 qh.get_name()), UVM_DEBUG); 00042 return 0; 00043 end 00044 endfunction : previous 00045 00046 00047 function bit cl_syoscb_queue_iterator_std::first(); 00048 // Std queue uses an SV queue for its items, first item is always 0 00049 this.position = 0; 00050 return 1; 00051 endfunction : first 00052 00053 00054 function bit cl_syoscb_queue_iterator_std::last(); 00055 cl_syoscb_queue qh = this.get_queue(); 00056 00057 this.position = qh.get_size()-1; 00058 return 1; 00059 endfunction : last 00060 00061 00062 function int unsigned cl_syoscb_queue_iterator_std::get_idx(); 00063 return this.position; 00064 endfunction : get_idx 00065 00066 00067 function uvm_sequence_item cl_syoscb_queue_iterator_std::get_item(); 00068 cl_syoscb_queue qh = this.get_queue(); 00069 00070 return qh.get_item(this.position); 00071 endfunction : get_item 00072 00073 00074 function bit cl_syoscb_queue_iterator_std::is_done(); 00075 cl_syoscb_queue qh = this.get_queue(); 00076 00077 if(this.position == qh.get_size()) begin 00078 return 1; 00079 end else begin 00080 return 0; 00081 end 00082 endfunction : is_done 00083 00084 function bit cl_syoscb_queue_iterator_std::set_queue(cl_syoscb_queue owner); 00085 if(owner == null) begin 00086 // An iterator should always have an associated queue 00087 `uvm_error("QUEUE_ERROR", $sformatf("Unable to associate queue with iterator ")); 00088 return 0; 00089 end else begin 00090 this.owner = owner; 00091 return 1; 00092 end 00093 endfunction : set_queue
|
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:40 2015 |