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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [axi4_stream_lib/] [src/] [axis_if.sv] - Blame information for rev 45

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 23 qaztronic
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// Copyright (C) 2015 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
interface
30
  axis_if
31 45 qaztronic
  #(  N     // data bus width in bytes
32
  ,   I = 1 // TID width
33
  ,   D = 1 // TDEST width
34
  ,   U = 1 // TUSER width
35 23 qaztronic
  )
36 45 qaztronic
  ( input aclk
37
  , input aresetn
38 23 qaztronic
  );
39 31 qaztronic
  wire              tvalid;
40
  wire              tready;
41
  wire  [(8*N)-1:0] tdata;
42
  wire  [N-1:0]     tstrb;
43
  wire  [N-1:0]     tkeep;
44
  wire              tlast;
45
  wire  [I-1:0]     tid;
46
  wire  [D-1:0]     tdest;
47
  wire  [U-1:0]     tuser;
48 23 qaztronic
 
49 31 qaztronic
// --------------------------------------------------------------------
50
// synthesis translate_off
51 45 qaztronic
  default clocking cb_m @(posedge aclk);
52
    input   aresetn;
53 31 qaztronic
    output  tvalid;
54
    input   tready;
55
    output  tdata;
56
    output  tstrb;
57
    output  tkeep;
58
    output  tlast;
59
    output  tid;
60
    output  tdest;
61
    output  tuser;
62
  endclocking
63 23 qaztronic
 
64 31 qaztronic
  // --------------------------------------------------------------------
65 45 qaztronic
  clocking cb_s @(posedge aclk);
66
    input   aresetn;
67 31 qaztronic
    input   tvalid;
68
    output  tready;
69
    input   tdata;
70
    input   tstrb;
71
    input   tkeep;
72
    input   tlast;
73
    input   tid;
74
    input   tdest;
75
    input   tuser;
76
  endclocking
77
// synthesis translate_on
78
// --------------------------------------------------------------------
79 23 qaztronic
 
80 31 qaztronic
  // --------------------------------------------------------------------
81
  //
82
`ifdef USE_MOD_PORTS
83 23 qaztronic
    modport
84
      master
85
      (
86 31 qaztronic
// --------------------------------------------------------------------
87
// synthesis translate_off
88
          clocking  cb_m,
89
// synthesis translate_on
90
// --------------------------------------------------------------------
91 23 qaztronic
        input     aresetn,
92
        input     aclk,
93
        output    tvalid,
94
        input     tready,
95
        output    tdata,
96
        output    tstrb,
97
        output    tkeep,
98
        output    tlast,
99
        output    tid,
100
        output    tdest,
101 31 qaztronic
        output    tuser
102 23 qaztronic
      );
103
 
104
    // --------------------------------------------------------------------
105
    modport
106
      slave
107
      (
108 31 qaztronic
// --------------------------------------------------------------------
109
// synthesis translate_off
110
          clocking  cb_s,
111
// synthesis translate_on
112
// --------------------------------------------------------------------
113 23 qaztronic
        input     aresetn,
114
        input     aclk,
115
        input     tvalid,
116
        output    tready,
117
        input     tdata,
118
        input     tstrb,
119
        input     tkeep,
120
        input     tlast,
121
        input     tid,
122
        input     tdest,
123 31 qaztronic
        input     tuser
124 23 qaztronic
      );
125 31 qaztronic
`endif
126 23 qaztronic
 
127 31 qaztronic
// --------------------------------------------------------------------
128
// synthesis translate_off
129 45 qaztronic
  task zero_cycle_delay;
130 31 qaztronic
    ##0;
131
  endtask: zero_cycle_delay
132
// synthesis translate_on
133
// --------------------------------------------------------------------
134
 
135
// --------------------------------------------------------------------
136 23 qaztronic
endinterface: axis_if

powered by: WebSVN 2.1.0

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