Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / ncu / rtl / ncu_i2cbuf32_ni_ctl.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: ncu_i2cbuf32_ni_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 ============================================
35module ncu_i2cbuf32_ni_ctl (
36 iol2clk,
37 scan_in,
38 scan_out,
39 tcu_pce_ov,
40 tcu_clk_stop,
41 tcu_scan_en,
42 tcu_aclk,
43 tcu_bclk,
44 tcu_dbr_gateoff,
45 ucb_iob_vld,
46 ucb_iob_data,
47 iob_ucb_stall,
48 req_ack_obj,
49 req_ack_vld,
50 rd_req_ack_dbl_buf) ;
51wire stall_d1_n;
52wire stall_d1;
53wire vld_d1_ff_scanin;
54wire vld_d1_ff_scanout;
55wire vld_d1;
56wire l1clk;
57wire rdy1;
58wire data_d1_ff_scanin;
59wire data_d1_ff_scanout;
60wire [31:0] data_d1;
61wire iob_ucb_stall_f;
62wire stall_ff_scanin;
63wire stall_ff_scanout;
64wire iob_ucb_stall_a1;
65wire stall_d1_ff_scanin;
66wire stall_d1_ff_scanout;
67wire rdy0_ff_scanin;
68wire rdy0_ff_scanout;
69wire rdy0;
70wire rdy1_ff_scanin;
71wire rdy1_ff_scanout;
72wire skid_buf0_en;
73wire vld_buf0_ff_scanin;
74wire vld_buf0_ff_scanout;
75wire vld_buf0;
76wire data_buf0_ff_scanin;
77wire data_buf0_ff_scanout;
78wire [31:0] data_buf0;
79wire skid_buf1_en_ff_scanin;
80wire skid_buf1_en_ff_scanout;
81wire skid_buf1_en;
82wire vld_buf1_ff_scanin;
83wire vld_buf1_ff_scanout;
84wire vld_buf1;
85wire data_buf1_ff_scanin;
86wire data_buf1_ff_scanout;
87wire [31:0] data_buf1;
88wire skid_buf0_sel;
89wire skid_buf1_sel_ff_scanin;
90wire skid_buf1_sel_ff_scanout;
91wire skid_buf1_sel;
92wire vld_mux;
93wire [31:0] data_mux;
94wire [3:0] indata_vec_next;
95wire [3:0] indata_vec;
96wire iob_ucb_stall_a1_;
97wire indata_vec_ff_scanin;
98wire indata_vec_ff_scanout;
99wire [127:0] indata_buf_next;
100wire [127:0] indata_buf;
101wire indata_buf_ff_scanin;
102wire indata_buf_ff_scanout;
103wire indata_vec0_d1_ff_scanin;
104wire indata_vec0_d1_ff_scanout;
105wire indata_vec0_d1;
106wire indata_buf_vld;
107wire req_ack_pending;
108wire req_ack_dbl_buf_full;
109wire wr_req_ack_dbl_buf;
110wire wr_buf0;
111wire buf1_vld;
112wire buf0_vld;
113wire buf1_older;
114wire wr_buf1;
115wire rd_buf0;
116wire rd_buf1;
117wire rd_buf;
118wire buf1_older_n;
119wire buf1_older_ff_scanin;
120wire buf1_older_ff_scanout;
121wire en_vld0;
122wire en_vld1;
123wire buf0_vld_ff_scanin;
124wire buf0_vld_ff_scanout;
125wire buf1_vld_ff_scanin;
126wire buf1_vld_ff_scanout;
127wire buf0_obj_ff_scanin;
128wire buf0_obj_ff_scanout;
129wire [127:0] buf0_obj;
130wire buf1_obj_ff_scanin;
131wire buf1_obj_ff_scanout;
132wire [127:0] buf1_obj;
133wire siclk;
134wire soclk;
135wire se;
136wire pce_ov;
137wire stop;
138
139
140
141 // Global interface
142input iol2clk;
143input scan_in;
144output scan_out;
145input tcu_pce_ov;
146input tcu_clk_stop;
147input tcu_scan_en;
148input tcu_aclk;
149input tcu_bclk;
150input tcu_dbr_gateoff;
151
152
153 // UCB interface
154input ucb_iob_vld;
155input [31:0] ucb_iob_data;
156output iob_ucb_stall;
157
158 // i2c slow control/datapath interface
159output [127:0] req_ack_obj;
160output req_ack_vld;
161input rd_req_ack_dbl_buf;
162
163 // Internal signals
164
165/************************************************************
166 * Assemble inbound packet
167 ************************************************************/
168// ucb_bus_in #(UCB_BUS_WIDTH) ucb_bus_in
169// (
170// .clk(iol2clk),
171// .vld(ucb_iob_vld),
172// .data(ucb_iob_data[UCB_BUS_WIDTH-1:0]),
173// .stall(iob_ucb_stall),
174// .indata_buf_vld(indata_buf_vld),
175// .indata_buf(indata_buf[127:0]),
176// .stall_a1(iob_ucb_stall_a1)
177// );
178//============================================================
179//============================================================
180//============================================================
181/************************************************************
182 * UCB bus interface flops
183 * This is to make signals going between IOB and UCB flop-to-flop
184 * to improve timing.
185 ************************************************************/
186assign stall_d1_n = ~stall_d1 ;
187ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_1 vld_d1_ff
188 (
189 .scan_in(vld_d1_ff_scanin),
190 .scan_out(vld_d1_ff_scanout),
191 .dout (vld_d1),
192 .l1clk (l1clk),
193 .en (stall_d1_n&rdy1),
194 .din (ucb_iob_vld),
195 .siclk(siclk),
196 .soclk(soclk)
197 );
198
199ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_32 data_d1_ff
200 (
201 .scan_in(data_d1_ff_scanin),
202 .scan_out(data_d1_ff_scanout),
203 .dout (data_d1[31:0]),
204 .l1clk (l1clk),
205 .en (stall_d1_n),
206 .din (ucb_iob_data[31:0]),
207 .siclk(siclk),
208 .soclk(soclk)
209 );
210
211assign iob_ucb_stall = iob_ucb_stall_f & tcu_dbr_gateoff;
212ncu_i2cbuf32_ni_ctl_msff_ctl_macro__width_1 stall_ff
213 (
214 .scan_in(stall_ff_scanin),
215 .scan_out(stall_ff_scanout),
216 .dout (iob_ucb_stall_f),
217 .l1clk (l1clk),
218 .din (iob_ucb_stall_a1),
219 .siclk(siclk),
220 .soclk(soclk)
221 );
222
223ncu_i2cbuf32_ni_ctl_msff_ctl_macro__width_1 stall_d1_ff
224 (
225 .scan_in(stall_d1_ff_scanin),
226 .scan_out(stall_d1_ff_scanout),
227 .dout (stall_d1),
228 .l1clk (l1clk),
229 .din (iob_ucb_stall),
230 .siclk(siclk),
231 .soclk(soclk)
232 );
233
234
235ncu_i2cbuf32_ni_ctl_msff_ctl_macro__width_1 rdy0_ff
236 (
237 .scan_in(rdy0_ff_scanin),
238 .scan_out(rdy0_ff_scanout),
239 .dout (rdy0),
240 .l1clk (l1clk),
241 .din (1'b1),
242 .siclk(siclk),
243 .soclk(soclk)
244 );
245
246ncu_i2cbuf32_ni_ctl_msff_ctl_macro__width_1 rdy1_ff
247 (
248 .scan_in(rdy1_ff_scanin),
249 .scan_out(rdy1_ff_scanout),
250 .dout (rdy1),
251 .l1clk (l1clk),
252 .din (rdy0),
253 .siclk(siclk),
254 .soclk(soclk)
255 );
256
257/************************************************************
258 * Skid buffer
259 * We need a two deep skid buffer to handle stalling.
260 ************************************************************/
261// Assertion: stall has to be deasserted for more than 1 cycle
262// ie time between two separate stalls has to be
263// at least two cycles. Otherwise, contents from
264// skid buffer will be lost.
265
266// Buffer 0
267assign skid_buf0_en = iob_ucb_stall_a1 & ~iob_ucb_stall;
268
269ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_1 vld_buf0_ff
270 (
271 .scan_in(vld_buf0_ff_scanin),
272 .scan_out(vld_buf0_ff_scanout),
273 .dout (vld_buf0),
274 .l1clk (l1clk),
275 .en (skid_buf0_en),
276 .din (vld_d1),
277 .siclk(siclk),
278 .soclk(soclk)
279 );
280
281ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_32 data_buf0_ff
282 (
283 .scan_in(data_buf0_ff_scanin),
284 .scan_out(data_buf0_ff_scanout),
285 .dout (data_buf0[31:0]),
286 .l1clk (l1clk),
287 .en (skid_buf0_en),
288 .din (data_d1[31:0]),
289 .siclk(siclk),
290 .soclk(soclk)
291 );
292
293// Buffer 1
294ncu_i2cbuf32_ni_ctl_msff_ctl_macro__width_1 skid_buf1_en_ff
295 (
296 .scan_in(skid_buf1_en_ff_scanin),
297 .scan_out(skid_buf1_en_ff_scanout),
298 .dout (skid_buf1_en),
299 .l1clk (l1clk),
300 .din (skid_buf0_en),
301 .siclk(siclk),
302 .soclk(soclk)
303 );
304
305ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_1 vld_buf1_ff
306 (
307 .scan_in(vld_buf1_ff_scanin),
308 .scan_out(vld_buf1_ff_scanout),
309 .dout (vld_buf1),
310 .l1clk (l1clk),
311 .en (skid_buf1_en),
312 .din (vld_d1),
313 .siclk(siclk),
314 .soclk(soclk)
315 );
316
317ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_32 data_buf1_ff
318 (
319 .scan_in(data_buf1_ff_scanin),
320 .scan_out(data_buf1_ff_scanout),
321 .dout (data_buf1[31:0]),
322 .l1clk (l1clk),
323 .en (skid_buf1_en),
324 .din (data_d1[31:0]),
325 .siclk(siclk),
326 .soclk(soclk)
327 );
328
329/************************************************************
330 * Mux between skid buffer and interface flop
331 ************************************************************/
332// Assertion: stall has to be deasserted for more than 1 cycle
333// ie time between two separate stalls has to be
334// at least two cycles. Otherwise, contents from
335// skid buffer will be lost.
336
337assign skid_buf0_sel = ~iob_ucb_stall_a1 & iob_ucb_stall;
338
339ncu_i2cbuf32_ni_ctl_msff_ctl_macro__width_1 skid_buf1_sel_ff
340 (
341 .scan_in(skid_buf1_sel_ff_scanin),
342 .scan_out(skid_buf1_sel_ff_scanout),
343 .dout (skid_buf1_sel),
344 .l1clk (l1clk),
345 .din (skid_buf0_sel),
346 .siclk(siclk),
347 .soclk(soclk)
348 );
349
350assign vld_mux = skid_buf0_sel ? vld_buf0 :
351 skid_buf1_sel ? vld_buf1 : vld_d1;
352
353assign data_mux[31:0] = skid_buf0_sel ? data_buf0[31:0] :
354 skid_buf1_sel ? data_buf1[31:0] : data_d1[31:0];
355
356/************************************************************
357 * Assemble inbound data
358 ************************************************************/
359// valid vector
360assign indata_vec_next[3:0] = {vld_mux, indata_vec[3:1]};
361assign iob_ucb_stall_a1_= ~iob_ucb_stall_a1;
362ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_4 indata_vec_ff
363 (
364 .scan_in(indata_vec_ff_scanin),
365 .scan_out(indata_vec_ff_scanout),
366 .dout (indata_vec[3:0]),
367 .l1clk (l1clk),
368 .en (iob_ucb_stall_a1_),
369 .din (indata_vec_next[3:0]),
370 .siclk(siclk),
371 .soclk(soclk)
372 );
373
374// data buffer
375assign indata_buf_next[127:0] = {data_mux[31:0], indata_buf[127:32]};
376ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_128 indata_buf_ff
377 (
378 .scan_in(indata_buf_ff_scanin),
379 .scan_out(indata_buf_ff_scanout),
380 .dout (indata_buf[127:0]),
381 .l1clk (l1clk),
382 .en (iob_ucb_stall_a1_),
383 .din (indata_buf_next[127:0]),
384 .siclk(siclk),
385 .soclk(soclk)
386 );
387
388// detect a new packet
389ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_1 indata_vec0_d1_ff
390 (
391 .scan_in(indata_vec0_d1_ff_scanin),
392 .scan_out(indata_vec0_d1_ff_scanout),
393 .dout (indata_vec0_d1),
394 .l1clk (l1clk),
395 .en (iob_ucb_stall_a1_),
396 .din (indata_vec[0]),
397 .siclk(siclk),
398 .soclk(soclk)
399 );
400
401assign indata_buf_vld = indata_vec[0] & ~indata_vec0_d1;
402//============================================================
403//============================================================
404//============================================================
405
406
407
408
409/************************************************************
410 * Decode inbound packet type
411 ************************************************************/
412// non-interrupt packet
413assign req_ack_pending = indata_buf_vld;
414
415assign iob_ucb_stall_a1 = (req_ack_pending & req_ack_dbl_buf_full);
416
417/************************************************************
418 * Double buffer to store non-interrupt packets
419 ************************************************************/
420assign wr_req_ack_dbl_buf = req_ack_pending & ~req_ack_dbl_buf_full;
421
422/* dbl_buf #(128) req_ack_dbl_buf (
423 .clk(iol2clk),
424 .wr(wr_req_ack_dbl_buf),
425 .din(indata_buf[127:0]),
426 .rd(rd_req_ack_dbl_buf),
427 .dout(req_ack_obj[127:0]),
428 .vld(req_ack_vld),
429 .full(req_ack_dbl_buf_full));
430*/
431//============================================================
432//============================================================
433//============================================================
434
435// if both entries are empty, write to entry pointed to by the older pointer
436assign wr_buf0 = wr_req_ack_dbl_buf & (buf1_vld | (~buf0_vld & ~buf1_older));
437assign wr_buf1 = wr_req_ack_dbl_buf & (buf0_vld | (~buf1_vld & buf1_older));
438
439// read from the older entry
440assign rd_buf0 = rd_req_ack_dbl_buf & ~buf1_older;
441assign rd_buf1 = rd_req_ack_dbl_buf & buf1_older;
442
443// flip older pointer when an entry is read
444assign rd_buf = rd_req_ack_dbl_buf & (buf0_vld | buf1_vld);
445assign buf1_older_n = ~buf1_older;
446ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_1 buf1_older_ff
447 (
448 .scan_in(buf1_older_ff_scanin),
449 .scan_out(buf1_older_ff_scanout),
450 .dout (buf1_older),
451 .l1clk (l1clk),
452 .en (rd_buf),
453 .din (buf1_older_n),
454 .siclk(siclk),
455 .soclk(soclk)
456 );
457
458// set valid bit for writes and reset for reads
459assign en_vld0 = wr_buf0 | rd_buf0;
460assign en_vld1 = wr_buf1 | rd_buf1;
461
462// the actual buffers
463ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_1 buf0_vld_ff
464 (
465 .scan_in(buf0_vld_ff_scanin),
466 .scan_out(buf0_vld_ff_scanout),
467 .dout (buf0_vld),
468 .l1clk (l1clk),
469 .en (en_vld0),
470 .din (wr_buf0),
471 .siclk(siclk),
472 .soclk(soclk)
473 );
474
475ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_1 buf1_vld_ff
476 (
477 .scan_in(buf1_vld_ff_scanin),
478 .scan_out(buf1_vld_ff_scanout),
479 .dout (buf1_vld),
480 .l1clk (l1clk),
481 .en (en_vld1),
482 .din (wr_buf1),
483 .siclk(siclk),
484 .soclk(soclk)
485 );
486
487ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_128 buf0_obj_ff
488 (
489 .scan_in(buf0_obj_ff_scanin),
490 .scan_out(buf0_obj_ff_scanout),
491 .dout (buf0_obj[127:0]),
492 .l1clk (l1clk),
493 .en (wr_buf0),
494 .din (indata_buf[127:0]),
495 .siclk(siclk),
496 .soclk(soclk)
497 );
498
499ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_128 buf1_obj_ff
500 (
501 .scan_in(buf1_obj_ff_scanin),
502 .scan_out(buf1_obj_ff_scanout),
503 .dout (buf1_obj[127:0]),
504 .l1clk (l1clk),
505 .en (wr_buf1),
506 .din (indata_buf[127:0]),
507 .siclk(siclk),
508 .soclk(soclk)
509 );
510
511// mux out the older entry
512assign req_ack_obj[127:0] = (buf1_older) ? buf1_obj[127:0] : buf0_obj[127:0] ;
513
514assign req_ack_vld = buf0_vld | buf1_vld;
515assign req_ack_dbl_buf_full = buf0_vld & buf1_vld;
516//============================================================
517//============================================================
518//============================================================
519
520
521
522
523/**** adding clock header ****/
524ncu_i2cbuf32_ni_ctl_l1clkhdr_ctl_macro clkgen (
525 .l2clk (iol2clk),
526 .l1en (1'b1),
527 .l1clk (l1clk),
528 .pce_ov(pce_ov),
529 .stop(stop),
530 .se(se)
531 );
532
533/*** building tcu port ***/
534assign siclk = tcu_aclk;
535assign soclk = tcu_bclk;
536assign se = tcu_scan_en;
537assign pce_ov = tcu_pce_ov;
538assign stop = tcu_clk_stop;
539
540// fixscan start:
541assign vld_d1_ff_scanin = scan_in ;
542assign data_d1_ff_scanin = vld_d1_ff_scanout ;
543assign stall_ff_scanin = data_d1_ff_scanout ;
544assign stall_d1_ff_scanin = stall_ff_scanout ;
545assign rdy0_ff_scanin = stall_d1_ff_scanout ;
546assign rdy1_ff_scanin = rdy0_ff_scanout ;
547assign vld_buf0_ff_scanin = rdy1_ff_scanout ;
548assign data_buf0_ff_scanin = vld_buf0_ff_scanout ;
549assign skid_buf1_en_ff_scanin = data_buf0_ff_scanout ;
550assign vld_buf1_ff_scanin = skid_buf1_en_ff_scanout ;
551assign data_buf1_ff_scanin = vld_buf1_ff_scanout ;
552assign skid_buf1_sel_ff_scanin = data_buf1_ff_scanout ;
553assign indata_vec_ff_scanin = skid_buf1_sel_ff_scanout ;
554assign indata_buf_ff_scanin = indata_vec_ff_scanout ;
555assign indata_vec0_d1_ff_scanin = indata_buf_ff_scanout ;
556assign buf1_older_ff_scanin = indata_vec0_d1_ff_scanout;
557assign buf0_vld_ff_scanin = buf1_older_ff_scanout ;
558assign buf1_vld_ff_scanin = buf0_vld_ff_scanout ;
559assign buf0_obj_ff_scanin = buf1_vld_ff_scanout ;
560assign buf1_obj_ff_scanin = buf0_obj_ff_scanout ;
561assign scan_out = buf1_obj_ff_scanout ;
562// fixscan end:
563endmodule // i2c_buf
564
565
566
567
568
569
570
571
572// any PARAMS parms go into naming of macro
573
574module ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_1 (
575 din,
576 en,
577 l1clk,
578 scan_in,
579 siclk,
580 soclk,
581 dout,
582 scan_out);
583wire [0:0] fdin;
584
585 input [0:0] din;
586 input en;
587 input l1clk;
588 input scan_in;
589
590
591 input siclk;
592 input soclk;
593
594 output [0:0] dout;
595 output scan_out;
596assign fdin[0:0] = (din[0:0] & {1{en}}) | (dout[0:0] & ~{1{en}});
597
598
599
600
601
602
603dff #(1) d0_0 (
604.l1clk(l1clk),
605.siclk(siclk),
606.soclk(soclk),
607.d(fdin[0:0]),
608.si(scan_in),
609.so(scan_out),
610.q(dout[0:0])
611);
612
613
614
615
616
617
618
619
620
621
622
623
624endmodule
625
626
627
628
629
630
631
632
633
634
635
636
637
638// any PARAMS parms go into naming of macro
639
640module ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_32 (
641 din,
642 en,
643 l1clk,
644 scan_in,
645 siclk,
646 soclk,
647 dout,
648 scan_out);
649wire [31:0] fdin;
650wire [30:0] so;
651
652 input [31:0] din;
653 input en;
654 input l1clk;
655 input scan_in;
656
657
658 input siclk;
659 input soclk;
660
661 output [31:0] dout;
662 output scan_out;
663assign fdin[31:0] = (din[31:0] & {32{en}}) | (dout[31:0] & ~{32{en}});
664
665
666
667
668
669
670dff #(32) d0_0 (
671.l1clk(l1clk),
672.siclk(siclk),
673.soclk(soclk),
674.d(fdin[31:0]),
675.si({scan_in,so[30:0]}),
676.so({so[30:0],scan_out}),
677.q(dout[31:0])
678);
679
680
681
682
683
684
685
686
687
688
689
690
691endmodule
692
693
694
695
696
697
698
699
700
701
702
703
704
705// any PARAMS parms go into naming of macro
706
707module ncu_i2cbuf32_ni_ctl_msff_ctl_macro__width_1 (
708 din,
709 l1clk,
710 scan_in,
711 siclk,
712 soclk,
713 dout,
714 scan_out);
715wire [0:0] fdin;
716
717 input [0:0] din;
718 input l1clk;
719 input scan_in;
720
721
722 input siclk;
723 input soclk;
724
725 output [0:0] dout;
726 output scan_out;
727assign fdin[0:0] = din[0:0];
728
729
730
731
732
733
734dff #(1) d0_0 (
735.l1clk(l1clk),
736.siclk(siclk),
737.soclk(soclk),
738.d(fdin[0:0]),
739.si(scan_in),
740.so(scan_out),
741.q(dout[0:0])
742);
743
744
745
746
747
748
749
750
751
752
753
754
755endmodule
756
757
758
759
760
761
762
763
764
765
766
767
768
769// any PARAMS parms go into naming of macro
770
771module ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_4 (
772 din,
773 en,
774 l1clk,
775 scan_in,
776 siclk,
777 soclk,
778 dout,
779 scan_out);
780wire [3:0] fdin;
781wire [2:0] so;
782
783 input [3:0] din;
784 input en;
785 input l1clk;
786 input scan_in;
787
788
789 input siclk;
790 input soclk;
791
792 output [3:0] dout;
793 output scan_out;
794assign fdin[3:0] = (din[3:0] & {4{en}}) | (dout[3:0] & ~{4{en}});
795
796
797
798
799
800
801dff #(4) d0_0 (
802.l1clk(l1clk),
803.siclk(siclk),
804.soclk(soclk),
805.d(fdin[3:0]),
806.si({scan_in,so[2:0]}),
807.so({so[2:0],scan_out}),
808.q(dout[3:0])
809);
810
811
812
813
814
815
816
817
818
819
820
821
822endmodule
823
824
825
826
827
828
829
830
831
832
833
834
835
836// any PARAMS parms go into naming of macro
837
838module ncu_i2cbuf32_ni_ctl_msff_ctl_macro__en_1__width_128 (
839 din,
840 en,
841 l1clk,
842 scan_in,
843 siclk,
844 soclk,
845 dout,
846 scan_out);
847wire [127:0] fdin;
848wire [126:0] so;
849
850 input [127:0] din;
851 input en;
852 input l1clk;
853 input scan_in;
854
855
856 input siclk;
857 input soclk;
858
859 output [127:0] dout;
860 output scan_out;
861assign fdin[127:0] = (din[127:0] & {128{en}}) | (dout[127:0] & ~{128{en}});
862
863
864
865
866
867
868dff #(128) d0_0 (
869.l1clk(l1clk),
870.siclk(siclk),
871.soclk(soclk),
872.d(fdin[127:0]),
873.si({scan_in,so[126:0]}),
874.so({so[126:0],scan_out}),
875.q(dout[127:0])
876);
877
878
879
880
881
882
883
884
885
886
887
888
889endmodule
890
891
892
893
894
895
896
897
898
899
900
901
902
903// any PARAMS parms go into naming of macro
904
905module ncu_i2cbuf32_ni_ctl_l1clkhdr_ctl_macro (
906 l2clk,
907 l1en,
908 pce_ov,
909 stop,
910 se,
911 l1clk);
912
913
914 input l2clk;
915 input l1en;
916 input pce_ov;
917 input stop;
918 input se;
919 output l1clk;
920
921
922
923
924
925cl_sc1_l1hdr_8x c_0 (
926
927
928 .l2clk(l2clk),
929 .pce(l1en),
930 .l1clk(l1clk),
931 .se(se),
932 .pce_ov(pce_ov),
933 .stop(stop)
934);
935
936
937
938endmodule
939
940
941
942
943
944
945
946