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