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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [PCIe/] [sim/] [src/] [RIFFA/] [riffa_rp_rx_driver.svh] - Blame information for rev 50

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 50 qaztronic
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// Copyright (C) 2019 Authors and OPENCORES.ORG                 ////
4
////                                                              ////
5
//// This source file may be used and distributed without         ////
6
//// restriction provided that this copyright statement is not    ////
7
//// removed from the file and that any derivative work contains  ////
8
//// the original copyright notice and the associated disclaimer. ////
9
////                                                              ////
10
//// This source file is free software; you can redistribute it   ////
11
//// and/or modify it under the terms of the GNU Lesser General   ////
12
//// Public License as published by the Free Software Foundation; ////
13
//// either version 2.1 of the License, or (at your option) any   ////
14
//// later version.                                               ////
15
////                                                              ////
16
//// This source is distributed in the hope that it will be       ////
17
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
18
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
19
//// PURPOSE.  See the GNU Lesser General Public License for more ////
20
//// details.                                                     ////
21
////                                                              ////
22
//// You should have received a copy of the GNU Lesser General    ////
23
//// Public License along with this source; if not, download it   ////
24
//// from http://www.opencores.org/lgpl.shtml                     ////
25
////                                                              ////
26
//////////////////////////////////////////////////////////////////////
27
 
28
class riffa_rp_rx_driver #(N) extends uvm_driver #(riffa_sequence_item);
29
  `uvm_component_param_utils(riffa_rp_rx_driver #(N))
30
 
31
  // --------------------------------------------------------------------
32
  virtual riffa_chnl_if #(N) vif;
33
 
34
  //--------------------------------------------------------------------
35
  function void set_default;
36
    vif.cb_rp_rx.tx_ack <= 0;
37
    vif.cb_rp_rx.tx_data_ren <= 0;
38
  endfunction: set_default
39
 
40
  //--------------------------------------------------------------------
41
  virtual task run_phase(uvm_phase phase);
42
    riffa_sequence_item item;
43
    super.run_phase(phase);
44
 
45
    set_default();
46
 
47
    forever
48
    begin
49
      wait(~vif.tx_reset);
50
      seq_item_port.get_next_item(item);
51
 
52
      @(vif.cb_rp_rx iff vif.cb_rp_rx.tx);
53
 
54
      item.init( N
55
               , vif.cb_rp_rx.tx_len
56
               , vif.cb_rp_rx.tx_off
57
               , vif.cb_rp_rx.tx_last);
58
 
59
      vif.cb_rp_rx.tx_ack <= 1;
60
      vif.cb_rp_rx.tx_data_ren <= 1;
61
 
62
      fork
63
        @(vif.cb_rp_rx)
64
          vif.cb_rp_rx.tx_ack <= 0;
65
      join_none
66
 
67
      for(int i = 0; i < item.beats; i++)
68
      begin
69
        @(vif.cb_rp_rx iff vif.cb_rp_rx.tx_data_valid)
70
          {<
71
 
72
        // $display("^^^^^ %16.t | TX | %d | %h", $time, i, vif.cb_rp_rx.tx_data);
73
      end
74
 
75
      set_default();
76
      seq_item_port.item_done();
77
    end
78
  endtask : run_phase
79
 
80
  //--------------------------------------------------------------------
81
  function new(string name, uvm_component parent);
82
    super.new(name, parent);
83
  endfunction
84
 
85
// --------------------------------------------------------------------
86
endclass

powered by: WebSVN 2.1.0

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