Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / libs / n2sram / compiler / physical / n2_com_dp_64x72_cust_l / n2_com_dp_64x72_cust / rtl / n2_com_dp_64x72_cust.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: n2_com_dp_64x72_cust.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 OUTFLOP_n2_com_dp_64x72_cust TRUE
36
37
38
39// define module name here
40// ********* DON'T TOUCH NEXT LINE *********
41module n2_com_dp_64x72_cust (
42 wr_adr,
43 wr_en,
44 rd_adr,
45 rd_en,
46 din,
47 dout,
48 rdclk,
49 wrclk,
50 scan_in,
51 tcu_pce_ov,
52 tcu_aclk,
53 tcu_bclk,
54 tcu_array_wr_inhibit,
55 tcu_se_scancollar_in,
56 tcu_se_scancollar_out,
57 bist_clk_mux_sel,
58 rd_pce,
59 wr_pce,
60 scan_out);
61wire rd_lce;
62wire wr_lce;
63wire rdclk_in;
64wire wrclk_in;
65wire rdclk_free;
66wire wrclk_free;
67wire rdclk_out;
68wire dff_wr_addr_scanin;
69wire dff_wr_addr_scanout;
70wire [5:0] wr_adr_d1;
71wire [5:1] dff_rd_addr_scan;
72wire dff_rd_addr_scanin;
73wire dff_rd_addr_scanout;
74wire [5:0] rd_adr_d1;
75wire [5:0] rd_adr_mq_l_unused;
76wire [5:0] rd_adr_q_unused;
77wire [5:0] rd_adr_q_l_unused;
78wire dff_rd_en_scanin;
79wire dff_rd_en_scanout;
80wire rd_en_d1;
81wire rd_en_mq_l_unused;
82wire rd_en_q_unused;
83wire rd_en_q_l_unused;
84wire dff_wr_en_scanin;
85wire dff_wr_en_scanout;
86wire wr_en_d1;
87wire [35:1] dff_din_hi_scan;
88wire dff_din_hi_scanin;
89wire dff_din_hi_scanout;
90wire [71:0] din_d1;
91wire [35:1] dff_din_lo_scan;
92wire dff_din_lo_scanin;
93wire dff_din_lo_scanout;
94wire wr_inh_;
95wire rd_en_d1_qual;
96wire wr_en_d1_qual;
97wire [71:0] local_dout;
98wire dff_dout_scanin;
99wire dff_dout_scanout;
100
101input [5:0] wr_adr;
102input wr_en;
103input [5:0] rd_adr;
104input rd_en;
105input [71:0] din;
106output [71:0] dout;
107input rdclk;
108input wrclk;
109input scan_in;
110input tcu_pce_ov;
111input tcu_aclk;
112input tcu_bclk;
113input tcu_array_wr_inhibit;
114input tcu_se_scancollar_in;
115
116input tcu_se_scancollar_out;
117
118input bist_clk_mux_sel;
119input rd_pce;
120input wr_pce;
121output scan_out;
122
123// synopsys translate_off
124
125wire pce_ov = tcu_pce_ov;
126wire siclk = tcu_aclk;
127wire soclk = tcu_bclk;
128//================================================
129// Clock headers
130//================================================
131cl_mc1_bistlatch_4x rd_pce_lat (
132 .l2clk (rdclk),
133 .pce (rd_pce),
134 .pce_ov (pce_ov),
135 .lce (rd_lce)
136);
137cl_mc1_bistlatch_4x wr_pce_lat (
138 .l2clk (wrclk),
139 .pce (wr_pce),
140 .pce_ov (pce_ov),
141 .lce (wr_lce)
142);
143cl_mc1_bistl1hdr_8x rch_in (
144 .l2clk (rdclk),
145 .se (tcu_se_scancollar_in),
146 .clksel (bist_clk_mux_sel),
147 .bistclk(rdclk),
148 .lce (rd_lce),
149 .l1clk (rdclk_in)
150);
151cl_mc1_bistl1hdr_8x wch_in (
152 .l2clk (wrclk),
153 .se (tcu_se_scancollar_in),
154 .clksel (bist_clk_mux_sel),
155 .bistclk(rdclk),
156 .lce (wr_lce),
157 .l1clk (wrclk_in)
158);
159cl_mc1_bistl1hdr_8x rch_free (
160 .l2clk (rdclk),
161 .se (1'b0),
162 .clksel (bist_clk_mux_sel),
163 .bistclk(rdclk),
164 .lce (rd_lce),
165 .l1clk (rdclk_free)
166);
167cl_mc1_bistl1hdr_8x wch_free (
168 .l2clk (wrclk),
169 .se (1'b0),
170 .clksel (bist_clk_mux_sel),
171 .bistclk(rdclk),
172 .lce (wr_lce),
173 .l1clk (wrclk_free)
174);
175
176cl_mc1_bistl1hdr_8x rch_out (
177 .l2clk (rdclk),
178 .se (tcu_se_scancollar_out),
179 .clksel (bist_clk_mux_sel),
180 .bistclk(rdclk),
181 .lce (rd_lce),
182 .l1clk (rdclk_out)
183);
184
185///////////////////////////////////////////////////////////////
186// Flop the inputs //
187///////////////////////////////////////////////////////////////
188n2_com_dp_64x72_cust_msff_ctl_macro__width_6 dff_wr_addr (
189 .scan_in (dff_wr_addr_scanin),
190 .scan_out (dff_wr_addr_scanout),
191 .l1clk (wrclk_in),
192 .din (wr_adr[5:0]),
193 .dout (wr_adr_d1[5:0]),
194 .siclk(siclk),
195 .soclk(soclk)
196);
197n2_com_dp_64x72_cust_sram_msff_mo_macro__fs_1__width_6 dff_rd_addr (
198 .scan_in ({dff_rd_addr_scan[5:1],dff_rd_addr_scanin}),
199 .scan_out ({dff_rd_addr_scanout,dff_rd_addr_scan[5:1]}),
200 .l1clk (rdclk_in),
201 .and_clk (rdclk_in),
202 .d (rd_adr[5:0]),
203 .mq (rd_adr_d1[5:0]),
204 .mq_l (rd_adr_mq_l_unused[5:0]),
205 .q (rd_adr_q_unused[5:0]),
206 .q_l (rd_adr_q_l_unused[5:0]),
207 .siclk(siclk),
208 .soclk(soclk)
209);
210n2_com_dp_64x72_cust_sram_msff_mo_macro__width_1 dff_rd_en (
211 .scan_in (dff_rd_en_scanin),
212 .scan_out (dff_rd_en_scanout),
213 .l1clk (rdclk_in),
214 .and_clk (rdclk_in),
215 .d (rd_en),
216 .mq (rd_en_d1),
217 .mq_l (rd_en_mq_l_unused),
218 .q (rd_en_q_unused),
219 .q_l (rd_en_q_l_unused),
220 .siclk(siclk),
221 .soclk(soclk)
222);
223n2_com_dp_64x72_cust_msff_ctl_macro__width_1 dff_wr_en (
224 .scan_in (dff_wr_en_scanin),
225 .scan_out (dff_wr_en_scanout),
226 .l1clk (wrclk_in),
227 .din (wr_en),
228 .dout (wr_en_d1),
229 .siclk(siclk),
230 .soclk(soclk)
231);
232n2_com_dp_64x72_cust_msff_ctl_macro__fs_1__width_36 dff_din_hi (
233 .scan_in ({dff_din_hi_scan[35:1],dff_din_hi_scanin}),
234 .scan_out ({dff_din_hi_scanout,dff_din_hi_scan[35:1]}),
235 .l1clk (wrclk_in),
236 .din (din[71:36]),
237 .dout (din_d1[71:36]),
238 .siclk(siclk),
239 .soclk(soclk)
240);
241n2_com_dp_64x72_cust_msff_ctl_macro__fs_1__width_36 dff_din_lo (
242 .scan_in ({dff_din_lo_scan[35:1],dff_din_lo_scanin}),
243 .scan_out ({dff_din_lo_scanout,dff_din_lo_scan[35:1]}),
244 .l1clk (wrclk_in),
245 .din (din[35:0]),
246 .dout (din_d1[35:0]),
247 .siclk(siclk),
248 .soclk(soclk)
249);
250n2_com_dp_64x72_cust_inv_macro__width_1 wr_inh_inv (
251 .din (tcu_array_wr_inhibit),
252 .dout (wr_inh_)
253);
254n2_com_dp_64x72_cust_and_macro__width_2 enable_qual (
255 .din0 ({2{wr_inh_}}),
256 .din1 ({rd_en_d1,wr_en_d1}),
257 .dout ({rd_en_d1_qual,wr_en_d1_qual})
258);
259n2_com_dp_64x72_cust_n2_com_array_macro__rows_64__width_72__z_array array (
260 .rclk (rdclk_free),
261 .wclk (wrclk_free),
262 .wr_adr (wr_adr_d1[5:0]),
263 .wr_en (wr_en_d1_qual),
264 .rd_adr (rd_adr_d1[5:0]),
265 .rd_en (rd_en_d1_qual),
266 .din (din_d1[71:0]),
267 .dout (local_dout[71:0])
268);
269
270n2_com_dp_64x72_cust_msff_ctl_macro__width_72 dff_dout (
271 .scan_in (dff_dout_scanin),
272 .scan_out (dff_dout_scanout),
273 .l1clk (rdclk_out),
274 .din (local_dout[71:0]),
275 .dout (dout[71:0]),
276 .siclk(siclk),
277 .soclk(soclk)
278);
279
280
281supply0 vss;
282supply1 vdd;
283
284// fixscan start:
285assign dff_wr_addr_scanin = scan_in ;
286assign dff_rd_addr_scanin = dff_wr_addr_scanout ;
287assign dff_wr_en_scanin = dff_rd_addr_scanout ;
288assign dff_rd_en_scanin = dff_wr_en_scanout ;
289assign dff_din_lo_scanin = dff_rd_en_scanout ;
290assign dff_din_hi_scanin = dff_din_lo_scanout ;
291assign dff_dout_scanin = dff_din_hi_scanout ;
292assign scan_out = dff_dout_scanout ;
293// fixscan end:
294
295// synopsys translate_on
296
297endmodule
298
299
300
301
302
303
304
305// any PARAMS parms go into naming of macro
306
307module n2_com_dp_64x72_cust_msff_ctl_macro__width_6 (
308 din,
309 l1clk,
310 scan_in,
311 siclk,
312 soclk,
313 dout,
314 scan_out);
315wire [5:0] fdin;
316wire [4:0] so;
317
318 input [5:0] din;
319 input l1clk;
320 input scan_in;
321
322
323 input siclk;
324 input soclk;
325
326 output [5:0] dout;
327 output scan_out;
328assign fdin[5:0] = din[5:0];
329
330
331
332
333
334
335dff #(6) d0_0 (
336.l1clk(l1clk),
337.siclk(siclk),
338.soclk(soclk),
339.d(fdin[5:0]),
340.si({scan_in,so[4:0]}),
341.so({so[4:0],scan_out}),
342.q(dout[5:0])
343);
344
345
346
347
348
349
350
351
352
353
354
355
356endmodule
357
358
359
360
361
362
363
364
365
366//
367// macro for cl_mc1_sram_msff_mo_{16,8,4}x flops
368//
369//
370
371
372
373
374
375module n2_com_dp_64x72_cust_sram_msff_mo_macro__fs_1__width_6 (
376 d,
377 scan_in,
378 l1clk,
379 and_clk,
380 siclk,
381 soclk,
382 mq,
383 mq_l,
384 scan_out,
385 q,
386 q_l);
387input [5:0] d;
388 input [5:0] scan_in;
389input l1clk;
390input and_clk;
391input siclk;
392input soclk;
393output [5:0] mq;
394output [5:0] mq_l;
395 output [5:0] scan_out;
396output [5:0] q;
397output [5:0] q_l;
398
399
400
401
402
403
404new_dlata #(6) d0_0 (
405.d(d[5:0]),
406.si(scan_in[5:0]),
407.so(scan_out[5:0]),
408.l1clk(l1clk),
409.and_clk(and_clk),
410.siclk(siclk),
411.soclk(soclk),
412.q(q[5:0]),
413.q_l(q_l[5:0]),
414.mq(mq[5:0]),
415.mq_l(mq_l[5:0])
416);
417
418
419
420
421
422
423
424
425
426
427//place::generic_place($width,$stack,$left);
428
429endmodule
430
431
432
433
434
435//
436// macro for cl_mc1_sram_msff_mo_{16,8,4}x flops
437//
438//
439
440
441
442
443
444module n2_com_dp_64x72_cust_sram_msff_mo_macro__width_1 (
445 d,
446 scan_in,
447 l1clk,
448 and_clk,
449 siclk,
450 soclk,
451 mq,
452 mq_l,
453 scan_out,
454 q,
455 q_l);
456input [0:0] d;
457 input scan_in;
458input l1clk;
459input and_clk;
460input siclk;
461input soclk;
462output [0:0] mq;
463output [0:0] mq_l;
464 output scan_out;
465output [0:0] q;
466output [0:0] q_l;
467
468
469
470
471
472
473new_dlata #(1) d0_0 (
474.d(d[0:0]),
475.si(scan_in),
476.so(scan_out),
477.l1clk(l1clk),
478.and_clk(and_clk),
479.siclk(siclk),
480.soclk(soclk),
481.q(q[0:0]),
482.q_l(q_l[0:0]),
483.mq(mq[0:0]),
484.mq_l(mq_l[0:0])
485);
486
487
488
489
490
491
492
493
494
495
496//place::generic_place($width,$stack,$left);
497
498endmodule
499
500
501
502
503
504
505
506
507
508// any PARAMS parms go into naming of macro
509
510module n2_com_dp_64x72_cust_msff_ctl_macro__width_1 (
511 din,
512 l1clk,
513 scan_in,
514 siclk,
515 soclk,
516 dout,
517 scan_out);
518wire [0:0] fdin;
519
520 input [0:0] din;
521 input l1clk;
522 input scan_in;
523
524
525 input siclk;
526 input soclk;
527
528 output [0:0] dout;
529 output scan_out;
530assign fdin[0:0] = din[0:0];
531
532
533
534
535
536
537dff #(1) d0_0 (
538.l1clk(l1clk),
539.siclk(siclk),
540.soclk(soclk),
541.d(fdin[0:0]),
542.si(scan_in),
543.so(scan_out),
544.q(dout[0:0])
545);
546
547
548
549
550
551
552
553
554
555
556
557
558endmodule
559
560
561
562
563
564
565
566
567
568
569
570
571
572// any PARAMS parms go into naming of macro
573
574module n2_com_dp_64x72_cust_msff_ctl_macro__fs_1__width_36 (
575 din,
576 l1clk,
577 scan_in,
578 siclk,
579 soclk,
580 dout,
581 scan_out);
582wire [35:0] fdin;
583
584 input [35:0] din;
585 input l1clk;
586 input [35:0] scan_in;
587
588
589 input siclk;
590 input soclk;
591
592 output [35:0] dout;
593 output [35:0] scan_out;
594assign fdin[35:0] = din[35:0];
595
596
597
598
599
600
601dff #(36) d0_0 (
602.l1clk(l1clk),
603.siclk(siclk),
604.soclk(soclk),
605.d(fdin[35:0]),
606.si(scan_in[35:0]),
607.so(scan_out[35:0]),
608.q(dout[35:0])
609);
610
611
612
613
614
615
616
617
618
619
620
621
622endmodule
623
624
625
626
627
628
629
630
631
632//
633// invert macro
634//
635//
636
637
638
639
640
641module n2_com_dp_64x72_cust_inv_macro__width_1 (
642 din,
643 dout);
644 input [0:0] din;
645 output [0:0] dout;
646
647
648
649
650
651
652inv #(1) d0_0 (
653.in(din[0:0]),
654.out(dout[0:0])
655);
656
657
658
659
660
661
662
663
664
665endmodule
666
667
668
669
670
671//
672// and macro for ports = 2,3,4
673//
674//
675
676
677
678
679
680module n2_com_dp_64x72_cust_and_macro__width_2 (
681 din0,
682 din1,
683 dout);
684 input [1:0] din0;
685 input [1:0] din1;
686 output [1:0] dout;
687
688
689
690
691
692
693and2 #(2) d0_0 (
694.in0(din0[1:0]),
695.in1(din1[1:0]),
696.out(dout[1:0])
697);
698
699
700
701
702
703
704
705
706
707endmodule
708
709
710
711
712
713
714
715
716
717
718module n2_com_dp_64x72_cust_n2_com_array_macro__rows_64__width_72__z_array (
719 rclk,
720 wclk,
721 rd_adr,
722 rd_en,
723 wr_en,
724 wr_adr,
725 din,
726 dout);
727
728input rclk;
729input wclk;
730input [5:0] rd_adr;
731input rd_en;
732input wr_en;
733input [5:0] wr_adr;
734input [72-1:0] din;
735output [72-1:0] dout;
736
737
738
739reg [72-1:0] mem[64-1:0];
740reg [72-1:0] local_dout;
741
742`ifndef NOINITMEM
743// Emulate reset
744integer i;
745initial begin
746 for (i=0; i<64; i=i+1) begin
747 mem[i] = 72'b0;
748 end
749 local_dout = 72'b0;
750end
751`endif
752//////////////////////
753// Read/write array
754//////////////////////
755always @(negedge wclk) begin
756 if (wr_en) begin
757 mem[wr_adr] <= din;
758
759
760 end
761end
762always @(rclk or rd_en or wr_en or rd_adr or wr_adr) begin
763 if (rclk) begin
764 if (rd_en) begin
765 if (wr_en & (wr_adr[5:0] == rd_adr[5:0]))
766 local_dout[72-1:0] <= 72'hx;
767 else
768 local_dout[72-1:0] <= mem[rd_adr] ;
769 end
770 else
771 local_dout[72-1:0] <= ~(72'h0);
772 end
773end
774assign dout[72-1:0] = local_dout[72-1:0];
775supply0 vss;
776supply1 vdd;
777
778
779
780
781endmodule
782
783
784
785
786
787
788// any PARAMS parms go into naming of macro
789
790module n2_com_dp_64x72_cust_msff_ctl_macro__width_72 (
791 din,
792 l1clk,
793 scan_in,
794 siclk,
795 soclk,
796 dout,
797 scan_out);
798wire [71:0] fdin;
799wire [70:0] so;
800
801 input [71:0] din;
802 input l1clk;
803 input scan_in;
804
805
806 input siclk;
807 input soclk;
808
809 output [71:0] dout;
810 output scan_out;
811assign fdin[71:0] = din[71:0];
812
813
814
815
816
817
818dff #(72) d0_0 (
819.l1clk(l1clk),
820.siclk(siclk),
821.soclk(soclk),
822.d(fdin[71:0]),
823.si({scan_in,so[70:0]}),
824.so({so[70:0],scan_out}),
825.q(dout[71:0])
826);
827
828
829
830
831
832
833
834
835
836
837
838
839endmodule
840
841
842
843
844
845
846
847