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

Subversion Repositories pcie_sg_dma

[/] [pcie_sg_dma/] [branches/] [Virtex6/] [ML605_ISE13.3/] [ipcore_dir_ISE13.3/] [v6_pcie_v1_6/] [source/] [pcie_pipe_lane_v6.v] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 barabba
//-----------------------------------------------------------------------------
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       : pcie_pipe_lane_v6.v
52
// Version    : 1.7
53
//--
54
//-- Description: PIPE per lane module for Virtex6 PCIe Block
55
//--
56
//--
57
//--
58
//--------------------------------------------------------------------------------
59
 
60
`timescale 1ns/1ns
61
 
62
module pcie_pipe_lane_v6 #
63
(
64
    parameter        PIPE_PIPELINE_STAGES = 0    // 0 - 0 stages, 1 - 1 stage, 2 - 2 stages
65
)
66
(
67
    output  wire [ 1:0] pipe_rx_char_is_k_o     ,
68
    output  wire [15:0] pipe_rx_data_o         ,
69
    output  wire        pipe_rx_valid_o         ,
70
    output  wire        pipe_rx_chanisaligned_o ,
71
    output  wire [ 2:0] pipe_rx_status_o        ,
72
    output  wire        pipe_rx_phy_status_o    ,
73
    output  wire        pipe_rx_elec_idle_o     ,
74
    input   wire        pipe_rx_polarity_i      ,
75
    input   wire        pipe_tx_compliance_i    ,
76
    input   wire [ 1:0] pipe_tx_char_is_k_i     ,
77
    input   wire [15:0] pipe_tx_data_i          ,
78
    input   wire        pipe_tx_elec_idle_i     ,
79
    input   wire [ 1:0] pipe_tx_powerdown_i     ,
80
 
81
    input  wire [ 1:0]  pipe_rx_char_is_k_i     ,
82
    input  wire [15:0]  pipe_rx_data_i         ,
83
    input  wire         pipe_rx_valid_i         ,
84
    input  wire         pipe_rx_chanisaligned_i ,
85
    input  wire [ 2:0]  pipe_rx_status_i        ,
86
    input  wire         pipe_rx_phy_status_i    ,
87
    input  wire         pipe_rx_elec_idle_i     ,
88
    output wire         pipe_rx_polarity_o      ,
89
    output wire         pipe_tx_compliance_o    ,
90
    output wire [ 1:0]  pipe_tx_char_is_k_o     ,
91
    output wire [15:0]  pipe_tx_data_o          ,
92
    output wire         pipe_tx_elec_idle_o     ,
93
    output wire [ 1:0]  pipe_tx_powerdown_o     ,
94
 
95
    input   wire        pipe_clk                ,
96
    input   wire        rst_n
97
);
98
 
99
//******************************************************************//
100
// Reality check.                                                   //
101
//******************************************************************//
102
 
103
    parameter TCQ  = 1;      // clock to out delay model
104
 
105
    reg [ 1:0]          pipe_rx_char_is_k_q     ;
106
    reg [15:0]          pipe_rx_data_q          ;
107
    reg                 pipe_rx_valid_q         ;
108
    reg                 pipe_rx_chanisaligned_q ;
109
    reg [ 2:0]          pipe_rx_status_q        ;
110
    reg                 pipe_rx_phy_status_q    ;
111
    reg                 pipe_rx_elec_idle_q     ;
112
 
113
    reg                 pipe_rx_polarity_q      ;
114
    reg                 pipe_tx_compliance_q    ;
115
    reg [ 1:0]          pipe_tx_char_is_k_q     ;
116
    reg [15:0]          pipe_tx_data_q          ;
117
    reg                 pipe_tx_elec_idle_q     ;
118
    reg [ 1:0]          pipe_tx_powerdown_q     ;
119
 
120
    reg [ 1:0]          pipe_rx_char_is_k_qq    ;
121
    reg [15:0]          pipe_rx_data_qq         ;
122
    reg                 pipe_rx_valid_qq        ;
123
    reg                 pipe_rx_chanisaligned_qq;
124
    reg [ 2:0]          pipe_rx_status_qq       ;
125
    reg                 pipe_rx_phy_status_qq   ;
126
    reg                 pipe_rx_elec_idle_qq    ;
127
 
128
    reg                 pipe_rx_polarity_qq     ;
129
    reg                 pipe_tx_compliance_qq   ;
130
    reg [ 1:0]          pipe_tx_char_is_k_qq    ;
131
    reg [15:0]          pipe_tx_data_qq         ;
132
    reg                 pipe_tx_elec_idle_qq    ;
133
    reg [ 1:0]          pipe_tx_powerdown_qq    ;
134
 
135
    generate
136
 
137
      if (PIPE_PIPELINE_STAGES == 0) begin
138
 
139
        assign pipe_rx_char_is_k_o = pipe_rx_char_is_k_i;
140
        assign pipe_rx_data_o = pipe_rx_data_i;
141
        assign pipe_rx_valid_o = pipe_rx_valid_i;
142
        assign pipe_rx_chanisaligned_o = pipe_rx_chanisaligned_i;
143
        assign pipe_rx_status_o = pipe_rx_status_i;
144
        assign pipe_rx_phy_status_o = pipe_rx_phy_status_i;
145
        assign pipe_rx_elec_idle_o = pipe_rx_elec_idle_i;
146
 
147
        assign pipe_rx_polarity_o = pipe_rx_polarity_i;
148
        assign pipe_tx_compliance_o = pipe_tx_compliance_i;
149
        assign pipe_tx_char_is_k_o = pipe_tx_char_is_k_i;
150
        assign pipe_tx_data_o = pipe_tx_data_i;
151
        assign pipe_tx_elec_idle_o = pipe_tx_elec_idle_i;
152
        assign pipe_tx_powerdown_o = pipe_tx_powerdown_i;
153
 
154
      end else if (PIPE_PIPELINE_STAGES == 1) begin
155
 
156
        always @(posedge pipe_clk) begin
157
 
158
          if (rst_n) begin
159
 
160
            pipe_rx_char_is_k_q <= #TCQ 0;
161
            pipe_rx_data_q <= #TCQ 0;
162
            pipe_rx_valid_q <= #TCQ 0;
163
            pipe_rx_chanisaligned_q <= #TCQ 0;
164
            pipe_rx_status_q <= #TCQ 0;
165
            pipe_rx_phy_status_q <= #TCQ 0;
166
            pipe_rx_elec_idle_q <= #TCQ 0;
167
 
168
            pipe_rx_polarity_q <= #TCQ 0;
169
            pipe_tx_compliance_q <= #TCQ 0;
170
            pipe_tx_char_is_k_q <= #TCQ 0;
171
            pipe_tx_data_q <= #TCQ 0;
172
            pipe_tx_elec_idle_q <= #TCQ 1'b1;
173
            pipe_tx_powerdown_q <= #TCQ 2'b10;
174
 
175
          end else begin
176
 
177
            pipe_rx_char_is_k_q <= #TCQ pipe_rx_char_is_k_i;
178
            pipe_rx_data_q <= #TCQ pipe_rx_data_i;
179
            pipe_rx_valid_q <= #TCQ pipe_rx_valid_i;
180
            pipe_rx_chanisaligned_q <= #TCQ pipe_rx_chanisaligned_i;
181
            pipe_rx_status_q <= #TCQ pipe_rx_status_i;
182
            pipe_rx_phy_status_q <= #TCQ pipe_rx_phy_status_i;
183
            pipe_rx_elec_idle_q <= #TCQ pipe_rx_elec_idle_i;
184
 
185
            pipe_rx_polarity_q <= #TCQ pipe_rx_polarity_i;
186
            pipe_tx_compliance_q <= #TCQ pipe_tx_compliance_i;
187
            pipe_tx_char_is_k_q <= #TCQ pipe_tx_char_is_k_i;
188
            pipe_tx_data_q <= #TCQ pipe_tx_data_i;
189
            pipe_tx_elec_idle_q <= #TCQ pipe_tx_elec_idle_i;
190
            pipe_tx_powerdown_q <= #TCQ pipe_tx_powerdown_i;
191
 
192
          end
193
 
194
        end
195
 
196
        assign pipe_rx_char_is_k_o = pipe_rx_char_is_k_q;
197
        assign pipe_rx_data_o = pipe_rx_data_q;
198
        assign pipe_rx_valid_o = pipe_rx_valid_q;
199
        assign pipe_rx_chanisaligned_o = pipe_rx_chanisaligned_q;
200
        assign pipe_rx_status_o = pipe_rx_status_q;
201
        assign pipe_rx_phy_status_o = pipe_rx_phy_status_q;
202
        assign pipe_rx_elec_idle_o = pipe_rx_elec_idle_q;
203
 
204
        assign pipe_rx_polarity_o = pipe_rx_polarity_q;
205
        assign pipe_tx_compliance_o = pipe_tx_compliance_q;
206
        assign pipe_tx_char_is_k_o = pipe_tx_char_is_k_q;
207
        assign pipe_tx_data_o = pipe_tx_data_q;
208
        assign pipe_tx_elec_idle_o = pipe_tx_elec_idle_q;
209
        assign pipe_tx_powerdown_o = pipe_tx_powerdown_q;
210
 
211
      end else if (PIPE_PIPELINE_STAGES == 2) begin
212
 
213
        always @(posedge pipe_clk) begin
214
 
215
          if (rst_n) begin
216
 
217
            pipe_rx_char_is_k_q <= #TCQ 0;
218
            pipe_rx_data_q <= #TCQ 0;
219
            pipe_rx_valid_q <= #TCQ 0;
220
            pipe_rx_chanisaligned_q <= #TCQ 0;
221
            pipe_rx_status_q <= #TCQ 0;
222
            pipe_rx_phy_status_q <= #TCQ 0;
223
            pipe_rx_elec_idle_q <= #TCQ 0;
224
 
225
            pipe_rx_polarity_q <= #TCQ 0;
226
            pipe_tx_compliance_q <= #TCQ 0;
227
            pipe_tx_char_is_k_q <= #TCQ 0;
228
            pipe_tx_data_q <= #TCQ 0;
229
            pipe_tx_elec_idle_q <= #TCQ 1'b1;
230
            pipe_tx_powerdown_q <= #TCQ 2'b10;
231
 
232
            pipe_rx_char_is_k_qq <= #TCQ 0;
233
            pipe_rx_data_qq <= #TCQ 0;
234
            pipe_rx_valid_qq <= #TCQ 0;
235
            pipe_rx_chanisaligned_qq <= #TCQ 0;
236
            pipe_rx_status_qq <= #TCQ 0;
237
            pipe_rx_phy_status_qq <= #TCQ 0;
238
            pipe_rx_elec_idle_qq <= #TCQ 0;
239
 
240
            pipe_rx_polarity_qq <= #TCQ 0;
241
            pipe_tx_compliance_qq <= #TCQ 0;
242
            pipe_tx_char_is_k_qq <= #TCQ 0;
243
            pipe_tx_data_qq <= #TCQ 0;
244
            pipe_tx_elec_idle_qq <= #TCQ 1'b1;
245
            pipe_tx_powerdown_qq <= #TCQ 2'b10;
246
 
247
          end else begin
248
 
249
            pipe_rx_char_is_k_q <= #TCQ pipe_rx_char_is_k_i;
250
            pipe_rx_data_q <= #TCQ pipe_rx_data_i;
251
            pipe_rx_valid_q <= #TCQ pipe_rx_valid_i;
252
            pipe_rx_chanisaligned_q <= #TCQ pipe_rx_chanisaligned_i;
253
            pipe_rx_status_q <= #TCQ pipe_rx_status_i;
254
            pipe_rx_phy_status_q <= #TCQ pipe_rx_phy_status_i;
255
            pipe_rx_elec_idle_q <= #TCQ pipe_rx_elec_idle_i;
256
 
257
            pipe_rx_polarity_q <= #TCQ pipe_rx_polarity_i;
258
            pipe_tx_compliance_q <= #TCQ pipe_tx_compliance_i;
259
            pipe_tx_char_is_k_q <= #TCQ pipe_tx_char_is_k_i;
260
            pipe_tx_data_q <= #TCQ pipe_tx_data_i;
261
            pipe_tx_elec_idle_q <= #TCQ pipe_tx_elec_idle_i;
262
            pipe_tx_powerdown_q <= #TCQ pipe_tx_powerdown_i;
263
 
264
            pipe_rx_char_is_k_qq <= #TCQ pipe_rx_char_is_k_q;
265
            pipe_rx_data_qq <= #TCQ pipe_rx_data_q;
266
            pipe_rx_valid_qq <= #TCQ pipe_rx_valid_q;
267
            pipe_rx_chanisaligned_qq <= #TCQ pipe_rx_chanisaligned_q;
268
            pipe_rx_status_qq <= #TCQ pipe_rx_status_q;
269
            pipe_rx_phy_status_qq <= #TCQ pipe_rx_phy_status_q;
270
            pipe_rx_elec_idle_qq <= #TCQ pipe_rx_elec_idle_q;
271
 
272
            pipe_rx_polarity_qq <= #TCQ pipe_rx_polarity_q;
273
            pipe_tx_compliance_qq <= #TCQ pipe_tx_compliance_q;
274
            pipe_tx_char_is_k_qq <= #TCQ pipe_tx_char_is_k_q;
275
            pipe_tx_data_qq <= #TCQ pipe_tx_data_q;
276
            pipe_tx_elec_idle_qq <= #TCQ pipe_tx_elec_idle_q;
277
            pipe_tx_powerdown_qq <= #TCQ pipe_tx_powerdown_q;
278
 
279
          end
280
 
281
        end
282
 
283
        assign pipe_rx_char_is_k_o = pipe_rx_char_is_k_qq;
284
        assign pipe_rx_data_o = pipe_rx_data_qq;
285
        assign pipe_rx_valid_o = pipe_rx_valid_qq;
286
        assign pipe_rx_chanisaligned_o = pipe_rx_chanisaligned_qq;
287
        assign pipe_rx_status_o = pipe_rx_status_qq;
288
        assign pipe_rx_phy_status_o = pipe_rx_phy_status_qq;
289
        assign pipe_rx_elec_idle_o = pipe_rx_elec_idle_qq;
290
 
291
        assign pipe_rx_polarity_o = pipe_rx_polarity_qq;
292
        assign pipe_tx_compliance_o = pipe_tx_compliance_qq;
293
        assign pipe_tx_char_is_k_o = pipe_tx_char_is_k_qq;
294
        assign pipe_tx_data_o = pipe_tx_data_qq;
295
        assign pipe_tx_elec_idle_o = pipe_tx_elec_idle_qq;
296
        assign pipe_tx_powerdown_o = pipe_tx_powerdown_qq;
297
 
298
      end
299
 
300
    endgenerate
301
 
302
endmodule

powered by: WebSVN 2.1.0

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