Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: ncu_ssiflow_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 | module ncu_ssiflow_ctl ( | |
36 | iol2clk, | |
37 | tcu_pce_ov, | |
38 | tcu_clk_stop, | |
39 | tcu_scan_en, | |
40 | tcu_aclk, | |
41 | tcu_bclk, | |
42 | scan_in, | |
43 | scan_out, | |
44 | sck_cntexp, | |
45 | iob_ucb_vld, | |
46 | iob_ucb_data, | |
47 | ucb_iob_stall, | |
48 | rd_req_vld, | |
49 | wr_req_vld, | |
50 | ifill_req_vld, | |
51 | thr_id_in, | |
52 | buf_id_in, | |
53 | size_in, | |
54 | addr_in, | |
55 | data_in, | |
56 | req_acpted, | |
57 | rd_ack_vld, | |
58 | rd_nack_vld, | |
59 | ifill_ack_vld, | |
60 | ifill_nack_vld, | |
61 | thr_id_out, | |
62 | buf_id_out, | |
63 | data_out, | |
64 | ack_busy, | |
65 | int_vld, | |
66 | int_typ, | |
67 | int_thr_id, | |
68 | dev_id, | |
69 | int_stat, | |
70 | int_vec, | |
71 | int_busy, | |
72 | ucb_iob_vld, | |
73 | ucb_iob_data, | |
74 | iob_ucb_stall) ; | |
75 | wire indata_buf_vld; | |
76 | wire [127:0] indata_buf; | |
77 | wire ucb_bus_in_scanin; | |
78 | wire ucb_bus_in_scanout; | |
79 | wire ucb_iob_stall_a1; | |
80 | wire read_pending; | |
81 | wire write_pending; | |
82 | wire ifill_pending; | |
83 | wire buf_full; | |
84 | wire rd_buf; | |
85 | wire [1:0] buf_head_next; | |
86 | wire [1:0] buf_head; | |
87 | wire buf_head_next0_n; | |
88 | wire buf_head0_n; | |
89 | wire buf_head_ff0_scanin; | |
90 | wire buf_head_ff0_scanout; | |
91 | wire l1clk; | |
92 | wire buf_head_ff1_scanin; | |
93 | wire buf_head_ff1_scanout; | |
94 | wire wr_buf; | |
95 | wire [1:0] buf_tail_next; | |
96 | wire [1:0] buf_tail; | |
97 | wire buf_tail_next0_n; | |
98 | wire buf_tail0_n; | |
99 | wire buf_tail_ff0_scanin; | |
100 | wire buf_tail_ff0_scanout; | |
101 | wire buf_tail_ff1_scanin; | |
102 | wire buf_tail_ff1_scanout; | |
103 | wire buf_full_next; | |
104 | wire buf_full_ff_scanin; | |
105 | wire buf_full_ff_scanout; | |
106 | wire buf_empty_next; | |
107 | wire buf_empty_next_n; | |
108 | wire buf_empty; | |
109 | wire buf_empty_n; | |
110 | wire buf_empty_ff_scanin; | |
111 | wire buf_empty_ff_scanout; | |
112 | wire [117:0] req_in; | |
113 | wire [8:0] unconnected_rsvd; | |
114 | wire buf0_en; | |
115 | wire buf0_ff_scanin; | |
116 | wire buf0_ff_scanout; | |
117 | wire [117:0] buf0; | |
118 | wire buf1_en; | |
119 | wire buf1_ff_scanin; | |
120 | wire buf1_ff_scanout; | |
121 | wire [117:0] buf1; | |
122 | wire [117:0] req_out; | |
123 | wire ifill_req_vld_nq; | |
124 | wire wr_req_vld_nq; | |
125 | wire rd_req_vld_nq; | |
126 | wire ack_buf_wr; | |
127 | wire ack_buf_vld_next; | |
128 | wire ack_buf_rd; | |
129 | wire ack_buf_vld; | |
130 | wire ack_buf_vld_ff_scanin; | |
131 | wire ack_buf_vld_ff_scanout; | |
132 | wire ack_buf_is_nack_ff_scanin; | |
133 | wire ack_buf_is_nack_ff_scanout; | |
134 | wire ack_buf_is_nack; | |
135 | wire [3:0] ack_typ_out; | |
136 | wire [75:0] ack_buf_in; | |
137 | wire ack_buf_ff_scanin; | |
138 | wire ack_buf_ff_scanout; | |
139 | wire [75:0] ack_buf; | |
140 | wire [31:0] ack_buf_vec; | |
141 | wire int_buf_wr; | |
142 | wire int_buf_vld_next; | |
143 | wire int_buf_rd; | |
144 | wire int_buf_vld; | |
145 | wire int_buf_vld_ff_scanin; | |
146 | wire int_buf_vld_ff_scanout; | |
147 | wire [56:0] int_buf_in; | |
148 | wire int_buf_ff_scanin; | |
149 | wire int_buf_ff_scanout; | |
150 | wire [56:0] int_buf; | |
151 | wire [31:0] int_buf_vec; | |
152 | wire int_last_rd_ff_scanin; | |
153 | wire int_last_rd_ff_scanout; | |
154 | wire int_last_rd; | |
155 | wire outdata_buf_busy; | |
156 | wire outdata_buf_wr; | |
157 | wire [127:0] outdata_buf_in; | |
158 | wire [31:0] outdata_vec_in; | |
159 | wire ucb_bus_out_scanin; | |
160 | wire ucb_bus_out_scanout; | |
161 | wire siclk; | |
162 | wire soclk; | |
163 | wire se; | |
164 | wire pce_ov; | |
165 | wire stop; | |
166 | ||
167 | ||
168 | // Globals | |
169 | input iol2clk; | |
170 | input tcu_pce_ov; | |
171 | input tcu_clk_stop; | |
172 | input tcu_scan_en; | |
173 | input tcu_aclk; | |
174 | input tcu_bclk; | |
175 | input scan_in; | |
176 | output scan_out; | |
177 | input sck_cntexp; | |
178 | ||
179 | // Request from IO Bridge | |
180 | input iob_ucb_vld; | |
181 | input [3:0] iob_ucb_data; | |
182 | output ucb_iob_stall; | |
183 | ||
184 | // Request to local unit | |
185 | output rd_req_vld; | |
186 | output wr_req_vld; | |
187 | output ifill_req_vld; | |
188 | output [5:0] thr_id_in; | |
189 | output [1:0] buf_id_in; | |
190 | output [2:0] size_in; // only pertinent to JBI and SPI | |
191 | output [39:0] addr_in; | |
192 | output [63:0] data_in; | |
193 | input req_acpted; | |
194 | ||
195 | // Ack/Nack from local unit | |
196 | input rd_ack_vld; | |
197 | input rd_nack_vld; | |
198 | input ifill_ack_vld; | |
199 | input ifill_nack_vld; | |
200 | input [5:0] thr_id_out; | |
201 | input [1:0] buf_id_out; | |
202 | input [63:0] data_out; | |
203 | output ack_busy; | |
204 | ||
205 | // Interrupt from local unit | |
206 | input int_vld; | |
207 | input [3:0] int_typ; // interrupt type | |
208 | input [5:0] int_thr_id; // interrupt thread ID | |
209 | input [8:0] dev_id; // interrupt device ID | |
210 | input [31:0] int_stat; // interrupt status | |
211 | input [5:0] int_vec; // interrupt vector | |
212 | output int_busy; | |
213 | ||
214 | // Output to IO Bridge | |
215 | output ucb_iob_vld; | |
216 | output [3:0] ucb_iob_data; | |
217 | input iob_ucb_stall; | |
218 | ||
219 | ||
220 | ||
221 | ||
222 | // Local signals | |
223 | ||
224 | ||
225 | ||
226 | ||
227 | ||
228 | ||
229 | ||
230 | ||
231 | ||
232 | ||
233 | //////////////////////////////////////////////////////////////////////// | |
234 | // Code starts here | |
235 | //////////////////////////////////////////////////////////////////////// | |
236 | ncu_ssiui4_ctl ucb_bus_in (/*autoinst*/ | |
237 | // Outputs | |
238 | .stall(ucb_iob_stall), // Templated | |
239 | .indata_buf_vld(indata_buf_vld), | |
240 | .indata_buf(indata_buf[127:0]), | |
241 | // Inputs | |
242 | .scan_in(ucb_bus_in_scanin), | |
243 | .scan_out(ucb_bus_in_scanout), | |
244 | .iol2clk(iol2clk), | |
245 | .tcu_pce_ov(tcu_pce_ov), | |
246 | .tcu_clk_stop(tcu_clk_stop), | |
247 | .tcu_aclk(tcu_aclk), | |
248 | .tcu_bclk(tcu_bclk), | |
249 | .tcu_scan_en(tcu_scan_en), | |
250 | .vld(iob_ucb_vld), // Templated | |
251 | .data(iob_ucb_data[3:0]), // Templated | |
252 | .stall_a1(ucb_iob_stall_a1)); // Templated | |
253 | ||
254 | ||
255 | /************************************************************ | |
256 | * Decode inbound packet type | |
257 | ************************************************************/ | |
258 | assign read_pending = (indata_buf[3:0] == 4'b0100) & indata_buf_vld; | |
259 | ||
260 | assign write_pending = (indata_buf[3:0] == 4'b0101) & indata_buf_vld; | |
261 | ||
262 | assign ifill_pending = (indata_buf[3:0] == 4'b0110) & indata_buf_vld; | |
263 | ||
264 | assign ucb_iob_stall_a1 = (read_pending | write_pending | ifill_pending) & buf_full; | |
265 | ||
266 | ||
267 | /************************************************************ | |
268 | * Inbound buffer | |
269 | ************************************************************/ | |
270 | // Head pointer | |
271 | assign rd_buf = req_acpted; | |
272 | assign buf_head_next[1:0] = rd_buf ? {buf_head[0],buf_head[1]} : buf_head[1:0]; | |
273 | ||
274 | assign buf_head_next0_n = ~buf_head_next[0] ; | |
275 | assign buf_head[0] = ~buf_head0_n ; | |
276 | ncu_ssiflow_ctl_msff_ctl_macro__width_1 buf_head_ff0 | |
277 | ( | |
278 | .scan_in(buf_head_ff0_scanin), | |
279 | .scan_out(buf_head_ff0_scanout), | |
280 | .dout (buf_head0_n), | |
281 | .l1clk (l1clk), | |
282 | .din (buf_head_next0_n), | |
283 | .siclk(siclk), | |
284 | .soclk(soclk) | |
285 | ); | |
286 | ||
287 | ncu_ssiflow_ctl_msff_ctl_macro__width_1 buf_head_ff1 | |
288 | ( | |
289 | .scan_in(buf_head_ff1_scanin), | |
290 | .scan_out(buf_head_ff1_scanout), | |
291 | .dout (buf_head[1]), | |
292 | .l1clk (l1clk), | |
293 | .din (buf_head_next[1]), | |
294 | .siclk(siclk), | |
295 | .soclk(soclk) | |
296 | ); | |
297 | ||
298 | // Tail pointer | |
299 | assign wr_buf = (read_pending | write_pending | ifill_pending) & ~buf_full; | |
300 | ||
301 | assign buf_tail_next[1:0] = wr_buf ? {buf_tail[0], buf_tail[1]} : buf_tail[1:0]; | |
302 | ||
303 | assign buf_tail_next0_n = ~buf_tail_next[0]; | |
304 | assign buf_tail[0] = ~buf_tail0_n ; | |
305 | ncu_ssiflow_ctl_msff_ctl_macro__width_1 buf_tail_ff0 | |
306 | ( | |
307 | .scan_in(buf_tail_ff0_scanin), | |
308 | .scan_out(buf_tail_ff0_scanout), | |
309 | .dout (buf_tail0_n), | |
310 | .l1clk (l1clk), | |
311 | .din (buf_tail_next0_n), | |
312 | .siclk(siclk), | |
313 | .soclk(soclk) | |
314 | ); | |
315 | ||
316 | ncu_ssiflow_ctl_msff_ctl_macro__width_1 buf_tail_ff1 | |
317 | ( | |
318 | .scan_in(buf_tail_ff1_scanin), | |
319 | .scan_out(buf_tail_ff1_scanout), | |
320 | .dout (buf_tail[1]), | |
321 | .l1clk (l1clk), | |
322 | .din (buf_tail_next[1]), | |
323 | .siclk(siclk), | |
324 | .soclk(soclk) | |
325 | ); | |
326 | ||
327 | // Buffer full | |
328 | assign buf_full_next = (buf_head_next[1:0] == buf_tail_next[1:0]) & wr_buf; | |
329 | ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_1 buf_full_ff | |
330 | ( | |
331 | .scan_in(buf_full_ff_scanin), | |
332 | .scan_out(buf_full_ff_scanout), | |
333 | .dout (buf_full), | |
334 | .l1clk (l1clk), | |
335 | .en (rd_buf|wr_buf), | |
336 | .din (buf_full_next), | |
337 | .siclk(siclk), | |
338 | .soclk(soclk) | |
339 | ); | |
340 | ||
341 | // Buffer empty | |
342 | assign buf_empty_next = ((buf_head_next[1:0] == buf_tail_next[1:0]) & rd_buf) ; | |
343 | assign buf_empty_next_n = ~buf_empty_next ; | |
344 | assign buf_empty = ~buf_empty_n; | |
345 | ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_1 buf_empty_ff | |
346 | ( | |
347 | .scan_in(buf_empty_ff_scanin), | |
348 | .scan_out(buf_empty_ff_scanout), | |
349 | .dout (buf_empty_n), | |
350 | .l1clk (l1clk), | |
351 | .en (rd_buf|wr_buf), | |
352 | .din (buf_empty_next_n), | |
353 | .siclk(siclk), | |
354 | .soclk(soclk) | |
355 | ); | |
356 | ||
357 | assign {req_in[117:54], | |
358 | unconnected_rsvd[8:0], | |
359 | req_in[53:0]} = {indata_buf[127:64], | |
360 | indata_buf[63:55], | |
361 | indata_buf[54:15], | |
362 | indata_buf[14:12], | |
363 | indata_buf[11:10], | |
364 | indata_buf[9:4], | |
365 | ifill_pending, | |
366 | write_pending, | |
367 | read_pending}; | |
368 | ||
369 | // Buffer 0 | |
370 | assign buf0_en = buf_tail[0] & wr_buf; | |
371 | ||
372 | ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_118 buf0_ff | |
373 | ( | |
374 | .scan_in(buf0_ff_scanin), | |
375 | .scan_out(buf0_ff_scanout), | |
376 | .dout (buf0[117:0]), | |
377 | .l1clk (l1clk), | |
378 | .en (buf0_en), | |
379 | .din (req_in[117:0]), | |
380 | .siclk(siclk), | |
381 | .soclk(soclk) | |
382 | ); | |
383 | // Buffer 1 | |
384 | assign buf1_en = buf_tail[1] & wr_buf; | |
385 | ||
386 | ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_118 buf1_ff | |
387 | ( | |
388 | .scan_in(buf1_ff_scanin), | |
389 | .scan_out(buf1_ff_scanout), | |
390 | .dout (buf1[117:0]), | |
391 | .l1clk (l1clk), | |
392 | .en (buf1_en), | |
393 | .din (req_in[117:0]), | |
394 | .siclk(siclk), | |
395 | .soclk(soclk) | |
396 | ); | |
397 | ||
398 | assign req_out[117:0] = buf_head[0] ? buf0[117:0] : | |
399 | buf_head[1] ? buf1[117:0] :118'b0 ; | |
400 | ||
401 | ||
402 | /************************************************************ | |
403 | * Inbound interface to local unit | |
404 | ************************************************************/ | |
405 | assign {data_in[63:0], | |
406 | addr_in[39:0], | |
407 | size_in[2:0], | |
408 | buf_id_in[1:0], | |
409 | thr_id_in[5:0], | |
410 | ifill_req_vld_nq, | |
411 | wr_req_vld_nq, | |
412 | rd_req_vld_nq} = req_out[117:0]; | |
413 | ||
414 | assign rd_req_vld = rd_req_vld_nq & ~buf_empty; | |
415 | assign wr_req_vld = wr_req_vld_nq & ~buf_empty; | |
416 | assign ifill_req_vld = ifill_req_vld_nq & ~buf_empty & sck_cntexp; | |
417 | ||
418 | ||
419 | /************************************************************ | |
420 | * Outbound Ack/Nack | |
421 | ************************************************************/ | |
422 | assign ack_buf_wr = rd_ack_vld | rd_nack_vld | ifill_ack_vld | ifill_nack_vld; | |
423 | ||
424 | assign ack_buf_vld_next = ack_buf_wr ? 1'b1 : | |
425 | ack_buf_rd ? 1'b0 : ack_buf_vld; | |
426 | ||
427 | ncu_ssiflow_ctl_msff_ctl_macro__width_1 ack_buf_vld_ff | |
428 | ( | |
429 | .scan_in(ack_buf_vld_ff_scanin), | |
430 | .scan_out(ack_buf_vld_ff_scanout), | |
431 | .dout (ack_buf_vld), | |
432 | .l1clk (l1clk), | |
433 | .din (ack_buf_vld_next), | |
434 | .siclk(siclk), | |
435 | .soclk(soclk) | |
436 | ); | |
437 | ||
438 | ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_1 ack_buf_is_nack_ff | |
439 | ( | |
440 | .scan_in(ack_buf_is_nack_ff_scanin), | |
441 | .scan_out(ack_buf_is_nack_ff_scanout), | |
442 | .dout (ack_buf_is_nack), | |
443 | .l1clk (l1clk), | |
444 | .en (ack_buf_wr), | |
445 | .din (rd_nack_vld|ifill_nack_vld), | |
446 | .siclk(siclk), | |
447 | .soclk(soclk) | |
448 | ); | |
449 | ||
450 | assign ack_typ_out[3:0] = rd_ack_vld ? 4'b0001: //READ_ACK | |
451 | rd_nack_vld ? 4'b0000: //READ_NACK | |
452 | ifill_ack_vld ? 4'b0011: //IFILL_ACK | |
453 | 4'b0111; //IFILL_NACK | |
454 | ||
455 | assign ack_buf_in[75:0] = {data_out[63:0], | |
456 | buf_id_out[1:0], | |
457 | thr_id_out[5:0], | |
458 | ack_typ_out[3:0]}; | |
459 | ||
460 | ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_76 ack_buf_ff | |
461 | ( | |
462 | .scan_in(ack_buf_ff_scanin), | |
463 | .scan_out(ack_buf_ff_scanout), | |
464 | .dout (ack_buf[75:0]), | |
465 | .l1clk (l1clk), | |
466 | .en (ack_buf_wr), | |
467 | .din (ack_buf_in[75:0]), | |
468 | .siclk(siclk), | |
469 | .soclk(soclk) | |
470 | ); | |
471 | ||
472 | assign ack_buf_vec[31:0] = ack_buf_is_nack ? {16'h0000,16'hffff} : {32'hffff_ffff} ; | |
473 | ||
474 | assign ack_busy = ack_buf_vld; | |
475 | ||
476 | ||
477 | /************************************************************ | |
478 | * Outbound Interrupt | |
479 | ************************************************************/ | |
480 | // Assertion: int_buf_wr shoudn't be asserted if int_buf_busy | |
481 | assign int_buf_wr = int_vld; | |
482 | ||
483 | assign int_buf_vld_next = int_buf_wr ? 1'b1 : | |
484 | int_buf_rd ? 1'b0 : int_buf_vld; | |
485 | ||
486 | ncu_ssiflow_ctl_msff_ctl_macro__width_1 int_buf_vld_ff | |
487 | ( | |
488 | .scan_in(int_buf_vld_ff_scanin), | |
489 | .scan_out(int_buf_vld_ff_scanout), | |
490 | .dout (int_buf_vld), | |
491 | .l1clk (l1clk), | |
492 | .din (int_buf_vld_next), | |
493 | .siclk(siclk), | |
494 | .soclk(soclk) | |
495 | ); | |
496 | ||
497 | assign int_buf_in[56:0] = { int_vec[5:0], | |
498 | int_stat[31:0], | |
499 | dev_id[8:0], | |
500 | int_thr_id[5:0], | |
501 | int_typ[3:0]}; | |
502 | ||
503 | ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_57 int_buf_ff | |
504 | ( | |
505 | .scan_in(int_buf_ff_scanin), | |
506 | .scan_out(int_buf_ff_scanout), | |
507 | .dout (int_buf[56:0]), | |
508 | .l1clk (l1clk), | |
509 | .en (int_buf_wr), | |
510 | .din (int_buf_in[56:0]), | |
511 | .siclk(siclk), | |
512 | .soclk(soclk) | |
513 | ); | |
514 | ||
515 | assign int_buf_vec[31:0] = {16'h0000,16'hffff} ; | |
516 | ||
517 | ||
518 | assign int_busy = int_buf_vld; | |
519 | ||
520 | ||
521 | /************************************************************ | |
522 | * Outbound ack/interrupt Arbitration | |
523 | ************************************************************/ | |
524 | ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_1 int_last_rd_ff | |
525 | ( | |
526 | .scan_in(int_last_rd_ff_scanin), | |
527 | .scan_out(int_last_rd_ff_scanout), | |
528 | .dout (int_last_rd), | |
529 | .l1clk (l1clk), | |
530 | .en (ack_buf_rd|int_buf_rd), | |
531 | .din (int_buf_rd), | |
532 | .siclk(siclk), | |
533 | .soclk(soclk) | |
534 | ); | |
535 | ||
536 | assign ack_buf_rd = ~outdata_buf_busy & ack_buf_vld & | |
537 | (~int_buf_vld | int_last_rd); | |
538 | ||
539 | assign int_buf_rd = ~outdata_buf_busy & int_buf_vld & | |
540 | (~ack_buf_vld | ~int_last_rd); | |
541 | ||
542 | assign outdata_buf_wr = ack_buf_rd | int_buf_rd; | |
543 | ||
544 | assign outdata_buf_in[127:0] = ack_buf_rd ? {ack_buf[75:12], | |
545 | 9'b0, | |
546 | 40'b0, | |
547 | 3'b0, | |
548 | ack_buf[11:10], | |
549 | ack_buf[9:4], | |
550 | ack_buf[3:0]}: | |
551 | {64'b0, | |
552 | 7'b0, | |
553 | int_buf[56:51], | |
554 | int_buf[50:19], | |
555 | int_buf[18:10], | |
556 | int_buf[9:4], | |
557 | int_buf[3:0]}; | |
558 | ||
559 | assign outdata_vec_in[31:0] = ack_buf_rd ? ack_buf_vec[31:0] : int_buf_vec[31:0]; | |
560 | ||
561 | ||
562 | ncu_ssiuo4_ctl ucb_bus_out (/*autoinst*/ | |
563 | // Outputs | |
564 | .vld(ucb_iob_vld), // Templated | |
565 | .data(ucb_iob_data[3:0]), // Templated | |
566 | .outdata_buf_busy(outdata_buf_busy), | |
567 | // Inputs | |
568 | .scan_in(ucb_bus_out_scanin), | |
569 | .scan_out(ucb_bus_out_scanout), | |
570 | .iol2clk(iol2clk), | |
571 | .tcu_pce_ov(tcu_pce_ov), | |
572 | .tcu_clk_stop(tcu_clk_stop), | |
573 | .tcu_aclk(tcu_aclk), | |
574 | .tcu_bclk(tcu_bclk), | |
575 | .tcu_scan_en(tcu_scan_en), | |
576 | .stall(iob_ucb_stall), // Templated | |
577 | .outdata_buf_in(outdata_buf_in[127:0]), | |
578 | .outdata_vec_in(outdata_vec_in[31:0]), // Templated | |
579 | .outdata_buf_wr(outdata_buf_wr)); | |
580 | ||
581 | ||
582 | ||
583 | ||
584 | /**** adding clock header ****/ | |
585 | ncu_ssiflow_ctl_l1clkhdr_ctl_macro clkgen ( | |
586 | .l2clk (iol2clk), | |
587 | .l1en (1'b1), | |
588 | .l1clk (l1clk), | |
589 | .pce_ov(pce_ov), | |
590 | .stop(stop), | |
591 | .se(se) | |
592 | ); | |
593 | ||
594 | /*** building tcu port ***/ | |
595 | assign siclk = tcu_aclk; | |
596 | assign soclk = tcu_bclk; | |
597 | assign se = tcu_scan_en; | |
598 | assign pce_ov = tcu_pce_ov; | |
599 | assign stop = tcu_clk_stop; | |
600 | ||
601 | // fixscan start: | |
602 | assign ucb_bus_in_scanin = scan_in ; | |
603 | assign buf_head_ff0_scanin = ucb_bus_in_scanout ; | |
604 | assign buf_head_ff1_scanin = buf_head_ff0_scanout ; | |
605 | assign buf_tail_ff0_scanin = buf_head_ff1_scanout ; | |
606 | assign buf_tail_ff1_scanin = buf_tail_ff0_scanout ; | |
607 | assign buf_full_ff_scanin = buf_tail_ff1_scanout ; | |
608 | assign buf_empty_ff_scanin = buf_full_ff_scanout ; | |
609 | assign buf0_ff_scanin = buf_empty_ff_scanout ; | |
610 | assign buf1_ff_scanin = buf0_ff_scanout ; | |
611 | assign ack_buf_vld_ff_scanin = buf1_ff_scanout ; | |
612 | assign ack_buf_is_nack_ff_scanin = ack_buf_vld_ff_scanout ; | |
613 | assign ack_buf_ff_scanin = ack_buf_is_nack_ff_scanout; | |
614 | assign int_buf_vld_ff_scanin = ack_buf_ff_scanout ; | |
615 | assign int_buf_ff_scanin = int_buf_vld_ff_scanout ; | |
616 | assign int_last_rd_ff_scanin = int_buf_ff_scanout ; | |
617 | assign ucb_bus_out_scanin = int_last_rd_ff_scanout ; | |
618 | assign scan_out = ucb_bus_out_scanout ; | |
619 | // fixscan end: | |
620 | endmodule | |
621 | ||
622 | // Local Variables: | |
623 | // verilog-library-directories:(".") | |
624 | // End: | |
625 | ||
626 | ||
627 | ||
628 | // any PARAMS parms go into naming of macro | |
629 | ||
630 | module ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_1 ( | |
631 | din, | |
632 | en, | |
633 | l1clk, | |
634 | scan_in, | |
635 | siclk, | |
636 | soclk, | |
637 | dout, | |
638 | scan_out); | |
639 | wire [0:0] fdin; | |
640 | ||
641 | input [0:0] din; | |
642 | input en; | |
643 | input l1clk; | |
644 | input scan_in; | |
645 | ||
646 | ||
647 | input siclk; | |
648 | input soclk; | |
649 | ||
650 | output [0:0] dout; | |
651 | output scan_out; | |
652 | assign fdin[0:0] = (din[0:0] & {1{en}}) | (dout[0:0] & ~{1{en}}); | |
653 | ||
654 | ||
655 | ||
656 | ||
657 | ||
658 | ||
659 | dff #(1) d0_0 ( | |
660 | .l1clk(l1clk), | |
661 | .siclk(siclk), | |
662 | .soclk(soclk), | |
663 | .d(fdin[0:0]), | |
664 | .si(scan_in), | |
665 | .so(scan_out), | |
666 | .q(dout[0:0]) | |
667 | ); | |
668 | ||
669 | ||
670 | ||
671 | ||
672 | ||
673 | ||
674 | ||
675 | ||
676 | ||
677 | ||
678 | ||
679 | ||
680 | endmodule | |
681 | ||
682 | ||
683 | ||
684 | ||
685 | ||
686 | ||
687 | ||
688 | ||
689 | ||
690 | ||
691 | ||
692 | ||
693 | ||
694 | // any PARAMS parms go into naming of macro | |
695 | ||
696 | module ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_4 ( | |
697 | din, | |
698 | en, | |
699 | l1clk, | |
700 | scan_in, | |
701 | siclk, | |
702 | soclk, | |
703 | dout, | |
704 | scan_out); | |
705 | wire [3:0] fdin; | |
706 | wire [2:0] so; | |
707 | ||
708 | input [3:0] din; | |
709 | input en; | |
710 | input l1clk; | |
711 | input scan_in; | |
712 | ||
713 | ||
714 | input siclk; | |
715 | input soclk; | |
716 | ||
717 | output [3:0] dout; | |
718 | output scan_out; | |
719 | assign fdin[3:0] = (din[3:0] & {4{en}}) | (dout[3:0] & ~{4{en}}); | |
720 | ||
721 | ||
722 | ||
723 | ||
724 | ||
725 | ||
726 | dff #(4) d0_0 ( | |
727 | .l1clk(l1clk), | |
728 | .siclk(siclk), | |
729 | .soclk(soclk), | |
730 | .d(fdin[3:0]), | |
731 | .si({scan_in,so[2:0]}), | |
732 | .so({so[2:0],scan_out}), | |
733 | .q(dout[3:0]) | |
734 | ); | |
735 | ||
736 | ||
737 | ||
738 | ||
739 | ||
740 | ||
741 | ||
742 | ||
743 | ||
744 | ||
745 | ||
746 | ||
747 | endmodule | |
748 | ||
749 | ||
750 | ||
751 | ||
752 | ||
753 | ||
754 | ||
755 | ||
756 | ||
757 | ||
758 | ||
759 | ||
760 | ||
761 | // any PARAMS parms go into naming of macro | |
762 | ||
763 | module ncu_ssiflow_ctl_msff_ctl_macro__width_1 ( | |
764 | din, | |
765 | l1clk, | |
766 | scan_in, | |
767 | siclk, | |
768 | soclk, | |
769 | dout, | |
770 | scan_out); | |
771 | wire [0:0] fdin; | |
772 | ||
773 | input [0:0] din; | |
774 | input l1clk; | |
775 | input scan_in; | |
776 | ||
777 | ||
778 | input siclk; | |
779 | input soclk; | |
780 | ||
781 | output [0:0] dout; | |
782 | output scan_out; | |
783 | assign fdin[0:0] = din[0:0]; | |
784 | ||
785 | ||
786 | ||
787 | ||
788 | ||
789 | ||
790 | dff #(1) d0_0 ( | |
791 | .l1clk(l1clk), | |
792 | .siclk(siclk), | |
793 | .soclk(soclk), | |
794 | .d(fdin[0:0]), | |
795 | .si(scan_in), | |
796 | .so(scan_out), | |
797 | .q(dout[0:0]) | |
798 | ); | |
799 | ||
800 | ||
801 | ||
802 | ||
803 | ||
804 | ||
805 | ||
806 | ||
807 | ||
808 | ||
809 | ||
810 | ||
811 | endmodule | |
812 | ||
813 | ||
814 | ||
815 | ||
816 | ||
817 | ||
818 | ||
819 | ||
820 | ||
821 | ||
822 | ||
823 | ||
824 | ||
825 | // any PARAMS parms go into naming of macro | |
826 | ||
827 | module ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_32 ( | |
828 | din, | |
829 | en, | |
830 | l1clk, | |
831 | scan_in, | |
832 | siclk, | |
833 | soclk, | |
834 | dout, | |
835 | scan_out); | |
836 | wire [31:0] fdin; | |
837 | wire [30:0] so; | |
838 | ||
839 | input [31:0] din; | |
840 | input en; | |
841 | input l1clk; | |
842 | input scan_in; | |
843 | ||
844 | ||
845 | input siclk; | |
846 | input soclk; | |
847 | ||
848 | output [31:0] dout; | |
849 | output scan_out; | |
850 | assign fdin[31:0] = (din[31:0] & {32{en}}) | (dout[31:0] & ~{32{en}}); | |
851 | ||
852 | ||
853 | ||
854 | ||
855 | ||
856 | ||
857 | dff #(32) d0_0 ( | |
858 | .l1clk(l1clk), | |
859 | .siclk(siclk), | |
860 | .soclk(soclk), | |
861 | .d(fdin[31:0]), | |
862 | .si({scan_in,so[30:0]}), | |
863 | .so({so[30:0],scan_out}), | |
864 | .q(dout[31:0]) | |
865 | ); | |
866 | ||
867 | ||
868 | ||
869 | ||
870 | ||
871 | ||
872 | ||
873 | ||
874 | ||
875 | ||
876 | ||
877 | ||
878 | endmodule | |
879 | ||
880 | ||
881 | ||
882 | ||
883 | ||
884 | ||
885 | ||
886 | ||
887 | ||
888 | ||
889 | ||
890 | ||
891 | ||
892 | // any PARAMS parms go into naming of macro | |
893 | ||
894 | module ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_128 ( | |
895 | din, | |
896 | en, | |
897 | l1clk, | |
898 | scan_in, | |
899 | siclk, | |
900 | soclk, | |
901 | dout, | |
902 | scan_out); | |
903 | wire [127:0] fdin; | |
904 | wire [126:0] so; | |
905 | ||
906 | input [127:0] din; | |
907 | input en; | |
908 | input l1clk; | |
909 | input scan_in; | |
910 | ||
911 | ||
912 | input siclk; | |
913 | input soclk; | |
914 | ||
915 | output [127:0] dout; | |
916 | output scan_out; | |
917 | assign fdin[127:0] = (din[127:0] & {128{en}}) | (dout[127:0] & ~{128{en}}); | |
918 | ||
919 | ||
920 | ||
921 | ||
922 | ||
923 | ||
924 | dff #(128) d0_0 ( | |
925 | .l1clk(l1clk), | |
926 | .siclk(siclk), | |
927 | .soclk(soclk), | |
928 | .d(fdin[127:0]), | |
929 | .si({scan_in,so[126:0]}), | |
930 | .so({so[126:0],scan_out}), | |
931 | .q(dout[127:0]) | |
932 | ); | |
933 | ||
934 | ||
935 | ||
936 | ||
937 | ||
938 | ||
939 | ||
940 | ||
941 | ||
942 | ||
943 | ||
944 | ||
945 | endmodule | |
946 | ||
947 | ||
948 | ||
949 | ||
950 | ||
951 | ||
952 | ||
953 | ||
954 | ||
955 | ||
956 | ||
957 | ||
958 | ||
959 | // any PARAMS parms go into naming of macro | |
960 | ||
961 | module ncu_ssiflow_ctl_l1clkhdr_ctl_macro ( | |
962 | l2clk, | |
963 | l1en, | |
964 | pce_ov, | |
965 | stop, | |
966 | se, | |
967 | l1clk); | |
968 | ||
969 | ||
970 | input l2clk; | |
971 | input l1en; | |
972 | input pce_ov; | |
973 | input stop; | |
974 | input se; | |
975 | output l1clk; | |
976 | ||
977 | ||
978 | ||
979 | ||
980 | ||
981 | cl_sc1_l1hdr_8x c_0 ( | |
982 | ||
983 | ||
984 | .l2clk(l2clk), | |
985 | .pce(l1en), | |
986 | .l1clk(l1clk), | |
987 | .se(se), | |
988 | .pce_ov(pce_ov), | |
989 | .stop(stop) | |
990 | ); | |
991 | ||
992 | ||
993 | ||
994 | endmodule | |
995 | ||
996 | ||
997 | ||
998 | ||
999 | ||
1000 | ||
1001 | ||
1002 | ||
1003 | ||
1004 | ||
1005 | ||
1006 | ||
1007 | ||
1008 | // any PARAMS parms go into naming of macro | |
1009 | ||
1010 | module ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_118 ( | |
1011 | din, | |
1012 | en, | |
1013 | l1clk, | |
1014 | scan_in, | |
1015 | siclk, | |
1016 | soclk, | |
1017 | dout, | |
1018 | scan_out); | |
1019 | wire [117:0] fdin; | |
1020 | wire [116:0] so; | |
1021 | ||
1022 | input [117:0] din; | |
1023 | input en; | |
1024 | input l1clk; | |
1025 | input scan_in; | |
1026 | ||
1027 | ||
1028 | input siclk; | |
1029 | input soclk; | |
1030 | ||
1031 | output [117:0] dout; | |
1032 | output scan_out; | |
1033 | assign fdin[117:0] = (din[117:0] & {118{en}}) | (dout[117:0] & ~{118{en}}); | |
1034 | ||
1035 | ||
1036 | ||
1037 | ||
1038 | ||
1039 | ||
1040 | dff #(118) d0_0 ( | |
1041 | .l1clk(l1clk), | |
1042 | .siclk(siclk), | |
1043 | .soclk(soclk), | |
1044 | .d(fdin[117:0]), | |
1045 | .si({scan_in,so[116:0]}), | |
1046 | .so({so[116:0],scan_out}), | |
1047 | .q(dout[117:0]) | |
1048 | ); | |
1049 | ||
1050 | ||
1051 | ||
1052 | ||
1053 | ||
1054 | ||
1055 | ||
1056 | ||
1057 | ||
1058 | ||
1059 | ||
1060 | ||
1061 | endmodule | |
1062 | ||
1063 | ||
1064 | ||
1065 | ||
1066 | ||
1067 | ||
1068 | ||
1069 | ||
1070 | ||
1071 | ||
1072 | ||
1073 | ||
1074 | ||
1075 | // any PARAMS parms go into naming of macro | |
1076 | ||
1077 | module ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_76 ( | |
1078 | din, | |
1079 | en, | |
1080 | l1clk, | |
1081 | scan_in, | |
1082 | siclk, | |
1083 | soclk, | |
1084 | dout, | |
1085 | scan_out); | |
1086 | wire [75:0] fdin; | |
1087 | wire [74:0] so; | |
1088 | ||
1089 | input [75:0] din; | |
1090 | input en; | |
1091 | input l1clk; | |
1092 | input scan_in; | |
1093 | ||
1094 | ||
1095 | input siclk; | |
1096 | input soclk; | |
1097 | ||
1098 | output [75:0] dout; | |
1099 | output scan_out; | |
1100 | assign fdin[75:0] = (din[75:0] & {76{en}}) | (dout[75:0] & ~{76{en}}); | |
1101 | ||
1102 | ||
1103 | ||
1104 | ||
1105 | ||
1106 | ||
1107 | dff #(76) d0_0 ( | |
1108 | .l1clk(l1clk), | |
1109 | .siclk(siclk), | |
1110 | .soclk(soclk), | |
1111 | .d(fdin[75:0]), | |
1112 | .si({scan_in,so[74:0]}), | |
1113 | .so({so[74:0],scan_out}), | |
1114 | .q(dout[75:0]) | |
1115 | ); | |
1116 | ||
1117 | ||
1118 | ||
1119 | ||
1120 | ||
1121 | ||
1122 | ||
1123 | ||
1124 | ||
1125 | ||
1126 | ||
1127 | ||
1128 | endmodule | |
1129 | ||
1130 | ||
1131 | ||
1132 | ||
1133 | ||
1134 | ||
1135 | ||
1136 | ||
1137 | ||
1138 | ||
1139 | ||
1140 | ||
1141 | ||
1142 | // any PARAMS parms go into naming of macro | |
1143 | ||
1144 | module ncu_ssiflow_ctl_msff_ctl_macro__en_1__width_57 ( | |
1145 | din, | |
1146 | en, | |
1147 | l1clk, | |
1148 | scan_in, | |
1149 | siclk, | |
1150 | soclk, | |
1151 | dout, | |
1152 | scan_out); | |
1153 | wire [56:0] fdin; | |
1154 | wire [55:0] so; | |
1155 | ||
1156 | input [56:0] din; | |
1157 | input en; | |
1158 | input l1clk; | |
1159 | input scan_in; | |
1160 | ||
1161 | ||
1162 | input siclk; | |
1163 | input soclk; | |
1164 | ||
1165 | output [56:0] dout; | |
1166 | output scan_out; | |
1167 | assign fdin[56:0] = (din[56:0] & {57{en}}) | (dout[56:0] & ~{57{en}}); | |
1168 | ||
1169 | ||
1170 | ||
1171 | ||
1172 | ||
1173 | ||
1174 | dff #(57) d0_0 ( | |
1175 | .l1clk(l1clk), | |
1176 | .siclk(siclk), | |
1177 | .soclk(soclk), | |
1178 | .d(fdin[56:0]), | |
1179 | .si({scan_in,so[55:0]}), | |
1180 | .so({so[55:0],scan_out}), | |
1181 | .q(dout[56:0]) | |
1182 | ); | |
1183 | ||
1184 | ||
1185 | ||
1186 | ||
1187 | ||
1188 | ||
1189 | ||
1190 | ||
1191 | ||
1192 | ||
1193 | ||
1194 | ||
1195 | endmodule | |
1196 | ||
1197 | ||
1198 | ||
1199 | // any PARAMS parms go into naming of macro | |
1200 | ||
1201 | module ncu_ssiflow_ctl_msff_ctl_macro__width_32 ( | |
1202 | din, | |
1203 | l1clk, | |
1204 | scan_in, | |
1205 | siclk, | |
1206 | soclk, | |
1207 | dout, | |
1208 | scan_out); | |
1209 | wire [31:0] fdin; | |
1210 | wire [30:0] so; | |
1211 | ||
1212 | input [31:0] din; | |
1213 | input l1clk; | |
1214 | input scan_in; | |
1215 | ||
1216 | ||
1217 | input siclk; | |
1218 | input soclk; | |
1219 | ||
1220 | output [31:0] dout; | |
1221 | output scan_out; | |
1222 | assign fdin[31:0] = din[31:0]; | |
1223 | ||
1224 | ||
1225 | ||
1226 | ||
1227 | ||
1228 | ||
1229 | dff #(32) d0_0 ( | |
1230 | .l1clk(l1clk), | |
1231 | .siclk(siclk), | |
1232 | .soclk(soclk), | |
1233 | .d(fdin[31:0]), | |
1234 | .si({scan_in,so[30:0]}), | |
1235 | .so({so[30:0],scan_out}), | |
1236 | .q(dout[31:0]) | |
1237 | ); | |
1238 | ||
1239 | ||
1240 | ||
1241 | ||
1242 | ||
1243 | ||
1244 | ||
1245 | ||
1246 | ||
1247 | ||
1248 | ||
1249 | ||
1250 | endmodule | |
1251 | ||
1252 | ||
1253 | ||
1254 | ||
1255 | ||
1256 | ||
1257 | ||
1258 | ||
1259 | ||
1260 | ||
1261 | ||
1262 | ||
1263 | ||
1264 | // any PARAMS parms go into naming of macro | |
1265 | ||
1266 | module ncu_ssiflow_ctl_msff_ctl_macro__width_128 ( | |
1267 | din, | |
1268 | l1clk, | |
1269 | scan_in, | |
1270 | siclk, | |
1271 | soclk, | |
1272 | dout, | |
1273 | scan_out); | |
1274 | wire [127:0] fdin; | |
1275 | wire [126:0] so; | |
1276 | ||
1277 | input [127:0] din; | |
1278 | input l1clk; | |
1279 | input scan_in; | |
1280 | ||
1281 | ||
1282 | input siclk; | |
1283 | input soclk; | |
1284 | ||
1285 | output [127:0] dout; | |
1286 | output scan_out; | |
1287 | assign fdin[127:0] = din[127:0]; | |
1288 | ||
1289 | ||
1290 | ||
1291 | ||
1292 | ||
1293 | ||
1294 | dff #(128) d0_0 ( | |
1295 | .l1clk(l1clk), | |
1296 | .siclk(siclk), | |
1297 | .soclk(soclk), | |
1298 | .d(fdin[127:0]), | |
1299 | .si({scan_in,so[126:0]}), | |
1300 | .so({so[126:0],scan_out}), | |
1301 | .q(dout[127:0]) | |
1302 | ); | |
1303 | ||
1304 | ||
1305 | ||
1306 | ||
1307 | ||
1308 | ||
1309 | ||
1310 | ||
1311 | ||
1312 | ||
1313 | ||
1314 | ||
1315 | endmodule | |
1316 | ||
1317 | ||
1318 | ||
1319 | ||
1320 | ||
1321 | ||
1322 | ||
1323 |