cl_syoscb_item.svh

00001 /// The UVM scoreboard item. This item wraps the uvm_sequence_items. This ensures that future
00002 /// extensions to the UVM scoreboard will always be able to use all uvm_sqeuence_items from
00003 /// already existing testbenches etc. even though more META data is added to the wrapping item.
00004 class cl_syoscb_item extends uvm_object;
00005   //-------------------------------------
00006   // Non randomizable variables
00007   //-------------------------------------
00008   /// Hold the name of the producer
00009   string producer;
00010 
00011   /// Handle to the wrapped uvm_sequence_item
00012   uvm_sequence_item item;
00013 
00014   //-------------------------------------
00015   // UVM Macros
00016   //-------------------------------------
00017   `uvm_object_utils_begin(cl_syoscb_item)
00018 `ifdef SYOSIL_APPLY_TLM_GP_CMP_WORKAROUND
00019     // Use NOCOMPARE when do_compare is implemented. Otherwise the compare is done twice since
00020     // the super of uvm field automation is called before do_compare. This will invoke the compare
00021     // since the functions are virtual
00022     `uvm_field_string(producer, UVM_DEFAULT | UVM_NOCOMPARE)
00023     `uvm_field_object(item,     UVM_DEFAULT | UVM_NOCOMPARE)
00024 `else
00025     `uvm_field_string(producer, UVM_DEFAULT)
00026     `uvm_field_object(item,     UVM_DEFAULT)
00027 `endif
00028   `uvm_object_utils_end
00029 
00030   //-------------------------------------
00031   // Constructor
00032   //-------------------------------------
00033   extern function new(string name = "cl_syoscb_item");
00034 
00035   //-------------------------------------
00036   // Item API
00037   //-------------------------------------
00038   extern function string get_producer();
00039   extern function void set_producer(string producer);
00040   extern function uvm_sequence_item get_item();
00041   extern function void set_item(uvm_sequence_item item);
00042 
00043 `ifdef SYOSIL_APPLY_TLM_GP_CMP_WORKAROUND
00044   //-------------------------------------
00045   // UVM TLM2 Generic Payload compare
00046   // workaround
00047   //-------------------------------------
00048   function bit do_compare(uvm_object rhs, uvm_comparer comparer);
00049     bit status = 1'b1;
00050     cl_syoscb_item that;
00051    
00052     // Code it properly using the comparer policy
00053     if(!$cast(that, rhs)) begin
00054       status = 1'b0;
00055     end else begin
00056       // "producer" compare using the comparer object
00057       status &= comparer.compare_string("producer", this.producer, that.producer);
00058 
00059       // Apply WORKAROUND:
00060       //   Ensure that the comparer object is properly updated at this level
00061       //   and propagate the compare result bit correctly
00062       status &= comparer.compare_object("item", this.item, that.item);
00063     end
00064     return(status);
00065   endfunction: do_compare
00066 `endif
00067 endclass: cl_syoscb_item
00068 
00069 function cl_syoscb_item::new(string name = "cl_syoscb_item");
00070   super.new(name);
00071 endfunction : new     
00072 
00073 /// <b>Item API:</b> Returns the producer
00074 function string cl_syoscb_item::get_producer();
00075   return(this.producer);
00076 endfunction: get_producer
00077 
00078 /// <b>Item API:</b> Sets the producer
00079 function void cl_syoscb_item::set_producer(string producer);
00080   // The producer has been checked by the parent prior
00081   // to the insertion
00082   this.producer = producer;
00083 endfunction: set_producer
00084 
00085 /// <b>Item API:</b> Returns the wrapped uvm_sequence_item
00086 function uvm_sequence_item cl_syoscb_item::get_item();
00087   return(this.item);
00088 endfunction: get_item
00089 
00090 /// <b>Item API:</b> Sets the to be wrapped uvm_sequence_item
00091 function void cl_syoscb_item::set_item(uvm_sequence_item item);
00092   this.item = item;
00093 endfunction: set_item
 All Classes Functions Variables

Project: SyoSil ApS UVM Scoreboard, Revision: 1.0.2.3

Copyright 2014-2015 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.6.1
IDV SV Filter Version: 2.6.2
Mon Sep 28 02:57:58 2015
Find a documentation bug? Report bugs to: bugs.intelligentdv.com Project: DoxygenFilterSV