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

Subversion Repositories pcie_sg_dma

[/] [pcie_sg_dma/] [branches/] [Virtex6/] [ML605_ISE12.3/] [pcie_sg_dma/] [Virtex6/] [ML605/] [v6_pcie_v1_3/] [source/] [pcie_pipe_lane_v6.v] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 barabba
//-----------------------------------------------------------------------------
2
//
3
// (c) Copyright 2009 Xilinx, Inc. All rights reserved.
4
//
5
// This file contains confidential and proprietary information of Xilinx, Inc.
6
// and is protected under U.S. and international copyright and other
7
// intellectual property laws.
8
//
9
// DISCLAIMER
10
//
11
// This disclaimer is not a license and does not grant any rights to the
12
// materials distributed herewith. Except as otherwise provided in a valid
13
// license issued to you by Xilinx, and to the maximum extent permitted by
14
// applicable law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND WITH ALL
15
// FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS,
16
// IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
17
// MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE;
18
// and (2) Xilinx shall not be liable (whether in contract or tort, including
19
// negligence, or under any other theory of liability) for any loss or damage
20
// of any kind or nature related to, arising under or in connection with these
21
// materials, including for any direct, or any indirect, special, incidental,
22
// or consequential loss or damage (including loss of data, profits, goodwill,
23
// or any type of loss or damage suffered as a result of any action brought by
24
// a third party) even if such damage or loss was reasonably foreseeable or
25
// Xilinx had been advised of the possibility of the same.
26
//
27
// CRITICAL APPLICATIONS
28
//
29
// Xilinx products are not designed or intended to be fail-safe, or for use in
30
// any application requiring fail-safe performance, such as life-support or
31
// safety devices or systems, Class III medical devices, nuclear facilities,
32
// applications related to the deployment of airbags, or any other
33
// applications that could lead to death, personal injury, or severe property
34
// or environmental damage (individually and collectively, "Critical
35
// Applications"). Customer assumes the sole risk and liability of any use of
36
// Xilinx products in Critical Applications, subject only to applicable laws
37
// and regulations governing limitations on product liability.
38
//
39
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS PART OF THIS FILE
40
// AT ALL TIMES.
41
//
42
//-----------------------------------------------------------------------------
43
// Project    : Virtex-6 Integrated Block for PCI Express
44
// File       : pcie_pipe_lane_v6.v
45
//--
46
//-- Description: PIPE per lane module for Virtex6 PCIe Block
47
//--
48
//--
49
//--
50
//--------------------------------------------------------------------------------
51
 
52
`timescale 1ns/1ns
53
 
54
module pcie_pipe_lane_v6 #
55
(
56
    parameter        PIPE_PIPELINE_STAGES = 0    // 0 - 0 stages, 1 - 1 stage, 2 - 2 stages
57
)
58
(
59
    output  wire [ 1:0] pipe_rx_char_is_k_o     ,
60
    output  wire [15:0] pipe_rx_data_o         ,
61
    output  wire        pipe_rx_valid_o         ,
62
    output  wire        pipe_rx_chanisaligned_o ,
63
    output  wire [ 2:0] pipe_rx_status_o        ,
64
    output  wire        pipe_rx_phy_status_o    ,
65
    output  wire        pipe_rx_elec_idle_o     ,
66
    input   wire        pipe_rx_polarity_i      ,
67
    input   wire        pipe_tx_compliance_i    ,
68
    input   wire [ 1:0] pipe_tx_char_is_k_i     ,
69
    input   wire [15:0] pipe_tx_data_i          ,
70
    input   wire        pipe_tx_elec_idle_i     ,
71
    input   wire [ 1:0] pipe_tx_powerdown_i     ,
72
 
73
    input  wire [ 1:0]  pipe_rx_char_is_k_i     ,
74
    input  wire [15:0]  pipe_rx_data_i         ,
75
    input  wire         pipe_rx_valid_i         ,
76
    input  wire         pipe_rx_chanisaligned_i ,
77
    input  wire [ 2:0]  pipe_rx_status_i        ,
78
    input  wire         pipe_rx_phy_status_i    ,
79
    input  wire         pipe_rx_elec_idle_i     ,
80
    output wire         pipe_rx_polarity_o      ,
81
    output wire         pipe_tx_compliance_o    ,
82
    output wire [ 1:0]  pipe_tx_char_is_k_o     ,
83
    output wire [15:0]  pipe_tx_data_o          ,
84
    output wire         pipe_tx_elec_idle_o     ,
85
    output wire [ 1:0]  pipe_tx_powerdown_o     ,
86
 
87
    input   wire        pipe_clk                ,
88
    input   wire        rst_n
89
);
90
 
91
//******************************************************************//
92
// Reality check.                                                   //
93
//******************************************************************//
94
 
95
    parameter TCQ  = 1;      // clock to out delay model
96
 
97
    reg [ 1:0]          pipe_rx_char_is_k_q     ;
98
    reg [15:0]          pipe_rx_data_q          ;
99
    reg                 pipe_rx_valid_q         ;
100
    reg                 pipe_rx_chanisaligned_q ;
101
    reg [ 2:0]          pipe_rx_status_q        ;
102
    reg                 pipe_rx_phy_status_q    ;
103
    reg                 pipe_rx_elec_idle_q     ;
104
 
105
    reg                 pipe_rx_polarity_q      ;
106
    reg                 pipe_tx_compliance_q    ;
107
    reg [ 1:0]          pipe_tx_char_is_k_q     ;
108
    reg [15:0]          pipe_tx_data_q          ;
109
    reg                 pipe_tx_elec_idle_q     ;
110
    reg [ 1:0]          pipe_tx_powerdown_q     ;
111
 
112
    reg [ 1:0]          pipe_rx_char_is_k_qq    ;
113
    reg [15:0]          pipe_rx_data_qq         ;
114
    reg                 pipe_rx_valid_qq        ;
115
    reg                 pipe_rx_chanisaligned_qq;
116
    reg [ 2:0]          pipe_rx_status_qq       ;
117
    reg                 pipe_rx_phy_status_qq   ;
118
    reg                 pipe_rx_elec_idle_qq    ;
119
 
120
    reg                 pipe_rx_polarity_qq     ;
121
    reg                 pipe_tx_compliance_qq   ;
122
    reg [ 1:0]          pipe_tx_char_is_k_qq    ;
123
    reg [15:0]          pipe_tx_data_qq         ;
124
    reg                 pipe_tx_elec_idle_qq    ;
125
    reg [ 1:0]          pipe_tx_powerdown_qq    ;
126
 
127
    generate
128
 
129
      if (PIPE_PIPELINE_STAGES == 0) begin
130
 
131
        assign pipe_rx_char_is_k_o = pipe_rx_char_is_k_i;
132
        assign pipe_rx_data_o = pipe_rx_data_i;
133
        assign pipe_rx_valid_o = pipe_rx_valid_i;
134
        assign pipe_rx_chanisaligned_o = pipe_rx_chanisaligned_i;
135
        assign pipe_rx_status_o = pipe_rx_status_i;
136
        assign pipe_rx_phy_status_o = pipe_rx_phy_status_i;
137
        assign pipe_rx_elec_idle_o = pipe_rx_elec_idle_i;
138
 
139
        assign pipe_rx_polarity_o = pipe_rx_polarity_i;
140
        assign pipe_tx_compliance_o = pipe_tx_compliance_i;
141
        assign pipe_tx_char_is_k_o = pipe_tx_char_is_k_i;
142
        assign pipe_tx_data_o = pipe_tx_data_i;
143
        assign pipe_tx_elec_idle_o = pipe_tx_elec_idle_i;
144
        assign pipe_tx_powerdown_o = pipe_tx_powerdown_i;
145
 
146
      end else if (PIPE_PIPELINE_STAGES == 1) begin
147
 
148
        always @(posedge pipe_clk) begin
149
 
150
          if (rst_n) begin
151
 
152
            pipe_rx_char_is_k_q <= #TCQ 0;
153
            pipe_rx_data_q <= #TCQ 0;
154
            pipe_rx_valid_q <= #TCQ 0;
155
            pipe_rx_chanisaligned_q <= #TCQ 0;
156
            pipe_rx_status_q <= #TCQ 0;
157
            pipe_rx_phy_status_q <= #TCQ 0;
158
            pipe_rx_elec_idle_q <= #TCQ 0;
159
 
160
            pipe_rx_polarity_q <= #TCQ 0;
161
            pipe_tx_compliance_q <= #TCQ 0;
162
            pipe_tx_char_is_k_q <= #TCQ 0;
163
            pipe_tx_data_q <= #TCQ 0;
164
            pipe_tx_elec_idle_q <= #TCQ 1'b1;
165
            pipe_tx_powerdown_q <= #TCQ 2'b10;
166
 
167
          end else begin
168
 
169
            pipe_rx_char_is_k_q <= #TCQ pipe_rx_char_is_k_i;
170
            pipe_rx_data_q <= #TCQ pipe_rx_data_i;
171
            pipe_rx_valid_q <= #TCQ pipe_rx_valid_i;
172
            pipe_rx_chanisaligned_q <= #TCQ pipe_rx_chanisaligned_i;
173
            pipe_rx_status_q <= #TCQ pipe_rx_status_i;
174
            pipe_rx_phy_status_q <= #TCQ pipe_rx_phy_status_i;
175
            pipe_rx_elec_idle_q <= #TCQ pipe_rx_elec_idle_i;
176
 
177
            pipe_rx_polarity_q <= #TCQ pipe_rx_polarity_i;
178
            pipe_tx_compliance_q <= #TCQ pipe_tx_compliance_i;
179
            pipe_tx_char_is_k_q <= #TCQ pipe_tx_char_is_k_i;
180
            pipe_tx_data_q <= #TCQ pipe_tx_data_i;
181
            pipe_tx_elec_idle_q <= #TCQ pipe_tx_elec_idle_i;
182
            pipe_tx_powerdown_q <= #TCQ pipe_tx_powerdown_i;
183
 
184
          end
185
 
186
        end
187
 
188
        assign pipe_rx_char_is_k_o = pipe_rx_char_is_k_q;
189
        assign pipe_rx_data_o = pipe_rx_data_q;
190
        assign pipe_rx_valid_o = pipe_rx_valid_q;
191
        assign pipe_rx_chanisaligned_o = pipe_rx_chanisaligned_q;
192
        assign pipe_rx_status_o = pipe_rx_status_q;
193
        assign pipe_rx_phy_status_o = pipe_rx_phy_status_q;
194
        assign pipe_rx_elec_idle_o = pipe_rx_elec_idle_q;
195
 
196
        assign pipe_rx_polarity_o = pipe_rx_polarity_q;
197
        assign pipe_tx_compliance_o = pipe_tx_compliance_q;
198
        assign pipe_tx_char_is_k_o = pipe_tx_char_is_k_q;
199
        assign pipe_tx_data_o = pipe_tx_data_q;
200
        assign pipe_tx_elec_idle_o = pipe_tx_elec_idle_q;
201
        assign pipe_tx_powerdown_o = pipe_tx_powerdown_q;
202
 
203
      end else if (PIPE_PIPELINE_STAGES == 2) begin
204
 
205
        always @(posedge pipe_clk) begin
206
 
207
          if (rst_n) begin
208
 
209
            pipe_rx_char_is_k_q <= #TCQ 0;
210
            pipe_rx_data_q <= #TCQ 0;
211
            pipe_rx_valid_q <= #TCQ 0;
212
            pipe_rx_chanisaligned_q <= #TCQ 0;
213
            pipe_rx_status_q <= #TCQ 0;
214
            pipe_rx_phy_status_q <= #TCQ 0;
215
            pipe_rx_elec_idle_q <= #TCQ 0;
216
 
217
            pipe_rx_polarity_q <= #TCQ 0;
218
            pipe_tx_compliance_q <= #TCQ 0;
219
            pipe_tx_char_is_k_q <= #TCQ 0;
220
            pipe_tx_data_q <= #TCQ 0;
221
            pipe_tx_elec_idle_q <= #TCQ 1'b1;
222
            pipe_tx_powerdown_q <= #TCQ 2'b10;
223
 
224
            pipe_rx_char_is_k_qq <= #TCQ 0;
225
            pipe_rx_data_qq <= #TCQ 0;
226
            pipe_rx_valid_qq <= #TCQ 0;
227
            pipe_rx_chanisaligned_qq <= #TCQ 0;
228
            pipe_rx_status_qq <= #TCQ 0;
229
            pipe_rx_phy_status_qq <= #TCQ 0;
230
            pipe_rx_elec_idle_qq <= #TCQ 0;
231
 
232
            pipe_rx_polarity_qq <= #TCQ 0;
233
            pipe_tx_compliance_qq <= #TCQ 0;
234
            pipe_tx_char_is_k_qq <= #TCQ 0;
235
            pipe_tx_data_qq <= #TCQ 0;
236
            pipe_tx_elec_idle_qq <= #TCQ 1'b1;
237
            pipe_tx_powerdown_qq <= #TCQ 2'b10;
238
 
239
          end else begin
240
 
241
            pipe_rx_char_is_k_q <= #TCQ pipe_rx_char_is_k_i;
242
            pipe_rx_data_q <= #TCQ pipe_rx_data_i;
243
            pipe_rx_valid_q <= #TCQ pipe_rx_valid_i;
244
            pipe_rx_chanisaligned_q <= #TCQ pipe_rx_chanisaligned_i;
245
            pipe_rx_status_q <= #TCQ pipe_rx_status_i;
246
            pipe_rx_phy_status_q <= #TCQ pipe_rx_phy_status_i;
247
            pipe_rx_elec_idle_q <= #TCQ pipe_rx_elec_idle_i;
248
 
249
            pipe_rx_polarity_q <= #TCQ pipe_rx_polarity_i;
250
            pipe_tx_compliance_q <= #TCQ pipe_tx_compliance_i;
251
            pipe_tx_char_is_k_q <= #TCQ pipe_tx_char_is_k_i;
252
            pipe_tx_data_q <= #TCQ pipe_tx_data_i;
253
            pipe_tx_elec_idle_q <= #TCQ pipe_tx_elec_idle_i;
254
            pipe_tx_powerdown_q <= #TCQ pipe_tx_powerdown_i;
255
 
256
            pipe_rx_char_is_k_qq <= #TCQ pipe_rx_char_is_k_q;
257
            pipe_rx_data_qq <= #TCQ pipe_rx_data_q;
258
            pipe_rx_valid_qq <= #TCQ pipe_rx_valid_q;
259
            pipe_rx_chanisaligned_qq <= #TCQ pipe_rx_chanisaligned_q;
260
            pipe_rx_status_qq <= #TCQ pipe_rx_status_q;
261
            pipe_rx_phy_status_qq <= #TCQ pipe_rx_phy_status_q;
262
            pipe_rx_elec_idle_qq <= #TCQ pipe_rx_elec_idle_q;
263
 
264
            pipe_rx_polarity_qq <= #TCQ pipe_rx_polarity_q;
265
            pipe_tx_compliance_qq <= #TCQ pipe_tx_compliance_q;
266
            pipe_tx_char_is_k_qq <= #TCQ pipe_tx_char_is_k_q;
267
            pipe_tx_data_qq <= #TCQ pipe_tx_data_q;
268
            pipe_tx_elec_idle_qq <= #TCQ pipe_tx_elec_idle_q;
269
            pipe_tx_powerdown_qq <= #TCQ pipe_tx_powerdown_q;
270
 
271
          end
272
 
273
        end
274
 
275
        assign pipe_rx_char_is_k_o = pipe_rx_char_is_k_qq;
276
        assign pipe_rx_data_o = pipe_rx_data_qq;
277
        assign pipe_rx_valid_o = pipe_rx_valid_qq;
278
        assign pipe_rx_chanisaligned_o = pipe_rx_chanisaligned_qq;
279
        assign pipe_rx_status_o = pipe_rx_status_qq;
280
        assign pipe_rx_phy_status_o = pipe_rx_phy_status_qq;
281
        assign pipe_rx_elec_idle_o = pipe_rx_elec_idle_qq;
282
 
283
        assign pipe_rx_polarity_o = pipe_rx_polarity_qq;
284
        assign pipe_tx_compliance_o = pipe_tx_compliance_qq;
285
        assign pipe_tx_char_is_k_o = pipe_tx_char_is_k_qq;
286
        assign pipe_tx_data_o = pipe_tx_data_qq;
287
        assign pipe_tx_elec_idle_o = pipe_tx_elec_idle_qq;
288
        assign pipe_tx_powerdown_o = pipe_tx_powerdown_qq;
289
 
290
      end
291
 
292
    endgenerate
293
 
294
endmodule

powered by: WebSVN 2.1.0

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