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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [PCIe/] [src/] [RIFFA/] [riffa_axis_test_pattern.sv] - Blame information for rev 39

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 34 qaztronic
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// Copyright (C) 2017 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
 
29
module
30
  riffa_axis_test_pattern
31
  #(
32
    N, // RIFFA data bus width in bytes
33
    W = 4, // word width in bytes
34
    WPB = N / W // number of words per beat
35
  )
36
  (
37 39 qaztronic
    riffa_chnl_if chnl_bus,
38 34 qaztronic
    input [31:0] tx_len,
39
    input clk,
40
    input reset
41
  );
42
 
43
  // --------------------------------------------------------------------
44
  //
45
  localparam I = 0; // TID width
46
  localparam D = 0; // TDEST width
47
  localparam U = 3; // TUSER width
48
  localparam RW = (N/4); // width of the RIFFA bus in 32 bit words
49
 
50
 
51
  // --------------------------------------------------------------------
52
  //
53
  wire aclk = clk;
54
  wire aresetn = ~reset;
55
 
56
 
57
  // --------------------------------------------------------------------
58
  //
59
  axis_if #(.N(N), .I(I), .D(D), .U(U)) axis_out(.*);
60
 
61 37 qaztronic
  axis_test_patern #(.N(N), .W(W), .WPB(WPB))
62 34 qaztronic
    axis_test_patern_i(.*);
63
 
64
 
65
  // --------------------------------------------------------------------
66
  //
67
  wire tx_ready = 1;
68
  wire tx_last = 1;
69
  wire acked;
70
  wire [30:0] tx_off = 0;
71
  wire [30:0] tx_index;
72
  wire tx_done = (tx_index >= tx_len - RW);
73
 
74
  riffa_chn_tx #(.N(N))
75
    riffa_chn_tx_i(.*);
76
 
77
 
78
  // --------------------------------------------------------------------
79
  //
80 39 qaztronic
  assign axis_out.tready = chnl_bus.tx_data_ren & acked;
81 34 qaztronic
 
82
 
83
  // --------------------------------------------------------------------
84
  //
85 39 qaztronic
  assign chnl_bus.rx_clk = clk;
86
  assign chnl_bus.tx_clk = clk;
87
  assign chnl_bus.rx_reset = reset;
88
  assign chnl_bus.tx_reset = reset;
89
  assign chnl_bus.tx_last = tx_last;
90
  assign chnl_bus.tx_len = tx_len;
91
  assign chnl_bus.tx_off = tx_off;
92
  assign chnl_bus.tx_data_valid = axis_out.tvalid & acked;
93
  assign chnl_bus.tx_data = axis_out.tdata;
94 34 qaztronic
 
95
// --------------------------------------------------------------------
96
//
97
endmodule
98
 
99
 
100
 
101
 

powered by: WebSVN 2.1.0

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