00001 /// Generic subscriber for the scoreboard. It provides the write method 00002 /// for UVM monitors and utilizes the function based API of the scb to insert 00003 /// the items received through the write method. 00004 class cl_syoscb_subscriber extends uvm_subscriber#(uvm_sequence_item); 00005 //------------------------------------- 00006 // Non randomizable variables 00007 //------------------------------------- 00008 local string queue_name; 00009 local string producer; 00010 00011 //------------------------------------- 00012 // UVM Macros 00013 //------------------------------------- 00014 `uvm_component_utils(cl_syoscb_subscriber) 00015 00016 //------------------------------------- 00017 // Constructor 00018 //------------------------------------- 00019 extern function new(string name = "cl_syoscb_subscriber", uvm_component parent = null); 00020 00021 //------------------------------------- 00022 // UVM overwrites/extensions 00023 //------------------------------------- 00024 extern function void write(uvm_sequence_item t); 00025 00026 //------------------------------------- 00027 // Subscriber API 00028 //------------------------------------- 00029 extern function string get_queue_name(); 00030 extern function void set_queue_name(string qn); 00031 extern function string get_producer(); 00032 extern function void set_producer(string p); 00033 endclass: cl_syoscb_subscriber 00034 00035 function cl_syoscb_subscriber::new(string name = "cl_syoscb_subscriber", uvm_component parent = null); 00036 super.new(name, parent); 00037 endfunction: new 00038 00039 /// The write method which must be implemented when extening uvm_subscriber. 00040 function void cl_syoscb_subscriber::write(uvm_sequence_item t); 00041 cl_syoscb parent; 00042 00043 // Get the parent which is the SCB top 00044 // This is needed for access to the function based API 00045 begin 00046 uvm_component tmp_parent; 00047 00048 tmp_parent = this.get_parent(); 00049 00050 if(!$cast(parent, tmp_parent)) begin 00051 `uvm_fatal("IMPL_ERROR", "Unable to cast parent of subscriber"); 00052 end 00053 end 00054 00055 // Add the 00056 parent.add_item(this.queue_name, this.producer, t); 00057 endfunction 00058 00059 /// <b>Subscriber API</b>: Returns the name of the queue which this subscriber is connected to. 00060 function string cl_syoscb_subscriber::get_queue_name(); 00061 return(this.queue_name); 00062 endfunction: get_queue_name 00063 00064 /// <b>Subscriber API</b>: Sets the name of the queue which this subscriber is connected to. 00065 function void cl_syoscb_subscriber::set_queue_name(string qn); 00066 this.queue_name = qn; 00067 endfunction: set_queue_name 00068 00069 /// <b>Subscriber API</b>: Returns the name of the produer which this subscriber is connected to. 00070 function string cl_syoscb_subscriber::get_producer(); 00071 return(this.producer); 00072 endfunction: get_producer 00073 00074 /// <b>Subscriber API</b>: Sets the name of the producer which this subscriber is connected to. 00075 function void cl_syoscb_subscriber::set_producer(string p); 00076 this.producer = p; 00077 endfunction: set_producer
|
Project: SyoSil ApS UVM Scoreboard, Revision: 1.0.2.1 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 Version: 1.6.1 IDV SV Filter Version: 2.6.2 Thu Jun 4 23:02:22 2015 |