Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / niu / rtl / niu_rxc.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: niu_rxc.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_rxc.v
41
42 Module(s) name : niu_rxc
43
44 Parent modules : none
45
46 Child modules : niu_ipp_top.v, niu_zcp.v, fflp.v
47
48 Author's name : George Chu
49
50 Date : March 9, 2004
51
52 Description : Top level of the RXC.
53
54 Synthesis Notes:
55
56 Modification History:
57
58 Date Description
59 ---- -----------
60
61************************************************************
62***********************************************************/
63
64module niu_rxc (
65`ifdef NEPTUNE
66`else
67 tcu_mbist_user_mode,
68 tcu_scan_en,
69 tcu_mbist_bisi_en,
70 tcu_rtx_rxc_ipp0_mbist_start,
71 tcu_rtx_rxc_ipp1_mbist_start,
72 tcu_rtx_rxc_mb5_mbist_start,
73 tcu_rtx_rxc_mb6_mbist_start,
74 tcu_rtx_rxc_zcp0_mbist_start,
75 tcu_rtx_rxc_zcp1_mbist_start,
76 rtx_rxc_ipp0_tcu_mbist_fail,
77 rtx_rxc_ipp1_tcu_mbist_fail,
78 rtx_rxc_mb5_tcu_mbist_fail,
79 rtx_rxc_mb6_tcu_mbist_fail,
80 rtx_rxc_zcp0_tcu_mbist_fail,
81 rtx_rxc_zcp1_tcu_mbist_fail,
82 rtx_rxc_ipp0_tcu_mbist_done,
83 rtx_rxc_ipp1_tcu_mbist_done,
84 rtx_rxc_mb5_tcu_mbist_done,
85 rtx_rxc_mb6_tcu_mbist_done,
86 rtx_rxc_zcp0_tcu_mbist_done,
87 rtx_rxc_zcp1_tcu_mbist_done,
88 niu_mb3_prebuf_header_scan_in,
89 niu_mb3_prebuf_header_scan_out,
90 niu_mb3_rx_data_fifo_scan_in,
91 niu_mb3_rx_data_fifo_scan_out,
92 rtx_rxc_ipp0_mb3_mbist_scan_in,
93 rtx_rxc_ipp0_mb3_mbist_scan_out,
94 rtx_rxc_ipp0_mb3_dmo_dout,
95 niu_mb4_prebuf_header_scan_in,
96 niu_mb4_prebuf_header_scan_out,
97 niu_mb4_rx_data_fifo_scan_in,
98 niu_mb4_rx_data_fifo_scan_out,
99 rtx_rxc_ipp1_mb3_mbist_scan_in,
100 rtx_rxc_ipp1_mb3_mbist_scan_out,
101 rtx_rxc_ipp1_mb3_dmo_dout,
102 niu_mb5_tcam_cntrl_scan_in,
103 niu_mb5_tcam_cntrl_scan_out,
104 rtx_rxc_tcam_cntrl_mbist_scan_in,
105 rtx_rxc_tcam_cntrl_mbist_scan_out,
106 niu_mb6_tcam_array_scan_in,
107 niu_mb6_tcam_array_scan_out,
108 niu_mb6_vlan_scan_in,
109 niu_mb6_vlan_scan_out,
110 rtx_rxc_tcam_vlan_mbist_scan_in,
111 rtx_rxc_tcam_vlan_mbist_scan_out,
112 rtx_rxc_vlan_mb6_dmo_dout,
113 niu_mb7_cntrl_fifo_zcp_scan_in,
114 niu_mb7_cntrl_fifo_zcp_scan_out,
115 rtx_rxc_zcp0_mb7_mbist_scan_in,
116 rtx_rxc_zcp0_mb7_mbist_scan_out,
117 rtx_rxc_zcp0_mb7_dmo_dout,
118 niu_mb8_cntrl_fifo_zcp_scan_in,
119 niu_mb8_cntrl_fifo_zcp_scan_out,
120 rtx_rxc_zcp1_mb7_mbist_scan_in,
121 rtx_rxc_zcp1_mb7_mbist_scan_out,
122 rtx_rxc_zcp1_mb7_dmo_dout,
123
124 hdr_sram_rvalue_ipp0,
125 hdr_sram_rid_ipp0,
126 hdr_sram_wr_en_ipp0,
127 hdr_sram_red_clr_ipp0,
128 sram_hdr_read_data_ipp0,
129 hdr_sram_rvalue_ipp1,
130 hdr_sram_rid_ipp1,
131 hdr_sram_wr_en_ipp1,
132 hdr_sram_red_clr_ipp1,
133 sram_hdr_read_data_ipp1,
134
135 hdr_sram_rvalue_zcp0,
136 hdr_sram_rid_zcp0,
137 hdr_sram_wr_en_zcp0,
138 hdr_sram_red_clr_zcp0,
139 sram_hdr_read_data_zcp0,
140 hdr_sram_rvalue_zcp1,
141 hdr_sram_rid_zcp1,
142 hdr_sram_wr_en_zcp1,
143 hdr_sram_red_clr_zcp1,
144 sram_hdr_read_data_zcp1,
145
146 hdr_sram_rvalue_vlan,
147 hdr_sram_rid_vlan,
148 hdr_sram_wr_en_vlan,
149 hdr_sram_red_clr_vlan,
150 sram_hdr_read_data_vlan,
151
152 tcu_aclk,
153 tcu_bclk,
154 tcu_se_scancollar_in,
155 tcu_se_scancollar_out,
156 tcu_array_wr_inhibit,
157
158 iol2clk,
159 iol2clk_2x,
160`endif
161 pio_ipp_sel, // input from cpu
162 pio_zcp_sel,
163 pio_fflp_sel,
164 pio_clients_addr,
165`ifdef NEPTUNE
166 pio_client_32b,
167`endif
168 pio_clients_rd,
169 pio_clients_wdata,
170
171 niu_reset_l,
172 niu_clk,
173
174 ipp_pio_ack, // output to cpu
175 ipp_pio_rdata,
176 ipp_pio_err,
177 ipp_pio_intr,
178 ipp_debug_port,
179
180 zcp_pio_ack,
181 zcp_pio_rdata,
182 zcp_pio_err,
183 zcp_pio_intr,
184 zcp_debug_port,
185
186 fflp_pio_rdata,
187 fflp_pio_ack,
188 fflp_pio_err,
189 fflp_pio_intr,
190 fflp_debug_port,
191
192// ipp0
193 mac_rxc_ack0, // input from xmac
194 mac_rxc_tag0,
195 mac_rxc_data0,
196 mac_rxc_ctrl0,
197 mac_rxc_stat0,
198 dmc_ipp_dat_req0, // input from dmc
199
200 rxc_mac_req0, // output to xmac
201 ipp_dmc_dat_ack0, // output to dmc
202 ipp_dmc_data0,
203 ipp_dmc_ful_pkt0,
204 ipp_dmc_dat_err0,
205// ipp1
206 mac_rxc_ack1, // input from xmac
207 mac_rxc_tag1,
208 mac_rxc_data1,
209 mac_rxc_ctrl1,
210 mac_rxc_stat1,
211 dmc_ipp_dat_req1, // input from dmc
212
213 rxc_mac_req1, // output to xmac
214 ipp_dmc_dat_ack1, // output to dmc
215 ipp_dmc_data1,
216 ipp_dmc_ful_pkt1,
217 ipp_dmc_dat_err1,
218
219`ifdef NEPTUNE
220// ipp2
221 mac_rxc_req2, // input from bmac
222 mac_rxc_tag2,
223 mac_rxc_data2,
224 mac_rxc_ctrl2,
225 mac_rxc_stat2,
226 dmc_ipp_dat_req2, // input from dmc
227
228 rxc_mac_ack2, // output to bmac
229 ipp_dmc_dat_ack2, // output to dmc
230 ipp_dmc_data2,
231 ipp_dmc_ful_pkt2,
232 ipp_dmc_dat_err2,
233// ipp3
234 mac_rxc_req3, // input from bmac
235 mac_rxc_tag3,
236 mac_rxc_data3,
237 mac_rxc_ctrl3,
238 mac_rxc_stat3,
239 dmc_ipp_dat_req3, // input from dmc
240
241 rxc_mac_ack3, // output to bmac
242 ipp_dmc_dat_ack3, // output to dmc
243 ipp_dmc_data3,
244 ipp_dmc_ful_pkt3,
245 ipp_dmc_dat_err3,
246`endif
247
248`ifdef NEPTUNE
249// fcram
250 fcram_clk, // input from fcram
251 fcram_fflp_mstrready,
252 fcram_fflp_fatal_err,
253 fcram_fflp_data_ready,
254 fcram_fflp_even_din,
255 fcram_fflp_odd_din,
256 fcram_fflp_cfg_datrd,
257 fcram_fflp_cfg_done,
258 fcram_fflp_cfg_err,
259
260 fflp_fcram_cfg_rst,
261 fflp_fcram_cfg_sel,
262 fflp_fcram_cfg_rd,
263 fflp_fcram_cfg_addr,
264 fflp_fcram_cfg_datwr,
265 fflp_fcram_slv_update,
266 fflp_fcram_rd_en,
267 fflp_fcram_cs_l, // output to fcram
268 fflp_fcram_fn,
269 fflp_fcram_pd_l,
270 fflp_fcram_ba0,
271 fflp_fcram_ba1,
272 fflp_fcram_addr,
273 fflp_fcram_ds,
274 fflp_fcram_triz_en_l,
275 fflp_fcram_even_dout,
276 fflp_fcram_odd_dout,
277
278 page_handle, // input from rdmc
279 rdmc_zcp_func_num,
280
281 arb1_zcp_req_accept, // input from arb1
282 zcp_arb1_req, // output to arb1
283 zcp_arb1_req_cmd,
284 zcp_arb1_req_address,
285 zcp_arb1_req_length,
286 zcp_arb1_req_port_num,
287 zcp_arb1_req_dma_num,
288 zcp_arb1_req_func_num,
289
290 meta_zcp_resp_length,
291 meta_zcp_resp_dma_num,
292 meta_zcp_resp_complete,
293 meta_zcp_resp_transfer_cmpl,
294 meta_zcp_resp_ready,
295 meta_zcp_resp_cmd,
296 meta_zcp_resp_cmd_status,
297 meta_zcp_resp_client,
298 zcp_meta_resp_accept, // output to meta RESPONSE control
299
300 meta_zcp_data_valid, // input from meta RESPONSE data
301 meta_zcp_data,
302 meta_zcp_resp_byteenable,
303 meta_zcp_data_status,
304
305// zcp.port3
306 dmc_zcp_req3, // input from dmc
307 zcp_dmc_ack3, // output to dmc
308 zcp_dmc_dat3,
309 zcp_dmc_dat_err3,
310 zcp_dmc_ful_pkt3,
311// zcp.port2
312 dmc_zcp_req2, // input from dmc
313 zcp_dmc_ack2, // output to dmc
314 zcp_dmc_dat2,
315 zcp_dmc_dat_err2,
316 zcp_dmc_ful_pkt2,
317`endif
318
319// zcp.port1
320 dmc_zcp_req1, // input from dmc
321 zcp_dmc_ack1, // output to dmc
322 zcp_dmc_dat1,
323 zcp_dmc_dat_err1,
324 zcp_dmc_ful_pkt1,
325// zcp.port0
326 dmc_zcp_req0, // input from dmc
327 zcp_dmc_ack0, // output to dmc
328 zcp_dmc_dat0,
329 zcp_dmc_dat_err0,
330 zcp_dmc_ful_pkt0
331 ); // end of niu_rxc_top pin definition
332
333`ifdef NEPTUNE
334`else
335input tcu_mbist_user_mode;
336input tcu_scan_en;
337input tcu_mbist_bisi_en;
338input tcu_rtx_rxc_ipp0_mbist_start;
339input tcu_rtx_rxc_ipp1_mbist_start;
340input tcu_rtx_rxc_mb5_mbist_start;
341input tcu_rtx_rxc_mb6_mbist_start;
342input tcu_rtx_rxc_zcp0_mbist_start;
343input tcu_rtx_rxc_zcp1_mbist_start;
344output rtx_rxc_ipp0_tcu_mbist_fail;
345output rtx_rxc_ipp1_tcu_mbist_fail;
346output rtx_rxc_mb5_tcu_mbist_fail;
347output rtx_rxc_mb6_tcu_mbist_fail;
348output rtx_rxc_zcp0_tcu_mbist_fail;
349output rtx_rxc_zcp1_tcu_mbist_fail;
350output rtx_rxc_ipp0_tcu_mbist_done;
351output rtx_rxc_ipp1_tcu_mbist_done;
352output rtx_rxc_mb5_tcu_mbist_done;
353output rtx_rxc_mb6_tcu_mbist_done;
354output rtx_rxc_zcp0_tcu_mbist_done;
355output rtx_rxc_zcp1_tcu_mbist_done;
356input niu_mb3_prebuf_header_scan_in;
357output niu_mb3_prebuf_header_scan_out;
358input niu_mb3_rx_data_fifo_scan_in;
359output niu_mb3_rx_data_fifo_scan_out;
360input rtx_rxc_ipp0_mb3_mbist_scan_in;
361output rtx_rxc_ipp0_mb3_mbist_scan_out;
362output [39:0] rtx_rxc_ipp0_mb3_dmo_dout;
363input niu_mb4_prebuf_header_scan_in;
364output niu_mb4_prebuf_header_scan_out;
365input niu_mb4_rx_data_fifo_scan_in;
366output niu_mb4_rx_data_fifo_scan_out;
367input rtx_rxc_ipp1_mb3_mbist_scan_in;
368output rtx_rxc_ipp1_mb3_mbist_scan_out;
369output [39:0] rtx_rxc_ipp1_mb3_dmo_dout;
370input niu_mb5_tcam_cntrl_scan_in;
371output niu_mb5_tcam_cntrl_scan_out;
372input rtx_rxc_tcam_cntrl_mbist_scan_in;
373output rtx_rxc_tcam_cntrl_mbist_scan_out;
374input niu_mb6_tcam_array_scan_in;
375output niu_mb6_tcam_array_scan_out;
376input niu_mb6_vlan_scan_in;
377output niu_mb6_vlan_scan_out;
378input rtx_rxc_tcam_vlan_mbist_scan_in;
379output rtx_rxc_tcam_vlan_mbist_scan_out;
380output [39:0] rtx_rxc_vlan_mb6_dmo_dout;
381
382input niu_mb7_cntrl_fifo_zcp_scan_in;
383output niu_mb7_cntrl_fifo_zcp_scan_out;
384input rtx_rxc_zcp0_mb7_mbist_scan_in;
385output rtx_rxc_zcp0_mb7_mbist_scan_out;
386output [39:0] rtx_rxc_zcp0_mb7_dmo_dout;
387input niu_mb8_cntrl_fifo_zcp_scan_in;
388output niu_mb8_cntrl_fifo_zcp_scan_out;
389input rtx_rxc_zcp1_mb7_mbist_scan_in;
390output rtx_rxc_zcp1_mb7_mbist_scan_out;
391output [39:0] rtx_rxc_zcp1_mb7_dmo_dout;
392
393input [6:0] hdr_sram_rvalue_ipp0;
394input [2:0] hdr_sram_rid_ipp0;
395input hdr_sram_wr_en_ipp0;
396input hdr_sram_red_clr_ipp0;
397output [6:0] sram_hdr_read_data_ipp0;
398input [6:0] hdr_sram_rvalue_ipp1;
399input [2:0] hdr_sram_rid_ipp1;
400input hdr_sram_wr_en_ipp1;
401input hdr_sram_red_clr_ipp1;
402output [6:0] sram_hdr_read_data_ipp1;
403
404input [6:0] hdr_sram_rvalue_zcp0;
405input [1:0] hdr_sram_rid_zcp0;
406input hdr_sram_wr_en_zcp0;
407input hdr_sram_red_clr_zcp0;
408output [6:0] sram_hdr_read_data_zcp0;
409input [6:0] hdr_sram_rvalue_zcp1;
410input [1:0] hdr_sram_rid_zcp1;
411input hdr_sram_wr_en_zcp1;
412input hdr_sram_red_clr_zcp1;
413output [6:0] sram_hdr_read_data_zcp1;
414
415input [5:0] hdr_sram_rvalue_vlan;
416input hdr_sram_rid_vlan;
417input hdr_sram_wr_en_vlan;
418input hdr_sram_red_clr_vlan;
419output [5:0] sram_hdr_read_data_vlan;
420
421input tcu_aclk;
422input tcu_bclk;
423input tcu_se_scancollar_in;
424input tcu_se_scancollar_out;
425input tcu_array_wr_inhibit;
426
427input iol2clk;
428input iol2clk_2x;
429`endif
430
431// input from cpu
432input pio_ipp_sel; // select ipp's
433input pio_zcp_sel; // select zcp's
434input pio_fflp_sel; // select fflp's
435input [19:0] pio_clients_addr;
436`ifdef NEPTUNE
437input pio_client_32b;
438`endif
439input pio_clients_rd; // rd_wr
440input [63:0] pio_clients_wdata;
441
442// input from global
443input niu_reset_l;
444input niu_clk;
445
446// output to cpu
447output ipp_pio_ack; // output to cpu
448output [63:0] ipp_pio_rdata;
449output ipp_pio_err;
450output ipp_pio_intr;
451output [31:0] ipp_debug_port;
452
453output zcp_pio_ack;
454output [63:0] zcp_pio_rdata;
455output zcp_pio_err;
456output zcp_pio_intr;
457output [31:0] zcp_debug_port;
458
459output [63:0] fflp_pio_rdata;
460output fflp_pio_ack;
461output fflp_pio_err;
462output fflp_pio_intr;
463output [31:0] fflp_debug_port;
464
465// input to ipp0
466input mac_rxc_ack0; // xmac sends the ack to ipp
467input mac_rxc_tag0; // xmac identifies the last part packet
468input [63:0] mac_rxc_data0; // xmac writing the data to ipp
469input mac_rxc_ctrl0; // active high for control information
470input [22:0] mac_rxc_stat0; // xmac writing the status to ipp
471input dmc_ipp_dat_req0; // dmc request data from rxc_data_fifo_0
472
473// output of ipp0
474output rxc_mac_req0; // req(as rdy) from ipp to xmac
475output ipp_dmc_dat_ack0; // rxc_data_fifo_0 is sending data to dmc
476output [129:0] ipp_dmc_data0; // rxc_data_fifo_0's data to dmc
477output ipp_dmc_ful_pkt0; // rxc_data_fifo_0 has at least 1 full packet
478output ipp_dmc_dat_err0; // rxc_data_fifo_0 data has error
479
480// input to ipp1
481input mac_rxc_ack1; // xmac sends the ack to ipp
482input mac_rxc_tag1; // bmac identifies the last part packet
483input [63:0] mac_rxc_data1; // bmac writing the data to ipp
484input mac_rxc_ctrl1; // active high for control information
485input [22:0] mac_rxc_stat1; // bmac writing the status to ipp
486input dmc_ipp_dat_req1; // dmc request data from rxc_data_fifo_1
487
488// output of ipp1
489output rxc_mac_req1; // ack from ipp to bmac
490output ipp_dmc_dat_ack1; // rxc_data_fifo_1 is sending data to dmc
491output [129:0] ipp_dmc_data1; // rxc_data_fifo_1's data to dmc
492output ipp_dmc_ful_pkt1; // rxc_data_fifo_1 has at least 1 full packet
493output ipp_dmc_dat_err1; // rxc_data_fifo_1 data has ewrror
494
495`ifdef NEPTUNE
496// input to ipp2
497input mac_rxc_req2; // bmac sends the request to ipp
498input mac_rxc_tag2; // bmac identifies the last part packet
499input [63:0] mac_rxc_data2; // bmac writing the data to ipp
500input mac_rxc_ctrl2; // active high for control information
501input [22:0] mac_rxc_stat2; // bmac writing the status to ipp
502input dmc_ipp_dat_req2; // dmc request data from rxc_data_fifo_2
503
504// output of ipp2
505output rxc_mac_ack2; // ack from ipp to bmac
506output ipp_dmc_dat_ack2; // rxc_data_fifo_2 is sending data to dmc
507output [129:0] ipp_dmc_data2; // rxc_data_fifo_2's data to dmc
508output ipp_dmc_ful_pkt2; // rxc_data_fifo_2 has at least 1 full packet
509output ipp_dmc_dat_err2; // rxc_data_fifo_2 data has error
510
511// input to ipp3
512input mac_rxc_req3; // bmac sends the request to ipp
513input mac_rxc_tag3; // bmac identifies the last part packet
514input [63:0] mac_rxc_data3; // bmac writing the data to ipp
515input mac_rxc_ctrl3; // active high for control information
516input [22:0] mac_rxc_stat3; // bmac writing the status to ipp
517input dmc_ipp_dat_req3; // dmc request data from rxc_data_fifo_3
518
519// output of ipp3
520output rxc_mac_ack3; // ack from ipp to bmac
521output ipp_dmc_dat_ack3; // rxc_data_fifo_3 is sending data to dmc
522output [129:0] ipp_dmc_data3; // rxc_data_fifo_3's data to dmc
523output ipp_dmc_ful_pkt3; // rxc_data_fifo_3 has at least 1 full packet
524output ipp_dmc_dat_err3; // rxc_data_fifo_3 data has error
525`endif
526
527// inputs to zcp.port0
528input dmc_zcp_req0;
529
530// output of zcp.port0
531output zcp_dmc_ack0;
532output [129:0] zcp_dmc_dat0;
533output zcp_dmc_dat_err0;
534output zcp_dmc_ful_pkt0;
535
536// inputs to zcp.port1
537input dmc_zcp_req1;
538
539// output of zcp.port1
540output zcp_dmc_ack1;
541output [129:0] zcp_dmc_dat1;
542output zcp_dmc_dat_err1;
543output zcp_dmc_ful_pkt1;
544
545`ifdef NEPTUNE
546// inputs of zcp fr rdmc
547input [319:0] page_handle;
548input [31:0] rdmc_zcp_func_num;
549
550// inputs to zcp.port2
551input dmc_zcp_req2;
552
553// output of zcp.port2
554output zcp_dmc_ack2;
555output [129:0] zcp_dmc_dat2;
556output zcp_dmc_dat_err2;
557output zcp_dmc_ful_pkt2;
558
559// inputs to zcp.port3
560input dmc_zcp_req3;
561
562// output of zcp.port3
563output zcp_dmc_ack3;
564output [129:0] zcp_dmc_dat3;
565output zcp_dmc_dat_err3;
566output zcp_dmc_ful_pkt3;
567
568// inputs of zcp fr arb1
569input arb1_zcp_req_accept;
570
571// output of zcp to arb1
572output zcp_arb1_req;
573output [7:0] zcp_arb1_req_cmd;
574output [63:0] zcp_arb1_req_address;
575output [13:0] zcp_arb1_req_length;
576output [1:0] zcp_arb1_req_port_num;
577output [4:0] zcp_arb1_req_dma_num;
578output [1:0] zcp_arb1_req_func_num;
579
580// inputs of zcp fr meta RESPONSE control info
581input [13:0] meta_zcp_resp_length; // Packet Length
582input [4:0] meta_zcp_resp_dma_num; // Channel Number
583input meta_zcp_resp_complete; // bitwise ZCP_CLIENT[0]
584input meta_zcp_resp_transfer_cmpl;// bitwise ZCP_CLIENT[0]
585input meta_zcp_resp_ready; // Resp Command Request
586input [7:0] meta_zcp_resp_cmd; // cmd
587input [3:0] meta_zcp_resp_cmd_status; // cmd status
588input meta_zcp_resp_client; // bit 0
589
590// output of zcp to meta RESPONSE control info
591output zcp_meta_resp_accept; // bitwise client accept
592
593// inputs of zcp fr meta RESPONSE data
594input meta_zcp_data_valid; // Transfer Data Ack
595input [127:0] meta_zcp_data; // Transfer Data
596input [15:0] meta_zcp_resp_byteenable; // First/Last BE
597input [3:0] meta_zcp_data_status; // Transfer Data Status
598`endif
599
600// input to fcram
601`ifdef NEPTUNE
602input fcram_clk;
603input fcram_fflp_mstrready;
604input fcram_fflp_fatal_err;
605input[3:0] fcram_fflp_data_ready;
606input[35:0] fcram_fflp_even_din;
607input[35:0] fcram_fflp_odd_din;
608input[15:0] fcram_fflp_cfg_datrd;
609input fcram_fflp_cfg_done;
610input fcram_fflp_cfg_err;
611
612// output to fcram
613output fflp_fcram_cfg_rst;
614output fflp_fcram_cfg_sel;
615output fflp_fcram_cfg_rd;
616output[7:0] fflp_fcram_cfg_addr;
617output[15:0] fflp_fcram_cfg_datwr;
618output fflp_fcram_slv_update;
619output[1:0] fflp_fcram_rd_en;
620output fflp_fcram_cs_l;
621output fflp_fcram_fn;
622output fflp_fcram_pd_l;
623output fflp_fcram_ba0;
624output fflp_fcram_ba1;
625output[14:0] fflp_fcram_addr;
626output[1:0] fflp_fcram_ds;
627output[1:0] fflp_fcram_triz_en_l;
628output[35:0] fflp_fcram_even_dout;
629output[35:0] fflp_fcram_odd_dout;
630`endif
631
632/************************** ipp **********************************************/
633// output to ffl
634wire ipp_fflp_dvalid;
635wire [1:0] ipp_fflp_port;
636wire [127:0] ipp_fflp_data;
637wire [11:0] ipp_fflp_mac_default;
638
639// output to cpu
640wire ipp_pio_ack;
641wire [63:0] ipp_pio_rdata;
642wire ipp_pio_err;
643wire ipp_pio_intr;
644wire [31:0] ipp_debug_port;
645
646// output of ipp0
647wire rxc_mac_req0;
648wire ipp_dmc_dat_ack0;
649wire [129:0] ipp_dmc_data0;
650wire ipp_dmc_ful_pkt0;
651wire ipp_dmc_dat_err0;
652
653// output of ipp1
654wire rxc_mac_req1;
655wire ipp_dmc_dat_ack1;
656wire [129:0] ipp_dmc_data1;
657wire ipp_dmc_ful_pkt1;
658wire ipp_dmc_dat_err1;
659
660`ifdef NEPTUNE
661// output of ipp2
662wire rxc_mac_ack2;
663wire ipp_dmc_dat_ack2;
664wire [129:0] ipp_dmc_data2;
665wire ipp_dmc_ful_pkt2;
666wire ipp_dmc_dat_err2;
667
668// output of ipp3
669wire rxc_mac_ack3;
670wire ipp_dmc_dat_ack3;
671wire [129:0] ipp_dmc_data3;
672wire ipp_dmc_ful_pkt3;
673wire ipp_dmc_dat_err3;
674`endif
675
676/************************** zcp **********************************************/
677wire zcp_pio_ack;
678wire [63:0] zcp_pio_rdata;
679wire zcp_pio_err;
680wire zcp_pio_intr;
681wire [31:0] zcp_debug_port;
682
683// output of zcp.port0
684wire zcp_dmc_ack0;
685wire [129:0] zcp_dmc_dat0;
686wire zcp_dmc_dat_err0;
687wire zcp_dmc_ful_pkt0;
688
689// output of zcp.port1
690wire zcp_dmc_ack1;
691wire [129:0] zcp_dmc_dat1;
692wire zcp_dmc_dat_err1;
693wire zcp_dmc_ful_pkt1;
694
695`ifdef NEPTUNE
696// output of zcp.port2
697wire zcp_dmc_ack2;
698wire [129:0] zcp_dmc_dat2;
699wire zcp_dmc_dat_err2;
700wire zcp_dmc_ful_pkt2;
701
702wire zcp_dmc_ack3;
703wire [129:0] zcp_dmc_dat3;
704wire zcp_dmc_dat_err3;
705wire zcp_dmc_ful_pkt3;
706
707// output of zcp to arb1
708wire zcp_arb1_req;
709wire [7:0] zcp_arb1_req_cmd;
710wire [63:0] zcp_arb1_req_address;
711wire [13:0] zcp_arb1_req_length;
712wire [1:0] zcp_arb1_req_port_num;
713wire [4:0] zcp_arb1_req_dma_num;
714wire [1:0] zcp_arb1_req_func_num;
715
716// output of zcp to meta RESPONSE control info
717wire zcp_meta_resp_accept;
718`endif
719
720/************************** fflp *********************************************/
721`ifdef NEPTUNE
722// output to fcram
723wire fflp_fcram_cfg_rst;
724wire fflp_fcram_cfg_sel;
725wire fflp_fcram_cfg_rd;
726wire [7:0] fflp_fcram_cfg_addr;
727wire [15:0] fflp_fcram_cfg_datwr;
728wire fflp_fcram_slv_update;
729wire [1:0] fflp_fcram_rd_en;
730wire fflp_fcram_cs_l;
731wire fflp_fcram_fn;
732wire fflp_fcram_pd_l;
733wire fflp_fcram_ba0;
734wire fflp_fcram_ba1;
735wire [14:0] fflp_fcram_addr;
736wire [1:0] fflp_fcram_ds;
737wire [1:0] fflp_fcram_triz_en_l;
738wire [35:0] fflp_fcram_even_dout;
739wire [35:0] fflp_fcram_odd_dout;
740`endif
741
742// output of fflp
743wire fflp_ipp_ready; // ready to accept data from ipp
744wire [3:0] fflp_ipp_dvalid; // which port's parsed data is valid
745wire [15:0] fflp_ipp_data; // parsed packet header information
746
747wire [4:0] fflp_zcp_wr;
748wire [215:0] fflp_zcp_data;
749
750wire [199:0] cam_data_inp;
751wire cam_compare;
752wire cam_pio_wr;
753wire cam_pio_rd;
754wire cam_pio_sel;
755wire [9:0] cam_index; // pio access address,
756
757wire am_rd;
758wire am_wr;
759wire [9:0] am_addr;
760wire [41:0] am_dout;
761
762wire [63:0] fflp_pio_rdata;
763wire fflp_pio_ack;
764wire fflp_pio_err;
765wire fflp_pio_intr;
766wire [31:0] fflp_debug_port;
767
768wire vlan_tbl_cs;
769wire vlan_tbl_wr;
770wire [11:0] vlan_tbl_addr;
771wire [17:0] vlan_tbl_wr_dout;
772
773/************************** tcam *********************************************/
774// output of tcam
775wire cam_valid; // if 1, cam is ready to accept a new comparison
776wire cam_hit; // if 1, there is a cam match/hit
777`ifdef NEPTUNE
778wire [7:0] cam_haddr; // index of a cam match/hit entry, N2: {1'b0,haddr[6:0]}
779`else
780wire [6:0] cam_haddr;
781wire reset_core_tcam;
782`endif
783wire reset_core_fflp_l;
784wire pio_rd_vld; // pio_read_out_data valid for the core_clk domain
785wire [201:0] msk_dat_out; // pio data read out of cam's mask or data plane
786
787/************************** associated ram ***********************************/
788// output of associated ram
789wire [41:0] am_din;
790
791/************************** vlan_table ***************************************/
792// output of vlan_table
793wire [17:0] vlan_tbl_rd_din;
794
795`ifdef NEPTUNE
796`else
797/******************************* N2 mode memory scan and mbist staff *********/
798// ----- niu_rxc global bist -----
799wire rtx_rxc_ipp0_tcu_mbist_fail;
800wire rtx_rxc_ipp1_tcu_mbist_fail;
801wire rtx_rxc_mb5_tcu_mbist_fail;
802wire rtx_rxc_mb6_tcu_mbist_fail;
803wire rtx_rxc_zcp0_tcu_mbist_fail;
804wire rtx_rxc_zcp1_tcu_mbist_fail;
805
806wire rtx_rxc_ipp0_tcu_mbist_done;
807wire rtx_rxc_ipp1_tcu_mbist_done;
808wire rtx_rxc_mb5_tcu_mbist_done;
809wire rtx_rxc_mb6_tcu_mbist_done;
810wire rtx_rxc_zcp0_tcu_mbist_done;
811wire rtx_rxc_zcp1_tcu_mbist_done;
812
813// ----- ipp mem_bist -----
814wire niu_mb3_prebuf_header_scan_out;
815wire niu_mb3_rx_data_fifo_scan_out;
816wire rtx_rxc_ipp0_mb3_mbist_scan_out;
817wire [39:0] rtx_rxc_ipp0_mb3_dmo_dout;
818wire niu_mb4_prebuf_header_scan_out;
819wire niu_mb4_rx_data_fifo_scan_out;
820wire rtx_rxc_ipp1_mb3_mbist_scan_out;
821wire [39:0] rtx_rxc_ipp1_mb3_dmo_dout;
822
823// ----- zcp mem_bist -----
824wire niu_mb7_cntrl_fifo_zcp_scan_out;
825wire rtx_rxc_zcp0_mb7_mbist_scan_out;
826wire [39:0] rtx_rxc_zcp0_mb7_dmo_dout;
827wire niu_mb8_cntrl_fifo_zcp_scan_out;
828wire rtx_rxc_zcp1_mb7_mbist_scan_out;
829wire [39:0] rtx_rxc_zcp1_mb7_dmo_dout;
830
831// ----- tcam mem_bist -----
832wire niu_mb5_tcam_cntrl_scan_out;
833wire rtx_rxc_tcam_cntrl_mbist_scan_out;
834
835wire [6:0] niu_mb5_addr;
836wire niu_mb5_tcam_cntrl_rd_en;
837wire niu_mb5_tcam_cntrl_wr_en;
838wire niu_mb5_run;
839wire [199:0] niu_mb5_data_inp;
840wire niu_mb5_pio_sel;
841wire niu_mb5_cam_compare;
842
843// ----- vlan mem_bist -----
844wire niu_mb6_tcam_array_scan_out;
845wire niu_mb6_vlan_scan_out;
846wire rtx_rxc_tcam_vlan_mbist_scan_out;
847wire [39:0] rtx_rxc_vlan_mb6_dmo_dout;
848
849wire [7:0] niu_mb6_wdata;
850wire [11:0] niu_mb6_addr;
851wire niu_mb6_run;
852wire niu_mb6_tcam_array_wr_en;
853wire niu_mb6_tcam_array_rd_en;
854wire [6:0] niu_mb6_tcam_array_rd_addr = niu_mb6_addr[6:0];
855wire [6:0] niu_mb6_tcam_array_wr_addr = niu_mb6_addr[6:0];
856wire niu_mb6_tcam_array_run = niu_mb6_run;
857wire [41:0] niu_mb6_tcam_array_wdata_42 = {niu_mb6_wdata[1:0],{5{niu_mb6_wdata}}};
858wire [41:0] niu_mb6_tcam_array_data_out = am_din[41:0];
859
860wire [11:0] niu_mb6_vlan_rw_addr = niu_mb6_addr[11:0];
861wire niu_mb6_vlan_wr_en;
862wire niu_mb6_vlan_rd_en;
863wire niu_mb6_vlan_run = niu_mb6_run;
864wire [8:0] niu_mb6_vlan_wdata_9 = {niu_mb6_wdata[0],niu_mb6_wdata};
865wire [8:0] niu_mb6_vlan_data_out = vlan_tbl_rd_din[8:0];
866
867/******************************* N2 mode repairable SRAM headers *************/
868wire [6:0] sram_hdr_read_data_ipp0;
869wire [6:0] sram_hdr_read_data_ipp1;
870
871wire [6:0] sram_hdr_read_data_zcp0;
872wire [6:0] sram_hdr_read_data_zcp1;
873
874wire [5:0] sram_hdr_read_data_vlan;
875
876`endif
877
878/******************************* Instantiation niu_ipp ***********************/
879
880 niu_ipp_top ipp_top_0 (
881`ifdef NEPTUNE
882`else
883 .tcu_mbist_user_mode (tcu_mbist_user_mode),
884 .tcu_scan_en (tcu_scan_en),
885 .tcu_mbist_bisi_en (tcu_mbist_bisi_en),
886 .tcu_rtx_rxc_ipp0_mbist_start (tcu_rtx_rxc_ipp0_mbist_start),
887 .tcu_rtx_rxc_ipp1_mbist_start (tcu_rtx_rxc_ipp1_mbist_start),
888 .rtx_rxc_ipp0_tcu_mbist_fail (rtx_rxc_ipp0_tcu_mbist_fail),
889 .rtx_rxc_ipp0_tcu_mbist_done (rtx_rxc_ipp0_tcu_mbist_done),
890 .rtx_rxc_ipp1_tcu_mbist_fail (rtx_rxc_ipp1_tcu_mbist_fail),
891 .rtx_rxc_ipp1_tcu_mbist_done (rtx_rxc_ipp1_tcu_mbist_done),
892 .niu_mb3_prebuf_header_scan_in (niu_mb3_prebuf_header_scan_in),
893 .niu_mb3_prebuf_header_scan_out (niu_mb3_prebuf_header_scan_out),
894 .niu_mb3_rx_data_fifo_scan_in (niu_mb3_rx_data_fifo_scan_in),
895 .niu_mb3_rx_data_fifo_scan_out (niu_mb3_rx_data_fifo_scan_out),
896 .rtx_rxc_ipp0_mb3_mbist_scan_in (rtx_rxc_ipp0_mb3_mbist_scan_in),
897 .rtx_rxc_ipp0_mb3_mbist_scan_out (rtx_rxc_ipp0_mb3_mbist_scan_out),
898 .rtx_rxc_ipp0_mb3_dmo_dout (rtx_rxc_ipp0_mb3_dmo_dout),
899 .niu_mb4_prebuf_header_scan_in (niu_mb4_prebuf_header_scan_in),
900 .niu_mb4_prebuf_header_scan_out (niu_mb4_prebuf_header_scan_out),
901 .niu_mb4_rx_data_fifo_scan_in (niu_mb4_rx_data_fifo_scan_in),
902 .niu_mb4_rx_data_fifo_scan_out (niu_mb4_rx_data_fifo_scan_out),
903 .rtx_rxc_ipp1_mb3_mbist_scan_in (rtx_rxc_ipp1_mb3_mbist_scan_in),
904 .rtx_rxc_ipp1_mb3_mbist_scan_out (rtx_rxc_ipp1_mb3_mbist_scan_out),
905 .rtx_rxc_ipp1_mb3_dmo_dout (rtx_rxc_ipp1_mb3_dmo_dout),
906
907 .hdr_sram_rvalue_ipp0 (hdr_sram_rvalue_ipp0),
908 .hdr_sram_rid_ipp0 (hdr_sram_rid_ipp0),
909 .hdr_sram_wr_en_ipp0 (hdr_sram_wr_en_ipp0),
910 .hdr_sram_red_clr_ipp0 (hdr_sram_red_clr_ipp0),
911 .sram_hdr_read_data_ipp0 (sram_hdr_read_data_ipp0),
912
913 .hdr_sram_rvalue_ipp1 (hdr_sram_rvalue_ipp1),
914 .hdr_sram_rid_ipp1 (hdr_sram_rid_ipp1),
915 .hdr_sram_wr_en_ipp1 (hdr_sram_wr_en_ipp1),
916 .hdr_sram_red_clr_ipp1 (hdr_sram_red_clr_ipp1),
917 .sram_hdr_read_data_ipp1 (sram_hdr_read_data_ipp1),
918
919 .tcu_aclk (tcu_aclk),
920 .tcu_bclk (tcu_bclk),
921 .tcu_se_scancollar_in (tcu_se_scancollar_in),
922 .tcu_se_scancollar_out (tcu_se_scancollar_out),
923 .tcu_array_wr_inhibit (tcu_array_wr_inhibit),
924
925 .iol2clk (iol2clk),
926 .l2clk_2x (iol2clk_2x),
927`endif
928 .fflp_ipp_ready (fflp_ipp_ready), // input from fflp
929`ifdef NEPTUNE
930 .fflp_ipp_dvalid (fflp_ipp_dvalid[3:0]),
931`else
932 .fflp_ipp_dvalid (fflp_ipp_dvalid[1:0]),
933`endif
934 .fflp_ipp_sum (fflp_ipp_data[13:0]),
935
936 .pio_clients_sel_ipp (pio_ipp_sel), // input from cpu
937 .pio_clients_addr (pio_clients_addr[19:0]),
938 .pio_clients_rd (pio_clients_rd),
939 .pio_clients_wdata (pio_clients_wdata[31:0]),
940
941 .reset_l (niu_reset_l),
942 .clk (niu_clk),
943
944 .ipp_fflp_dvalid (ipp_fflp_dvalid), // output to fflp
945 .ipp_fflp_port (ipp_fflp_port[1:0]),
946 .ipp_fflp_data (ipp_fflp_data[127:0]),
947 .ipp_fflp_mac_default (ipp_fflp_mac_default[11:0]),
948
949 .ipp_pio_ack (ipp_pio_ack), // output to cpu
950 .ipp_pio_rdata (ipp_pio_rdata[63:0]),
951 .ipp_pio_err (ipp_pio_err),
952 .ipp_pio_intr (ipp_pio_intr),
953 .ipp_debug_port (ipp_debug_port[31:0]),
954`ifdef NEPTUNE
955// ipp3
956 .mac_rxc_req3 (mac_rxc_req3), // input from bmac
957 .mac_rxc_tag3 (mac_rxc_tag3),
958 .mac_rxc_data3 (mac_rxc_data3[63:0]),
959 .mac_rxc_ctrl3 (mac_rxc_ctrl3),
960 .mac_rxc_stat3 (mac_rxc_stat3[22:0]),
961 .dmc_ipp_dat_req3 (dmc_ipp_dat_req3), // input from dmc
962
963 .rxc_mac_ack3 (rxc_mac_ack3), // output to bmac
964 .ipp_dmc_dat_ack3 (ipp_dmc_dat_ack3), // output to dmc
965 .ipp_dmc_data3 (ipp_dmc_data3[129:0]),
966 .ipp_dmc_ful_pkt3 (ipp_dmc_ful_pkt3),
967 .ipp_dmc_dat_err3 (ipp_dmc_dat_err3),
968// ipp2
969 .mac_rxc_req2 (mac_rxc_req2), // input from bmac
970 .mac_rxc_tag2 (mac_rxc_tag2),
971 .mac_rxc_data2 (mac_rxc_data2[63:0]),
972 .mac_rxc_ctrl2 (mac_rxc_ctrl2),
973 .mac_rxc_stat2 (mac_rxc_stat2[22:0]),
974 .dmc_ipp_dat_req2 (dmc_ipp_dat_req2), // input from dmc
975
976 .rxc_mac_ack2 (rxc_mac_ack2), // output to bmac
977 .ipp_dmc_dat_ack2 (ipp_dmc_dat_ack2), // output to dmc
978 .ipp_dmc_data2 (ipp_dmc_data2[129:0]),
979 .ipp_dmc_ful_pkt2 (ipp_dmc_ful_pkt2),
980 .ipp_dmc_dat_err2 (ipp_dmc_dat_err2),
981`endif
982// ipp1
983 .mac_rxc_ack1 (mac_rxc_ack1), // input from xmac
984 .mac_rxc_tag1 (mac_rxc_tag1),
985 .mac_rxc_data1 (mac_rxc_data1[63:0]),
986 .mac_rxc_ctrl1 (mac_rxc_ctrl1),
987 .mac_rxc_stat1 (mac_rxc_stat1[22:0]),
988 .dmc_ipp_dat_req1 (dmc_ipp_dat_req1), // input from dmc
989
990 .rxc_mac_req1 (rxc_mac_req1), // output to xmac
991 .ipp_dmc_dat_ack1 (ipp_dmc_dat_ack1), // output to dmc
992 .ipp_dmc_data1 (ipp_dmc_data1[129:0]),
993 .ipp_dmc_ful_pkt1 (ipp_dmc_ful_pkt1),
994 .ipp_dmc_dat_err1 (ipp_dmc_dat_err1),
995// ipp0
996 .mac_rxc_ack0 (mac_rxc_ack0), // input from xmac
997 .mac_rxc_tag0 (mac_rxc_tag0),
998 .mac_rxc_data0 (mac_rxc_data0[63:0]),
999 .mac_rxc_ctrl0 (mac_rxc_ctrl0),
1000 .mac_rxc_stat0 (mac_rxc_stat0[22:0]),
1001 .dmc_ipp_dat_req0 (dmc_ipp_dat_req0), // input from dmc
1002
1003 .rxc_mac_req0 (rxc_mac_req0), // output to xmac
1004 .ipp_dmc_dat_ack0 (ipp_dmc_dat_ack0), // output to dmc
1005 .ipp_dmc_data0 (ipp_dmc_data0[129:0]),
1006 .ipp_dmc_ful_pkt0 (ipp_dmc_ful_pkt0),
1007 .ipp_dmc_dat_err0 (ipp_dmc_dat_err0)
1008 ); // end of niu_ipp_top pin definition
1009
1010/******************************* Instantiation niu_zcp ***********************/
1011 niu_zcp niu_zcp_0 (
1012 .zcp_pio_ack (zcp_pio_ack),
1013 .zcp_pio_rdata (zcp_pio_rdata[63:0]),
1014 .zcp_pio_err (zcp_pio_err),
1015 .zcp_pio_intr (zcp_pio_intr),
1016 .zcp_debug_port (zcp_debug_port),
1017 .zcp_dmc_ack0 (zcp_dmc_ack0),
1018 .zcp_dmc_dat0 (zcp_dmc_dat0[129:0]),
1019 .zcp_dmc_dat_err0 (zcp_dmc_dat_err0),
1020 .zcp_dmc_ful_pkt0 (zcp_dmc_ful_pkt0),
1021 .zcp_dmc_ack1 (zcp_dmc_ack1),
1022 .zcp_dmc_dat1 (zcp_dmc_dat1[129:0]),
1023 .zcp_dmc_dat_err1 (zcp_dmc_dat_err1),
1024 .zcp_dmc_ful_pkt1 (zcp_dmc_ful_pkt1),
1025`ifdef NEPTUNE .zcp_dmc_ack2 (zcp_dmc_ack2),
1026 .zcp_dmc_dat2 (zcp_dmc_dat2[129:0]),
1027 .zcp_dmc_dat_err2 (zcp_dmc_dat_err2),
1028 .zcp_dmc_ful_pkt2 (zcp_dmc_ful_pkt2),
1029 .zcp_dmc_ack3 (zcp_dmc_ack3),
1030 .zcp_dmc_dat3 (zcp_dmc_dat3[129:0]),
1031 .zcp_dmc_dat_err3 (zcp_dmc_dat_err3),
1032 .zcp_dmc_ful_pkt3 (zcp_dmc_ful_pkt3),
1033 .zcp_arb1_req (zcp_arb1_req),
1034 .zcp_arb1_req_cmd (zcp_arb1_req_cmd[7:0]),
1035 .zcp_arb1_req_address (zcp_arb1_req_address[63:0]),
1036 .zcp_arb1_req_length (zcp_arb1_req_length[13:0]),
1037 .zcp_arb1_req_port_num (zcp_arb1_req_port_num[1:0]),
1038 .zcp_arb1_req_dma_num (zcp_arb1_req_dma_num[4:0]),
1039 .zcp_arb1_req_func_num (zcp_arb1_req_func_num[1:0]),
1040 .zcp_meta_resp_accept (zcp_meta_resp_accept),
1041`endif
1042 .clk (niu_clk),
1043 .reset_l (niu_reset_l),
1044 .pio_clients_addr (pio_clients_addr[19:0]),
1045 .pio_clients_rd (pio_clients_rd),
1046 .pio_clients_wdata (pio_clients_wdata[31:0]),
1047 .pio_zcp_sel (pio_zcp_sel),
1048 .fflp_zcp_wr (fflp_zcp_wr),
1049 .fflp_zcp_data (fflp_zcp_data[215:0]),
1050`ifdef NEPTUNE
1051 .page_handle (page_handle),
1052 .rdmc_zcp_func_num (rdmc_zcp_func_num),
1053 .dmc_zcp_req3 (dmc_zcp_req3),
1054 .dmc_zcp_req2 (dmc_zcp_req2),
1055 .arb1_zcp_req_accept (arb1_zcp_req_accept),
1056 .meta_zcp_resp_length (meta_zcp_resp_length[13:0]),
1057 .meta_zcp_resp_dma_num (meta_zcp_resp_dma_num[4:0]),
1058 .meta_zcp_resp_complete (meta_zcp_resp_complete),
1059 .meta_zcp_resp_transfer_cmpl (meta_zcp_resp_transfer_cmpl),
1060 .meta_zcp_resp_ready (meta_zcp_resp_ready),
1061 .meta_zcp_resp_cmd (meta_zcp_resp_cmd[7:0]),
1062 .meta_zcp_resp_cmd_status (meta_zcp_resp_cmd_status[3:0]),
1063 .meta_zcp_resp_client (meta_zcp_resp_client),
1064 .meta_zcp_data_valid (meta_zcp_data_valid),
1065 .meta_zcp_data (meta_zcp_data[127:0]),
1066 .meta_zcp_resp_byteenable (meta_zcp_resp_byteenable[15:0]),
1067 .meta_zcp_data_status (meta_zcp_data_status[3:0]),
1068`endif
1069 .dmc_zcp_req1 (dmc_zcp_req1),
1070`ifdef NEPTUNE
1071 .dmc_zcp_req0 (dmc_zcp_req0)
1072 );
1073`else
1074 .dmc_zcp_req0 (dmc_zcp_req0),
1075 .iol2clk (iol2clk),
1076 .tcu_mbist_user_mode (tcu_mbist_user_mode),
1077 .tcu_aclk (tcu_aclk),
1078 .tcu_bclk (tcu_bclk),
1079 .tcu_se_scancollar_in (tcu_se_scancollar_in),
1080 .tcu_se_scancollar_out (tcu_se_scancollar_out),
1081 .tcu_array_wr_inhibit (tcu_array_wr_inhibit),
1082 .niu_mb7_cntrl_fifo_zcp_scan_in (niu_mb7_cntrl_fifo_zcp_scan_in),
1083 .niu_mb7_cntrl_fifo_zcp_scan_out (niu_mb7_cntrl_fifo_zcp_scan_out),
1084 .l2clk_2x (iol2clk_2x),
1085 .hdr_sram_rvalue_zcp0 (hdr_sram_rvalue_zcp0),
1086 .hdr_sram_rid_zcp0 (hdr_sram_rid_zcp0),
1087 .hdr_sram_wr_en_zcp0 (hdr_sram_wr_en_zcp0),
1088 .hdr_sram_red_clr_zcp0 (hdr_sram_red_clr_zcp0),
1089 .sram_hdr_read_data_zcp0 (sram_hdr_read_data_zcp0),
1090 .rtx_rxc_zcp0_mb7_dmo_dout (rtx_rxc_zcp0_mb7_dmo_dout),
1091 .hdr_sram_rvalue_zcp1 (hdr_sram_rvalue_zcp1),
1092 .hdr_sram_rid_zcp1 (hdr_sram_rid_zcp1),
1093 .hdr_sram_wr_en_zcp1 (hdr_sram_wr_en_zcp1),
1094 .hdr_sram_red_clr_zcp1 (hdr_sram_red_clr_zcp1),
1095 .sram_hdr_read_data_zcp1 (sram_hdr_read_data_zcp1),
1096 .rtx_rxc_zcp1_mb7_dmo_dout (rtx_rxc_zcp1_mb7_dmo_dout),
1097 .niu_tcu_mbist_fail_7 (rtx_rxc_zcp0_tcu_mbist_fail),
1098 .niu_tcu_mbist_done_7 (rtx_rxc_zcp0_tcu_mbist_done),
1099 .mb7_scan_in (rtx_rxc_zcp0_mb7_mbist_scan_in),
1100 .mb7_scan_out (rtx_rxc_zcp0_mb7_mbist_scan_out),
1101 .tcu_niu_mbist_start_7 (tcu_rtx_rxc_zcp0_mbist_start),
1102 .tcu_mbist_bisi_en (tcu_mbist_bisi_en),
1103 .tcu_scan_en (tcu_scan_en),
1104 .niu_mb8_cntrl_fifo_zcp_scan_in (niu_mb8_cntrl_fifo_zcp_scan_in),
1105 .niu_mb8_cntrl_fifo_zcp_scan_out (niu_mb8_cntrl_fifo_zcp_scan_out),
1106 .niu_tcu_mbist_fail_8 (rtx_rxc_zcp1_tcu_mbist_fail),
1107 .niu_tcu_mbist_done_8 (rtx_rxc_zcp1_tcu_mbist_done),
1108 .mb8_scan_in (rtx_rxc_zcp1_mb7_mbist_scan_in),
1109 .mb8_scan_out (rtx_rxc_zcp1_mb7_mbist_scan_out),
1110 .tcu_niu_mbist_start_8 (tcu_rtx_rxc_zcp1_mbist_start)
1111 );
1112`endif
1113
1114/******************************* Instantiation niu_fflp **********************/
1115 fflp fflp_0 (
1116 .cclk (niu_clk),
1117 .reset_l (reset_core_fflp_l),
1118//ipp if
1119 .ipp_fflp_dvalid (ipp_fflp_dvalid),
1120 .ipp_fflp_data (ipp_fflp_data[127:0]),
1121 .ipp_fflp_mac_default (ipp_fflp_mac_default[11:0]),
1122 .ipp_fflp_mac_port (ipp_fflp_port[1:0]),
1123
1124 .fflp_ipp_ready (fflp_ipp_ready),
1125 .fflp_ipp_dvalid (fflp_ipp_dvalid[3:0]),
1126 .fflp_ipp_data (fflp_ipp_data[15:0]),
1127//cam if
1128 .cam_hit (cam_hit),
1129 .cam_valid (cam_valid),
1130`ifdef NEPTUNE
1131 .cam_haddr ({2'h0,cam_haddr[7:0]}),
1132`else
1133 .cam_haddr ({3'h0,cam_haddr[6:0]}),
1134`endif
1135 .pio_rd_vld (pio_rd_vld),
1136 .cam_msk_dat_out (msk_dat_out[199:0]), // geo: change it with new release
1137
1138 .cam_data_inp (cam_data_inp[199:0]),
1139 .cam_compare (cam_compare),
1140 .cam_pio_wr (cam_pio_wr),
1141 .cam_pio_rd (cam_pio_rd),
1142 .cam_pio_sel (cam_pio_sel),
1143 .cam_index (cam_index[9:0]),
1144//ram if
1145 .am_din (am_din[41:0]),
1146
1147 .am_rd (am_rd),
1148 .am_wr (am_wr),
1149 .am_addr (am_addr[9:0]),
1150 .am_dout (am_dout[41:0]),
1151//zcp if
1152 .fflp_zcp_wr (fflp_zcp_wr),
1153 .fflp_zcp_data (fflp_zcp_data[215:0]),
1154//pio if
1155 .pio_fflp_wdata (pio_clients_wdata[63:0]),
1156 .pio_fflp_rd (pio_clients_rd),
1157 .pio_fflp_sel (pio_fflp_sel),
1158 .pio_fflp_addr (pio_clients_addr[19:0]),
1159`ifdef NEPTUNE
1160 .pio_client_32b (pio_client_32b),
1161`endif
1162 .fflp_pio_rdata (fflp_pio_rdata[63:0]),
1163 .fflp_pio_ack (fflp_pio_ack),
1164 .fflp_pio_err (fflp_pio_err),
1165 .fflp_pio_intr (fflp_pio_intr),
1166//vlan table
1167 .vlan_tbl_rd_din (vlan_tbl_rd_din[17:0]),
1168 .vlan_tbl_cs (vlan_tbl_cs),
1169 .vlan_tbl_wr (vlan_tbl_wr),
1170 .vlan_tbl_addr (vlan_tbl_addr[11:0]),
1171 .vlan_tbl_wr_dout (vlan_tbl_wr_dout[17:0]),
1172`ifdef NEPTUNE
1173//fcram if
1174 .fcram_clk (fcram_clk),
1175 .fcram_fflp_mstrready (fcram_fflp_mstrready),
1176 .fcram_fflp_fatal_err (fcram_fflp_fatal_err),
1177 .fcram_fflp_data_ready (fcram_fflp_data_ready[3:0]),
1178 .fcram_fflp_even_din (fcram_fflp_even_din[35:0]),
1179 .fcram_fflp_odd_din (fcram_fflp_odd_din[35:0]),
1180 .fcram_fflp_cfg_datrd (fcram_fflp_cfg_datrd[15:0]),
1181 .fcram_fflp_cfg_done (fcram_fflp_cfg_done),
1182 .fcram_fflp_cfg_err (fcram_fflp_cfg_err),
1183
1184 .fflp_fcram_cfg_rst (fflp_fcram_cfg_rst),
1185 .fflp_fcram_cfg_sel (fflp_fcram_cfg_sel),
1186 .fflp_fcram_cfg_rd (fflp_fcram_cfg_rd),
1187 .fflp_fcram_cfg_addr (fflp_fcram_cfg_addr[7:0]),
1188 .fflp_fcram_cfg_datwr (fflp_fcram_cfg_datwr[15:0]),
1189 .fflp_fcram_slv_update (fflp_fcram_slv_update),
1190 .fflp_fcram_rd_en (fflp_fcram_rd_en[1:0]),
1191 .fflp_fcram_cs_l (fflp_fcram_cs_l),
1192 .fflp_fcram_fn (fflp_fcram_fn),
1193 .fflp_fcram_pd_l (fflp_fcram_pd_l),
1194 .fflp_fcram_ba0 (fflp_fcram_ba0),
1195 .fflp_fcram_ba1 (fflp_fcram_ba1),
1196 .fflp_fcram_addr (fflp_fcram_addr[14:0]),
1197 .fflp_fcram_ds (fflp_fcram_ds[1:0]),
1198 .fflp_fcram_triz_en_l (fflp_fcram_triz_en_l[1:0]),
1199 .fflp_fcram_even_dout (fflp_fcram_even_dout[35:0]),
1200 .fflp_fcram_odd_dout (fflp_fcram_odd_dout[35:0]),
1201`endif
1202 .fflp_debug_port (fflp_debug_port[31:0])
1203 );
1204
1205/******************************* Instantiation niu_tcam **********************/
1206 niu_tcam niu_tcam_0 (
1207 .data_inp (cam_data_inp[199:0]),
1208 .cam_compare (cam_compare),
1209 .pio_wt (cam_pio_wr),
1210 .pio_rd (cam_pio_rd),
1211 .pio_sel (cam_pio_sel),
1212`ifdef NEPTUNE
1213 .cam_index (cam_index[7:0]),
1214`else
1215 .cam_index (cam_index[6:0]),
1216 .tcu_se_scancollar_in (tcu_se_scancollar_in),
1217 .tcu_se_scancollar_out (tcu_se_scancollar_out),
1218 .tcu_array_wr_inhibit (tcu_array_wr_inhibit),
1219 .tcu_aclk (tcu_aclk),
1220 .tcu_bclk (tcu_bclk),
1221 .iol2clk (iol2clk),
1222 .scan_in (niu_mb5_tcam_cntrl_scan_in),
1223 .scan_out (niu_mb5_tcam_cntrl_scan_out),
1224 .reset_core_tcam (reset_core_tcam),
1225 .mbi_wdata (niu_mb5_data_inp[199:0]),
1226 .mbi_rw_adr (niu_mb5_addr[6:0]),
1227 .mbi_pio_sel (niu_mb5_pio_sel),
1228 .mbi_wr_en (niu_mb5_tcam_cntrl_wr_en),
1229 .mbi_rd_en (niu_mb5_tcam_cntrl_rd_en),
1230 .mbi_compare (niu_mb5_cam_compare),
1231 .mbi_run (niu_mb5_run),
1232`endif
1233 .reset_l (niu_reset_l),
1234 .clk (niu_clk),
1235 .cam_valid (cam_valid),
1236 .cam_hit (cam_hit),
1237`ifdef NEPTUNE
1238 .cam_haddr (cam_haddr[7:0]),
1239`else
1240 .cam_haddr (cam_haddr[6:0]),
1241`endif
1242 .reset_core_fflp_l (reset_core_fflp_l),
1243 .pio_rd_vld (pio_rd_vld),
1244 .msk_dat_out (msk_dat_out[201:0])
1245 );
1246
1247/******************************* Instantiation fflp's RAMs *******************/
1248`ifdef NEPTUNE
1249 niu_ram_s_4096_18 niu_ram_4096_18_0 (
1250 .data_inp (vlan_tbl_wr_dout[17:0]),
1251 .addr_rw (vlan_tbl_addr[11:0]),
1252 .wt_enable (vlan_tbl_wr),
1253 .cs (vlan_tbl_cs),
1254 .clk (niu_clk),
1255 .data_out (vlan_tbl_rd_din[17:0])
1256 );
1257
1258 niu_ram_256_42 niu_ram_256_42_0 (
1259 .rd (am_rd),
1260 .rd_addr (am_addr[7:0]),
1261 .rd_dout (am_din[41:0]),
1262 .wr (am_wr),
1263 .wr_addr (am_addr[7:0]),
1264 .wr_din (am_dout[41:0]),
1265 .clk (niu_clk)
1266 );
1267
1268`else
1269 niu_ram_s_4096x9 niu_ram_4096x9_0 (
1270 .reset (reset_core_tcam),
1271 .tcu_aclk (tcu_aclk),
1272 .tcu_bclk (tcu_bclk),
1273 .tcu_scan_en (tcu_scan_en),
1274 .tcu_se_scancollar_in (tcu_se_scancollar_in),
1275 .tcu_se_scancollar_out (tcu_se_scancollar_out),
1276 .tcu_array_wr_inhibit (tcu_array_wr_inhibit),
1277 .scan_in (niu_mb6_vlan_scan_in),
1278 .scan_out (niu_mb6_vlan_scan_out),
1279 .hdr_sram_rvalue (hdr_sram_rvalue_vlan),
1280 .hdr_sram_rid (hdr_sram_rid_vlan),
1281 .hdr_sram_wr_en (hdr_sram_wr_en_vlan),
1282 .hdr_sram_red_clr (hdr_sram_red_clr_vlan),
1283 .sram_hdr_read_data (sram_hdr_read_data_vlan),
1284 .mbi_wdata (niu_mb6_vlan_wdata_9[8:0]),
1285 .mbi_rw_adr (niu_mb6_vlan_rw_addr),
1286 .mbi_wr_en (niu_mb6_vlan_wr_en),
1287 .mbi_rd_en (niu_mb6_vlan_rd_en),
1288 .mbi_run (niu_mb6_vlan_run),
1289 .data_inp (vlan_tbl_wr_dout[8:0]),
1290 .addr_rw (vlan_tbl_addr[11:0]),
1291 .wt_enable (vlan_tbl_wr),
1292 .cs_rd (vlan_tbl_cs),
1293 .clk (iol2clk),
1294 .data_out (vlan_tbl_rd_din[8:0])
1295 );
1296 assign vlan_tbl_rd_din[17:9] = 9'h0;
1297
1298 niu_ram_128_42 niu_ram_128_42_0 (
1299 .tcu_aclk (tcu_aclk),
1300 .tcu_bclk (tcu_bclk),
1301 .tcu_se_scancollar_in (tcu_se_scancollar_in),
1302 .tcu_array_wr_inhibit (tcu_array_wr_inhibit),
1303 .scan_in (niu_mb6_tcam_array_scan_in),
1304 .scan_out (niu_mb6_tcam_array_scan_out),
1305 .mbi_wdata (niu_mb6_tcam_array_wdata_42[41:0]),
1306 .mbi_rd_adr (niu_mb6_tcam_array_rd_addr[6:0]),
1307 .mbi_wr_adr (niu_mb6_tcam_array_wr_addr[6:0]),
1308 .mbi_wr_en (niu_mb6_tcam_array_wr_en),
1309 .mbi_rd_en (niu_mb6_tcam_array_rd_en),
1310 .mbi_run (niu_mb6_tcam_array_run),
1311 .data_inp (am_dout[41:0]),
1312 .addr_rd (am_addr[6:0]),
1313 .addr_wt (am_addr[6:0]),
1314 .wt_enable (am_wr),
1315 .cs_rd (am_rd),
1316 .clk (iol2clk),
1317 .data_out (am_din[41:0])
1318 );
1319
1320 niu_mb5 niu_mb5_tcam_ctrl_0 (
1321 .rst (reset_core_tcam),
1322 .niu_mb5_tcam_cntrl_rd_en (niu_mb5_tcam_cntrl_rd_en),
1323 .niu_mb5_tcam_cntrl_wr_en (niu_mb5_tcam_cntrl_wr_en),
1324 .niu_mb5_addr (niu_mb5_addr[6:0]),
1325 .niu_mb5_run (niu_mb5_run),
1326 .niu_tcu_mbist_fail_5 (rtx_rxc_mb5_tcu_mbist_fail),
1327 .niu_tcu_mbist_done_5 (rtx_rxc_mb5_tcu_mbist_done),
1328 .mb5_scan_out (rtx_rxc_tcam_cntrl_mbist_scan_out),
1329 .niu_mb5_data_inp (niu_mb5_data_inp[199:0]),
1330 .niu_mb5_pio_sel (niu_mb5_pio_sel),
1331 .niu_mb5_cam_compare (niu_mb5_cam_compare),
1332 .l1clk (niu_clk),
1333 .mb5_scan_in (rtx_rxc_tcam_cntrl_mbist_scan_in),
1334 .tcu_aclk (tcu_aclk),
1335 .tcu_bclk (tcu_bclk),
1336 .tcu_niu_mbist_start_5 (tcu_rtx_rxc_mb5_mbist_start),
1337 .niu_mb5_msk_dat_out (msk_dat_out[199:0]),
1338 .tcu_mbist_bisi_en (tcu_mbist_bisi_en),
1339 .niu_mb5_cam_haddr (cam_haddr[6:0]),
1340 .niu_mb5_cam_valid (cam_valid),
1341 .niu_mb5_rd_vld (pio_rd_vld),
1342 .niu_mb5_cam_hit (cam_hit),
1343 .tcu_mbist_user_mode (tcu_mbist_user_mode)
1344 );
1345
1346
1347 niu_mb6 niu_mb6_tcam_vlan_0 (
1348 .rst (reset_core_tcam),
1349 .niu_mb6_tcam_array_rd_en (niu_mb6_tcam_array_rd_en),
1350 .niu_mb6_tcam_array_wr_en (niu_mb6_tcam_array_wr_en),
1351 .niu_mb6_vlan_rd_en (niu_mb6_vlan_rd_en),
1352 .niu_mb6_vlan_wr_en (niu_mb6_vlan_wr_en),
1353 .niu_mb6_addr (niu_mb6_addr[11:0]),
1354 .niu_mb6_wdata (niu_mb6_wdata),
1355 .niu_mb6_run (niu_mb6_run),
1356 .niu_mb6_tcam_array_data_out (niu_mb6_tcam_array_data_out),
1357 .niu_mb6_vlan_data_out (niu_mb6_vlan_data_out),
1358 .tcu_mbist_bisi_en (tcu_mbist_bisi_en),
1359 .tcu_niu_mbist_start_6 (tcu_rtx_rxc_mb6_mbist_start),
1360 .niu_tcu_mbist_fail_6 (rtx_rxc_mb6_tcu_mbist_fail),
1361 .niu_tcu_mbist_done_6 (rtx_rxc_mb6_tcu_mbist_done),
1362 .l1clk (niu_clk),
1363 .mb6_scan_out (rtx_rxc_tcam_vlan_mbist_scan_out),
1364 .mb6_scan_in (rtx_rxc_tcam_vlan_mbist_scan_in),
1365 .mb6_dmo_dout (rtx_rxc_vlan_mb6_dmo_dout),
1366 .tcu_aclk (tcu_aclk),
1367 .tcu_bclk (tcu_bclk),
1368 .tcu_mbist_user_mode (tcu_mbist_user_mode)
1369 );
1370
1371
1372`endif
1373
1374endmodule