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

Subversion Repositories uart2bus_testbench

[/] [uart2bus_testbench/] [trunk/] [tb/] [uvm_src/] [seq/] [uvm_push_sequencer.svh] - Blame information for rev 16

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 16 HanySalah
//------------------------------------------------------------------------------
2
//   Copyright 2007-2011 Mentor Graphics Corporation
3
//   Copyright 2007-2011 Cadence Design Systems, Inc.
4
//   Copyright 2010 Synopsys, Inc.
5
//   All Rights Reserved Worldwide
6
//
7
//   Licensed under the Apache License, Version 2.0 (the
8
//   "License"); you may not use this file except in
9
//   compliance with the License.  You may obtain a copy of
10
//   the License at
11
//
12
//       http://www.apache.org/licenses/LICENSE-2.0
13
//
14
//   Unless required by applicable law or agreed to in
15
//   writing, software distributed under the License is
16
//   distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
17
//   CONDITIONS OF ANY KIND, either express or implied.  See
18
//   the License for the specific language governing
19
//   permissions and limitations under the License.
20
//------------------------------------------------------------------------------
21
 
22
 
23
//------------------------------------------------------------------------------
24
//
25
// CLASS: uvm_push_sequencer #(REQ,RSP)
26
//
27
//------------------------------------------------------------------------------
28
 
29
class uvm_push_sequencer #(type REQ=uvm_sequence_item, RSP=REQ)
30
                                   extends uvm_sequencer_param_base #(REQ, RSP);
31
 
32
  typedef uvm_push_sequencer #( REQ , RSP) this_type;
33
 
34
  // Port: req_port
35
  //
36
  // The push sequencer requires access to a blocking put interface.
37
  // A continuous stream of sequence items are sent out this port, based on
38
  // the list of available sequences loaded into this sequencer.
39
  //
40
  uvm_blocking_put_port #(REQ) req_port;
41
 
42
 
43
  // Function: new
44
  //
45
  // Standard component constructor that creates an instance of this class
46
  // using the given ~name~ and ~parent~, if any.
47
  //
48
  function new (string name, uvm_component parent=null);
49
    super.new(name, parent);
50
    req_port = new ("req_port", this);
51
  endfunction
52
 
53
 
54
  // Task: run_phase
55
  //
56
  // The push sequencer continuously selects from its list of available
57
  // sequences and sends the next item from the selected sequence out its
58
  //  using req_port.put(item). Typically, the req_port would be
59
  // connected to the req_export on an instance of a
60
  // , which would be responsible for
61
  // executing the item.
62
  //
63
  task run_phase(uvm_phase phase);
64
    REQ t;
65
    int selected_sequence;
66
 
67
    fork
68
      super.run_phase(phase);
69
      forever
70
        begin
71
          m_select_sequence();
72
          m_req_fifo.get(t);
73
          req_port.put(t);
74
          m_wait_for_item_sequence_id = t.get_sequence_id();
75
          m_wait_for_item_transaction_id = t.get_transaction_id();
76
        end
77
    join
78
  endtask
79
 
80
  protected virtual function int  m_find_number_driver_connections();
81
    return req_port.size();
82
  endfunction
83
 
84
endclass

powered by: WebSVN 2.1.0

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