Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / libs / n2sram / mp / n2_mam_mp_160x66_cust_l / n2_mam_mp_160x66_cust / rtl / n2_mam_mp_160x66_cust.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: n2_mam_mp_160x66_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
36////////////////////////////////////////////////////////////////////////////////
37// $Id: n2_mam_mp_160x66_cust.v,v 1.1.1.1 2007/02/13 22:19:31 drp Exp $
38//
39// Copyright (C) 2003 by Sun Microsystems, Inc.
40//
41// All rights reserved. No part of this design may be reproduced,
42// stored in a retrieval system, or transmitted, in any form or by
43// any means, electronic, mechanical, photocopying, recording, or
44// otherwise, without prior written permission of Sun Microsystems,
45// Inc.
46//
47// Sun Proprietary/Confidential
48//
49// Description: SPU MA MEM
50// - 160 entry
51// - 64-bit data + 2-bit parity = 66-bit total
52// - 2 Read + 1 Write ports
53//
54// Primary Contact: christopher.olson@sun.com
55////////////////////////////////////////////////////////////////////////////////
56
57
58module n2_mam_mp_160x66_cust (
59 l2clk,
60 scan_in,
61 pce,
62 tcu_pce_ov,
63 tcu_aclk,
64 tcu_bclk,
65 tcu_array_wr_inhibit,
66 tcu_se_scancollar_in,
67 tcu_scan_en,
68 rd0_enable,
69 rd0_enable_ff_clken,
70 r0_addr,
71 r0_byp,
72 rd1_enable,
73 rd1_enable_ff_clken,
74 r1_addr,
75 r1_byp,
76 w_addr,
77 wr_enable,
78 wr_data,
79 scan_out,
80 rd0_data,
81 rd1_data);
82wire siclk;
83wire soclk;
84wire l1clk_wr_data_e;
85wire [65:0] i_wr_data_ff_scanin;
86wire [65:0] i_wr_data_ff_scanout;
87wire [65:0] wr_data_ff;
88wire l1clk_rd_data_e;
89wire [7:0] r0_addr_ff;
90wire [7:0] r0_mux;
91wire [7:0] i_r0_addr_ff_scanin;
92wire [7:0] i_r0_addr_ff_scanout;
93wire l1clk_out;
94wire [7:0] r0_addr_lat;
95wire [7:0] r0_lat_l_unused;
96wire [7:0] r0_dout_l_unused;
97wire [7:0] r1_addr_ff;
98wire [7:0] r1_mux;
99wire [7:0] i_r1_addr_ff_scanin;
100wire [7:0] i_r1_addr_ff_scanout;
101wire [7:0] r1_addr_lat;
102wire [7:0] r1_lat_l_unused;
103wire [7:0] r1_dout_l_unused;
104wire [7:0] i_w_addr_ff_scanin;
105wire [7:0] i_w_addr_ff_scanout;
106wire [7:0] w_addr_ff;
107wire rd0_enable_ff;
108wire rd0_enable_ff_mux;
109wire [0:0] i_rd0_enable_ff_scanin;
110wire [0:0] i_rd0_enable_ff_scanout;
111wire rd0_enable_lat;
112wire rd0_enable_ff_unused;
113wire rd0_enable_dout_l_unused;
114wire rd1_enable_ff;
115wire rd1_enable_ff_mux;
116wire [0:0] i_rd1_enable_ff_scanin;
117wire [0:0] i_rd1_enable_ff_scanout;
118wire rd1_enable_lat;
119wire rd1_enable_ff_unused;
120wire rd1_enable_dout_l_unused;
121wire [0:0] i_wr_enable_ff_scanin;
122wire [0:0] i_wr_enable_ff_scanout;
123wire wr_enable_ff;
124
125
126input l2clk;
127input scan_in;
128input pce;
129input tcu_pce_ov;
130input tcu_aclk;
131input tcu_bclk;
132input tcu_array_wr_inhibit;
133input tcu_se_scancollar_in;
134input tcu_scan_en;
135
136input rd0_enable;
137input rd0_enable_ff_clken;
138input [7:0] r0_addr;
139input r0_byp;
140input rd1_enable;
141input rd1_enable_ff_clken;
142input [7:0] r1_addr;
143input r1_byp;
144input [7:0] w_addr;
145input wr_enable;
146input [65:0] wr_data;
147
148output scan_out;
149output [65:0] rd0_data;
150output [65:0] rd1_data;
151
152
153// scan renames
154assign siclk = tcu_aclk;
155assign soclk = tcu_bclk;
156// end scan
157
158n2_mam_mp_160x66_cust_l1clkhdr_ctl_macro wr_en_clkgen (
159 .l2clk (l2clk ),
160 .l1en (wr_enable ),
161 .pce_ov (tcu_pce_ov ),
162 .stop (1'b0 ),
163 .se (tcu_se_scancollar_in ),
164 .l1clk (l1clk_wr_data_e )
165);
166
167n2_mam_mp_160x66_cust_msff_ctl_macro__fs_1__scanreverse_1__width_66 i_wr_data_ff (
168 .scan_in(i_wr_data_ff_scanin[65:0]),
169 .scan_out(i_wr_data_ff_scanout[65:0]),
170 .l1clk ( l1clk_wr_data_e ),
171 .din ( wr_data[65:0] ),
172 .dout ( wr_data_ff[65:0] ),
173 .siclk(siclk),
174 .soclk(soclk));
175
176// Change clk enables for read port addr/enables to be mux holds per Tai's request
177n2_mam_mp_160x66_cust_l1clkhdr_ctl_macro rd_en_clkgen (
178 .l2clk (l2clk ),
179 .l1en (pce ),
180 .pce_ov (tcu_pce_ov ),
181 .stop (1'b0 ),
182 .se (tcu_se_scancollar_in ),
183 .l1clk (l1clk_rd_data_e )
184);
185
186n2_mam_mp_160x66_cust_mux_macro__mux_aope__ports_2__width_8 i_r0_mux (
187 .din0 (r0_addr[7:0] ),
188 .din1 (r0_addr_ff[7:0] ),
189 .sel0 (rd0_enable_ff_clken ),
190 .dout (r0_mux[7:0] ));
191
192n2_mam_mp_160x66_cust_sram_msff_mo_macro__fs_1__width_8 i_r0_addr_ff (
193 .scan_in(i_r0_addr_ff_scanin[7:0]),
194 .scan_out(i_r0_addr_ff_scanout[7:0]),
195 .l1clk (l1clk_rd_data_e ),
196 .and_clk (l1clk_out ),
197 .siclk(siclk ),
198 .soclk(soclk ),
199 .d ( r0_mux[7:0] ),
200 .mq (r0_addr_lat[7:0] ),
201 .mq_l(r0_lat_l_unused[7:0] ),
202 .q_l(r0_dout_l_unused[7:0] ),
203 .q ( r0_addr_ff[7:0] ));
204
205//msff_ctl_macro i_r0_addr_ff (fs=1,width=8) (
206// .scan_in(i_r0_addr_ff_scanin[7:0]),
207// .scan_out(i_r0_addr_ff_scanout[7:0]),
208// .l1clk (l1clk_rd_data_e ),
209// .din ( r0_mux[7:0] ),
210// .dout ( r0_addr_ff[7:0] ));
211
212n2_mam_mp_160x66_cust_mux_macro__mux_aope__ports_2__width_8 i_r1_mux (
213 .din0 (r1_addr[7:0] ),
214 .din1 (r1_addr_ff[7:0] ),
215 .sel0 (rd1_enable_ff_clken ),
216 .dout (r1_mux[7:0] ));
217
218//msff_ctl_macro i_r1_addr_ff (fs=1,width=8) (
219// .scan_in(i_r1_addr_ff_scanin[7:0]),
220// .scan_out(i_r1_addr_ff_scanout[7:0]),
221// .l1clk ( l1clk_rd_data_e ),
222// .din ( r1_mux[7:0] ),
223// .dout ( r1_addr_ff[7:0] ));
224
225n2_mam_mp_160x66_cust_sram_msff_mo_macro__fs_1__width_8 i_r1_addr_ff (
226 .scan_in(i_r1_addr_ff_scanin[7:0]),
227 .scan_out(i_r1_addr_ff_scanout[7:0]),
228 .l1clk (l1clk_rd_data_e ),
229 .and_clk (l1clk_out ),
230 .siclk(siclk ),
231 .soclk(soclk ),
232 .d ( r1_mux[7:0] ),
233 .mq (r1_addr_lat[7:0] ),
234 .mq_l(r1_lat_l_unused[7:0] ),
235 .q_l(r1_dout_l_unused[7:0] ),
236 .q ( r1_addr_ff[7:0] ));
237
238n2_mam_mp_160x66_cust_msff_ctl_macro__fs_1__width_8 i_w_addr_ff (
239 .scan_in(i_w_addr_ff_scanin[7:0]),
240 .scan_out(i_w_addr_ff_scanout[7:0]),
241 .l1clk (l1clk_wr_data_e ),
242 .din ( w_addr[7:0] ),
243 .dout ( w_addr_ff[7:0] ),
244 .siclk(siclk),
245 .soclk(soclk));
246
247n2_mam_mp_160x66_cust_mux_macro__mux_aope__ports_2__width_1 i_r0_enable_mux (
248 .din0 (rd0_enable ),
249 .din1 (rd0_enable_ff ),
250 .sel0 (rd0_enable_ff_clken ),
251 .dout (rd0_enable_ff_mux ));
252
253//msff_ctl_macro i_rd0_enable_ff (fs=1,width=1) (
254// .scan_in(i_rd0_enable_ff_scanin[0:0]),
255// .scan_out(i_rd0_enable_ff_scanout[0:0]),
256// .l1clk (l1clk_rd_data_e ),
257// .din ( rd0_enable_ff_mux ),
258// .dout ( rd0_enable_ff ));
259
260n2_mam_mp_160x66_cust_sram_msff_mo_macro__fs_1__width_1 i_rd0_enable_ff (
261 .scan_in(i_rd0_enable_ff_scanin[0:0]),
262 .scan_out(i_rd0_enable_ff_scanout[0:0]),
263 .l1clk (l1clk_rd_data_e ),
264 .and_clk (l1clk_out ),
265 .siclk(siclk),
266 .soclk(soclk),
267 .d ( rd0_enable_ff_mux ),
268 .mq( rd0_enable_lat ),
269 .mq_l(rd0_enable_ff_unused ),
270 .q_l(rd0_enable_dout_l_unused ),
271 .q ( rd0_enable_ff ));
272
273n2_mam_mp_160x66_cust_mux_macro__mux_aope__ports_2__width_1 i_r1_enable_mux (
274 .din0 (rd1_enable ),
275 .din1 (rd1_enable_ff ),
276 .sel0 (rd1_enable_ff_clken ),
277 .dout (rd1_enable_ff_mux ));
278
279//msff_ctl_macro i_rd1_enable_ff (fs=1,width=1) (
280// .scan_in(i_rd1_enable_ff_scanin[0:0]),
281// .scan_out(i_rd1_enable_ff_scanout[0:0]),
282// .l1clk (l1clk_rd_data_e ),
283// .din ( rd1_enable_ff_mux ),
284// .dout ( rd1_enable_ff ));
285
286n2_mam_mp_160x66_cust_sram_msff_mo_macro__fs_1__width_1 i_rd1_enable_ff (
287 .scan_in(i_rd1_enable_ff_scanin[0:0] ),
288 .scan_out(i_rd1_enable_ff_scanout[0:0] ),
289 .l1clk (l1clk_rd_data_e ),
290 .and_clk (l1clk_out ),
291 .siclk(siclk ),
292 .soclk(soclk ),
293 .d ( rd1_enable_ff_mux ),
294 .mq( rd1_enable_lat ),
295 .mq_l(rd1_enable_ff_unused ),
296 .q_l(rd1_enable_dout_l_unused ),
297 .q ( rd1_enable_ff ));
298
299n2_mam_mp_160x66_cust_msff_ctl_macro__fs_1__width_1 i_wr_enable_ff (
300 .scan_in(i_wr_enable_ff_scanin[0:0]),
301 .scan_out(i_wr_enable_ff_scanout[0:0]),
302 .l1clk (l1clk_rd_data_e ),
303 .din ( wr_enable ),
304 .dout ( wr_enable_ff ),
305 .siclk(siclk),
306 .soclk(soclk));
307
308// L2 clock "free-running" clock
309n2_mam_mp_160x66_cust_l1clkhdr_ctl_macro l2_clkgen (
310 .l2clk (l2clk ),
311 .l1en (pce ),
312 .pce_ov (tcu_pce_ov ),
313 .stop (1'b0 ),
314 .se (tcu_scan_en ),
315 .l1clk (l1clk_out )
316);
317
318// 0in custom -fire (rd0_enable_ff & ~tcu_array_wr_inhibit & wr_enable_ff & (w_addr_ff == r0_addr_ff) & ~r0_byp) -message "Attempt to read and write port0 of MAMEM w/o bypass" -group core_array
319// 0in custom -fire (rd1_enable_ff & ~tcu_array_wr_inhibit & wr_enable_ff & (w_addr_ff == r1_addr_ff) & ~r1_byp) -message "Attempt to read and write port1 of MAMEM w/o bypass" -group core_array
320
321lib_160x66b_2r_1w_array mamem_array (
322 .clk ( l1clk_out ),
323 .rd0_en ( rd0_enable_lat ),
324 .r0_addr ( r0_addr_lat[7:0] ),
325 .rd1_en ( rd1_enable_lat ),
326 .r1_addr ( r1_addr_lat[7:0] ),
327 .w_addr ( w_addr_ff[7:0] ),
328 .wr_en ( wr_enable_ff ),
329 .tcu_array_wr_inhibit (tcu_array_wr_inhibit ),
330 .din ( wr_data_ff[65:0] ),
331 .r0_byp ( r0_byp ),
332 .r1_byp ( r1_byp ),
333 .dout0 ( rd0_data[65:0] ),
334 .dout1 ( rd1_data[65:0] ));
335
336supply0 vss;
337supply1 vdd;
338
339
340// scanorder start
341// i_wr_data_ff_scanin[0:65]
342// i_r0_addr_ff_scanin[7:0]
343// i_rd0_enable_ff_scanin[0]
344// i_r1_addr_ff_scanin[7:0]
345// i_rd1_enable_ff_scanin[0]
346// i_w_addr_ff_scanin[7:0]
347// i_wr_enable_ff_scanin[0]
348// scanorder end
349// fixscan start
350assign i_wr_data_ff_scanin[0]=scan_in;
351assign i_wr_data_ff_scanin[1]=i_wr_data_ff_scanout[0];
352assign i_wr_data_ff_scanin[2]=i_wr_data_ff_scanout[1];
353assign i_wr_data_ff_scanin[3]=i_wr_data_ff_scanout[2];
354assign i_wr_data_ff_scanin[4]=i_wr_data_ff_scanout[3];
355assign i_wr_data_ff_scanin[5]=i_wr_data_ff_scanout[4];
356assign i_wr_data_ff_scanin[6]=i_wr_data_ff_scanout[5];
357assign i_wr_data_ff_scanin[7]=i_wr_data_ff_scanout[6];
358assign i_wr_data_ff_scanin[8]=i_wr_data_ff_scanout[7];
359assign i_wr_data_ff_scanin[9]=i_wr_data_ff_scanout[8];
360assign i_wr_data_ff_scanin[10]=i_wr_data_ff_scanout[9];
361assign i_wr_data_ff_scanin[11]=i_wr_data_ff_scanout[10];
362assign i_wr_data_ff_scanin[12]=i_wr_data_ff_scanout[11];
363assign i_wr_data_ff_scanin[13]=i_wr_data_ff_scanout[12];
364assign i_wr_data_ff_scanin[14]=i_wr_data_ff_scanout[13];
365assign i_wr_data_ff_scanin[15]=i_wr_data_ff_scanout[14];
366assign i_wr_data_ff_scanin[16]=i_wr_data_ff_scanout[15];
367assign i_wr_data_ff_scanin[17]=i_wr_data_ff_scanout[16];
368assign i_wr_data_ff_scanin[18]=i_wr_data_ff_scanout[17];
369assign i_wr_data_ff_scanin[19]=i_wr_data_ff_scanout[18];
370assign i_wr_data_ff_scanin[20]=i_wr_data_ff_scanout[19];
371assign i_wr_data_ff_scanin[21]=i_wr_data_ff_scanout[20];
372assign i_wr_data_ff_scanin[22]=i_wr_data_ff_scanout[21];
373assign i_wr_data_ff_scanin[23]=i_wr_data_ff_scanout[22];
374assign i_wr_data_ff_scanin[24]=i_wr_data_ff_scanout[23];
375assign i_wr_data_ff_scanin[25]=i_wr_data_ff_scanout[24];
376assign i_wr_data_ff_scanin[26]=i_wr_data_ff_scanout[25];
377assign i_wr_data_ff_scanin[27]=i_wr_data_ff_scanout[26];
378assign i_wr_data_ff_scanin[28]=i_wr_data_ff_scanout[27];
379assign i_wr_data_ff_scanin[29]=i_wr_data_ff_scanout[28];
380assign i_wr_data_ff_scanin[30]=i_wr_data_ff_scanout[29];
381assign i_wr_data_ff_scanin[31]=i_wr_data_ff_scanout[30];
382assign i_wr_data_ff_scanin[32]=i_wr_data_ff_scanout[31];
383assign i_wr_data_ff_scanin[33]=i_wr_data_ff_scanout[32];
384assign i_wr_data_ff_scanin[34]=i_wr_data_ff_scanout[33];
385assign i_wr_data_ff_scanin[35]=i_wr_data_ff_scanout[34];
386assign i_wr_data_ff_scanin[36]=i_wr_data_ff_scanout[35];
387assign i_wr_data_ff_scanin[37]=i_wr_data_ff_scanout[36];
388assign i_wr_data_ff_scanin[38]=i_wr_data_ff_scanout[37];
389assign i_wr_data_ff_scanin[39]=i_wr_data_ff_scanout[38];
390assign i_wr_data_ff_scanin[40]=i_wr_data_ff_scanout[39];
391assign i_wr_data_ff_scanin[41]=i_wr_data_ff_scanout[40];
392assign i_wr_data_ff_scanin[42]=i_wr_data_ff_scanout[41];
393assign i_wr_data_ff_scanin[43]=i_wr_data_ff_scanout[42];
394assign i_wr_data_ff_scanin[44]=i_wr_data_ff_scanout[43];
395assign i_wr_data_ff_scanin[45]=i_wr_data_ff_scanout[44];
396assign i_wr_data_ff_scanin[46]=i_wr_data_ff_scanout[45];
397assign i_wr_data_ff_scanin[47]=i_wr_data_ff_scanout[46];
398assign i_wr_data_ff_scanin[48]=i_wr_data_ff_scanout[47];
399assign i_wr_data_ff_scanin[49]=i_wr_data_ff_scanout[48];
400assign i_wr_data_ff_scanin[50]=i_wr_data_ff_scanout[49];
401assign i_wr_data_ff_scanin[51]=i_wr_data_ff_scanout[50];
402assign i_wr_data_ff_scanin[52]=i_wr_data_ff_scanout[51];
403assign i_wr_data_ff_scanin[53]=i_wr_data_ff_scanout[52];
404assign i_wr_data_ff_scanin[54]=i_wr_data_ff_scanout[53];
405assign i_wr_data_ff_scanin[55]=i_wr_data_ff_scanout[54];
406assign i_wr_data_ff_scanin[56]=i_wr_data_ff_scanout[55];
407assign i_wr_data_ff_scanin[57]=i_wr_data_ff_scanout[56];
408assign i_wr_data_ff_scanin[58]=i_wr_data_ff_scanout[57];
409assign i_wr_data_ff_scanin[59]=i_wr_data_ff_scanout[58];
410assign i_wr_data_ff_scanin[60]=i_wr_data_ff_scanout[59];
411assign i_wr_data_ff_scanin[61]=i_wr_data_ff_scanout[60];
412assign i_wr_data_ff_scanin[62]=i_wr_data_ff_scanout[61];
413assign i_wr_data_ff_scanin[63]=i_wr_data_ff_scanout[62];
414assign i_wr_data_ff_scanin[64]=i_wr_data_ff_scanout[63];
415assign i_wr_data_ff_scanin[65]=i_wr_data_ff_scanout[64];
416assign i_r0_addr_ff_scanin[7]=i_wr_data_ff_scanout[65];
417assign i_r0_addr_ff_scanin[6]=i_r0_addr_ff_scanout[7];
418assign i_r0_addr_ff_scanin[5]=i_r0_addr_ff_scanout[6];
419assign i_r0_addr_ff_scanin[4]=i_r0_addr_ff_scanout[5];
420assign i_r0_addr_ff_scanin[3]=i_r0_addr_ff_scanout[4];
421assign i_r0_addr_ff_scanin[2]=i_r0_addr_ff_scanout[3];
422assign i_r0_addr_ff_scanin[1]=i_r0_addr_ff_scanout[2];
423assign i_r0_addr_ff_scanin[0]=i_r0_addr_ff_scanout[1];
424assign i_rd0_enable_ff_scanin[0]=i_r0_addr_ff_scanout[0];
425assign i_r1_addr_ff_scanin[7]=i_rd0_enable_ff_scanout[0];
426assign i_r1_addr_ff_scanin[6]=i_r1_addr_ff_scanout[7];
427assign i_r1_addr_ff_scanin[5]=i_r1_addr_ff_scanout[6];
428assign i_r1_addr_ff_scanin[4]=i_r1_addr_ff_scanout[5];
429assign i_r1_addr_ff_scanin[3]=i_r1_addr_ff_scanout[4];
430assign i_r1_addr_ff_scanin[2]=i_r1_addr_ff_scanout[3];
431assign i_r1_addr_ff_scanin[1]=i_r1_addr_ff_scanout[2];
432assign i_r1_addr_ff_scanin[0]=i_r1_addr_ff_scanout[1];
433assign i_rd1_enable_ff_scanin[0]=i_r1_addr_ff_scanout[0];
434assign i_w_addr_ff_scanin[7]=i_rd1_enable_ff_scanout[0];
435assign i_w_addr_ff_scanin[6]=i_w_addr_ff_scanout[7];
436assign i_w_addr_ff_scanin[5]=i_w_addr_ff_scanout[6];
437assign i_w_addr_ff_scanin[4]=i_w_addr_ff_scanout[5];
438assign i_w_addr_ff_scanin[3]=i_w_addr_ff_scanout[4];
439assign i_w_addr_ff_scanin[2]=i_w_addr_ff_scanout[3];
440assign i_w_addr_ff_scanin[1]=i_w_addr_ff_scanout[2];
441assign i_w_addr_ff_scanin[0]=i_w_addr_ff_scanout[1];
442assign i_wr_enable_ff_scanin[0]=i_w_addr_ff_scanout[0];
443assign scan_out=i_wr_enable_ff_scanout[0];
444// fixscan end
445endmodule
446
447
448
449
450
451
452
453// any PARAMS parms go into naming of macro
454
455module n2_mam_mp_160x66_cust_l1clkhdr_ctl_macro (
456 l2clk,
457 l1en,
458 pce_ov,
459 stop,
460 se,
461 l1clk);
462
463
464 input l2clk;
465 input l1en;
466 input pce_ov;
467 input stop;
468 input se;
469 output l1clk;
470
471
472
473
474
475cl_sc1_l1hdr_8x c_0 (
476
477
478 .l2clk(l2clk),
479 .pce(l1en),
480 .l1clk(l1clk),
481 .se(se),
482 .pce_ov(pce_ov),
483 .stop(stop)
484);
485
486
487
488endmodule
489
490
491
492
493
494
495
496
497
498
499
500
501
502// any PARAMS parms go into naming of macro
503
504module n2_mam_mp_160x66_cust_msff_ctl_macro__fs_1__scanreverse_1__width_66 (
505 din,
506 l1clk,
507 scan_in,
508 siclk,
509 soclk,
510 dout,
511 scan_out);
512wire [65:0] fdin;
513
514 input [65:0] din;
515 input l1clk;
516 input [65:0] scan_in;
517
518
519 input siclk;
520 input soclk;
521
522 output [65:0] dout;
523 output [65:0] scan_out;
524assign fdin[65:0] = din[65:0];
525
526
527
528
529
530
531dff #(66) d0_0 (
532.l1clk(l1clk),
533.siclk(siclk),
534.soclk(soclk),
535.d(fdin[65:0]),
536.si(scan_in[65:0]),
537.so(scan_out[65:0]),
538.q(dout[65:0])
539);
540
541
542
543
544
545
546
547
548
549
550
551
552endmodule
553
554
555
556
557
558
559
560
561
562// general mux macro for pass-gate and and-or muxes with/wout priority encoders
563// also for pass-gate with decoder
564
565
566
567
568
569// any PARAMS parms go into naming of macro
570
571module n2_mam_mp_160x66_cust_mux_macro__mux_aope__ports_2__width_8 (
572 din0,
573 din1,
574 sel0,
575 dout);
576wire psel0;
577wire psel1;
578
579 input [7:0] din0;
580 input [7:0] din1;
581 input sel0;
582 output [7:0] dout;
583
584
585
586
587
588cl_dp1_penc2_8x c0_0 (
589 .sel0(sel0),
590 .psel0(psel0),
591 .psel1(psel1)
592);
593
594mux2s #(8) d0_0 (
595 .sel0(psel0),
596 .sel1(psel1),
597 .in0(din0[7:0]),
598 .in1(din1[7:0]),
599.dout(dout[7:0])
600);
601
602
603
604
605
606
607
608
609
610
611
612
613
614endmodule
615
616
617//
618// macro for cl_mc1_sram_msff_mo_{16,8,4}x flops
619//
620//
621
622
623
624
625
626module n2_mam_mp_160x66_cust_sram_msff_mo_macro__fs_1__width_8 (
627 d,
628 scan_in,
629 l1clk,
630 and_clk,
631 siclk,
632 soclk,
633 mq,
634 mq_l,
635 scan_out,
636 q,
637 q_l);
638input [7:0] d;
639 input [7:0] scan_in;
640input l1clk;
641input and_clk;
642input siclk;
643input soclk;
644output [7:0] mq;
645output [7:0] mq_l;
646 output [7:0] scan_out;
647output [7:0] q;
648output [7:0] q_l;
649
650
651
652
653
654
655new_dlata #(8) d0_0 (
656.d(d[7:0]),
657.si(scan_in[7:0]),
658.so(scan_out[7:0]),
659.l1clk(l1clk),
660.and_clk(and_clk),
661.siclk(siclk),
662.soclk(soclk),
663.q(q[7:0]),
664.q_l(q_l[7:0]),
665.mq(mq[7:0]),
666.mq_l(mq_l[7:0])
667);
668
669
670
671
672
673
674
675
676
677
678//place::generic_place($width,$stack,$left);
679
680endmodule
681
682
683
684
685
686
687
688
689
690// any PARAMS parms go into naming of macro
691
692module n2_mam_mp_160x66_cust_msff_ctl_macro__fs_1__width_8 (
693 din,
694 l1clk,
695 scan_in,
696 siclk,
697 soclk,
698 dout,
699 scan_out);
700wire [7:0] fdin;
701
702 input [7:0] din;
703 input l1clk;
704 input [7:0] scan_in;
705
706
707 input siclk;
708 input soclk;
709
710 output [7:0] dout;
711 output [7:0] scan_out;
712assign fdin[7:0] = din[7:0];
713
714
715
716
717
718
719dff #(8) d0_0 (
720.l1clk(l1clk),
721.siclk(siclk),
722.soclk(soclk),
723.d(fdin[7:0]),
724.si(scan_in[7:0]),
725.so(scan_out[7:0]),
726.q(dout[7:0])
727);
728
729
730
731
732
733
734
735
736
737
738
739
740endmodule
741
742
743
744
745
746
747
748
749
750// general mux macro for pass-gate and and-or muxes with/wout priority encoders
751// also for pass-gate with decoder
752
753
754
755
756
757// any PARAMS parms go into naming of macro
758
759module n2_mam_mp_160x66_cust_mux_macro__mux_aope__ports_2__width_1 (
760 din0,
761 din1,
762 sel0,
763 dout);
764wire psel0;
765wire psel1;
766
767 input [0:0] din0;
768 input [0:0] din1;
769 input sel0;
770 output [0:0] dout;
771
772
773
774
775
776cl_dp1_penc2_8x c0_0 (
777 .sel0(sel0),
778 .psel0(psel0),
779 .psel1(psel1)
780);
781
782mux2s #(1) d0_0 (
783 .sel0(psel0),
784 .sel1(psel1),
785 .in0(din0[0:0]),
786 .in1(din1[0:0]),
787.dout(dout[0:0])
788);
789
790
791
792
793
794
795
796
797
798
799
800
801
802endmodule
803
804
805//
806// macro for cl_mc1_sram_msff_mo_{16,8,4}x flops
807//
808//
809
810
811
812
813
814module n2_mam_mp_160x66_cust_sram_msff_mo_macro__fs_1__width_1 (
815 d,
816 scan_in,
817 l1clk,
818 and_clk,
819 siclk,
820 soclk,
821 mq,
822 mq_l,
823 scan_out,
824 q,
825 q_l);
826input [0:0] d;
827 input [0:0] scan_in;
828input l1clk;
829input and_clk;
830input siclk;
831input soclk;
832output [0:0] mq;
833output [0:0] mq_l;
834 output [0:0] scan_out;
835output [0:0] q;
836output [0:0] q_l;
837
838
839
840
841
842
843new_dlata #(1) d0_0 (
844.d(d[0:0]),
845.si(scan_in[0:0]),
846.so(scan_out[0:0]),
847.l1clk(l1clk),
848.and_clk(and_clk),
849.siclk(siclk),
850.soclk(soclk),
851.q(q[0:0]),
852.q_l(q_l[0:0]),
853.mq(mq[0:0]),
854.mq_l(mq_l[0:0])
855);
856
857
858
859
860
861
862
863
864
865
866//place::generic_place($width,$stack,$left);
867
868endmodule
869
870
871
872
873
874
875
876
877
878// any PARAMS parms go into naming of macro
879
880module n2_mam_mp_160x66_cust_msff_ctl_macro__fs_1__width_1 (
881 din,
882 l1clk,
883 scan_in,
884 siclk,
885 soclk,
886 dout,
887 scan_out);
888wire [0:0] fdin;
889
890 input [0:0] din;
891 input l1clk;
892 input [0:0] scan_in;
893
894
895 input siclk;
896 input soclk;
897
898 output [0:0] dout;
899 output [0:0] scan_out;
900assign fdin[0:0] = din[0:0];
901
902
903
904
905
906
907dff #(1) d0_0 (
908.l1clk(l1clk),
909.siclk(siclk),
910.soclk(soclk),
911.d(fdin[0:0]),
912.si(scan_in[0:0]),
913.so(scan_out[0:0]),
914.q(dout[0:0])
915);
916
917
918
919
920
921
922
923
924
925
926
927
928endmodule
929
930
931
932
933
934
935
936
937
938////////////////////////////////////////////////////////////////////////////////
939// $Id: n2_mam_mp_160x66_cust.v,v 1.1.1.1 2007/02/13 22:19:31 drp Exp $
940//
941// Copyright (C) 2003 by Sun Microsystems, Inc.
942//
943// All rights reserved. No part of this design may be reproduced,
944// stored in a retrieval system, or transmitted, in any form or by
945// any means, electronic, mechanical, photocopying, recording, or
946// otherwise, without prior written permission of Sun Microsystems,
947// Inc.
948//
949// Sun Proprietary/Confidential
950//
951// Description: 160 x 66 dual-port array
952// Bypass write data to read port on read/write collision
953//
954// To produce a debussy dump of memory contents,
955// add -vcs_run_args=+DUMPMEM_160x66 to sims command line
956//
957// Primary Contact: Mark Luttrell
958////////////////////////////////////////////////////////////////////////////////
959
960module lib_160x66b_2r_1w_array (
961 clk,
962 rd0_en,
963 rd1_en,
964 wr_en,
965 tcu_array_wr_inhibit,
966 r0_addr,
967 r1_addr,
968 w_addr,
969 din,
970 r0_byp,
971 r1_byp,
972 dout0,
973 dout1);
974
975`define WIDTH 66
976`define ENTRIES 160
977`define ADDRBITS 8
978
979input clk;
980input rd0_en;
981input rd1_en;
982input wr_en;
983input tcu_array_wr_inhibit;
984input [`ADDRBITS-1:0] r0_addr;
985input [`ADDRBITS-1:0] r1_addr;
986input [`ADDRBITS-1:0] w_addr;
987
988input [`WIDTH-1:0] din;
989input r0_byp;
990input r1_byp;
991output [`WIDTH-1:0] dout0;
992output [`WIDTH-1:0] dout1;
993
994
995
996
997
998
999
1000
1001reg [`WIDTH-1:0] mem[`ENTRIES-1:0];
1002reg [`WIDTH-1:0] local_dout0;
1003reg [`WIDTH-1:0] local_dout1;
1004reg [`WIDTH-1:0] dout0;
1005reg [`WIDTH-1:0] dout1;
1006
1007// Emulate reset
1008`ifndef NOINITMEM
1009integer i;
1010initial begin
1011 for (i=0; i<`ENTRIES; i=i+1) begin
1012 mem[i] = {`WIDTH{1'b0}};
1013 end
1014 local_dout0 = {`WIDTH{1'b0}};
1015 local_dout1 = {`WIDTH{1'b0}};
1016end
1017`endif
1018
1019//////////////////////
1020// Read/write array
1021//////////////////////
1022always @ (clk or rd0_en or wr_en or tcu_array_wr_inhibit or w_addr or r0_addr) begin
1023 if (clk) begin
1024 if (rd0_en & ~tcu_array_wr_inhibit) begin
1025 if (r0_addr <= 8'b10011111) begin // 159
1026 if (wr_en & (w_addr == r0_addr))
1027 local_dout0[`WIDTH-1:0] = {`WIDTH {1'bx}};
1028 else
1029 local_dout0[`WIDTH-1:0] = mem[r0_addr];
1030 end
1031 else
1032 local_dout0[`WIDTH-1:0] = {`WIDTH {1'b0}}; // return 0's for out-of-bounds read address
1033 end
1034 else local_dout0[`WIDTH-1:0] = {`WIDTH {1'b0}}; // precharge
1035 end // clk
1036end
1037
1038always @ (clk or rd1_en or wr_en or tcu_array_wr_inhibit or w_addr or r1_addr) begin
1039 if (clk) begin
1040 if (rd1_en & ~tcu_array_wr_inhibit) begin
1041 if (r1_addr <= 8'b10011111) begin // 159
1042 if (wr_en & (w_addr == r1_addr))
1043 local_dout1[`WIDTH-1:0] = {`WIDTH {1'bx}};
1044 else
1045 local_dout1[`WIDTH-1:0] = mem[r1_addr];
1046 end
1047 else
1048 local_dout1[`WIDTH-1:0] = {`WIDTH {1'b0}}; // return 0's for out-of-bounds read address
1049 end
1050 else local_dout1[`WIDTH-1:0] = {`WIDTH {1'b0}}; // precharge
1051 end // clk
1052end
1053
1054always @ (negedge clk) begin
1055 if (wr_en & ~tcu_array_wr_inhibit) begin
1056 if (w_addr <= 8'b10011111) // make sure write address is valid
1057 mem[w_addr] <= din;
1058
1059
1060
1061
1062 end
1063
1064end
1065
1066
1067always @(r0_byp or local_dout0 or din) begin
1068 if (r0_byp) dout0[`WIDTH-1:0] <= din[`WIDTH-1:0];
1069 else dout0[`WIDTH-1:0] <= local_dout0[`WIDTH-1:0];
1070end
1071
1072always @(r1_byp or local_dout1 or din) begin
1073 if (r1_byp) dout1[`WIDTH-1:0] <= din[`WIDTH-1:0];
1074 else dout1[`WIDTH-1:0] <= local_dout1[`WIDTH-1:0];
1075end
1076
1077supply0 vss;
1078supply1 vdd;
1079
1080
1081
1082endmodule
1083