Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: niu_ipp_1ke.v | |
4 | // Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
5 | // 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
6 | // | |
7 | // * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
8 | // | |
9 | // This program is free software; you can redistribute it and/or modify | |
10 | // it under the terms of the GNU General Public License as published by | |
11 | // the Free Software Foundation; version 2 of the License. | |
12 | // | |
13 | // This program is distributed in the hope that it will be useful, | |
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | // GNU General Public License for more details. | |
17 | // | |
18 | // You should have received a copy of the GNU General Public License | |
19 | // along with this program; if not, write to the Free Software | |
20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 | // | |
22 | // For the avoidance of doubt, and except that if any non-GPL license | |
23 | // choice is available it will apply instead, Sun elects to use only | |
24 | // the General Public License version 2 (GPLv2) at this time for any | |
25 | // software where a choice of GPL license versions is made | |
26 | // available with the language indicating that GPLv2 or any later version | |
27 | // may be used, or where a choice of which version of the GPL is applied is | |
28 | // otherwise unspecified. | |
29 | // | |
30 | // Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
31 | // CA 95054 USA or visit www.sun.com if you need additional information or | |
32 | // have any questions. | |
33 | // | |
34 | // ========== Copyright Header End ============================================ | |
35 | /********************************************************** | |
36 | *********************************************************** | |
37 | ||
38 | Project : Niu | |
39 | ||
40 | File name : niu_ipp_1ke.v | |
41 | ||
42 | Module(s) name : niu_ipp_1ke | |
43 | Original: : ipp.v main.70, label: IPP_VERIF_1.84 | |
44 | ||
45 | Parent modules : niu_ipp_top.v | |
46 | ||
47 | Child modules : niu_ipp_load.v, niu_ipp_slv.v, niu_ipp_lib.v, | |
48 | niu_ipp_hdr_fifo.v, niu_ipp_dat_fifo_1ke.v, niu_ipp_sum_unit.v, | |
49 | niu_ipp_unload_ctl_1ke.v, niu_ipp_unload_dat.v, niu_ipp_pkt_dsc.v, | |
50 | niu_ipp.h. | |
51 | ||
52 | Author's name : Jonathan Shen, George Chu | |
53 | ||
54 | Date : January. 2001 | |
55 | ||
56 | Description : Top level of single IPP. | |
57 | ||
58 | Synthesis Notes: | |
59 | ||
60 | Modification History: | |
61 | ||
62 | Date Description | |
63 | ---- ----------- | |
64 | ||
65 | ************************************************************ | |
66 | ***********************************************************/ | |
67 | /* top level of single ipp block*/ | |
68 | ||
69 | module niu_ipp_1ke ( | |
70 | `ifdef NEPTUNE | |
71 | `else | |
72 | tcu_aclk, | |
73 | tcu_bclk, | |
74 | tcu_scan_en, | |
75 | tcu_se_scancollar_in, | |
76 | tcu_se_scancollar_out, | |
77 | tcu_array_wr_inhibit, | |
78 | hdr_sram_rvalue, | |
79 | hdr_sram_rid, | |
80 | hdr_sram_wr_en, | |
81 | hdr_sram_red_clr, | |
82 | sram_hdr_read_data, | |
83 | iol2clk, | |
84 | l2clk_2x, | |
85 | ||
86 | mbi_prebuf_header_wdata, | |
87 | mbi_prebuf_header_rd_addr, | |
88 | mbi_prebuf_header_wr_addr, | |
89 | mbi_prebuf_header_wr_en, | |
90 | mbi_prebuf_header_rd_en, | |
91 | mbi_prebuf_header_run, | |
92 | mbi_prebuf_header_scan_in, | |
93 | mbi_prebuf_header_scan_out, | |
94 | mbi_prebuf_header_data_out, | |
95 | ||
96 | mbi_rx_data_fifo_wdata, | |
97 | mbi_rx_data_fifo_rd_addr, | |
98 | mbi_rx_data_fifo_wr_addr, | |
99 | mbi_rx_data_fifo_wr_en, | |
100 | mbi_rx_data_fifo_rd_en, | |
101 | mbi_rx_data_fifo_run, | |
102 | mbi_rx_data_fifo_scan_in, | |
103 | mbi_rx_data_fifo_scan_out, | |
104 | mbi_rx_data_fifo_data_out, | |
105 | `endif | |
106 | ||
107 | // mac(xmac) interface | |
108 | mac_ipp_req, | |
109 | xmac_ipp_ack, | |
110 | mac_ipp_tag, | |
111 | mac_ipp_data, | |
112 | mac_ipp_ctrl, | |
113 | mac_ipp_stat, | |
114 | ipp_mac_ack, | |
115 | ipp_xmac_req, | |
116 | ||
117 | // ffl interface | |
118 | ffl_ipp_dvalid, | |
119 | ffl_ipp_data, | |
120 | ffl_ipp_ready, | |
121 | ipp_ffl_dvalid, | |
122 | ipp_ffl_data, | |
123 | ipp_ffl_mac_default, | |
124 | ||
125 | // dmc interface | |
126 | dmc_ipp_dat_req, | |
127 | ipp_dmc_dat_ack, | |
128 | ipp_dmc_data, | |
129 | ipp_dmc_ful_pkt, | |
130 | ipp_dmc_dat_err, | |
131 | ||
132 | // ffl_arb interface | |
133 | ipp_ffl_req, | |
134 | ffl_arb_ack, | |
135 | ||
136 | // cpu (ht) interface | |
137 | ipp_pio_sel, | |
138 | ipp_pio_addr, | |
139 | ipp_pio_rd, | |
140 | ipp_pio_wdata, | |
141 | ipp_pio_ack, | |
142 | ipp_pio_rdata, | |
143 | ipp_pio_err, | |
144 | ipp_pio_intr, | |
145 | ipp_debug, | |
146 | debug_out_ena, | |
147 | ||
148 | // global | |
149 | xmac_mode, | |
150 | port_id, | |
151 | clk, | |
152 | reset | |
153 | ); // end of pin definition | |
154 | ||
155 | `ifdef NEPTUNE | |
156 | `else | |
157 | input tcu_aclk; | |
158 | input tcu_bclk; | |
159 | input tcu_scan_en; | |
160 | input tcu_se_scancollar_in; | |
161 | input tcu_se_scancollar_out; | |
162 | input tcu_array_wr_inhibit; | |
163 | ||
164 | input [6:0] hdr_sram_rvalue; | |
165 | input [2:0] hdr_sram_rid; | |
166 | input hdr_sram_wr_en; | |
167 | input hdr_sram_red_clr; | |
168 | output [6:0] sram_hdr_read_data; | |
169 | ||
170 | input iol2clk; | |
171 | input l2clk_2x; | |
172 | ||
173 | input [7:0] mbi_prebuf_header_wdata; | |
174 | input [5:0] mbi_prebuf_header_rd_addr; | |
175 | input [5:0] mbi_prebuf_header_wr_addr; | |
176 | input mbi_prebuf_header_wr_en; | |
177 | input mbi_prebuf_header_rd_en; | |
178 | input mbi_prebuf_header_run; | |
179 | input mbi_prebuf_header_scan_in; | |
180 | output mbi_prebuf_header_scan_out; | |
181 | output [145:0] mbi_prebuf_header_data_out; | |
182 | ||
183 | input [7:0] mbi_rx_data_fifo_wdata; | |
184 | input [9:0] mbi_rx_data_fifo_rd_addr; | |
185 | input [9:0] mbi_rx_data_fifo_wr_addr; | |
186 | input mbi_rx_data_fifo_wr_en; | |
187 | input mbi_rx_data_fifo_rd_en; | |
188 | input mbi_rx_data_fifo_run; | |
189 | input mbi_rx_data_fifo_scan_in; | |
190 | output mbi_rx_data_fifo_scan_out; | |
191 | output [145:0] mbi_rx_data_fifo_data_out; | |
192 | `endif | |
193 | ||
194 | // input from mac | |
195 | input mac_ipp_req; // bmac sends the request to ipp | |
196 | input xmac_ipp_ack; // xmac sends the ack to ipp | |
197 | input mac_ipp_tag; // mac identifies the last part packet | |
198 | input [63:0] mac_ipp_data; // mac writing the data to ipp | |
199 | input mac_ipp_ctrl; // active high for control information | |
200 | input [22:0] mac_ipp_stat; // mac writing the status to ipp | |
201 | ||
202 | // input from ffl | |
203 | input ffl_ipp_ready; // ffl ready to take header | |
204 | input ffl_ipp_dvalid; // which port's parsed data is valid | |
205 | input [13:0] ffl_ipp_data; // parsed packet header information | |
206 | ||
207 | // input from dmc | |
208 | input dmc_ipp_dat_req; // dmc request data from ipp_data_fifo | |
209 | ||
210 | // input from ffl_arb | |
211 | input ffl_arb_ack; | |
212 | ||
213 | // input from cpu (ht) | |
214 | input ipp_pio_sel; // behaves like req | |
215 | `ifdef NEPTUNE | |
216 | input [13:0] ipp_pio_addr; // addr for slave | |
217 | `else | |
218 | input [14:0] ipp_pio_addr; // addr for slave | |
219 | `endif | |
220 | input ipp_pio_rd; // 1: rd; 0: wr. | |
221 | input [31:0] ipp_pio_wdata; // wr data bus | |
222 | ||
223 | // input grobal | |
224 | input xmac_mode; | |
225 | input [1:0] port_id; | |
226 | input clk; | |
227 | input reset; | |
228 | ||
229 | // output to mac | |
230 | output ipp_mac_ack; // ack from ipp to bmac | |
231 | output ipp_xmac_req; // req(as rdy) from ipp to xmac | |
232 | ||
233 | // output to ffl | |
234 | output ipp_ffl_dvalid; // valid data from ipp to ffl | |
235 | output [127:0] ipp_ffl_data; // ipp sends a packet's header data | |
236 | output [11:0] ipp_ffl_mac_default; // default value of mac addr table | |
237 | ||
238 | // output to dmc | |
239 | output ipp_dmc_dat_ack; | |
240 | output [129:0] ipp_dmc_data; | |
241 | output ipp_dmc_ful_pkt; | |
242 | output ipp_dmc_dat_err; | |
243 | ||
244 | // output to ffl_arb | |
245 | output ipp_ffl_req; // packet header data is valid | |
246 | ||
247 | // output to pio | |
248 | output ipp_pio_ack; // ack from nrx | |
249 | output [31:0] ipp_pio_rdata; // rd data bus | |
250 | output ipp_pio_err; | |
251 | output ipp_pio_intr; | |
252 | output [31:0] ipp_debug; | |
253 | output debug_out_ena; | |
254 | ||
255 | /*****************************************************************************/ | |
256 | wire ipp_dmc_dat_ack; | |
257 | wire [129:0] ipp_dmc_data; | |
258 | wire ipp_dmc_ful_pkt; | |
259 | wire ipp_dmc_dat_err; | |
260 | ||
261 | // from slave | |
262 | wire reset2; | |
263 | wire [31:0] ipp_debug; | |
264 | wire [24:0] config_reg; | |
265 | wire ipp_ecc_corrupt_sop; | |
266 | wire ipp_ecc_corrupt_2nd; | |
267 | wire ipp_ecc_corrupt_eop; | |
268 | wire ipp_ecc_corrupt_sing; | |
269 | wire ipp_ecc_corrupt_doub; | |
270 | wire ipp_ecc_corrupt_no_uncor; | |
271 | wire ecc_pkt_corrupted_clr; | |
272 | wire ipp_enable = config_reg[0]; | |
273 | wire debug_out_ena = config_reg[1]; | |
274 | wire dfifo_ecc_correct_en = config_reg[2]; | |
275 | wire ipp_hfifo_par_err_inc_en = config_reg[3]; | |
276 | wire pio_cksum_ena = config_reg[4]; | |
277 | wire datfifo_pio_wr_ena = config_reg[5]; | |
278 | wire ippfifo_rd_wr_ptr_bypass = config_reg[6]; // to ipp_load | |
279 | wire bypass_ffl = config_reg[7]; | |
280 | wire [16:0] ipp_max_bytes = config_reg[24:8]; | |
281 | wire pio_full_cksum = 1'h0; // geo: pio directly selects, No need | |
282 | ||
283 | wire xmac_mode; //1: xmac, 0: big mac; | |
284 | ||
285 | wire ippfifo_rd_ptr_pio_wr_en; // from slave to ipp_load | |
286 | wire ippfifo_wr_ptr_pio_wr_en; // from slave to ipp_load | |
287 | ||
288 | wire dfifo_wt_data_reg_wr_en_pls; | |
289 | wire dfifo_rd_ptr_pio_wr_en; | |
290 | wire dfifo_wt_ptr_pio_wr_en; | |
291 | ||
292 | wire mac_ipp_req; // from ipp to ipp_slv | |
293 | wire xmac_ipp_ack; // from ipp to ipp_slv | |
294 | wire mac_ipp_tag; // from ipp to ipp_slv | |
295 | wire [63:0] mac_ipp_data; // from ipp to ipp_slv | |
296 | wire mac_ipp_ctrl; // from ipp to ipp_slv | |
297 | wire [22:0] mac_ipp_stat; // from ipp to ipp_slv | |
298 | wire ipp_mac_ack; // from ipp to ipp_slv | |
299 | wire ipp_xmac_req; // from ipp to ipp_slv | |
300 | ||
301 | wire [129:0] fifo_wr_data_reg; | |
302 | wire fifo_wr_data_reg_wr_en_pls; | |
303 | ||
304 | wire vec_cycle1_wr_en; // geo: this is for pio programming fflp_ipp_sum | |
305 | ||
306 | wire rst_ipp_en; | |
307 | wire wr_ipp_en_bit0; | |
308 | ||
309 | // from state machine | |
310 | wire [2:0] phase_state_xmac; | |
311 | wire [2:0] phase_state; | |
312 | wire phase_state_1st_data; | |
313 | wire [3:0] mac_ack_fsm_curstate; | |
314 | wire [1:0] ipp_ffl_curstate; | |
315 | wire [1:0] tag_fsm_curstate; | |
316 | wire [1:0] ipp_en_rst_fsm_curstate; | |
317 | ||
318 | wire [31:0] ipp_pio_rdata; | |
319 | // end of slave module | |
320 | ||
321 | // from ipp_pkt_dsc | |
322 | wire ipp_dsc_pkt; | |
323 | wire ipp_inc_pkt_dsc_cnt; | |
324 | ||
325 | // from sum_unit | |
326 | wire sum_prt_started; | |
327 | wire sum_prt_valid; | |
328 | wire sum_prt_fail; | |
329 | wire [15:0] sum_prt_cksum; | |
330 | wire [15:0] sum_prt_length; | |
331 | wire [31:0] sum_prt_state; | |
332 | ||
333 | // from ipp_load | |
334 | wire ipp_hfifo_wten; | |
335 | wire [6:0] ipp_hfifo_wptr; | |
336 | wire ipp_hfifo_rden; | |
337 | wire [5:0] ipp_hfifo_rptr; | |
338 | wire ipp_hfifo_dat_empty; | |
339 | wire ipp_hfifo_over_run_r; | |
340 | wire ipp_hfifo_under_run_r; | |
341 | wire [1:0] port_id; | |
342 | wire ipp_ffl_dvalid_n; | |
343 | wire runt; | |
344 | wire [6:0] cur_pkt_hdr_base_ptr; | |
345 | wire [13:0] cur_pkt_ffl_sum_info; | |
346 | ||
347 | // from ipp_hdr_fifo | |
348 | wire [145:0] ipp_hfifo_dout; | |
349 | wire ipp_hfifo_par_err; | |
350 | wire [5:0] ipp_hfifo_par_addr; | |
351 | wire ipp_hfifo_par_err_inc = ipp_hfifo_par_err && ipp_hfifo_par_err_inc_en; | |
352 | ||
353 | // from ipp_unload_ctl | |
354 | wire [129:0] ipp_hfifo_dinp; | |
355 | wire inc_hfifo_dat_rptr; | |
356 | wire inc_hfifo_dat_rptr_d; | |
357 | wire [6:0] ipp_hfifo_dat_rptr; | |
358 | wire [1:0] ipp_hfifo_dat_tag_rd; | |
359 | wire [10:0] ipp_dfifo_wptr; // addr[9:0] of 16k-byte data, 1k entries, + 1_wrap | |
360 | wire ipp_dfifo_wten; | |
361 | wire ipp_dfifo_wten_2nd; | |
362 | wire ipp_dfifo_rden; | |
363 | wire [10:0] ipp_dfifo_rptr; // addr[9:0] of 16k-byte data, 1k entries, + 1_wrap | |
364 | wire ipp_dfifo_full; | |
365 | wire wt_dfifo_1st_wd; | |
366 | wire [11:0] addr_status; | |
367 | wire ipp_full_cksum; | |
368 | wire ipp_start_tcp; | |
369 | wire ipp_sum_info_vld; | |
370 | wire req_rd_dfifo_eop; // geo: may NOT need | |
371 | wire req_rd_dfifo_sop; // geo: may NOT need | |
372 | wire [1:0] ipp_la2_opti; | |
373 | wire [1:0] ipp_la3_vers; | |
374 | wire [3:0] ip4_hdr_leng; | |
375 | wire [1:0] ipp_la4_prot; | |
376 | wire clr_ipp_unload; | |
377 | wire fwd_posting_dn = clr_ipp_unload; | |
378 | wire n_ipp_unload_idle; | |
379 | wire fet_pio_tcp_ena; | |
380 | wire dfifo_miss_eop; | |
381 | wire dfifo_miss_sop; | |
382 | wire [4:0] c_unload_st; | |
383 | ||
384 | // from ipp_unload_dat | |
385 | wire [129:0] ipp_dfifo_dinp; | |
386 | wire sum_prt_fail_act = sum_prt_fail && ipp_full_cksum && fet_pio_tcp_ena; | |
387 | ||
388 | // from ipp_dat_fifo | |
389 | wire [1:0] ipp_dfifo_dout0_tag; | |
390 | wire [129:0] ipp_dfifo_dout1; | |
391 | wire [31:0] ipp_dfifo_dout1_ecc; | |
392 | wire [15:0] ipp_dfifo_dout1_ecc_syn; | |
393 | wire ipp_dmc_dat_err1; | |
394 | wire ecc_pkt_corrupted; | |
395 | ||
396 | // from ipp_slv | |
397 | wire [1:0] rd_eop; //10: eop, data; 11: stat, eop | |
398 | wire [1:0] rd_stat; //01: null, stat; 11: stat, eop | |
399 | ||
400 | wire [145:0] fifo_data_out = inc_hfifo_dat_rptr_d ? ipp_hfifo_dout[145:0] : 146'h0; // geo | |
401 | ||
402 | wire rd_abort_occ = (rd_stat[1:0] == 2'b01) ? | |
403 | fifo_data_out[15] : | |
404 | ((rd_stat[1:0] == 2'b11) ? | |
405 | fifo_data_out[79] : 1'b0); | |
406 | ||
407 | wire rd_abort; | |
408 | ipp_RSFF RSFF_abortOc (.reset(reset), .clk(clk), .set(rd_abort_occ), | |
409 | .rst(fwd_posting_dn), .Q(rd_abort)); | |
410 | ||
411 | wire bad_crc_occ = (rd_stat[1:0] == 2'b01) ? | |
412 | fifo_data_out[14] : | |
413 | ((rd_stat[1:0] == 2'b11) ? | |
414 | fifo_data_out[78] : 1'b0); | |
415 | ||
416 | wire bad_crc; | |
417 | ipp_RSFF RSFF_bad_crcOc (.reset(reset), .clk(clk), .set(bad_crc_occ), | |
418 | .rst(fwd_posting_dn), .Q(bad_crc)); | |
419 | ||
420 | wire drop_bad_crc = bad_crc; | |
421 | ||
422 | // for fifo_data_out | |
423 | reg [145:0] fifo_data_out_reg; // for ipp_slv | |
424 | ||
425 | always @(posedge clk) | |
426 | if (reset) | |
427 | fifo_data_out_reg[145:0] <= 146'h0; | |
428 | else | |
429 | //g:fifo_data_out_reg[145:0] <= fifo_data_out[145:0]; | |
430 | fifo_data_out_reg[145:0] <= ipp_hfifo_dout[145:0]; | |
431 | ||
432 | /***** ipp_ffl hand-shaking *****/ | |
433 | wire [127:0] ipp_ffl_data = ipp_hfifo_dout[127:0]; | |
434 | wire eop_from_hdr_fifo = ipp_hfifo_dout[129]; | |
435 | ||
436 | //****** Phase Monitor at IPP fifo data out point ****** | |
437 | // Generating rd_eop, rd_status | |
438 | wire /* geo */ fifo_rd_en_reg = inc_hfifo_dat_rptr_d; // 1 cycle delay of fifo_rd_en; no rd advance | |
439 | ||
440 | wire [1:0] ipp_fifo_rd_tag; | |
441 | assign ipp_fifo_rd_tag[1:0] = {fifo_rd_en_reg & fifo_data_out[129], | |
442 | fifo_rd_en_reg & fifo_data_out[128]}; | |
443 | ||
444 | /******************************* Instantiation *******************************/ | |
445 | ||
446 | // geo: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NIU ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
447 | ||
448 | //VCS coverage off | |
449 | // synopsys translate_off | |
450 | // from fflp_driver | |
451 | wire dmc_sum_prt_fail; | |
452 | wire [15:0] dmc_sum_prt_cksum; | |
453 | wire [31:0] dmc_sum_prt_state; | |
454 | wire dmc_sum_prt_valid; | |
455 | ||
456 | niu_ipp_dmc_checker ipp_dmc_checker_0 ( | |
457 | .ipp_dmc_data (ipp_dmc_data[129:0]), | |
458 | .ipp_dmc_dat_ack (ipp_dmc_dat_ack), | |
459 | .ipp_dmc_ful_pkt (ipp_dmc_ful_pkt), | |
460 | .reset (reset), | |
461 | .clk (clk), | |
462 | .dmc_ipp_dat_req (), | |
463 | .dmc_sum_prt_fail (dmc_sum_prt_fail), | |
464 | .dmc_sum_prt_cksum (dmc_sum_prt_cksum[15:0]), | |
465 | .dmc_sum_prt_state (dmc_sum_prt_state[31:0]), | |
466 | .dmc_sum_prt_valid (dmc_sum_prt_valid)); | |
467 | // synopsys translate_on | |
468 | //VCS coverage on | |
469 | ||
470 | // --------------------------------------------------------------------------- | |
471 | niu_ipp_pkt_dsc ipp_pkt_dsc_0 ( | |
472 | .ipp_hfifo_par_err_inc (ipp_hfifo_par_err_inc), | |
473 | .ipp_runt (runt), | |
474 | .clr_ipp_unload (clr_ipp_unload), | |
475 | .reset (reset), | |
476 | .clk (clk), | |
477 | .ipp_dsc_pkt (ipp_dsc_pkt), | |
478 | .ipp_inc_pkt_dsc_cnt (ipp_inc_pkt_dsc_cnt) | |
479 | ); | |
480 | ||
481 | reg ipp_sum_info_vld_d; | |
482 | reg ipp_start_tcp_d; | |
483 | reg ipp_hfifo_dat_tag_rd1_d; | |
484 | ||
485 | always @(posedge clk) | |
486 | if (reset) begin | |
487 | ipp_sum_info_vld_d <= 1'h0; | |
488 | ipp_start_tcp_d <= 1'h0; | |
489 | ipp_hfifo_dat_tag_rd1_d <= 1'h0; | |
490 | end | |
491 | else begin | |
492 | ipp_sum_info_vld_d <= ipp_sum_info_vld; | |
493 | ipp_start_tcp_d <= ipp_start_tcp; | |
494 | ipp_hfifo_dat_tag_rd1_d <= ipp_hfifo_dat_tag_rd[1]; | |
495 | end | |
496 | ||
497 | niu_ipp_sum_unit sum_unit_0 ( | |
498 | .ipp_din_dat (fifo_data_out_reg[127:0]), | |
499 | .port_num (1'h1 /* geo */), | |
500 | .ipp_full_cksum (1'h1 /* rxc */), | |
501 | .ipp_la4_prot (ipp_la4_prot[1:0]), | |
502 | .ipp_la3_vers (ipp_la3_vers[1:0]), | |
503 | .ipp_la2_opti (ipp_la2_opti[1:0]), | |
504 | .ip4_hdr_leng (ip4_hdr_leng[3:0]), | |
505 | .ipp_info_valid (ipp_sum_info_vld_d), | |
506 | .ipp_start_tcp (ipp_start_tcp_d), | |
507 | .ipp_pkt_end (ipp_hfifo_dat_tag_rd1_d), | |
508 | .ipp_max_bytes (ipp_max_bytes[16:0]), | |
509 | .reset (reset2), | |
510 | .clk (clk), | |
511 | .sum_prt_started (sum_prt_started), | |
512 | .sum_prt_valid (sum_prt_valid), | |
513 | .sum_prt_fail (sum_prt_fail), | |
514 | .sum_prt_cksum (sum_prt_cksum[15:0]), | |
515 | .sum_prt_length (sum_prt_length[15:0]), | |
516 | .sum_prt_state (sum_prt_state[31:0]) | |
517 | ); | |
518 | /* Zin memacc | |
519 | -read_addr ipp_hfifo_dat_rptr[5:0] | |
520 | -read inc_hfifo_dat_rptr_d | |
521 | -write_addr ipp_hfifo_wptr[5:0] | |
522 | -write ipp_hfifo_wten | |
523 | -single_access | |
524 | -read_data ipp_hfifo_dout | |
525 | -write_data ipp_hfifo_dinp | |
526 | -latency 1 | |
527 | -message "test ipp_ffl_hdr_fifo_146x64 FIFO" | |
528 | */ | |
529 | ||
530 | `ifdef NEPTUNE | |
531 | `else | |
532 | wire [6:0] sram_hdr_read_data; | |
533 | wire mbi_prebuf_header_scan_out; | |
534 | wire mbi_rx_data_fifo_scan_out; | |
535 | wire [145:0] mbi_prebuf_header_data_out = ipp_hfifo_dout[145:0]; | |
536 | wire [145:0] mbi_rx_data_fifo_data_out; | |
537 | wire [145:0] mbi_prebuf_header_wdata_146 = {mbi_prebuf_header_wdata[1:0],{18{mbi_prebuf_header_wdata}}}; | |
538 | wire [145:0] mbi_rx_data_fifo_wdata_146 = {mbi_rx_data_fifo_wdata[1:0], {18{mbi_rx_data_fifo_wdata}}}; | |
539 | `endif | |
540 | ||
541 | niu_ipp_hdr_fifo ipp_hdr_fifo_0 ( | |
542 | `ifdef NEPTUNE | |
543 | `else | |
544 | .iol2clk (iol2clk), | |
545 | .tcu_aclk (tcu_aclk), | |
546 | .tcu_bclk (tcu_bclk), | |
547 | .tcu_se_scancollar_in (tcu_se_scancollar_in), | |
548 | .tcu_array_wr_inhibit (tcu_array_wr_inhibit), | |
549 | .scan_in (mbi_prebuf_header_scan_in), | |
550 | .scan_out (mbi_prebuf_header_scan_out), | |
551 | .mbi_wdata (mbi_prebuf_header_wdata_146), | |
552 | .mbi_rd_adr (mbi_prebuf_header_rd_addr), | |
553 | .mbi_wr_adr (mbi_prebuf_header_wr_addr), | |
554 | .mbi_wr_en (mbi_prebuf_header_wr_en), | |
555 | .mbi_rd_en (mbi_prebuf_header_rd_en), | |
556 | .mbi_run (mbi_prebuf_header_run), | |
557 | `endif | |
558 | .ipp_hfifo_rden (ipp_hfifo_rden), | |
559 | .ipp_hfifo_rptr (ipp_hfifo_rptr[5:0]), | |
560 | .ipp_hfifo_wptr (ipp_hfifo_wptr[5:0]), | |
561 | .ipp_hfifo_wten (ipp_hfifo_wten), | |
562 | .ipp_hfifo_dinp (ipp_hfifo_dinp[129:0]), | |
563 | .inc_hfifo_dat_rptr_d (inc_hfifo_dat_rptr_d), | |
564 | .ipp_ffl_dvalid_n (ipp_ffl_dvalid_n), | |
565 | .clr_ipp_hfifo_par_err (clr_ipp_unload), | |
566 | .reset (reset), | |
567 | .clk (clk), | |
568 | .ipp_hfifo_dout (ipp_hfifo_dout[145:0]), | |
569 | .ipp_hfifo_par_err (ipp_hfifo_par_err), | |
570 | .ipp_hfifo_par_addr (ipp_hfifo_par_addr[5:0]) | |
571 | ); | |
572 | ||
573 | niu_ipp_load ipp_load( | |
574 | // input signals | |
575 | .clk(clk), | |
576 | .reset(reset2), | |
577 | .mac_ipp_req(mac_ipp_req), | |
578 | .xmac_ipp_ack(xmac_ipp_ack), | |
579 | .mac_ipp_data(mac_ipp_data), | |
580 | .mac_ipp_tag(mac_ipp_tag), | |
581 | .mac_ipp_ctrl(mac_ipp_ctrl), | |
582 | .mac_ipp_stat(mac_ipp_stat), | |
583 | .ffl_ipp_ready(ffl_ipp_ready), | |
584 | .ffl_ipp_dvalid(ffl_ipp_dvalid), | |
585 | .fflp_ipp_sum (ffl_ipp_data[13:0]), | |
586 | .ffl_arb_ack(ffl_arb_ack), | |
587 | .port_id(port_id), | |
588 | .ippfifo_rd_wr_ptr_bypass(ippfifo_rd_wr_ptr_bypass), | |
589 | .ippfifo_wr_ptr_pio_wr_en(ippfifo_wr_ptr_pio_wr_en), | |
590 | .eop_from_hdr_fifo(eop_from_hdr_fifo), | |
591 | .pio_wr_data (ipp_pio_wdata[13:0]), | |
592 | .fifo_wr_data_reg(fifo_wr_data_reg), | |
593 | .fifo_wr_data_reg_wr_en_pls(fifo_wr_data_reg_wr_en_pls), | |
594 | .ipp_enable(ipp_enable), | |
595 | .xmac_mode(xmac_mode), | |
596 | .bypass_ffl (bypass_ffl), | |
597 | .vec_cycle1_wr_en (vec_cycle1_wr_en), | |
598 | .inc_hfifo_dat_rptr (inc_hfifo_dat_rptr), | |
599 | .ipp_hfifo_dat_rptr (ipp_hfifo_dat_rptr[6:0]), | |
600 | .n_ipp_unload_idle (n_ipp_unload_idle), | |
601 | .clr_ipp_unload (clr_ipp_unload), | |
602 | // output signals | |
603 | .ipp_mac_ack(ipp_mac_ack), | |
604 | .ipp_xmac_req(ipp_xmac_req), | |
605 | .ipp_ffl_dvalid(ipp_ffl_dvalid), | |
606 | .ipp_ffl_dvalid_n(ipp_ffl_dvalid_n), | |
607 | .runt(runt), | |
608 | .ipp_ffl_mac_default(ipp_ffl_mac_default), | |
609 | .ipp_ffl_req(ipp_ffl_req), | |
610 | .fifo_wr_en (ipp_hfifo_wten), | |
611 | .fifo_wr_ptr (ipp_hfifo_wptr[6:0]), | |
612 | .ipp_hfifo_rden (ipp_hfifo_rden), | |
613 | .ipp_hfifo_rptr (ipp_hfifo_rptr[5:0]), | |
614 | .ipp_hfifo_dat_empty (ipp_hfifo_dat_empty), | |
615 | .fifo_data_in (ipp_hfifo_dinp[129:0]), | |
616 | .ipp_hfifo_over_run_r (ipp_hfifo_over_run_r), | |
617 | .ipp_hfifo_under_run_r (ipp_hfifo_under_run_r), | |
618 | .phase_state_xmac(phase_state_xmac), | |
619 | .phase_state(phase_state), | |
620 | .phase_state_1st_data(phase_state_1st_data), | |
621 | .mac_ack_fsm_curstate(mac_ack_fsm_curstate), | |
622 | .ipp_ffl_curstate(ipp_ffl_curstate), | |
623 | .cur_pkt_hdr_base_ptr (cur_pkt_hdr_base_ptr[6:0]), | |
624 | .cur_pkt_ffl_sum_info (cur_pkt_ffl_sum_info[13:0]) | |
625 | ); // end of ipp_load | |
626 | ||
627 | niu_ipp_unload_ctl_1ke ipp_unload_ctl_1ke_0 ( | |
628 | .ipp_ffl_dvalid_n (ipp_ffl_dvalid_n), | |
629 | .cur_pkt_hdr_base_ptr (cur_pkt_hdr_base_ptr[6:0]), | |
630 | .cur_pkt_ffl_sum_info (cur_pkt_ffl_sum_info[9:0]), | |
631 | .ipp_hfifo_dat_tag (ipp_hfifo_dout[129:128]), | |
632 | .ipp_hfifo_dat_empty (ipp_hfifo_dat_empty), | |
633 | .ipp_dfifo_dout_tag (ipp_dfifo_dout0_tag[1:0]), | |
634 | .ipp_dmc_dat_err1 (ipp_dmc_dat_err1), | |
635 | .sum_prt_valid (sum_prt_valid), | |
636 | .dmc_ipp_dat_req (dmc_ipp_dat_req), | |
637 | .pio_cksum_ena (pio_cksum_ena), | |
638 | .pio_full_cksum (pio_full_cksum), | |
639 | .ipp_enable (ipp_enable), | |
640 | .ippfifo_rd_wr_ptr_bypass (ippfifo_rd_wr_ptr_bypass), | |
641 | .ippfifo_rd_ptr_pio_wr_en (ippfifo_rd_ptr_pio_wr_en), | |
642 | .datfifo_pio_wr_ena (datfifo_pio_wr_ena), | |
643 | .dfifo_rd_ptr_pio_wr_en (dfifo_rd_ptr_pio_wr_en), | |
644 | .dfifo_wt_ptr_pio_wr_en (dfifo_wt_ptr_pio_wr_en), | |
645 | .dfifo_wt_data_reg_wr_en_pls (dfifo_wt_data_reg_wr_en_pls), | |
646 | .ipp_pio_wdata (ipp_pio_wdata[10:0]), | |
647 | .reset (reset2), | |
648 | .clk (clk), | |
649 | .inc_hfifo_dat_rptr (inc_hfifo_dat_rptr), | |
650 | .inc_hfifo_dat_rptr_d (inc_hfifo_dat_rptr_d), | |
651 | .ipp_hfifo_dat_rptr (ipp_hfifo_dat_rptr[6:0]), | |
652 | .ipp_hfifo_dat_tag_rd (ipp_hfifo_dat_tag_rd[1:0]), | |
653 | .ipp_dfifo_wptr (ipp_dfifo_wptr[10:0]), | |
654 | .ipp_dfifo_wten (ipp_dfifo_wten), | |
655 | .ipp_dfifo_wten_2nd (ipp_dfifo_wten_2nd), | |
656 | .ipp_dfifo_rden (ipp_dfifo_rden), | |
657 | .ipp_dfifo_rptr (ipp_dfifo_rptr[10:0]), | |
658 | .ipp_dfifo_full (ipp_dfifo_full), | |
659 | .wt_dfifo_1st_wd (wt_dfifo_1st_wd), | |
660 | .addr_status (addr_status[11:0]), | |
661 | .ipp_dmc_dat_ack (ipp_dmc_dat_ack), | |
662 | .ipp_dmc_ful_pkt (ipp_dmc_ful_pkt), | |
663 | .ipp_full_cksum (ipp_full_cksum), | |
664 | .ipp_start_tcp (ipp_start_tcp), | |
665 | .ipp_sum_info_vld (ipp_sum_info_vld), | |
666 | .req_rd_dfifo_eop (req_rd_dfifo_eop), | |
667 | .req_rd_dfifo_sop (req_rd_dfifo_sop), | |
668 | .ipp_la2_opti (ipp_la2_opti[1:0]), | |
669 | .ipp_la3_vers (ipp_la3_vers[1:0]), | |
670 | .ip4_hdr_leng (ip4_hdr_leng[3:0]), | |
671 | .ipp_la4_prot (ipp_la4_prot[1:0]), | |
672 | .clr_ipp_unload (clr_ipp_unload), | |
673 | .n_ipp_unload_idle (n_ipp_unload_idle), | |
674 | .fet_pio_tcp_ena (fet_pio_tcp_ena), | |
675 | .dfifo_miss_eop (dfifo_miss_eop), | |
676 | .dfifo_miss_sop (dfifo_miss_sop), | |
677 | .c_unload_st (c_unload_st[4:0]) | |
678 | ); | |
679 | ||
680 | niu_ipp_unload_dat ipp_unload_dat_0 ( | |
681 | .ipp_hfifo_dat_dout (ipp_hfifo_dout[129:0]), | |
682 | .inc_hfifo_dat_rptr_d (inc_hfifo_dat_rptr_d), | |
683 | .ipp_hfifo_dat_tag_rd (rd_stat /* geo: ipp_hfifo_dat_tag_rd[1:0] */), | |
684 | .wt_dfifo_1st_wd (wt_dfifo_1st_wd), | |
685 | .cur_pkt_ffl_sum_info (cur_pkt_ffl_sum_info[13:0]), | |
686 | .ipp_dsc_pkt (ipp_dsc_pkt), | |
687 | .mac_drop_bad_crc (1'h0 /* geo: drop_bad_crc */), | |
688 | .status_rd_abort (rd_abort), | |
689 | .ipp_hfifo_over_run_r (1'h0 /* geo: ipp_hfifo_over_run_r */), | |
690 | .ipp_hfifo_under_run_r (1'h0 /* geo: ipp_hfifo_under_run_r */), | |
691 | .ipp_hfifo_par_err (1'h0 /* geo: ipp_hfifo_par_err */), | |
692 | .fet_pio_tcp_ena (fet_pio_tcp_ena), | |
693 | .ipp_full_cksum (ipp_full_cksum), | |
694 | .sum_prt_cksum (sum_prt_cksum[15:0]), | |
695 | .sum_prt_length (sum_prt_length[15:0]), | |
696 | .sum_prt_fail (sum_prt_fail_act), | |
697 | `ifdef NEPTUNE .addr_status (12'h0 /* geo: addr_status[11:0] */), | |
698 | `else .addr_status (addr_status[11:0]), | |
699 | `endif | |
700 | .datfifo_pio_wr_ena (datfifo_pio_wr_ena), | |
701 | .dfifo_wt_data_reg (fifo_wr_data_reg[129:0]), | |
702 | .clr_ipp_unload (clr_ipp_unload), | |
703 | .reset (reset), | |
704 | .clk (clk), | |
705 | .ipp_dfifo_dinp (ipp_dfifo_dinp[129:0]) | |
706 | ); | |
707 | ||
708 | niu_ipp_dat_fifo_1ke ipp_dat_fifo_1ke_0 ( | |
709 | `ifdef NEPTUNE | |
710 | `else .tcu_aclk (tcu_aclk), | |
711 | .tcu_bclk (tcu_bclk), | |
712 | .tcu_scan_en (tcu_scan_en), | |
713 | .tcu_se_scancollar_in (tcu_se_scancollar_in), | |
714 | .tcu_se_scancollar_out (tcu_se_scancollar_out), | |
715 | .tcu_array_wr_inhibit (tcu_array_wr_inhibit), | |
716 | .scan_in (mbi_rx_data_fifo_scan_in), | |
717 | .scan_out (mbi_rx_data_fifo_scan_out), | |
718 | .hdr_sram_rvalue (hdr_sram_rvalue[6:0]), | |
719 | .hdr_sram_rid (hdr_sram_rid[2:0]), | |
720 | .hdr_sram_wr_en (hdr_sram_wr_en), | |
721 | .hdr_sram_red_clr (hdr_sram_red_clr), | |
722 | .sram_hdr_read_data (sram_hdr_read_data[6:0]), | |
723 | .iol2clk (iol2clk), | |
724 | .l2clk_2x (l2clk_2x), | |
725 | .mbi_wdata (mbi_rx_data_fifo_wdata_146), | |
726 | .mbi_rd_adr (mbi_rx_data_fifo_rd_addr), | |
727 | .mbi_wr_adr (mbi_rx_data_fifo_wr_addr), | |
728 | .mbi_wr_en (mbi_rx_data_fifo_wr_en), | |
729 | .mbi_rd_en (mbi_rx_data_fifo_rd_en), | |
730 | .mbi_run (mbi_rx_data_fifo_run), | |
731 | .mbi_rx_data_fifo_data_out (mbi_rx_data_fifo_data_out), | |
732 | `endif | |
733 | .ipp_dfifo_rden (ipp_dfifo_rden), | |
734 | .ipp_dfifo_rptr (ipp_dfifo_rptr[9:0]), | |
735 | .ipp_dfifo_wptr (ipp_dfifo_wptr[9:0]), | |
736 | .ipp_dfifo_wten (ipp_dfifo_wten), | |
737 | .ipp_dfifo_wten_2nd (ipp_dfifo_wten_2nd), | |
738 | .ipp_dfifo_dinp (ipp_dfifo_dinp[129:0]), | |
739 | .ipp_ecc_corrupt_sop (ipp_ecc_corrupt_sop), | |
740 | .ipp_ecc_corrupt_2nd (ipp_ecc_corrupt_2nd), | |
741 | .ipp_ecc_corrupt_eop (ipp_ecc_corrupt_eop), | |
742 | .ipp_ecc_corrupt_sing (ipp_ecc_corrupt_sing), | |
743 | .ipp_ecc_corrupt_doub (ipp_ecc_corrupt_doub), | |
744 | .ipp_ecc_corrupt_no_uncor(ipp_ecc_corrupt_no_uncor), | |
745 | .dfifo_ecc_correct_en (dfifo_ecc_correct_en), | |
746 | .ecc_pkt_corrupted_clr (ecc_pkt_corrupted_clr), | |
747 | .reset (reset), | |
748 | .clk (clk), | |
749 | .ipp_dfifo_dout (ipp_dmc_data[129:0]), | |
750 | .ipp_dfifo_dout0_tag (ipp_dfifo_dout0_tag[1:0]), | |
751 | .ipp_dmc_dat_err (ipp_dmc_dat_err), | |
752 | .ipp_dmc_dat_err1 (ipp_dmc_dat_err1), | |
753 | .ipp_dfifo_dout1 (ipp_dfifo_dout1[129:0]), | |
754 | .ipp_dfifo_dout1_ecc (ipp_dfifo_dout1_ecc[31:0]), | |
755 | .ipp_dfifo_dout1_ecc_syn (ipp_dfifo_dout1_ecc_syn[15:0]), | |
756 | .ecc_pkt_corrupted (ecc_pkt_corrupted) | |
757 | ); | |
758 | ||
759 | niu_ipp_slv ipp_slv ( | |
760 | // input signals | |
761 | .fifo_data_out_reg (fifo_data_out_reg[145:0]), | |
762 | .inc_pkt_disc_cntr (ipp_inc_pkt_dsc_cnt), | |
763 | .sum_prt_fail (sum_prt_fail), | |
764 | .sum_prt_valid (sum_prt_valid), | |
765 | .fifo_over_run (ipp_hfifo_over_run_r), | |
766 | .fifo_under_run (ipp_hfifo_under_run_r), | |
767 | .par_err (ipp_hfifo_par_err), | |
768 | .ipp_hfifo_par_addr (ipp_hfifo_par_addr[5:0]), | |
769 | .fwd_vec_cycle1 (cur_pkt_ffl_sum_info[13:0]), | |
770 | .fifo_rd_ptr (ipp_hfifo_dat_rptr[5:0]), | |
771 | .fifo_wr_ptr (ipp_hfifo_wptr[6:0]), | |
772 | .ipp_dfifo_rptr ({1'h0,ipp_dfifo_rptr[10:0]}), | |
773 | .ipp_dfifo_wptr ({1'h0,ipp_dfifo_wptr[10:0]}), | |
774 | .ipp_dfifo_dout1 (ipp_dfifo_dout1[129:0]), | |
775 | .ipp_dfifo_dout1_ecc (ipp_dfifo_dout1_ecc[18:0]), | |
776 | .ipp_dfifo_dout1_ecc_syn (ipp_dfifo_dout1_ecc_syn[15:0]), | |
777 | .dfifo_miss_eop (dfifo_miss_eop), | |
778 | .dfifo_miss_sop (dfifo_miss_sop), | |
779 | .ecc_pkt_corrupted (ecc_pkt_corrupted), | |
780 | .rst_ipp_en(rst_ipp_en), | |
781 | .state_mach0({1'b0, phase_state[2:0]}), | |
782 | .state_mach1({mac_ack_fsm_curstate[3:0]}), | |
783 | .state_mach2({2'b0, ipp_ffl_curstate[1:0]}), | |
784 | .state_mach3 (c_unload_st[3:0]), | |
785 | .state_mach4 ({3'h0,c_unload_st[4]}), | |
786 | .state_mach5 ({phase_state_1st_data,phase_state_xmac[2:0]}), | |
787 | .state_mach6({2'b0, tag_fsm_curstate[1:0]}), | |
788 | .state_mach7({2'b0, ipp_en_rst_fsm_curstate[1:0]}), | |
789 | .state_mach8 (sum_prt_state[03:00]), | |
790 | .state_mach9 (sum_prt_state[07:04]), | |
791 | .state_mach10 (sum_prt_state[11:08]), | |
792 | .state_mach11 (sum_prt_state[15:12]), | |
793 | .state_mach12 (sum_prt_state[19:16]), | |
794 | .state_mach13 (sum_prt_state[23:20]), | |
795 | .state_mach14 (sum_prt_state[27:24]), | |
796 | .state_mach15 (sum_prt_state[31:28]), | |
797 | .mac_ipp_req(mac_ipp_req), | |
798 | .xmac_ipp_ack(xmac_ipp_ack), | |
799 | .mac_ipp_tag(mac_ipp_tag), | |
800 | .mac_ipp_data(mac_ipp_data), | |
801 | .mac_ipp_ctrl(mac_ipp_ctrl), | |
802 | .mac_ipp_stat(mac_ipp_stat), | |
803 | .ipp_mac_ack(ipp_mac_ack), | |
804 | .ipp_xmac_req(ipp_xmac_req), | |
805 | .ffl_ipp_data (ffl_ipp_data[13:0]), | |
806 | .ffl_ipp_dvalid (ffl_ipp_dvalid), | |
807 | .ffl_ipp_ready (ffl_ipp_ready), | |
808 | .ipp_ffl_mac_default (ipp_ffl_mac_default[11:0]), | |
809 | .ipp_ffl_dvalid (ipp_ffl_dvalid), | |
810 | .ffl_arb_ack (ffl_arb_ack), | |
811 | .ipp_ffl_req (ipp_ffl_req), | |
812 | .ipp_pio_sel(ipp_pio_sel), | |
813 | `ifdef NEPTUNE .ipp_pio_addr (ipp_pio_addr[13:0]), | |
814 | `else .ipp_pio_addr (ipp_pio_addr[14:0]), | |
815 | `endif .ipp_pio_rd (ipp_pio_rd), | |
816 | .ipp_pio_wdata(ipp_pio_wdata), | |
817 | .clk(clk), | |
818 | .reset(reset), | |
819 | // output signals | |
820 | .fifo_wr_data_reg(fifo_wr_data_reg), | |
821 | .fifo_wr_data_reg_wr_en_pls(fifo_wr_data_reg_wr_en_pls), | |
822 | .config_reg (config_reg[24:0]), | |
823 | .vec_cycle1_wr_en(vec_cycle1_wr_en), | |
824 | .ippfifo_rd_ptr_pio_wr_en(ippfifo_rd_ptr_pio_wr_en), | |
825 | .ippfifo_wr_ptr_pio_wr_en(ippfifo_wr_ptr_pio_wr_en), | |
826 | .dfifo_wt_data_reg_wr_en_pls (dfifo_wt_data_reg_wr_en_pls), | |
827 | .dfifo_rd_ptr_pio_wr_en (dfifo_rd_ptr_pio_wr_en), | |
828 | .dfifo_wt_ptr_pio_wr_en (dfifo_wt_ptr_pio_wr_en), | |
829 | .wr_ipp_en_bit0(wr_ipp_en_bit0), | |
830 | .ipp_pio_ack(ipp_pio_ack), | |
831 | .ipp_pio_rdata(ipp_pio_rdata), | |
832 | .ipp_pio_err(ipp_pio_err), | |
833 | .ipp_pio_intr(ipp_pio_intr), | |
834 | .ipp_debug(ipp_debug), | |
835 | .ipp_ecc_corrupt_sop (ipp_ecc_corrupt_sop), | |
836 | .ipp_ecc_corrupt_2nd (ipp_ecc_corrupt_2nd), | |
837 | .ipp_ecc_corrupt_eop (ipp_ecc_corrupt_eop), | |
838 | .ipp_ecc_corrupt_sing (ipp_ecc_corrupt_sing), | |
839 | .ipp_ecc_corrupt_doub (ipp_ecc_corrupt_doub), | |
840 | .ipp_ecc_corrupt_no_uncor (ipp_ecc_corrupt_no_uncor), | |
841 | .ecc_pkt_corrupted_clr (ecc_pkt_corrupted_clr), | |
842 | .reset2(reset2) | |
843 | ); // end of ipp_slv | |
844 | ||
845 | // For phase_sm2 | |
846 | /***** geo: | |
847 | reg fifo_empty_reg; // fifo is read in front; same as ipp_hfifo_dat_empty | |
848 | ||
849 | always @ (posedge clk) | |
850 | fifo_empty_reg <= ipp_hfifo_dat_empty; | |
851 | *****/ | |
852 | ||
853 | ipp_phase_sm2 phase_sm2_u1 ( | |
854 | .clk(clk), | |
855 | .reset(reset2), | |
856 | .valid(~fifo_data_out[129] & ~fifo_data_out[128] & | |
857 | // ~fifo_empty_reg), | |
858 | fifo_rd_en_reg), | |
859 | .rx_tag(ipp_fifo_rd_tag), | |
860 | .rd_eop(rd_eop), | |
861 | .rd_status(rd_stat), | |
862 | .cur_state(tag_fsm_curstate) | |
863 | ); | |
864 | ||
865 | wire IFG = tag_fsm_curstate[1:0] == 2'b00; | |
866 | ||
867 | niu_ipp_en_rst_fsm ipp_en_rst_fsm_u1(.clk(clk), .reset(reset2), | |
868 | .ipp_enable(ipp_enable), .wr_ipp_en_bit0(wr_ipp_en_bit0), | |
869 | .mac_stat(rd_stat[0]), .IFG(IFG), .rst_ipp_en(rst_ipp_en), | |
870 | .ipp_en_rst_fsm_curstate(ipp_en_rst_fsm_curstate[1:0])); | |
871 | ||
872 | endmodule // end of ipp module | |
873 |