Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: ncu_c2ifc_ctl.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 | `define RF_RDEN_OFFSTATE 1'b1 | |
36 | ||
37 | //==================================== | |
38 | `define NCU_INTMANRF_DEPTH 128 | |
39 | `define NCU_INTMANRF_DATAWIDTH 16 | |
40 | `define NCU_INTMANRF_ADDRWIDTH 7 | |
41 | //==================================== | |
42 | ||
43 | //==================================== | |
44 | `define NCU_MONDORF_DEPTH 64 | |
45 | `define NCU_MONDORF_DATAWIDTH 72 | |
46 | `define NCU_MONDORF_ADDRWIDTH 6 | |
47 | //==================================== | |
48 | ||
49 | //==================================== | |
50 | `define NCU_CPUBUFRF_DEPTH 32 | |
51 | `define NCU_CPUBUFRF_DATAWIDTH 144 | |
52 | `define NCU_CPUBUFRF_ADDRWIDTH 5 | |
53 | //==================================== | |
54 | ||
55 | //==================================== | |
56 | `define NCU_IOBUFRF_DEPTH 32 | |
57 | `define NCU_IOBUFRF_DATAWIDTH 144 | |
58 | `define NCU_IOBUFRF_ADDRWIDTH 5 | |
59 | //==================================== | |
60 | ||
61 | //==================================== | |
62 | `define NCU_IOBUF1RF_DEPTH 32 | |
63 | `define NCU_IOBUF1RF_DATAWIDTH 32 | |
64 | `define NCU_IOBUF1RF_ADDRWIDTH 5 | |
65 | //==================================== | |
66 | ||
67 | //==================================== | |
68 | `define NCU_INTBUFRF_DEPTH 32 | |
69 | `define NCU_INTBUFRF_DATAWIDTH 144 | |
70 | `define NCU_INTBUFRF_ADDRWIDTH 5 | |
71 | //==================================== | |
72 | ||
73 | //== fix me : need to remove when warm // | |
74 | //== becomes available // | |
75 | `define WMR_LENGTH 10'd999 | |
76 | `define WMR_LENGTH_P1 10'd1000 | |
77 | ||
78 | //// NCU CSR_MAN address 80_0000_xxxx //// | |
79 | `define NCU_CSR_MAN 16'h0000 | |
80 | `define NCU_CREG_INTMAN 16'h0000 | |
81 | //`define NCU_CREG_INTVECDISP 16'h0800 | |
82 | `define NCU_CREG_MONDOINVEC 16'h0a00 | |
83 | `define NCU_CREG_SERNUM 16'h1000 | |
84 | `define NCU_CREG_FUSESTAT 16'h1008 | |
85 | `define NCU_CREG_COREAVAIL 16'h1010 | |
86 | `define NCU_CREG_BANKAVAIL 16'h1018 | |
87 | `define NCU_CREG_BANK_ENABLE 16'h1020 | |
88 | `define NCU_CREG_BANK_ENABLE_STATUS 16'h1028 | |
89 | `define NCU_CREG_L2_HASH_ENABLE 16'h1030 | |
90 | `define NCU_CREG_L2_HASH_ENABLE_STATUS 16'h1038 | |
91 | ||
92 | ||
93 | `define NCU_CREG_MEM32_BASE 16'h2000 | |
94 | `define NCU_CREG_MEM32_MASK 16'h2008 | |
95 | `define NCU_CREG_MEM64_BASE 16'h2010 | |
96 | `define NCU_CREG_MEM64_MASK 16'h2018 | |
97 | `define NCU_CREG_IOCON_BASE 16'h2020 | |
98 | `define NCU_CREG_IOCON_MASK 16'h2028 | |
99 | `define NCU_CREG_MMUFSH 16'h2030 | |
100 | ||
101 | `define NCU_CREG_ESR 16'h3000 | |
102 | `define NCU_CREG_ELE 16'h3008 | |
103 | `define NCU_CREG_EIE 16'h3010 | |
104 | `define NCU_CREG_EJR 16'h3018 | |
105 | `define NCU_CREG_FEE 16'h3020 | |
106 | `define NCU_CREG_PER 16'h3028 | |
107 | `define NCU_CREG_SIISYN 16'h3030 | |
108 | `define NCU_CREG_NCUSYN 16'h3038 | |
109 | `define NCU_CREG_SCKSEL 16'h3040 | |
110 | `define NCU_CREG_DBGTRIG_EN 16'h4000 | |
111 | ||
112 | //// NUC CSR_MONDO address 80_0004_xxxx //// | |
113 | `define NCU_CSR_MONDO 16'h0004 | |
114 | `define NCU_CREG_MDATA0 16'h0000 | |
115 | `define NCU_CREG_MDATA1 16'h0200 | |
116 | `define NCU_CREG_MDATA0_ALIAS 16'h0400 | |
117 | `define NCU_CREG_MDATA1_ALIAS 16'h0600 | |
118 | `define NCU_CREG_MBUSY 16'h0800 | |
119 | `define NCU_CREG_MBUSY_ALIAS 16'h0a00 | |
120 | ||
121 | ||
122 | ||
123 | // ASI shared reg 90_xxxx_xxxx// | |
124 | `define NCU_ASI_A_HIT 10'h104 // 6-bits cpuid and thread id are "x" | |
125 | `define NCU_ASI_B_HIT 10'h1CC // 6-bits cpuid and thread id are "x" | |
126 | `define NCU_ASI_C_HIT 10'h114 // 6-bits cpuid and thread id are "x" | |
127 | `define NCU_ASI_COREAVAIL 16'h0000 | |
128 | `define NCU_ASI_CORE_ENABLE_STATUS 16'h0010 | |
129 | `define NCU_ASI_CORE_ENABLE 16'h0020 | |
130 | `define NCU_ASI_XIR_STEERING 16'h0030 | |
131 | `define NCU_ASI_CORE_RUNNINGRW 16'h0050 | |
132 | `define NCU_ASI_CORE_RUNNING_STATUS 16'h0058 | |
133 | `define NCU_ASI_CORE_RUNNING_W1S 16'h0060 | |
134 | `define NCU_ASI_CORE_RUNNING_W1C 16'h0068 | |
135 | `define NCU_ASI_INTVECDISP 16'h0000 | |
136 | `define NCU_ASI_ERR_STR 16'h1000 | |
137 | `define NCU_ASI_WMR_VEC_MASK 16'h0018 | |
138 | `define NCU_ASI_CMP_TICK_ENABLE 16'h0038 | |
139 | ||
140 | ||
141 | //// UCB packet type //// | |
142 | `define UCB_READ_NACK 4'b0000 // ack/nack types | |
143 | `define UCB_READ_ACK 4'b0001 | |
144 | `define UCB_WRITE_ACK 4'b0010 | |
145 | `define UCB_IFILL_ACK 4'b0011 | |
146 | `define UCB_IFILL_NACK 4'b0111 | |
147 | ||
148 | `define UCB_READ_REQ 4'b0100 // req types | |
149 | `define UCB_WRITE_REQ 4'b0101 | |
150 | `define UCB_IFILL_REQ 4'b0110 | |
151 | ||
152 | `define UCB_INT 4'b1000 // plain interrupt | |
153 | `define UCB_INT_VEC 4'b1100 // interrupt with vector | |
154 | `define UCB_INT_SOC_UE 4'b1001 // soc interrup ue | |
155 | `define UCB_INT_SOC_CE 4'b1010 // soc interrup ce | |
156 | `define UCB_RESET_VEC 4'b0101 // reset with vector | |
157 | `define UCB_IDLE_VEC 4'b1110 // idle with vector | |
158 | `define UCB_RESUME_VEC 4'b1111 // resume with vector | |
159 | ||
160 | `define UCB_INT_SOC 4'b1101 // soc interrup ce | |
161 | ||
162 | ||
163 | //// PCX packet type //// | |
164 | `define PCX_LOAD_RQ 5'b00000 | |
165 | `define PCX_IMISS_RQ 5'b10000 | |
166 | `define PCX_STORE_RQ 5'b00001 | |
167 | `define PCX_FWD_RQs 5'b01101 | |
168 | `define PCX_FWD_RPYs 5'b01110 | |
169 | ||
170 | //// CPX packet type //// | |
171 | //`define CPX_LOAD_RET 4'b0000 | |
172 | `define CPX_LOAD_RET 4'b1000 | |
173 | `define CPX_ST_ACK 4'b0100 | |
174 | //`define CPX_IFILL_RET 4'b0001 | |
175 | `define CPX_IFILL_RET 4'b1001 | |
176 | `define CPX_INT_RET 4'b0111 | |
177 | `define CPX_INT_SOC 4'b1101 | |
178 | //`define CPX_FWD_RQ_RET 4'b1010 | |
179 | //`define CPX_FWD_RPY_RET 4'b1011 | |
180 | ||
181 | ||
182 | ||
183 | ||
184 | //// Global CSR decode //// | |
185 | `define NCU_CSR 8'h80 | |
186 | `define NIU_CSR 8'h81 | |
187 | //`define RNG_CSR 8'h82 | |
188 | `define DBG1_CSR 8'h86 | |
189 | `define CCU_CSR 8'h83 | |
190 | `define MCU_CSR 8'h84 | |
191 | `define TCU_CSR 8'h85 | |
192 | `define DMU_CSR 8'h88 | |
193 | `define RCU_CSR 8'h89 | |
194 | `define NCU_ASI 8'h90 | |
195 | /////8'h91 ~ 9F reserved | |
196 | /////8'hA0 ~ BF L2 CSR//// | |
197 | `define DMU_PIO 4'hC // C0 ~ CF | |
198 | /////8'hB0 ~ FE reserved | |
199 | `define SSI_CSR 8'hFF | |
200 | ||
201 | ||
202 | //// NCU_SSI //// | |
203 | `define SSI_ADDR 12'hFF_F | |
204 | `define SSI_ADDR_TIMEOUT_REG 40'hFF_0001_0088 | |
205 | `define SSI_ADDR_LOG_REG 40'hFF_0000_0018 | |
206 | ||
207 | `define IF_IDLE 2'b00 | |
208 | `define IF_ACPT 2'b01 | |
209 | `define IF_DROP 2'b10 | |
210 | ||
211 | `define SSI_IDLE 3'b000 | |
212 | `define SSI_REQ 3'b001 | |
213 | `define SSI_WDATA 3'b011 | |
214 | `define SSI_REQ_PAR 3'b101 | |
215 | `define SSI_ACK 3'b111 | |
216 | `define SSI_RDATA 3'b110 | |
217 | `define SSI_ACK_PAR 3'b010 | |
218 | ||
219 | ||
220 | ||
221 | ||
222 | ||
223 | ||
224 | ||
225 | ||
226 | ||
227 | ||
228 | module ncu_c2ifc_ctl ( | |
229 | l2clk, | |
230 | cmp_io_sync_en, | |
231 | io_cmp_sync_en, | |
232 | tcu_scan_en, | |
233 | scan_in, | |
234 | scan_out, | |
235 | tcu_pce_ov, | |
236 | tcu_clk_stop, | |
237 | tcu_aclk, | |
238 | tcu_bclk, | |
239 | pcx_ncu_data_rdy_px1, | |
240 | ncu_pcx_stall_pq, | |
241 | pcx_ncu_vld, | |
242 | pcx_ncu_req, | |
243 | pcx_ncu_addr, | |
244 | pcx_ncu_cputhr, | |
245 | io_mondo_data_wr, | |
246 | mondo_data_bypass_d2, | |
247 | mondo_addr_creg_mdata0_dec_d2, | |
248 | mondo_addr_creg_mdata1_dec_d2, | |
249 | mondo_addr_creg_mbusy_dec_d2, | |
250 | tap_mondo_rd_d2, | |
251 | cpu_mondo_addr_invld_d2, | |
252 | cpubuf_head_s, | |
253 | cpubuf_tail_f, | |
254 | intbuf_wr, | |
255 | intbuf_wr2i2c, | |
256 | cpu_mondo_rd_d2, | |
257 | intbuf_hit_hwm, | |
258 | io_mondo_data_wr_s, | |
259 | io_mondo_data_wr_addr_s, | |
260 | tap_mondo_acc_addr_s, | |
261 | tap_mondo_acc_seq_s, | |
262 | tap_mondo_wr_s, | |
263 | tap_mondo_acc_addr_invld_d2_f, | |
264 | tap_mondo_acc_seq_d2_f, | |
265 | mondo_data_addr_p0, | |
266 | mondo_busy_addr_p0, | |
267 | mondo_data_addr_p1, | |
268 | mondo_busy_addr_p1, | |
269 | mondo_busy_wr_p1, | |
270 | mondo_busy_addr_p2, | |
271 | mondo_busy_wr_p2, | |
272 | mondo_data0_wr, | |
273 | mondo_data1_wr, | |
274 | cpubuf_wr, | |
275 | cpubuf_tail_ptr, | |
276 | mb0_mondo_wr_en, | |
277 | mb0_waddr, | |
278 | mb0_raddr, | |
279 | mb0_run, | |
280 | mb1_run, | |
281 | mb1_waddr, | |
282 | mb1_cpubuf_wr_en, | |
283 | mb0_intbuf_wr_en) ; | |
284 | wire pcx_ncu_data_rdy_px2_ff_scanin; | |
285 | wire pcx_ncu_data_rdy_px2_ff_scanout; | |
286 | wire pcx_ncu_data_rdy_px2; | |
287 | wire l1clk; | |
288 | wire pcx_ncu_data_rdy_ff_scanin; | |
289 | wire pcx_ncu_data_rdy_ff_scanout; | |
290 | wire pcx_ncu_data_rdy; | |
291 | wire cpu_mondo_acc; | |
292 | wire cpu_mondo_rd; | |
293 | wire cpu_mondo_wr; | |
294 | wire cpu_mondo_rd_d1_ff_scanin; | |
295 | wire cpu_mondo_rd_d1_ff_scanout; | |
296 | wire cpu_mondo_rd_d1; | |
297 | wire cpu_mondo_rd_d2_ff_scanin; | |
298 | wire cpu_mondo_rd_d2_ff_scanout; | |
299 | wire cpu_mondo_wr_d1_ff_scanin; | |
300 | wire cpu_mondo_wr_d1_ff_scanout; | |
301 | wire cpu_mondo_wr_d1; | |
302 | wire cpu_mondo_wr_d2_ff_scanin; | |
303 | wire cpu_mondo_wr_d2_ff_scanout; | |
304 | wire cpu_mondo_wr_d2; | |
305 | wire cpu_mondo_rd_wr; | |
306 | wire cpu_mondo_rd_wr_d2; | |
307 | wire cpu_mondo_rd_wr_ff_scanin; | |
308 | wire cpu_mondo_rd_wr_ff_scanout; | |
309 | wire intbuf_wr2i2c_ff_scanin; | |
310 | wire intbuf_wr2i2c_ff_scanout; | |
311 | wire c_creg_mdata0_alias_dec; | |
312 | wire c_creg_mdata1_alias_dec; | |
313 | wire c_creg_mbusy_alias_dec; | |
314 | wire c_creg_mdata0_proper_dec; | |
315 | wire c_creg_mdata1_proper_dec; | |
316 | wire c_creg_mbusy_proper_dec; | |
317 | wire c_use_thr_addr; | |
318 | wire [5:0] cpu_mondo_data_addr; | |
319 | wire cpu_mondo_addr_creg_mdata0_dec; | |
320 | wire cpu_mondo_addr_creg_mdata1_dec; | |
321 | wire cpu_mondo_addr_creg_mbusy_dec; | |
322 | wire cpu_mondo_addr_invld; | |
323 | wire cpu_mondo_addr_creg_mdata0_dec_d1_ff_scanin; | |
324 | wire cpu_mondo_addr_creg_mdata0_dec_d1_ff_scanout; | |
325 | wire cpu_mondo_addr_creg_mdata0_dec_d1; | |
326 | wire cpu_mondo_addr_creg_mdata1_dec_d1_ff_scanin; | |
327 | wire cpu_mondo_addr_creg_mdata1_dec_d1_ff_scanout; | |
328 | wire cpu_mondo_addr_creg_mdata1_dec_d1; | |
329 | wire cpu_mondo_addr_creg_mbusy_dec_d1_ff_scanin; | |
330 | wire cpu_mondo_addr_creg_mbusy_dec_d1_ff_scanout; | |
331 | wire cpu_mondo_addr_creg_mbusy_dec_d1; | |
332 | wire cpu_mondo_addr_invld_d1_ff_scanin; | |
333 | wire cpu_mondo_addr_invld_d1_ff_scanout; | |
334 | wire cpu_mondo_addr_invld_d1; | |
335 | wire cpu_mondo_addr_invld_d2_ff_scanin; | |
336 | wire cpu_mondo_addr_invld_d2_ff_scanout; | |
337 | wire io_mondo_data_wr_ff_scanin; | |
338 | wire io_mondo_data_wr_ff_scanout; | |
339 | wire io_mondo_data_addr_ff_scanin; | |
340 | wire io_mondo_data_addr_ff_scanout; | |
341 | wire [5:0] io_mondo_data_addr; | |
342 | wire tap_mondo_acc_addr_ff_scanin; | |
343 | wire tap_mondo_acc_addr_ff_scanout; | |
344 | wire [21:0] tap_mondo_acc_addr; | |
345 | wire t_creg_mdata0_alias_dec; | |
346 | wire t_creg_mdata1_alias_dec; | |
347 | wire t_creg_mbusy_alias_dec; | |
348 | wire t_creg_mdata0_proper_dec; | |
349 | wire t_creg_mdata1_proper_dec; | |
350 | wire t_creg_mbusy_proper_dec; | |
351 | wire t_use_thr_addr; | |
352 | wire [5:0] tap_mondo_data_addr; | |
353 | wire tap_mondo_addr_creg_mdata0_dec; | |
354 | wire tap_mondo_addr_creg_mdata1_dec; | |
355 | wire tap_mondo_addr_creg_mbusy_dec; | |
356 | wire tap_mondo_addr_invld; | |
357 | wire tap_mondo_addr_creg_mdata0_dec_d1_ff_scanin; | |
358 | wire tap_mondo_addr_creg_mdata0_dec_d1_ff_scanout; | |
359 | wire tap_mondo_addr_creg_mdata0_dec_d1; | |
360 | wire tap_mondo_acc; | |
361 | wire tap_mondo_addr_creg_mdata1_dec_d1_ff_scanin; | |
362 | wire tap_mondo_addr_creg_mdata1_dec_d1_ff_scanout; | |
363 | wire tap_mondo_addr_creg_mdata1_dec_d1; | |
364 | wire tap_mondo_addr_creg_mbusy_dec_d1_ff_scanin; | |
365 | wire tap_mondo_addr_creg_mbusy_dec_d1_ff_scanout; | |
366 | wire tap_mondo_addr_creg_mbusy_dec_d1; | |
367 | wire tap_mondo_addr_invld_d1_ff_scanin; | |
368 | wire tap_mondo_addr_invld_d1_ff_scanout; | |
369 | wire tap_mondo_addr_invld_d1; | |
370 | wire tap_mondo_addr_invld_d2_ff_scanin; | |
371 | wire tap_mondo_addr_invld_d2_ff_scanout; | |
372 | wire tap_mondo_addr_invld_d2; | |
373 | wire tap_mondo_acc_addr_invld_d2_f_ff_scanin; | |
374 | wire tap_mondo_acc_addr_invld_d2_f_ff_scanout; | |
375 | wire tap_mondo_acc_seq_ff_scanin; | |
376 | wire tap_mondo_acc_seq_ff_scanout; | |
377 | wire tap_mondo_acc_seq; | |
378 | wire tap_mondo_acc_seq_d1_ff_scanin; | |
379 | wire tap_mondo_acc_seq_d1_ff_scanout; | |
380 | wire tap_mondo_acc_seq_d1; | |
381 | wire tap_mondo_acc_seq_d2_ff_scanin; | |
382 | wire tap_mondo_acc_seq_d2_ff_scanout; | |
383 | wire tap_mondo_acc_seq_d2; | |
384 | wire tap_mondo_acc_seq_d2_f_ff_scanin; | |
385 | wire tap_mondo_acc_seq_d2_f_ff_scanout; | |
386 | wire tap_mondo_wr_ff_scanin; | |
387 | wire tap_mondo_wr_ff_scanout; | |
388 | wire tap_mondo_wr; | |
389 | wire tap_mondo_rd; | |
390 | wire tap_mondo_rd_d1_ff_scanin; | |
391 | wire tap_mondo_rd_d1_ff_scanout; | |
392 | wire tap_mondo_rd_d1; | |
393 | wire tap_mondo_rd_d2_ff_scanin; | |
394 | wire tap_mondo_rd_d2_ff_scanout; | |
395 | wire mondo_addr_creg_mdata0_dec_d1; | |
396 | wire mondo_addr_creg_mdata0_dec_d2_ff_scanin; | |
397 | wire mondo_addr_creg_mdata0_dec_d2_ff_scanout; | |
398 | wire mondo_addr_creg_mdata1_dec_d1; | |
399 | wire mondo_addr_creg_mdata1_dec_d2_ff_scanin; | |
400 | wire mondo_addr_creg_mdata1_dec_d2_ff_scanout; | |
401 | wire mondo_addr_creg_mbusy_dec_d1; | |
402 | wire mondo_addr_creg_mbusy_dec_d2_ff_scanin; | |
403 | wire mondo_addr_creg_mbusy_dec_d2_ff_scanout; | |
404 | wire mondo_data0_wr_f; | |
405 | wire mondo_data1_wr_f; | |
406 | wire mondo_data_wr_d1_ff_scanin; | |
407 | wire mondo_data_wr_d1_ff_scanout; | |
408 | wire mondo_data_wr_d1; | |
409 | wire mondo_data_addr_p0_d1_ff_scanin; | |
410 | wire mondo_data_addr_p0_d1_ff_scanout; | |
411 | wire [5:0] mondo_data_addr_p0_d1; | |
412 | wire mondo_data_addr_p1_d1_ff_scanin; | |
413 | wire mondo_data_addr_p1_d1_ff_scanout; | |
414 | wire [5:0] mondo_data_addr_p1_d1; | |
415 | wire mondo_data_bypass_d1; | |
416 | wire mondo_data_bypass_d2_ff_scanin; | |
417 | wire mondo_data_bypass_d2_ff_scanout; | |
418 | wire cpubuf_tail_ff_scanin; | |
419 | wire cpubuf_tail_ff_scanout; | |
420 | wire [5:0] cpubuf_tail; | |
421 | wire [5:0] cpubuf_tail_plus; | |
422 | wire cpubuf_tail_f_ff_scanin; | |
423 | wire cpubuf_tail_f_ff_scanout; | |
424 | wire cpubuf_head_ff_scanin; | |
425 | wire cpubuf_head_ff_scanout; | |
426 | wire [5:0] cpubuf_head; | |
427 | wire [5:0] cpubuf_tail_plus6; | |
428 | wire cpubuf_hit_hwm; | |
429 | wire ncu_pcx_stall_pq_ff_scanin; | |
430 | wire ncu_pcx_stall_pq_ff_scanout; | |
431 | wire siclk; | |
432 | wire soclk; | |
433 | wire se; | |
434 | wire pce_ov; | |
435 | wire stop; | |
436 | ||
437 | ||
438 | //////////////////////////////////////////////////////////////////////// | |
439 | // Signal declarations | |
440 | //////////////////////////////////////////////////////////////////////// | |
441 | // Global interface | |
442 | input l2clk; | |
443 | input cmp_io_sync_en; | |
444 | input io_cmp_sync_en; | |
445 | ||
446 | input tcu_scan_en; | |
447 | input scan_in; | |
448 | output scan_out; | |
449 | input tcu_pce_ov; | |
450 | input tcu_clk_stop; | |
451 | input tcu_aclk; | |
452 | input tcu_bclk; | |
453 | ||
454 | // Crossbar interface | |
455 | input pcx_ncu_data_rdy_px1; | |
456 | output ncu_pcx_stall_pq; | |
457 | ||
458 | // c2i fast datapath interface | |
459 | input pcx_ncu_vld; | |
460 | input [4:0] pcx_ncu_req; | |
461 | input [39:0] pcx_ncu_addr; | |
462 | input [5:0] pcx_ncu_cputhr; | |
463 | ||
464 | output io_mondo_data_wr; | |
465 | output mondo_data_bypass_d2; | |
466 | output mondo_addr_creg_mdata0_dec_d2; | |
467 | output mondo_addr_creg_mdata1_dec_d2; | |
468 | output mondo_addr_creg_mbusy_dec_d2; | |
469 | output tap_mondo_rd_d2; | |
470 | output cpu_mondo_addr_invld_d2; | |
471 | ||
472 | // c2i slow control interface | |
473 | input [5:0] cpubuf_head_s; | |
474 | output [5:0] cpubuf_tail_f; | |
475 | ||
476 | // i2c fast control interface | |
477 | output intbuf_wr; | |
478 | output intbuf_wr2i2c; | |
479 | output cpu_mondo_rd_d2; | |
480 | ||
481 | input intbuf_hit_hwm; | |
482 | ||
483 | // i2c slow control interface | |
484 | input io_mondo_data_wr_s; | |
485 | ||
486 | // i2c slow datapath interface | |
487 | input [5:0] io_mondo_data_wr_addr_s; | |
488 | ||
489 | // IOB control interface | |
490 | input [21:0] tap_mondo_acc_addr_s; | |
491 | input tap_mondo_acc_seq_s; | |
492 | input tap_mondo_wr_s; | |
493 | output tap_mondo_acc_addr_invld_d2_f; | |
494 | output tap_mondo_acc_seq_d2_f; | |
495 | ||
496 | // Mondo data table interface | |
497 | output [5:0] mondo_data_addr_p0; | |
498 | output [5:0] mondo_busy_addr_p0; | |
499 | ||
500 | output [5:0] mondo_data_addr_p1; | |
501 | output [5:0] mondo_busy_addr_p1; | |
502 | output mondo_busy_wr_p1; | |
503 | ||
504 | output [5:0] mondo_busy_addr_p2; | |
505 | output mondo_busy_wr_p2; | |
506 | ||
507 | output mondo_data0_wr; | |
508 | output mondo_data1_wr; | |
509 | ||
510 | // Cpu buffer interface | |
511 | output cpubuf_wr; | |
512 | output [4:0] cpubuf_tail_ptr; | |
513 | ||
514 | // mb0 signals // | |
515 | input mb0_mondo_wr_en; | |
516 | input [5:0] mb0_waddr; | |
517 | input [5:0] mb0_raddr; | |
518 | input mb0_run; | |
519 | input mb1_run; | |
520 | input[5:0] mb1_waddr; | |
521 | input mb1_cpubuf_wr_en; | |
522 | input mb0_intbuf_wr_en; | |
523 | ||
524 | ||
525 | ||
526 | // Internal signals | |
527 | ||
528 | ||
529 | ||
530 | ||
531 | ||
532 | ||
533 | ||
534 | ||
535 | ||
536 | /***************************************************************** | |
537 | * Read/Write request to the interrupt status table, mondo data tables, | |
538 | * and mondo busy table from CPU. | |
539 | * Write will not update the tables (only generates ack) except the | |
540 | * mondo busy bit because the entries are read-only by software. | |
541 | *****************************************************************/ | |
542 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 pcx_ncu_data_rdy_px2_ff | |
543 | ( | |
544 | .scan_in(pcx_ncu_data_rdy_px2_ff_scanin), | |
545 | .scan_out(pcx_ncu_data_rdy_px2_ff_scanout), | |
546 | .dout (pcx_ncu_data_rdy_px2), | |
547 | .l1clk (l1clk), | |
548 | .din (pcx_ncu_data_rdy_px1), | |
549 | .siclk(siclk), | |
550 | .soclk(soclk) | |
551 | ); | |
552 | ||
553 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 pcx_ncu_data_rdy_ff | |
554 | ( | |
555 | .scan_in(pcx_ncu_data_rdy_ff_scanin), | |
556 | .scan_out(pcx_ncu_data_rdy_ff_scanout), | |
557 | .dout (pcx_ncu_data_rdy), | |
558 | .l1clk (l1clk), | |
559 | .din (pcx_ncu_data_rdy_px2), | |
560 | .siclk(siclk), | |
561 | .soclk(soclk) | |
562 | ); | |
563 | ||
564 | // Check address to see if request is mondo data, or mondo busy. | |
565 | // They are all in the NCU_MONDO CSR space. | |
566 | assign cpu_mondo_acc = pcx_ncu_data_rdy & pcx_ncu_vld & | |
567 | (pcx_ncu_addr[39:16] == {`NCU_CSR,`NCU_CSR_MONDO}); | |
568 | ||
569 | assign cpu_mondo_rd = cpu_mondo_acc & (pcx_ncu_req[4:0] == `PCX_LOAD_RQ); | |
570 | ||
571 | //jimmy : this will only cause a wr ack back to source cputhr // | |
572 | assign cpu_mondo_wr = cpu_mondo_acc & (pcx_ncu_req[4:0] == `PCX_STORE_RQ); | |
573 | ||
574 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 cpu_mondo_rd_d1_ff | |
575 | ( | |
576 | .scan_in(cpu_mondo_rd_d1_ff_scanin), | |
577 | .scan_out(cpu_mondo_rd_d1_ff_scanout), | |
578 | .dout (cpu_mondo_rd_d1), | |
579 | .l1clk (l1clk), | |
580 | .din (cpu_mondo_rd), | |
581 | .siclk(siclk), | |
582 | .soclk(soclk) | |
583 | ); | |
584 | ||
585 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 cpu_mondo_rd_d2_ff | |
586 | ( | |
587 | .scan_in(cpu_mondo_rd_d2_ff_scanin), | |
588 | .scan_out(cpu_mondo_rd_d2_ff_scanout), | |
589 | .dout (cpu_mondo_rd_d2), | |
590 | .l1clk (l1clk), | |
591 | .din (cpu_mondo_rd_d1), | |
592 | .siclk(siclk), | |
593 | .soclk(soclk) | |
594 | ); | |
595 | ||
596 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 cpu_mondo_wr_d1_ff | |
597 | ( | |
598 | .scan_in(cpu_mondo_wr_d1_ff_scanin), | |
599 | .scan_out(cpu_mondo_wr_d1_ff_scanout), | |
600 | .dout (cpu_mondo_wr_d1), | |
601 | .l1clk (l1clk), | |
602 | .din (cpu_mondo_wr), | |
603 | .siclk(siclk), | |
604 | .soclk(soclk) | |
605 | ); | |
606 | ||
607 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 cpu_mondo_wr_d2_ff | |
608 | ( | |
609 | .scan_in(cpu_mondo_wr_d2_ff_scanin), | |
610 | .scan_out(cpu_mondo_wr_d2_ff_scanout), | |
611 | .dout (cpu_mondo_wr_d2), | |
612 | .l1clk (l1clk), | |
613 | .din (cpu_mondo_wr_d1), | |
614 | .siclk(siclk), | |
615 | .soclk(soclk) | |
616 | ); | |
617 | ||
618 | assign intbuf_wr = mb0_run ? mb0_intbuf_wr_en : cpu_mondo_rd_wr ; | |
619 | assign cpu_mondo_rd_wr_d2 = (cpu_mondo_rd_d2 | cpu_mondo_wr_d2) ; | |
620 | //assign intbuf_wr_n = mb0_run ? mb0_intbuf_wr_en : (cpu_mondo_rd_d2 | cpu_mondo_wr_d2) ; | |
621 | ||
622 | /* | |
623 | msff_ctl_macro intbuf_wr_ff (width=1) | |
624 | ( | |
625 | .scan_in(intbuf_wr_ff_scanin), | |
626 | .scan_out(intbuf_wr_ff_scanout), | |
627 | .dout (intbuf_wr), | |
628 | .l1clk (l1clk), | |
629 | .din (intbuf_wr_n) | |
630 | ); | |
631 | */ | |
632 | ||
633 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 cpu_mondo_rd_wr_ff | |
634 | ( | |
635 | .scan_in(cpu_mondo_rd_wr_ff_scanin), | |
636 | .scan_out(cpu_mondo_rd_wr_ff_scanout), | |
637 | .dout (cpu_mondo_rd_wr), | |
638 | .l1clk (l1clk), | |
639 | .din (cpu_mondo_rd_wr_d2), | |
640 | .siclk(siclk), | |
641 | .soclk(soclk) | |
642 | ); | |
643 | ||
644 | ||
645 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 intbuf_wr2i2c_ff | |
646 | ( | |
647 | .scan_in(intbuf_wr2i2c_ff_scanin), | |
648 | .scan_out(intbuf_wr2i2c_ff_scanout), | |
649 | .dout (intbuf_wr2i2c), | |
650 | .l1clk (l1clk), | |
651 | //.din (intbuf_wr_n) | |
652 | .din (cpu_mondo_rd_wr_d2), | |
653 | .siclk(siclk), | |
654 | .soclk(soclk) | |
655 | ); | |
656 | ||
657 | /******************************************************* | |
658 | * Decode cpu side address to access interrupt table | |
659 | *******************************************************/ | |
660 | ||
661 | ///*iobdg_int_mondo_addr_dec cpu_mondo_addr_dec (.addr_in(pcx_ncu_addr[39:0]), | |
662 | // .thr_id_in(pcx_ncu_cputhr[5:0]), | |
663 | // .creg_mdata0_dec(cpu_mondo_addr_creg_mdata0_dec), | |
664 | // .creg_mdata1_dec(cpu_mondo_addr_creg_mdata1_dec), | |
665 | // .creg_mbusy_dec(cpu_mondo_addr_creg_mbusy_dec), | |
666 | // .mondo_data_addr(cpu_mondo_data_addr[5:0]), | |
667 | // .addr_invld(cpu_mondo_addr_invld)); */ | |
668 | assign c_creg_mdata0_alias_dec = (pcx_ncu_addr[15:0] == `NCU_CREG_MDATA0_ALIAS ); | |
669 | assign c_creg_mdata1_alias_dec = (pcx_ncu_addr[15:0] == `NCU_CREG_MDATA1_ALIAS ); | |
670 | assign c_creg_mbusy_alias_dec = (pcx_ncu_addr[15:0] == `NCU_CREG_MBUSY_ALIAS ); | |
671 | ||
672 | // 16'hff07 | |
673 | assign c_creg_mdata0_proper_dec = ((pcx_ncu_addr[15:0]&16'hfe07) == `NCU_CREG_MDATA0 ); | |
674 | assign c_creg_mdata1_proper_dec = ((pcx_ncu_addr[15:0]&16'hfe07) == `NCU_CREG_MDATA1 ); | |
675 | assign c_creg_mbusy_proper_dec = ((pcx_ncu_addr[15:0]&16'hfe07) == `NCU_CREG_MBUSY ); | |
676 | ||
677 | assign c_use_thr_addr = c_creg_mdata0_alias_dec | | |
678 | c_creg_mdata1_alias_dec | | |
679 | c_creg_mbusy_alias_dec; | |
680 | ||
681 | assign cpu_mondo_data_addr[5:0] = c_use_thr_addr ? pcx_ncu_cputhr[5:0] : pcx_ncu_addr[8:3]; | |
682 | ||
683 | assign cpu_mondo_addr_creg_mdata0_dec = c_creg_mdata0_proper_dec | c_creg_mdata0_alias_dec; | |
684 | assign cpu_mondo_addr_creg_mdata1_dec = c_creg_mdata1_proper_dec | c_creg_mdata1_alias_dec; | |
685 | assign cpu_mondo_addr_creg_mbusy_dec = c_creg_mbusy_proper_dec | c_creg_mbusy_alias_dec; | |
686 | ||
687 | assign cpu_mondo_addr_invld = ~cpu_mondo_addr_creg_mdata0_dec & | |
688 | ~cpu_mondo_addr_creg_mdata1_dec & | |
689 | ~cpu_mondo_addr_creg_mbusy_dec ; | |
690 | ||
691 | ||
692 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 cpu_mondo_addr_creg_mdata0_dec_d1_ff | |
693 | ( | |
694 | .scan_in(cpu_mondo_addr_creg_mdata0_dec_d1_ff_scanin), | |
695 | .scan_out(cpu_mondo_addr_creg_mdata0_dec_d1_ff_scanout), | |
696 | .dout (cpu_mondo_addr_creg_mdata0_dec_d1), | |
697 | .l1clk (l1clk), | |
698 | .din (cpu_mondo_addr_creg_mdata0_dec), | |
699 | .siclk(siclk), | |
700 | .soclk(soclk) | |
701 | ); | |
702 | ||
703 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 cpu_mondo_addr_creg_mdata1_dec_d1_ff | |
704 | ( | |
705 | .scan_in(cpu_mondo_addr_creg_mdata1_dec_d1_ff_scanin), | |
706 | .scan_out(cpu_mondo_addr_creg_mdata1_dec_d1_ff_scanout), | |
707 | .dout (cpu_mondo_addr_creg_mdata1_dec_d1), | |
708 | .l1clk (l1clk), | |
709 | .din (cpu_mondo_addr_creg_mdata1_dec), | |
710 | .siclk(siclk), | |
711 | .soclk(soclk) | |
712 | ); | |
713 | ||
714 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 cpu_mondo_addr_creg_mbusy_dec_d1_ff | |
715 | ( | |
716 | .scan_in(cpu_mondo_addr_creg_mbusy_dec_d1_ff_scanin), | |
717 | .scan_out(cpu_mondo_addr_creg_mbusy_dec_d1_ff_scanout), | |
718 | .dout (cpu_mondo_addr_creg_mbusy_dec_d1), | |
719 | .l1clk (l1clk), | |
720 | .din (cpu_mondo_addr_creg_mbusy_dec), | |
721 | .siclk(siclk), | |
722 | .soclk(soclk) | |
723 | ); | |
724 | ||
725 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 cpu_mondo_addr_invld_d1_ff | |
726 | ( | |
727 | .scan_in(cpu_mondo_addr_invld_d1_ff_scanin), | |
728 | .scan_out(cpu_mondo_addr_invld_d1_ff_scanout), | |
729 | .dout (cpu_mondo_addr_invld_d1), | |
730 | .l1clk (l1clk), | |
731 | .din (cpu_mondo_addr_invld), | |
732 | .siclk(siclk), | |
733 | .soclk(soclk) | |
734 | ); | |
735 | ||
736 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 cpu_mondo_addr_invld_d2_ff | |
737 | ( | |
738 | .scan_in(cpu_mondo_addr_invld_d2_ff_scanin), | |
739 | .scan_out(cpu_mondo_addr_invld_d2_ff_scanout), | |
740 | .dout (cpu_mondo_addr_invld_d2), | |
741 | .l1clk (l1clk), | |
742 | .din (cpu_mondo_addr_invld_d1), | |
743 | .siclk(siclk), | |
744 | .soclk(soclk) | |
745 | ); | |
746 | ||
747 | /***************************************************************** | |
748 | * Write request to the mondo data0, mondo data1, mondo busy table | |
749 | * from JBI | |
750 | *****************************************************************/ | |
751 | // Write will be asserted for multiple cycles. That's okay. The | |
752 | // same entry in the array will be written several times. | |
753 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_1 io_mondo_data_wr_ff | |
754 | ( | |
755 | .scan_in(io_mondo_data_wr_ff_scanin), | |
756 | .scan_out(io_mondo_data_wr_ff_scanout), | |
757 | .dout (io_mondo_data_wr), | |
758 | .l1clk (l1clk), | |
759 | .en (io_cmp_sync_en), | |
760 | .din (io_mondo_data_wr_s), | |
761 | .siclk(siclk), | |
762 | .soclk(soclk) | |
763 | ); | |
764 | ||
765 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_6 io_mondo_data_addr_ff | |
766 | ( | |
767 | .scan_in(io_mondo_data_addr_ff_scanin), | |
768 | .scan_out(io_mondo_data_addr_ff_scanout), | |
769 | .dout (io_mondo_data_addr[5:0]), | |
770 | .l1clk (l1clk), | |
771 | .en (io_cmp_sync_en), | |
772 | .din (io_mondo_data_wr_addr_s[5:0]), | |
773 | .siclk(siclk), | |
774 | .soclk(soclk) | |
775 | ); | |
776 | ||
777 | /***************************************************************** | |
778 | * Read/Write request to the mondo data, mondo busy table from TAP | |
779 | *****************************************************************/ | |
780 | // Flop address to convert to cpu clock domain | |
781 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_22 tap_mondo_acc_addr_ff | |
782 | ( | |
783 | .scan_in(tap_mondo_acc_addr_ff_scanin), | |
784 | .scan_out(tap_mondo_acc_addr_ff_scanout), | |
785 | .dout (tap_mondo_acc_addr[21:0]), | |
786 | .l1clk (l1clk), | |
787 | .en (io_cmp_sync_en), | |
788 | .din (tap_mondo_acc_addr_s[21:0]), | |
789 | .siclk(siclk), | |
790 | .soclk(soclk) | |
791 | ); | |
792 | ||
793 | // Decode address to access interrupt table, mondo data, mondo busy | |
794 | // Thread ID is hardwired to zero. TAP should use alias address to access | |
795 | // mondo data table. If it tries to use the software address, only | |
796 | // thread 0's entry is accessible. | |
797 | /*iobdg_int_mondo_addr_dec tap_mondo_addr_dec (.addr_in(tap_mondo_acc_addr), | |
798 | .thr_id_in(5'b0), | |
799 | .creg_mdata0_dec(tap_mondo_addr_creg_mdata0_dec), | |
800 | .creg_mdata1_dec(tap_mondo_addr_creg_mdata1_dec), | |
801 | .creg_mbusy_dec(tap_mondo_addr_creg_mbusy_dec), | |
802 | .mondo_data_addr(tap_mondo_data_addr), | |
803 | .addr_invld(tap_mondo_addr_invld));*/ | |
804 | assign t_creg_mdata0_alias_dec = (tap_mondo_acc_addr[15:0] == `NCU_CREG_MDATA0_ALIAS ); | |
805 | assign t_creg_mdata1_alias_dec = (tap_mondo_acc_addr[15:0] == `NCU_CREG_MDATA1_ALIAS ); | |
806 | assign t_creg_mbusy_alias_dec = (tap_mondo_acc_addr[15:0] == `NCU_CREG_MBUSY_ALIAS ); | |
807 | ||
808 | // 16'hff07 | |
809 | assign t_creg_mdata0_proper_dec = ((tap_mondo_acc_addr[15:0]&16'hfe07) == `NCU_CREG_MDATA0 ); | |
810 | assign t_creg_mdata1_proper_dec = ((tap_mondo_acc_addr[15:0]&16'hfe07) == `NCU_CREG_MDATA1 ); | |
811 | assign t_creg_mbusy_proper_dec = ((tap_mondo_acc_addr[15:0]&16'hfe07) == `NCU_CREG_MBUSY ); | |
812 | ||
813 | assign t_use_thr_addr = t_creg_mdata0_alias_dec | | |
814 | t_creg_mdata1_alias_dec | | |
815 | t_creg_mbusy_alias_dec; | |
816 | ||
817 | assign tap_mondo_data_addr[5:0] = t_use_thr_addr ? tap_mondo_acc_addr[21:16] : tap_mondo_acc_addr[8:3]; | |
818 | ||
819 | assign tap_mondo_addr_creg_mdata0_dec = t_creg_mdata0_proper_dec | t_creg_mdata0_alias_dec; | |
820 | assign tap_mondo_addr_creg_mdata1_dec = t_creg_mdata1_proper_dec | t_creg_mdata1_alias_dec; | |
821 | assign tap_mondo_addr_creg_mbusy_dec = t_creg_mbusy_proper_dec | t_creg_mbusy_alias_dec; | |
822 | ||
823 | assign tap_mondo_addr_invld = ~tap_mondo_addr_creg_mdata0_dec & | |
824 | ~tap_mondo_addr_creg_mdata1_dec & | |
825 | ~tap_mondo_addr_creg_mbusy_dec ; | |
826 | ||
827 | ||
828 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_1 tap_mondo_addr_creg_mdata0_dec_d1_ff | |
829 | ( | |
830 | .scan_in(tap_mondo_addr_creg_mdata0_dec_d1_ff_scanin), | |
831 | .scan_out(tap_mondo_addr_creg_mdata0_dec_d1_ff_scanout), | |
832 | .dout (tap_mondo_addr_creg_mdata0_dec_d1), | |
833 | .l1clk (l1clk), | |
834 | .en (tap_mondo_acc), | |
835 | .din (tap_mondo_addr_creg_mdata0_dec), | |
836 | .siclk(siclk), | |
837 | .soclk(soclk) | |
838 | ); | |
839 | ||
840 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_1 tap_mondo_addr_creg_mdata1_dec_d1_ff | |
841 | ( | |
842 | .scan_in(tap_mondo_addr_creg_mdata1_dec_d1_ff_scanin), | |
843 | .scan_out(tap_mondo_addr_creg_mdata1_dec_d1_ff_scanout), | |
844 | .dout (tap_mondo_addr_creg_mdata1_dec_d1), | |
845 | .l1clk (l1clk), | |
846 | .en (tap_mondo_acc), | |
847 | .din (tap_mondo_addr_creg_mdata1_dec), | |
848 | .siclk(siclk), | |
849 | .soclk(soclk) | |
850 | ); | |
851 | ||
852 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_1 tap_mondo_addr_creg_mbusy_dec_d1_ff | |
853 | ( | |
854 | .scan_in(tap_mondo_addr_creg_mbusy_dec_d1_ff_scanin), | |
855 | .scan_out(tap_mondo_addr_creg_mbusy_dec_d1_ff_scanout), | |
856 | .dout (tap_mondo_addr_creg_mbusy_dec_d1), | |
857 | .l1clk (l1clk), | |
858 | .en (tap_mondo_acc), | |
859 | .din (tap_mondo_addr_creg_mbusy_dec), | |
860 | .siclk(siclk), | |
861 | .soclk(soclk) | |
862 | ); | |
863 | ||
864 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_1 tap_mondo_addr_invld_d1_ff | |
865 | ( | |
866 | .scan_in(tap_mondo_addr_invld_d1_ff_scanin), | |
867 | .scan_out(tap_mondo_addr_invld_d1_ff_scanout), | |
868 | .dout (tap_mondo_addr_invld_d1), | |
869 | .l1clk (l1clk), | |
870 | .en (tap_mondo_acc), | |
871 | .din (tap_mondo_addr_invld), | |
872 | .siclk(siclk), | |
873 | .soclk(soclk) | |
874 | ); | |
875 | ||
876 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 tap_mondo_addr_invld_d2_ff | |
877 | ( | |
878 | .scan_in(tap_mondo_addr_invld_d2_ff_scanin), | |
879 | .scan_out(tap_mondo_addr_invld_d2_ff_scanout), | |
880 | .dout (tap_mondo_addr_invld_d2), | |
881 | .l1clk (l1clk), | |
882 | .din (tap_mondo_addr_invld_d1), | |
883 | .siclk(siclk), | |
884 | .soclk(soclk) | |
885 | ); | |
886 | ||
887 | // Send result back to BSC clock domain | |
888 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_1 tap_mondo_acc_addr_invld_d2_f_ff | |
889 | ( | |
890 | .scan_in(tap_mondo_acc_addr_invld_d2_f_ff_scanin), | |
891 | .scan_out(tap_mondo_acc_addr_invld_d2_f_ff_scanout), | |
892 | .dout (tap_mondo_acc_addr_invld_d2_f), | |
893 | .l1clk (l1clk), | |
894 | .en (cmp_io_sync_en), | |
895 | .din (tap_mondo_addr_invld_d2), | |
896 | .siclk(siclk), | |
897 | .soclk(soclk) | |
898 | ); | |
899 | ||
900 | // Flop sequence number to convert to cpu clock domain | |
901 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_1 tap_mondo_acc_seq_ff | |
902 | ( | |
903 | .scan_in(tap_mondo_acc_seq_ff_scanin), | |
904 | .scan_out(tap_mondo_acc_seq_ff_scanout), | |
905 | .dout (tap_mondo_acc_seq), | |
906 | .l1clk (l1clk), | |
907 | .en (io_cmp_sync_en), | |
908 | .din (tap_mondo_acc_seq_s), | |
909 | .siclk(siclk), | |
910 | .soclk(soclk) | |
911 | ); | |
912 | ||
913 | // Keep track of which sequence number has been serviced | |
914 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_1 tap_mondo_acc_seq_d1_ff | |
915 | ( | |
916 | .scan_in(tap_mondo_acc_seq_d1_ff_scanin), | |
917 | .scan_out(tap_mondo_acc_seq_d1_ff_scanout), | |
918 | .dout (tap_mondo_acc_seq_d1), | |
919 | .l1clk (l1clk), | |
920 | .en (tap_mondo_acc), | |
921 | .din (tap_mondo_acc_seq), | |
922 | .siclk(siclk), | |
923 | .soclk(soclk) | |
924 | ); | |
925 | ||
926 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 tap_mondo_acc_seq_d2_ff | |
927 | ( | |
928 | .scan_in(tap_mondo_acc_seq_d2_ff_scanin), | |
929 | .scan_out(tap_mondo_acc_seq_d2_ff_scanout), | |
930 | .dout (tap_mondo_acc_seq_d2), | |
931 | .l1clk (l1clk), | |
932 | .din (tap_mondo_acc_seq_d1), | |
933 | .siclk(siclk), | |
934 | .soclk(soclk) | |
935 | ); | |
936 | ||
937 | // Send result back to JBUS clock domain | |
938 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_1 tap_mondo_acc_seq_d2_f_ff | |
939 | ( | |
940 | .scan_in(tap_mondo_acc_seq_d2_f_ff_scanin), | |
941 | .scan_out(tap_mondo_acc_seq_d2_f_ff_scanout), | |
942 | .dout (tap_mondo_acc_seq_d2_f), | |
943 | .l1clk (l1clk), | |
944 | .en (cmp_io_sync_en), | |
945 | .din (tap_mondo_acc_seq_d2), | |
946 | .siclk(siclk), | |
947 | .soclk(soclk) | |
948 | ); | |
949 | ||
950 | ||
951 | // Flop write signal to convert to cpu clock domain | |
952 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_1 tap_mondo_wr_ff | |
953 | ( | |
954 | .scan_in(tap_mondo_wr_ff_scanin), | |
955 | .scan_out(tap_mondo_wr_ff_scanout), | |
956 | .dout (tap_mondo_wr), | |
957 | .l1clk (l1clk), | |
958 | .en (io_cmp_sync_en), | |
959 | .din (tap_mondo_wr_s), | |
960 | .siclk(siclk), | |
961 | .soclk(soclk) | |
962 | ); | |
963 | ||
964 | ||
965 | // CPU read and IO write has higher priority than TAP read/write | |
966 | assign tap_mondo_acc = ~cpu_mondo_acc & | |
967 | ~io_mondo_data_wr & | |
968 | (tap_mondo_acc_seq != tap_mondo_acc_seq_d1); | |
969 | ||
970 | assign tap_mondo_rd = tap_mondo_acc & ~tap_mondo_wr; | |
971 | ||
972 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 tap_mondo_rd_d1_ff | |
973 | ( | |
974 | .scan_in(tap_mondo_rd_d1_ff_scanin), | |
975 | .scan_out(tap_mondo_rd_d1_ff_scanout), | |
976 | .dout (tap_mondo_rd_d1), | |
977 | .l1clk (l1clk), | |
978 | .din (tap_mondo_rd), | |
979 | .siclk(siclk), | |
980 | .soclk(soclk) | |
981 | ); | |
982 | ||
983 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 tap_mondo_rd_d2_ff | |
984 | ( | |
985 | .scan_in(tap_mondo_rd_d2_ff_scanin), | |
986 | .scan_out(tap_mondo_rd_d2_ff_scanout), | |
987 | .dout (tap_mondo_rd_d2), | |
988 | .l1clk (l1clk), | |
989 | .din (tap_mondo_rd_d1), | |
990 | .siclk(siclk), | |
991 | .soclk(soclk) | |
992 | ); | |
993 | ||
994 | ||
995 | /***************************************************************** | |
996 | * Mux out decoded signals depending on CPU or TAP access | |
997 | *****************************************************************/ | |
998 | assign mondo_addr_creg_mdata0_dec_d1 = | |
999 | cpu_mondo_rd_d1 ? cpu_mondo_addr_creg_mdata0_dec_d1 : | |
1000 | tap_mondo_addr_creg_mdata0_dec_d1; | |
1001 | ||
1002 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 mondo_addr_creg_mdata0_dec_d2_ff | |
1003 | ( | |
1004 | .scan_in(mondo_addr_creg_mdata0_dec_d2_ff_scanin), | |
1005 | .scan_out(mondo_addr_creg_mdata0_dec_d2_ff_scanout), | |
1006 | .dout (mondo_addr_creg_mdata0_dec_d2), | |
1007 | .l1clk (l1clk), | |
1008 | .din (mondo_addr_creg_mdata0_dec_d1), | |
1009 | .siclk(siclk), | |
1010 | .soclk(soclk) | |
1011 | ); | |
1012 | ||
1013 | ||
1014 | assign mondo_addr_creg_mdata1_dec_d1 = | |
1015 | cpu_mondo_rd_d1 ? cpu_mondo_addr_creg_mdata1_dec_d1 : | |
1016 | tap_mondo_addr_creg_mdata1_dec_d1; | |
1017 | ||
1018 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 mondo_addr_creg_mdata1_dec_d2_ff | |
1019 | ( | |
1020 | .scan_in(mondo_addr_creg_mdata1_dec_d2_ff_scanin), | |
1021 | .scan_out(mondo_addr_creg_mdata1_dec_d2_ff_scanout), | |
1022 | .dout (mondo_addr_creg_mdata1_dec_d2), | |
1023 | .l1clk (l1clk), | |
1024 | .din (mondo_addr_creg_mdata1_dec_d1), | |
1025 | .siclk(siclk), | |
1026 | .soclk(soclk) | |
1027 | ); | |
1028 | ||
1029 | ||
1030 | assign mondo_addr_creg_mbusy_dec_d1 = | |
1031 | cpu_mondo_rd_d1 ? cpu_mondo_addr_creg_mbusy_dec_d1 : | |
1032 | tap_mondo_addr_creg_mbusy_dec_d1; | |
1033 | ||
1034 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 mondo_addr_creg_mbusy_dec_d2_ff | |
1035 | ( | |
1036 | .scan_in(mondo_addr_creg_mbusy_dec_d2_ff_scanin), | |
1037 | .scan_out(mondo_addr_creg_mbusy_dec_d2_ff_scanout), | |
1038 | .dout (mondo_addr_creg_mbusy_dec_d2), | |
1039 | .l1clk (l1clk), | |
1040 | .din (mondo_addr_creg_mbusy_dec_d1), | |
1041 | .siclk(siclk), | |
1042 | .soclk(soclk) | |
1043 | ); | |
1044 | ||
1045 | ||
1046 | ||
1047 | /***************************************************************** | |
1048 | * Setup read/write access to mondo data table | |
1049 | *****************************************************************/ | |
1050 | //assign mb0_mondo_sel = mb0_run * mb0_mondo_rd_en; | |
1051 | assign mondo_data_addr_p0[5:0] = mb0_run ? mb0_raddr[5:0] : | |
1052 | cpu_mondo_acc ? cpu_mondo_data_addr[5:0] : tap_mondo_data_addr[5:0]; | |
1053 | ||
1054 | assign mondo_data_addr_p1[5:0] = mb0_run ? mb0_waddr[5:0] : | |
1055 | io_mondo_data_wr ? io_mondo_data_addr[5:0] : tap_mondo_data_addr[5:0]; | |
1056 | ||
1057 | assign mondo_data0_wr = mb0_run ? mb0_mondo_wr_en : mondo_data0_wr_f; | |
1058 | assign mondo_data0_wr_f = io_mondo_data_wr | | |
1059 | (tap_mondo_acc & tap_mondo_wr & tap_mondo_addr_creg_mdata0_dec); | |
1060 | ||
1061 | assign mondo_data1_wr = mb0_run ? mb0_mondo_wr_en : mondo_data1_wr_f; | |
1062 | assign mondo_data1_wr_f = io_mondo_data_wr | | |
1063 | (tap_mondo_acc & tap_mondo_wr & tap_mondo_addr_creg_mdata1_dec); | |
1064 | ||
1065 | // Bypass detection - Only bypass if io_mondo_data_wr. This bypass | |
1066 | // is for the case when Jbus interrupt updates the | |
1067 | // tables and CPU tries to read the exact same | |
1068 | // entry. | |
1069 | // No need to bypass if TAP is writing because | |
1070 | // TAP access is allowed only if CPU is not | |
1071 | // accessing the tables. | |
1072 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 mondo_data_wr_d1_ff | |
1073 | ( | |
1074 | .scan_in(mondo_data_wr_d1_ff_scanin), | |
1075 | .scan_out(mondo_data_wr_d1_ff_scanout), | |
1076 | .dout (mondo_data_wr_d1), | |
1077 | .l1clk (l1clk), | |
1078 | .din (io_mondo_data_wr), | |
1079 | .siclk(siclk), | |
1080 | .soclk(soclk) | |
1081 | ); | |
1082 | ||
1083 | ncu_c2ifc_ctl_msff_ctl_macro__width_6 mondo_data_addr_p0_d1_ff | |
1084 | ( | |
1085 | .scan_in(mondo_data_addr_p0_d1_ff_scanin), | |
1086 | .scan_out(mondo_data_addr_p0_d1_ff_scanout), | |
1087 | .dout (mondo_data_addr_p0_d1[5:0]), | |
1088 | .l1clk (l1clk), | |
1089 | .din (mondo_data_addr_p0[5:0]), | |
1090 | .siclk(siclk), | |
1091 | .soclk(soclk) | |
1092 | ); | |
1093 | ||
1094 | ncu_c2ifc_ctl_msff_ctl_macro__width_6 mondo_data_addr_p1_d1_ff | |
1095 | ( | |
1096 | .scan_in(mondo_data_addr_p1_d1_ff_scanin), | |
1097 | .scan_out(mondo_data_addr_p1_d1_ff_scanout), | |
1098 | .dout (mondo_data_addr_p1_d1[5:0]), | |
1099 | .l1clk (l1clk), | |
1100 | .din (mondo_data_addr_p1[5:0]), | |
1101 | .siclk(siclk), | |
1102 | .soclk(soclk) | |
1103 | ); | |
1104 | ||
1105 | assign mondo_data_bypass_d1 = mondo_data_wr_d1 & | |
1106 | (mondo_data_addr_p0_d1[5:0] == mondo_data_addr_p1_d1[5:0]); | |
1107 | ||
1108 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 mondo_data_bypass_d2_ff | |
1109 | ( | |
1110 | .scan_in(mondo_data_bypass_d2_ff_scanin), | |
1111 | .scan_out(mondo_data_bypass_d2_ff_scanout), | |
1112 | .dout (mondo_data_bypass_d2), | |
1113 | .l1clk (l1clk), | |
1114 | .din (mondo_data_bypass_d1), | |
1115 | .siclk(siclk), | |
1116 | .soclk(soclk) | |
1117 | ); | |
1118 | ||
1119 | ||
1120 | /***************************************************************** | |
1121 | * Setup read/write access to mondo busy | |
1122 | *****************************************************************/ | |
1123 | // Need two write ports because JBUS and CPU may write the Busy bit | |
1124 | // at the same time. If they try to write the same entry at the same | |
1125 | // time (which is probably a software bug), JBUS wins. | |
1126 | // Port 0 - CPU or TAP read | |
1127 | // Port 1 - JBUS or TAP write | |
1128 | // Port 2 - CPU write | |
1129 | assign mondo_busy_addr_p0 = mondo_data_addr_p0; | |
1130 | ||
1131 | assign mondo_busy_addr_p1 = mondo_data_addr_p1; | |
1132 | ||
1133 | assign mondo_busy_addr_p2 = cpu_mondo_data_addr; | |
1134 | ||
1135 | ||
1136 | assign mondo_busy_wr_p1 = io_mondo_data_wr | | |
1137 | (tap_mondo_acc & tap_mondo_wr & tap_mondo_addr_creg_mbusy_dec); | |
1138 | ||
1139 | assign mondo_busy_wr_p2 = cpu_mondo_acc & cpu_mondo_wr & cpu_mondo_addr_creg_mbusy_dec; | |
1140 | ||
1141 | ||
1142 | /***************************************************************** | |
1143 | * Cpu Buffer Control | |
1144 | *****************************************************************/ | |
1145 | assign cpubuf_wr = mb1_run ? mb1_cpubuf_wr_en : (pcx_ncu_data_rdy & pcx_ncu_vld & ~(cpu_mondo_rd | cpu_mondo_wr)); | |
1146 | //assign cpubuf_wr_l = ~cpubuf_wr; | |
1147 | ||
1148 | ||
1149 | // Tail pointer to cpu buffer | |
1150 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_6 cpubuf_tail_ff | |
1151 | ( | |
1152 | .scan_in(cpubuf_tail_ff_scanin), | |
1153 | .scan_out(cpubuf_tail_ff_scanout), | |
1154 | .dout (cpubuf_tail[5:0]), | |
1155 | .l1clk (l1clk), | |
1156 | .en (cpubuf_wr), | |
1157 | .din (cpubuf_tail_plus[5:0]), | |
1158 | .siclk(siclk), | |
1159 | .soclk(soclk) | |
1160 | ); | |
1161 | ||
1162 | assign cpubuf_tail_plus[5:0] = cpubuf_tail[5:0] + 6'd1; | |
1163 | ||
1164 | assign cpubuf_tail_ptr[4:0] = mb1_run ? mb1_waddr[4:0] : cpubuf_tail[4:0]; | |
1165 | //assign cpubuf_tail_ptr[4:0] = cpubuf_tail[4:0]; // cpubuf no longer goes to mb0; | |
1166 | ||
1167 | // Send tail pointer to BSC clock domain | |
1168 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_6 cpubuf_tail_f_ff | |
1169 | ( | |
1170 | .scan_in(cpubuf_tail_f_ff_scanin), | |
1171 | .scan_out(cpubuf_tail_f_ff_scanout), | |
1172 | .dout (cpubuf_tail_f[5:0]), | |
1173 | .l1clk (l1clk), | |
1174 | .en (cmp_io_sync_en), | |
1175 | .din (cpubuf_tail[5:0]), | |
1176 | .siclk(siclk), | |
1177 | .soclk(soclk) | |
1178 | ); | |
1179 | ||
1180 | ||
1181 | // Flop head pointer to convert to CPU clock domain | |
1182 | ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_6 cpubuf_head_ff | |
1183 | ( | |
1184 | .scan_in(cpubuf_head_ff_scanin), | |
1185 | .scan_out(cpubuf_head_ff_scanout), | |
1186 | .dout (cpubuf_head[5:0]), | |
1187 | .l1clk (l1clk), | |
1188 | .en (io_cmp_sync_en), | |
1189 | .din (cpubuf_head_s[5:0]), | |
1190 | .siclk(siclk), | |
1191 | .soclk(soclk) | |
1192 | ); | |
1193 | ||
1194 | ||
1195 | //// this is the original n1 scheme, n2 is similar but different// | |
1196 | /************************************************************************ | |
1197 | * __tail incremented here | |
1198 | * flop req | for packet in PX2 | |
1199 | * | | | |
1200 | * | | compute __stall sent here | |
1201 | * | | hwm | | |
1202 | * | | | | | |
1203 | * V V V V | |
1204 | * PQ PA PX1 rptr PX2 C1 C2 C3 rtpr | |
1205 | * PQ PA PX1 rptr PX2 C1 C2 C3 rptr | |
1206 | * PQ PA PX1 rptr PX2 C1 C2 C3 rptr | |
1207 | * PQ PA PX1 rptr PX2 C1 C2 C3 rptr | |
1208 | * PQ PA PX1 rptr PX2 C1 C2 C3 rptr | |
1209 | * PQ PA PX1 rptr PX2 C1 C2 C3 rptr | |
1210 | * PQ PA PX1 rptr PX2 C1 C2 C3 rptr | |
1211 | * PQ PA PX1 rptr PX2 C1 C2 C3 rptr | |
1212 | * PQ PA PX1 rptr PX2 C1 C2 C3 rptr | |
1213 | * --> PQ PA | |
1214 | * | | |
1215 | * | | |
1216 | * packet in this PQ is stalled | |
1217 | * | |
1218 | * When the stall is signalled, there can potentially be 8 packets in | |
1219 | * C2, C1, PX2, rptr, PX1, PA, PQ, and PQ-1 that need to be queued in | |
1220 | * the CPU shared buffer. | |
1221 | * Hence, the high water mark is 16 - 8 = 8. | |
1222 | ************************************************************************/ | |
1223 | // Assert stall to crossbar if we are 7 or less entries away from filling | |
1224 | // up cpu buffer. | |
1225 | assign cpubuf_tail_plus6[5:0] = cpubuf_tail[5:0] + 6'd6; | |
1226 | ||
1227 | assign cpubuf_hit_hwm = ((cpubuf_tail_plus6[5] != cpubuf_head[5]) & | |
1228 | (cpubuf_tail_plus6[4:0] >= cpubuf_head[4:0])) | | |
1229 | ((cpubuf_tail_plus6[5] == cpubuf_head[5]) & | |
1230 | (cpubuf_tail_plus6[4:0] <= cpubuf_head[4:0])); | |
1231 | ||
1232 | ncu_c2ifc_ctl_msff_ctl_macro__width_1 ncu_pcx_stall_pq_ff | |
1233 | ( | |
1234 | .scan_in(ncu_pcx_stall_pq_ff_scanin), | |
1235 | .scan_out(ncu_pcx_stall_pq_ff_scanout), | |
1236 | .dout (ncu_pcx_stall_pq), | |
1237 | .l1clk (l1clk), | |
1238 | .din (cpubuf_hit_hwm | intbuf_hit_hwm), | |
1239 | .siclk(siclk), | |
1240 | .soclk(soclk) | |
1241 | ); | |
1242 | ||
1243 | ||
1244 | /**** adding clock header ****/ | |
1245 | ncu_c2ifc_ctl_l1clkhdr_ctl_macro clkgen ( | |
1246 | .l2clk (l2clk), | |
1247 | .l1en (1'b1), | |
1248 | .l1clk (l1clk), | |
1249 | .pce_ov(pce_ov), | |
1250 | .stop(stop), | |
1251 | .se(se) | |
1252 | ); | |
1253 | ||
1254 | /*** building tcu port ***/ | |
1255 | assign siclk = tcu_aclk; | |
1256 | assign soclk = tcu_bclk; | |
1257 | assign se = tcu_scan_en; | |
1258 | assign pce_ov = tcu_pce_ov; | |
1259 | assign stop = tcu_clk_stop; | |
1260 | ||
1261 | // fixscan start: | |
1262 | assign pcx_ncu_data_rdy_px2_ff_scanin = scan_in ; | |
1263 | assign pcx_ncu_data_rdy_ff_scanin = pcx_ncu_data_rdy_px2_ff_scanout; | |
1264 | assign cpu_mondo_rd_d1_ff_scanin = pcx_ncu_data_rdy_ff_scanout; | |
1265 | assign cpu_mondo_rd_d2_ff_scanin = cpu_mondo_rd_d1_ff_scanout; | |
1266 | assign cpu_mondo_wr_d1_ff_scanin = cpu_mondo_rd_d2_ff_scanout; | |
1267 | assign cpu_mondo_wr_d2_ff_scanin = cpu_mondo_wr_d1_ff_scanout; | |
1268 | assign cpu_mondo_rd_wr_ff_scanin = cpu_mondo_wr_d2_ff_scanout; | |
1269 | assign intbuf_wr2i2c_ff_scanin = cpu_mondo_rd_wr_ff_scanout ; | |
1270 | assign cpu_mondo_addr_creg_mdata0_dec_d1_ff_scanin = intbuf_wr2i2c_ff_scanout ; | |
1271 | assign cpu_mondo_addr_creg_mdata1_dec_d1_ff_scanin = cpu_mondo_addr_creg_mdata0_dec_d1_ff_scanout; | |
1272 | assign cpu_mondo_addr_creg_mbusy_dec_d1_ff_scanin = cpu_mondo_addr_creg_mdata1_dec_d1_ff_scanout; | |
1273 | assign cpu_mondo_addr_invld_d1_ff_scanin = cpu_mondo_addr_creg_mbusy_dec_d1_ff_scanout; | |
1274 | assign cpu_mondo_addr_invld_d2_ff_scanin = cpu_mondo_addr_invld_d1_ff_scanout; | |
1275 | assign io_mondo_data_wr_ff_scanin = cpu_mondo_addr_invld_d2_ff_scanout; | |
1276 | assign io_mondo_data_addr_ff_scanin = io_mondo_data_wr_ff_scanout; | |
1277 | assign tap_mondo_acc_addr_ff_scanin = io_mondo_data_addr_ff_scanout; | |
1278 | assign tap_mondo_addr_creg_mdata0_dec_d1_ff_scanin = tap_mondo_acc_addr_ff_scanout; | |
1279 | assign tap_mondo_addr_creg_mdata1_dec_d1_ff_scanin = tap_mondo_addr_creg_mdata0_dec_d1_ff_scanout; | |
1280 | assign tap_mondo_addr_creg_mbusy_dec_d1_ff_scanin = tap_mondo_addr_creg_mdata1_dec_d1_ff_scanout; | |
1281 | assign tap_mondo_addr_invld_d1_ff_scanin = tap_mondo_addr_creg_mbusy_dec_d1_ff_scanout; | |
1282 | assign tap_mondo_addr_invld_d2_ff_scanin = tap_mondo_addr_invld_d1_ff_scanout; | |
1283 | assign tap_mondo_acc_addr_invld_d2_f_ff_scanin = tap_mondo_addr_invld_d2_ff_scanout; | |
1284 | assign tap_mondo_acc_seq_ff_scanin = tap_mondo_acc_addr_invld_d2_f_ff_scanout; | |
1285 | assign tap_mondo_acc_seq_d1_ff_scanin = tap_mondo_acc_seq_ff_scanout; | |
1286 | assign tap_mondo_acc_seq_d2_ff_scanin = tap_mondo_acc_seq_d1_ff_scanout; | |
1287 | assign tap_mondo_acc_seq_d2_f_ff_scanin = tap_mondo_acc_seq_d2_ff_scanout; | |
1288 | assign tap_mondo_wr_ff_scanin = tap_mondo_acc_seq_d2_f_ff_scanout; | |
1289 | assign tap_mondo_rd_d1_ff_scanin = tap_mondo_wr_ff_scanout ; | |
1290 | assign tap_mondo_rd_d2_ff_scanin = tap_mondo_rd_d1_ff_scanout; | |
1291 | assign mondo_addr_creg_mdata0_dec_d2_ff_scanin = tap_mondo_rd_d2_ff_scanout; | |
1292 | assign mondo_addr_creg_mdata1_dec_d2_ff_scanin = mondo_addr_creg_mdata0_dec_d2_ff_scanout; | |
1293 | assign mondo_addr_creg_mbusy_dec_d2_ff_scanin = mondo_addr_creg_mdata1_dec_d2_ff_scanout; | |
1294 | assign mondo_data_wr_d1_ff_scanin = mondo_addr_creg_mbusy_dec_d2_ff_scanout; | |
1295 | assign mondo_data_addr_p0_d1_ff_scanin = mondo_data_wr_d1_ff_scanout; | |
1296 | assign mondo_data_addr_p1_d1_ff_scanin = mondo_data_addr_p0_d1_ff_scanout; | |
1297 | assign mondo_data_bypass_d2_ff_scanin = mondo_data_addr_p1_d1_ff_scanout; | |
1298 | assign cpubuf_tail_ff_scanin = mondo_data_bypass_d2_ff_scanout; | |
1299 | assign cpubuf_tail_f_ff_scanin = cpubuf_tail_ff_scanout ; | |
1300 | assign cpubuf_head_ff_scanin = cpubuf_tail_f_ff_scanout ; | |
1301 | assign ncu_pcx_stall_pq_ff_scanin = cpubuf_head_ff_scanout ; | |
1302 | assign scan_out = ncu_pcx_stall_pq_ff_scanout; | |
1303 | // fixscan end: | |
1304 | endmodule // c2i_fctrl | |
1305 | ||
1306 | ||
1307 | ||
1308 | ||
1309 | ||
1310 | ||
1311 | ||
1312 | // any PARAMS parms go into naming of macro | |
1313 | ||
1314 | module ncu_c2ifc_ctl_msff_ctl_macro__width_1 ( | |
1315 | din, | |
1316 | l1clk, | |
1317 | scan_in, | |
1318 | siclk, | |
1319 | soclk, | |
1320 | dout, | |
1321 | scan_out); | |
1322 | wire [0:0] fdin; | |
1323 | ||
1324 | input [0:0] din; | |
1325 | input l1clk; | |
1326 | input scan_in; | |
1327 | ||
1328 | ||
1329 | input siclk; | |
1330 | input soclk; | |
1331 | ||
1332 | output [0:0] dout; | |
1333 | output scan_out; | |
1334 | assign fdin[0:0] = din[0:0]; | |
1335 | ||
1336 | ||
1337 | ||
1338 | ||
1339 | ||
1340 | ||
1341 | dff #(1) d0_0 ( | |
1342 | .l1clk(l1clk), | |
1343 | .siclk(siclk), | |
1344 | .soclk(soclk), | |
1345 | .d(fdin[0:0]), | |
1346 | .si(scan_in), | |
1347 | .so(scan_out), | |
1348 | .q(dout[0:0]) | |
1349 | ); | |
1350 | ||
1351 | ||
1352 | ||
1353 | ||
1354 | ||
1355 | ||
1356 | ||
1357 | ||
1358 | ||
1359 | ||
1360 | ||
1361 | ||
1362 | endmodule | |
1363 | ||
1364 | ||
1365 | ||
1366 | ||
1367 | ||
1368 | ||
1369 | ||
1370 | ||
1371 | ||
1372 | ||
1373 | ||
1374 | ||
1375 | ||
1376 | // any PARAMS parms go into naming of macro | |
1377 | ||
1378 | module ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_1 ( | |
1379 | din, | |
1380 | en, | |
1381 | l1clk, | |
1382 | scan_in, | |
1383 | siclk, | |
1384 | soclk, | |
1385 | dout, | |
1386 | scan_out); | |
1387 | wire [0:0] fdin; | |
1388 | ||
1389 | input [0:0] din; | |
1390 | input en; | |
1391 | input l1clk; | |
1392 | input scan_in; | |
1393 | ||
1394 | ||
1395 | input siclk; | |
1396 | input soclk; | |
1397 | ||
1398 | output [0:0] dout; | |
1399 | output scan_out; | |
1400 | assign fdin[0:0] = (din[0:0] & {1{en}}) | (dout[0:0] & ~{1{en}}); | |
1401 | ||
1402 | ||
1403 | ||
1404 | ||
1405 | ||
1406 | ||
1407 | dff #(1) d0_0 ( | |
1408 | .l1clk(l1clk), | |
1409 | .siclk(siclk), | |
1410 | .soclk(soclk), | |
1411 | .d(fdin[0:0]), | |
1412 | .si(scan_in), | |
1413 | .so(scan_out), | |
1414 | .q(dout[0:0]) | |
1415 | ); | |
1416 | ||
1417 | ||
1418 | ||
1419 | ||
1420 | ||
1421 | ||
1422 | ||
1423 | ||
1424 | ||
1425 | ||
1426 | ||
1427 | ||
1428 | endmodule | |
1429 | ||
1430 | ||
1431 | ||
1432 | ||
1433 | ||
1434 | ||
1435 | ||
1436 | ||
1437 | ||
1438 | ||
1439 | ||
1440 | ||
1441 | ||
1442 | // any PARAMS parms go into naming of macro | |
1443 | ||
1444 | module ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_6 ( | |
1445 | din, | |
1446 | en, | |
1447 | l1clk, | |
1448 | scan_in, | |
1449 | siclk, | |
1450 | soclk, | |
1451 | dout, | |
1452 | scan_out); | |
1453 | wire [5:0] fdin; | |
1454 | wire [4:0] so; | |
1455 | ||
1456 | input [5:0] din; | |
1457 | input en; | |
1458 | input l1clk; | |
1459 | input scan_in; | |
1460 | ||
1461 | ||
1462 | input siclk; | |
1463 | input soclk; | |
1464 | ||
1465 | output [5:0] dout; | |
1466 | output scan_out; | |
1467 | assign fdin[5:0] = (din[5:0] & {6{en}}) | (dout[5:0] & ~{6{en}}); | |
1468 | ||
1469 | ||
1470 | ||
1471 | ||
1472 | ||
1473 | ||
1474 | dff #(6) d0_0 ( | |
1475 | .l1clk(l1clk), | |
1476 | .siclk(siclk), | |
1477 | .soclk(soclk), | |
1478 | .d(fdin[5:0]), | |
1479 | .si({scan_in,so[4:0]}), | |
1480 | .so({so[4:0],scan_out}), | |
1481 | .q(dout[5:0]) | |
1482 | ); | |
1483 | ||
1484 | ||
1485 | ||
1486 | ||
1487 | ||
1488 | ||
1489 | ||
1490 | ||
1491 | ||
1492 | ||
1493 | ||
1494 | ||
1495 | endmodule | |
1496 | ||
1497 | ||
1498 | ||
1499 | ||
1500 | ||
1501 | ||
1502 | ||
1503 | ||
1504 | ||
1505 | ||
1506 | ||
1507 | ||
1508 | ||
1509 | // any PARAMS parms go into naming of macro | |
1510 | ||
1511 | module ncu_c2ifc_ctl_msff_ctl_macro__en_1__width_22 ( | |
1512 | din, | |
1513 | en, | |
1514 | l1clk, | |
1515 | scan_in, | |
1516 | siclk, | |
1517 | soclk, | |
1518 | dout, | |
1519 | scan_out); | |
1520 | wire [21:0] fdin; | |
1521 | wire [20:0] so; | |
1522 | ||
1523 | input [21:0] din; | |
1524 | input en; | |
1525 | input l1clk; | |
1526 | input scan_in; | |
1527 | ||
1528 | ||
1529 | input siclk; | |
1530 | input soclk; | |
1531 | ||
1532 | output [21:0] dout; | |
1533 | output scan_out; | |
1534 | assign fdin[21:0] = (din[21:0] & {22{en}}) | (dout[21:0] & ~{22{en}}); | |
1535 | ||
1536 | ||
1537 | ||
1538 | ||
1539 | ||
1540 | ||
1541 | dff #(22) d0_0 ( | |
1542 | .l1clk(l1clk), | |
1543 | .siclk(siclk), | |
1544 | .soclk(soclk), | |
1545 | .d(fdin[21:0]), | |
1546 | .si({scan_in,so[20:0]}), | |
1547 | .so({so[20:0],scan_out}), | |
1548 | .q(dout[21:0]) | |
1549 | ); | |
1550 | ||
1551 | ||
1552 | ||
1553 | ||
1554 | ||
1555 | ||
1556 | ||
1557 | ||
1558 | ||
1559 | ||
1560 | ||
1561 | ||
1562 | endmodule | |
1563 | ||
1564 | ||
1565 | ||
1566 | ||
1567 | ||
1568 | ||
1569 | ||
1570 | ||
1571 | ||
1572 | ||
1573 | ||
1574 | ||
1575 | ||
1576 | // any PARAMS parms go into naming of macro | |
1577 | ||
1578 | module ncu_c2ifc_ctl_msff_ctl_macro__width_6 ( | |
1579 | din, | |
1580 | l1clk, | |
1581 | scan_in, | |
1582 | siclk, | |
1583 | soclk, | |
1584 | dout, | |
1585 | scan_out); | |
1586 | wire [5:0] fdin; | |
1587 | wire [4:0] so; | |
1588 | ||
1589 | input [5:0] din; | |
1590 | input l1clk; | |
1591 | input scan_in; | |
1592 | ||
1593 | ||
1594 | input siclk; | |
1595 | input soclk; | |
1596 | ||
1597 | output [5:0] dout; | |
1598 | output scan_out; | |
1599 | assign fdin[5:0] = din[5:0]; | |
1600 | ||
1601 | ||
1602 | ||
1603 | ||
1604 | ||
1605 | ||
1606 | dff #(6) d0_0 ( | |
1607 | .l1clk(l1clk), | |
1608 | .siclk(siclk), | |
1609 | .soclk(soclk), | |
1610 | .d(fdin[5:0]), | |
1611 | .si({scan_in,so[4:0]}), | |
1612 | .so({so[4:0],scan_out}), | |
1613 | .q(dout[5:0]) | |
1614 | ); | |
1615 | ||
1616 | ||
1617 | ||
1618 | ||
1619 | ||
1620 | ||
1621 | ||
1622 | ||
1623 | ||
1624 | ||
1625 | ||
1626 | ||
1627 | endmodule | |
1628 | ||
1629 | ||
1630 | ||
1631 | ||
1632 | ||
1633 | ||
1634 | ||
1635 | ||
1636 | ||
1637 | ||
1638 | ||
1639 | ||
1640 | ||
1641 | // any PARAMS parms go into naming of macro | |
1642 | ||
1643 | module ncu_c2ifc_ctl_l1clkhdr_ctl_macro ( | |
1644 | l2clk, | |
1645 | l1en, | |
1646 | pce_ov, | |
1647 | stop, | |
1648 | se, | |
1649 | l1clk); | |
1650 | ||
1651 | ||
1652 | input l2clk; | |
1653 | input l1en; | |
1654 | input pce_ov; | |
1655 | input stop; | |
1656 | input se; | |
1657 | output l1clk; | |
1658 | ||
1659 | ||
1660 | ||
1661 | ||
1662 | ||
1663 | cl_sc1_l1hdr_8x c_0 ( | |
1664 | ||
1665 | ||
1666 | .l2clk(l2clk), | |
1667 | .pce(l1en), | |
1668 | .l1clk(l1clk), | |
1669 | .se(se), | |
1670 | .pce_ov(pce_ov), | |
1671 | .stop(stop) | |
1672 | ); | |
1673 | ||
1674 | ||
1675 | ||
1676 | endmodule | |
1677 | ||
1678 | ||
1679 | ||
1680 | ||
1681 | ||
1682 | ||
1683 | ||
1684 |