OpenCores
URL https://opencores.org/ocsvn/uart2bus_testbench/uart2bus_testbench/trunk

Subversion Repositories uart2bus_testbench

[/] [uart2bus_testbench/] [trunk/] [tb/] [uvm_src/] [comps/] [uvm_subscriber.svh] - Blame information for rev 16

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 16 HanySalah
//
2
//------------------------------------------------------------------------------
3
//   Copyright 2007-2011 Mentor Graphics Corporation
4
//   Copyright 2007-2010 Cadence Design Systems, Inc.
5
//   Copyright 2010 Synopsys, Inc.
6
//   All Rights Reserved Worldwide
7
//
8
//   Licensed under the Apache License, Version 2.0 (the
9
//   "License"); you may not use this file except in
10
//   compliance with the License.  You may obtain a copy of
11
//   the License at
12
//
13
//       http://www.apache.org/licenses/LICENSE-2.0
14
//
15
//   Unless required by applicable law or agreed to in
16
//   writing, software distributed under the License is
17
//   distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
18
//   CONDITIONS OF ANY KIND, either express or implied.  See
19
//   the License for the specific language governing
20
//   permissions and limitations under the License.
21
//------------------------------------------------------------------------------
22
 
23
//------------------------------------------------------------------------------
24
//
25
// CLASS: uvm_subscriber
26
//
27
// This class provides an analysis export for receiving transactions from a
28
// connected analysis export. Making such a connection "subscribes" this
29
// component to any transactions emitted by the connected analysis port.
30
//
31
// Subtypes of this class must define the write method to process the incoming
32
// transactions. This class is particularly useful when designing a coverage
33
// collector that attaches to a monitor.
34
//------------------------------------------------------------------------------
35
 
36
virtual class uvm_subscriber #(type T=int) extends uvm_component;
37
 
38
  typedef uvm_subscriber #(T) this_type;
39
 
40
  // Port: analysis_export
41
  //
42
  // This export provides access to the write method, which derived subscribers
43
  // must implement.
44
 
45
  uvm_analysis_imp #(T, this_type) analysis_export;
46
 
47
  // Function: new
48
  //
49
  // Creates and initializes an instance of this class using the normal
50
  // constructor arguments for : ~name~ is the name of the
51
  // instance, and ~parent~ is the handle to the hierarchical parent, if any.
52
 
53
  function new (string name, uvm_component parent);
54
    super.new(name, parent);
55
    analysis_export = new("analysis_imp", this);
56
  endfunction
57
 
58
  // Function: write
59
  //
60
  // A pure virtual method that must be defined in each subclass. Access
61
  // to this method by outside components should be done via the
62
  // analysis_export.
63
 
64
  pure virtual function void write(T t);
65
 
66
endclass
67
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.