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

Subversion Repositories pcie_ds_dma

[/] [pcie_ds_dma/] [trunk/] [core/] [ds_dma64/] [pcie_src/] [pcie_core64_m1/] [source_virtex6/] [axi_basic_rx.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dsmv
-------------------------------------------------------------------------------
2
--
3
-- (c) Copyright 2009-2011 Xilinx, Inc. All rights reserved.
4
--
5
-- This file contains confidential and proprietary information
6
-- of Xilinx, Inc. and is protected under U.S. and
7
-- international copyright and other intellectual property
8
-- laws.
9
--
10
-- DISCLAIMER
11
-- This disclaimer is not a license and does not grant any
12
-- rights to the materials distributed herewith. Except as
13
-- otherwise provided in a valid license issued to you by
14
-- Xilinx, and to the maximum extent permitted by applicable
15
-- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
16
-- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
17
-- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
18
-- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
19
-- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
20
-- (2) Xilinx shall not be liable (whether in contract or tort,
21
-- including negligence, or under any other theory of
22
-- liability) for any loss or damage of any kind or nature
23
-- related to, arising under or in connection with these
24
-- materials, including for any direct, or any indirect,
25
-- special, incidental, or consequential loss or damage
26
-- (including loss of data, profits, goodwill, or any type of
27
-- loss or damage suffered as a result of any action brought
28
-- by a third party) even if such damage or loss was
29
-- reasonably foreseeable or Xilinx had been advised of the
30
-- possibility of the same.
31
--
32
-- CRITICAL APPLICATIONS
33
-- Xilinx products are not designed or intended to be fail-
34
-- safe, or for use in any application requiring fail-safe
35
-- performance, such as life-support or safety devices or
36
-- systems, Class III medical devices, nuclear facilities,
37
-- applications related to the deployment of airbags, or any
38
-- other applications that could lead to death, personal
39
-- injury, or severe property or environmental damage
40
-- (individually and collectively, "Critical
41
-- Applications"). Customer assumes the sole risk and
42
-- liability of any use of Xilinx products in Critical
43
-- Applications, subject only to applicable laws and
44
-- regulations governing limitations on product liability.
45
--
46
-- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
47
-- PART OF THIS FILE AT ALL TIMES.
48
--
49
-------------------------------------------------------------------------------
50
-- Project    : Virtex-6 Integrated Block for PCI Express
51
-- File       : axi_basic_rx.vhd
52
-- Version    : 2.3
53
-- Description:
54
--  TRN to AXI RX module. Instantiates pipeline and null generator RX
55
--  submodules.
56
--
57
--  Notes:
58
--  Optional notes section.
59
--
60
--  Hierarchical:
61
--    axi_basic_top
62
--      axi_basic_rx
63
--------------------------------------------------------------------------------
64
-- Library Declarations
65
--------------------------------------------------------------------------------
66
 
67
LIBRARY ieee;
68
   USE ieee.std_logic_1164.all;
69
   USE ieee.std_logic_unsigned.all;
70
 
71
 
72
ENTITY axi_basic_rx IS
73
   GENERIC (
74
      C_DATA_WIDTH      : INTEGER := 128;           -- RX/TX interface data width
75
      C_FAMILY          : STRING  := "X7";          -- Targeted FPGA family
76
      C_ROOT_PORT       : BOOLEAN := FALSE;       -- PCIe block is in root port mode
77
      C_PM_PRIORITY     : BOOLEAN := FALSE;       -- Disable TX packet boundary thrtl
78
      TCQ               : INTEGER := 1;             -- Clock to Q time
79
 
80
      C_REM_WIDTH       : INTEGER := 1;             -- trem/rrem width
81
      C_STRB_WIDTH      : INTEGER := 4              -- TSTRB width
82
   );
83
   PORT (
84
      -------------------------------------------------
85
      -- User Design I/O                             --
86
      -------------------------------------------------
87
      -- AXI RX
88
      -------------
89
 
90
      M_AXIS_RX_TDATA   : OUT STD_LOGIC_VECTOR(C_DATA_WIDTH - 1 DOWNTO 0):=(OTHERS=>'0'); -- RX data to user
91
      M_AXIS_RX_TVALID  : OUT STD_LOGIC                                  :='0';           -- RX data is valid
92
      M_AXIS_RX_TREADY  : IN STD_LOGIC                                   :='0';           -- RX ready for data
93
      M_AXIS_RX_TSTRB   : OUT STD_LOGIC_VECTOR(C_STRB_WIDTH - 1 DOWNTO 0):=(OTHERS=>'0'); -- RX strobe byte enables
94
      M_AXIS_RX_TLAST   : OUT STD_LOGIC                                  :='0';           -- RX data is last
95
      M_AXIS_RX_TUSER   : OUT STD_LOGIC_VECTOR(21 DOWNTO 0)              :=(OTHERS=>'0'); -- RX user signals
96
      -------------------------------------------------
97
      -- PCIe Block I/O                              --
98
      -------------------------------------------------
99
      -- TRN RX
100
      -------------
101
      TRN_RD            : IN STD_LOGIC_VECTOR(C_DATA_WIDTH - 1 DOWNTO 0) :=(OTHERS=>'0');   -- RX data from block
102
      TRN_RSOF          : IN STD_LOGIC                                   :='0';             -- RX start of packet
103
      TRN_REOF          : IN STD_LOGIC                                   :='0';             -- RX end of packet
104
      TRN_RSRC_RDY      : IN STD_LOGIC                                   :='0';             -- RX source ready
105
      TRN_RDST_RDY      : OUT STD_LOGIC                                  :='0';             -- RX destination ready
106
      TRN_RSRC_DSC      : IN STD_LOGIC                                   :='0';             -- RX source discontinue
107
      TRN_RREM          : IN STD_LOGIC_VECTOR(C_REM_WIDTH - 1 DOWNTO 0)  :=(OTHERS=>'0');   -- RX remainder
108
      TRN_RERRFWD       : IN STD_LOGIC                                   :='0';             -- RX error forward
109
      TRN_RBAR_HIT      : IN STD_LOGIC_VECTOR(6 DOWNTO 0) :=(OTHERS=>'0');   -- RX BAR hit
110
      TRN_RECRC_ERR     : IN STD_LOGIC                                   :='0';             -- RX ECRC error
111
 
112
      -- System
113
      -------------
114
      NP_COUNTER        : OUT STD_LOGIC_VECTOR(2 DOWNTO 0)               :=(OTHERS=>'0');   -- Non-posted counter
115
      USER_CLK          : IN STD_LOGIC                                   :='0';             -- user clock from block
116
      USER_RST          : IN STD_LOGIC                                   :='0'              -- user reset from block
117
   );
118
END axi_basic_rx;
119
 
120
-------------------------------------------------
121
  -- RX Data Pipeline                            --
122
  -------------------------------------------------
123
 
124
 
125
ARCHITECTURE TRANS OF axi_basic_rx IS
126
 
127
   SIGNAL null_rx_tvalid         : STD_LOGIC;
128
   SIGNAL null_rx_tlast          : STD_LOGIC;
129
   SIGNAL null_rx_tstrb          : STD_LOGIC_VECTOR(C_STRB_WIDTH - 1 DOWNTO 0);
130
   SIGNAL null_rdst_rdy          : STD_LOGIC;
131
   SIGNAL null_is_eof            : STD_LOGIC_VECTOR(4 DOWNTO 0);
132
 
133
   -- Declare intermediate signals for referenced outputs
134
   SIGNAL m_axis_rx_tdata_xhdl0  : STD_LOGIC_VECTOR(C_DATA_WIDTH - 1 DOWNTO 0);
135
   SIGNAL m_axis_rx_tvalid_xhdl4 : STD_LOGIC;
136
   SIGNAL m_axis_rx_tstrb_xhdl2  : STD_LOGIC_VECTOR(C_STRB_WIDTH - 1 DOWNTO 0);
137
   SIGNAL m_axis_rx_tlast_xhdl1  : STD_LOGIC;
138
   SIGNAL m_axis_rx_tuser_xhdl3  : STD_LOGIC_VECTOR(21 DOWNTO 0);
139
   SIGNAL trn_rdst_rdy_xhdl6     : STD_LOGIC;
140
   SIGNAL np_counter_xhdl5       : STD_LOGIC_VECTOR(2 DOWNTO 0);
141
 
142
   COMPONENT axi_basic_rx_null_gen IS
143
   GENERIC (
144
      C_DATA_WIDTH            : INTEGER := 128;
145
      TCQ                     : INTEGER := 1;
146
      C_STRB_WIDTH            : INTEGER := 4
147
   );
148
   PORT (
149
      M_AXIS_RX_TDATA         : IN STD_LOGIC_VECTOR(C_DATA_WIDTH - 1 DOWNTO 0)  := (OTHERS=>'0');
150
      M_AXIS_RX_TVALID        : IN STD_LOGIC                                    := '0';
151
      M_AXIS_RX_TREADY        : IN STD_LOGIC                                    := '0';
152
      M_AXIS_RX_TLAST         : IN STD_LOGIC                                    := '0';
153
      M_AXIS_RX_TUSER         : IN STD_LOGIC_VECTOR(21 DOWNTO 0)                := (OTHERS=>'0');
154
 
155
      NULL_RX_TVALID          : OUT STD_LOGIC                                   := '0';
156
      NULL_RX_TLAST           : OUT STD_LOGIC                                   := '0';
157
      NULL_RX_TSTRB           : OUT STD_LOGIC_VECTOR(C_STRB_WIDTH - 1 DOWNTO 0) := (OTHERS=>'0');
158
      NULL_RDST_RDY           : OUT STD_LOGIC                                   := '0';
159
      NULL_IS_EOF             : OUT STD_LOGIC_VECTOR(4 DOWNTO 0)                := (OTHERS=>'0');
160
 
161
      USER_CLK                : IN STD_LOGIC                                    := '0';
162
      USER_RST                : IN STD_LOGIC                                    := '0'
163
   );
164
END COMPONENT axi_basic_rx_null_gen;
165
 
166
  -------------------------------------------------
167
  -- RX Data Pipeline                            --
168
  -------------------------------------------------
169
   COMPONENT axi_basic_rx_pipeline IS
170
   GENERIC (
171
      C_DATA_WIDTH            : INTEGER := 128;
172
      C_FAMILY                : STRING := "X7";
173
      TCQ                     : INTEGER := 1;
174
 
175
      C_REM_WIDTH             : INTEGER := 1;
176
      C_STRB_WIDTH            : INTEGER := 4
177
   );
178
   PORT (
179
 
180
      M_AXIS_RX_TDATA         : OUT STD_LOGIC_VECTOR(C_DATA_WIDTH - 1 DOWNTO 0)   := (OTHERS=>'0');
181
      M_AXIS_RX_TVALID        : OUT STD_LOGIC                                     := '0';
182
      M_AXIS_RX_TREADY        : IN STD_LOGIC                                      := '0';
183
      M_AXIS_RX_TSTRB         : OUT STD_LOGIC_VECTOR(C_STRB_WIDTH - 1 DOWNTO 0)   := (OTHERS=>'0');
184
      M_AXIS_RX_TLAST         : OUT STD_LOGIC                                     := '0';
185
      M_AXIS_RX_TUSER         : OUT STD_LOGIC_VECTOR(21 DOWNTO 0)                 := (OTHERS=>'0');
186
 
187
      TRN_RD                  : IN STD_LOGIC_VECTOR(C_DATA_WIDTH - 1 DOWNTO 0)    := (OTHERS=>'0');
188
      TRN_RSOF                : IN STD_LOGIC                                      := '0';
189
      TRN_REOF                : IN STD_LOGIC                                      := '0';
190
      TRN_RSRC_RDY            : IN STD_LOGIC                                      := '0';
191
      TRN_RDST_RDY            : OUT STD_LOGIC                                     := '0';
192
      TRN_RSRC_DSC            : IN STD_LOGIC                                      := '0';
193
      TRN_RREM                : IN STD_LOGIC_VECTOR(C_REM_WIDTH - 1 DOWNTO 0)     := (OTHERS=>'0');
194
      TRN_RERRFWD             : IN STD_LOGIC                                      := '0';
195
      TRN_RBAR_HIT            : IN STD_LOGIC_VECTOR(6 DOWNTO 0)                   := (OTHERS=>'0');
196
      TRN_RECRC_ERR           : IN STD_LOGIC                                      := '0';
197
 
198
      NULL_RX_TVALID          : IN STD_LOGIC                                      := '0';
199
      NULL_RX_TLAST           : IN STD_LOGIC                                      := '0';
200
      NULL_RX_TSTRB           : IN STD_LOGIC_VECTOR(C_STRB_WIDTH - 1 DOWNTO 0)    := (OTHERS=>'0') ;
201
      NULL_RDST_RDY           : IN STD_LOGIC                                      := '0';
202
      NULL_IS_EOF             : IN STD_LOGIC_VECTOR(4 DOWNTO 0)                   := (OTHERS=>'0');
203
 
204
      NP_COUNTER              : OUT STD_LOGIC_VECTOR(2 DOWNTO 0)                  :=(OTHERS=>'0');
205
      USER_CLK                : IN STD_LOGIC                                      :='0';
206
      USER_RST                : IN STD_LOGIC                                      :='0'
207
   );
208
END COMPONENT axi_basic_rx_pipeline;
209
BEGIN
210
   -- Drive referenced outputs
211
   M_AXIS_RX_TDATA     <= m_axis_rx_tdata_xhdl0;
212
   M_AXIS_RX_TVALID    <= m_axis_rx_tvalid_xhdl4;
213
   M_AXIS_RX_TSTRB     <= m_axis_rx_tstrb_xhdl2;
214
   M_AXIS_RX_TLAST     <= m_axis_rx_tlast_xhdl1;
215
   M_AXIS_RX_TUSER     <= m_axis_rx_tuser_xhdl3;
216
   TRN_RDST_RDY        <= trn_rdst_rdy_xhdl6;
217
   NP_COUNTER          <= np_counter_xhdl5;
218
 
219
 
220
   rx_pipeline_inst : axi_basic_rx_pipeline
221
      GENERIC MAP (
222
         C_DATA_WIDTH    => C_DATA_WIDTH,
223
         C_FAMILY        => C_FAMILY,
224
         TCQ             => TCQ,
225
         C_REM_WIDTH     => C_REM_WIDTH,
226
         C_STRB_WIDTH    => C_STRB_WIDTH
227
      )
228
      PORT MAP (
229
 
230
         ----------------------
231
         -- Outgoing AXI TX
232
         ----------------------
233
         M_AXIS_RX_TDATA   => m_axis_rx_tdata_xhdl0,
234
         M_AXIS_RX_TVALID  => m_axis_rx_tvalid_xhdl4,
235
         M_AXIS_RX_TREADY  => M_AXIS_RX_TREADY,
236
         M_AXIS_RX_TSTRB   => m_axis_rx_tstrb_xhdl2,
237
         M_AXIS_RX_TLAST   => m_axis_rx_tlast_xhdl1,
238
         M_AXIS_RX_TUSER   => m_axis_rx_tuser_xhdl3,
239
 
240
         ----------------------
241
          -- Incoming TRN RX
242
         ----------------------
243
         TRN_RD            => TRN_RD,
244
         TRN_RSOF          => TRN_RSOF,
245
         TRN_REOF          => TRN_REOF,
246
         TRN_RSRC_RDY      => TRN_RSRC_RDY,
247
         TRN_RDST_RDY      => trn_rdst_rdy_xhdl6,
248
         TRN_RSRC_DSC      => TRN_RSRC_DSC,
249
         TRN_RREM          => TRN_RREM,
250
         TRN_RERRFWD       => TRN_RERRFWD,
251
         TRN_RBAR_HIT      => TRN_RBAR_HIT,
252
         TRN_RECRC_ERR     => TRN_RECRC_ERR,
253
 
254
         ----------------------
255
          -- Null Inputs
256
         ----------------------
257
         NULL_RX_TVALID    => null_rx_tvalid,
258
         NULL_RX_TLAST     => null_rx_tlast,
259
         NULL_RX_TSTRB     => null_rx_tstrb,
260
         NULL_RDST_RDY     => null_rdst_rdy,
261
         NULL_IS_EOF       => null_is_eof,
262
 
263
         ----------------------
264
         -- System
265
         ----------------------
266
         NP_COUNTER        => np_counter_xhdl5,
267
         USER_CLK          => USER_CLK,
268
         USER_RST          => USER_RST
269
      );
270
 
271
 
272
 
273
   rx_null_gen_inst : axi_basic_rx_null_gen
274
      GENERIC MAP (
275
         C_DATA_WIDTH      => C_DATA_WIDTH,
276
         TCQ               => TCQ,
277
         C_STRB_WIDTH      => C_STRB_WIDTH
278
      )
279
      PORT MAP (
280
         ----------------------
281
         -- Inputs
282
         ----------------------
283
         M_AXIS_RX_TDATA   => m_axis_rx_tdata_xhdl0,
284
         M_AXIS_RX_TVALID  => m_axis_rx_tvalid_xhdl4,
285
         M_AXIS_RX_TREADY  => M_AXIS_RX_TREADY,
286
         M_AXIS_RX_TLAST   => m_axis_rx_tlast_xhdl1,
287
         M_AXIS_RX_TUSER   => m_axis_rx_tuser_xhdl3,
288
 
289
         ----------------------
290
          -- Null Outputs
291
         ----------------------
292
         NULL_RX_TVALID    => null_rx_tvalid,
293
         NULL_RX_TLAST     => null_rx_tlast,
294
         NULL_RX_TSTRB     => null_rx_tstrb,
295
         NULL_RDST_RDY     => null_rdst_rdy,
296
         NULL_IS_EOF       => null_is_eof,
297
 
298
         ----------------------
299
         -- System
300
         ----------------------
301
         USER_CLK          => USER_CLK,
302
         USER_RST          => USER_RST
303
      );
304
 
305
END TRANS;

powered by: WebSVN 2.1.0

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