Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / libs / tisram / soc / n2_l2d_sp_512kb_cust_l / n2_l2d_sp_512kb_cust / rtl / n2_l2d_dmux78_cust.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: n2_l2d_dmux78_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_l2d_dmux78_cust (
36 waysel_c3,
37 set_c3,
38 coloff_c3,
39 coloff_c4_l,
40 rd_wr_c3,
41 worden_c3,
42 l2clk,
43 tcu_pce_ov,
44 tcu_pce,
45 se,
46 tcu_clk_stop,
47 waysel_top_c4,
48 waysel_bot_c4,
49 set_top_c3b,
50 set_bot_c3b,
51 coloff_top_c3b_l,
52 coloff_bot_c3b_l,
53 writeen_top_c3b,
54 writeen_bot_c3b,
55 l1clk,
56 worden_top_c3b,
57 worden_bot_c3b,
58 sat_lo0_bc_l,
59 sat_hi0_bc_l,
60 sat_lo1_bc_l,
61 sat_hi1_bc_l,
62 sab_lo0_bc_l,
63 sab_hi0_bc_l,
64 sab_lo1_bc_l,
65 sab_hi1_bc_l,
66 ldin0lo_b,
67 ldin0hi_b,
68 ldin1lo_b,
69 ldin1hi_b,
70 ldout0lo_b,
71 ldout0hi_b,
72 ldout1lo_b,
73 ldout1hi_b,
74 red_d_in_00,
75 red_d_out_00,
76 fuse_l2d_rid_00,
77 fuse_l2d_wren_00,
78 fuse_l2d_reset_00_l,
79 sel_quad_00,
80 red_d_in_01,
81 red_d_out_01,
82 fuse_l2d_rid_01,
83 fuse_l2d_wren_01,
84 fuse_l2d_reset_01_l,
85 sel_quad_01,
86 red_addr_top,
87 red_addr_bot,
88 red_top_d_00,
89 red_top_d_01,
90 cred);
91
92input [7:0] waysel_c3;
93input [8:0] set_c3;
94input coloff_c3;
95input coloff_c4_l;
96//input [1:0] coloff_c5;
97input rd_wr_c3;
98//input readen_c5;
99input [3:0] worden_c3;
100input l2clk;
101input tcu_pce_ov;
102input tcu_pce;
103input se;
104input tcu_clk_stop;
105
106output [7:0] waysel_top_c4;
107output [7:0] waysel_bot_c4;
108output [8:0] set_top_c3b; // Set 8 will be inverted for top/bot
109output [8:0] set_bot_c3b; // Set 8 will be inverted for top/bot
110output coloff_top_c3b_l;
111output coloff_bot_c3b_l;
112//output coloff_top_c4_l ;
113//output coloff_bot_c4_l;
114//output [1:0] coloff_top_c5;
115//output [1:0] coloff_bot_c5;
116output writeen_top_c3b;
117output writeen_bot_c3b;
118//output readen_top_c5;
119//output readen_bot_c5;
120output l1clk;
121output [3:0] worden_top_c3b;
122output [3:0] worden_bot_c3b;
123
124
125input [19:0] sat_lo0_bc_l; // Senseamp out from top-16kb
126input [19:0] sat_hi0_bc_l; // Senseamp out from top-16kb
127input [18:0] sat_lo1_bc_l; // Senseamp out from top-16kb
128input [18:0] sat_hi1_bc_l; // Senseamp out from top-16kb
129input [19:0] sab_lo0_bc_l; // Senseamp out from bot-16kb
130input [19:0] sab_hi0_bc_l; // Senseamp out from bot-16kb
131input [18:0] sab_lo1_bc_l; // Senseamp out from bot-16kb
132input [18:0] sab_hi1_bc_l; // Senseamp out from bot-16kb
133input [19:0] ldin0lo_b;
134input [19:0] ldin0hi_b;
135input [18:0] ldin1lo_b;
136input [18:0] ldin1hi_b;
137//input bnken_lat; // Address latch enable (1.5cycle)
138output [19:0] ldout0lo_b;
139output [19:0] ldout0hi_b;
140output [18:0] ldout1lo_b;
141output [18:0] ldout1hi_b;
142
143
144input [9:0] red_d_in_00;
145output [9:0] red_d_out_00;
146input [2:0] fuse_l2d_rid_00;
147input fuse_l2d_wren_00;
148input fuse_l2d_reset_00_l;
149input sel_quad_00;
150
151input [9:0] red_d_in_01;
152output [9:0] red_d_out_01;
153input [2:0] fuse_l2d_rid_01;
154input fuse_l2d_wren_01;
155input fuse_l2d_reset_01_l;
156input sel_quad_01;
157
158output [9:0] red_addr_top;
159output [9:0] red_addr_bot;
160// forwarded
161input [9:0] red_top_d_00;
162input [9:0] red_top_d_01;
163
164output [77:0] cred;
165//output fuse_l2d_reset_00_l_buf;
166//output fuse_l2d_reset_01_l_buf;
167
168reg [7:0] waysel_top_c4;
169reg [7:0] waysel_bot_c4;
170reg [8:0] set_top_c3b;
171reg [8:0] set_bot_c3b;
172reg writeen_top_c3b;
173reg writeen_bot_c3b;
174reg [3:0] worden_top_c3b;
175reg [3:0] worden_bot_c3b;
176reg coloff_top_c3b_l;
177reg coloff_bot_c3b_l;
178reg [7:0] waysel_top_c3b;
179reg [7:0] waysel_bot_c3b;
180//always@(posedge l2clk)
181always@(negedge l2clk)
182begin
183 coloff_top_c3b_l <= ~coloff_c3;
184 coloff_bot_c3b_l <= ~coloff_c3;
185 worden_top_c3b[3:0] <= worden_c3[3:0];
186 worden_bot_c3b[3:0] <= worden_c3[3:0];
187 writeen_top_c3b <= ~rd_wr_c3;
188 writeen_bot_c3b <= ~rd_wr_c3;
189end
190
191//always@(negedge l2clk)
192//always@(l2clk or bnken_lat)
193always@(l2clk or coloff_c4_l)
194begin
195// if(~bnken_lat)
196 if(~l2clk & coloff_c4_l)
197 begin
198 waysel_top_c3b[7:0] <= waysel_c3[7:0];
199 waysel_bot_c3b[7:0] <= waysel_c3[7:0];
200 set_bot_c3b[8:0] <= set_c3[8:0];
201 set_top_c3b[8:0] <= {~set_c3[8],set_c3[7:0]};
202
203 end
204end
205
206always@(posedge l2clk )
207begin
208waysel_top_c4[7:0] <= waysel_top_c3b[7:0];
209waysel_bot_c4[7:0] <= waysel_bot_c3b[7:0];
210end
211//assign readen_top_c5 = readen_c5;
212//assign readen_bot_c5 = readen_c5;
213//assign coloff_top_c5 = coloff_c5[1:0];
214//assign coloff_bot_c5 = coloff_c5[1:0];
215//assign coloff_top_c4_l = coloff_c4_l;
216//assign coloff_bot_c4_l = coloff_c4_l;
217
218
219wire [19:0] sat_lo0_bc;
220wire [19:0] sab_lo0_bc;
221wire [19:0] sat_hi0_bc;
222wire [19:0] sab_hi0_bc;
223
224wire [18:0] sat_lo1_bc;
225wire [18:0] sab_lo1_bc;
226wire [18:0] sat_hi1_bc;
227wire [18:0] sab_hi1_bc;
228
229
230//always@(posedge l1clk)
231//begin
232assign sat_lo0_bc[19:0] = ~sat_lo0_bc_l[19:0];
233assign sab_lo0_bc[19:0] = ~sab_lo0_bc_l[19:0];
234assign sat_hi0_bc[19:0] = ~sat_hi0_bc_l[19:0];
235assign sab_hi0_bc[19:0] = ~sab_hi0_bc_l[19:0];
236
237assign sat_lo1_bc[18:0] = ~sat_lo1_bc_l[18:0];
238assign sab_lo1_bc[18:0] = ~sab_lo1_bc_l[18:0];
239assign sat_hi1_bc[18:0] = ~sat_hi1_bc_l[18:0];
240assign sab_hi1_bc[18:0] = ~sab_hi1_bc_l[18:0];
241//end
242
243
244
245n2_l2d_dmux78_cust_or_macro__ports_3__width_20 or_ldout0lo_b
246 (
247 .dout (ldout0lo_b[19:0]),
248 .din0 (sat_lo0_bc[19:0]),
249 .din1 (sab_lo0_bc[19:0]),
250 .din2 (ldin0lo_b[19:0])
251 );
252
253n2_l2d_dmux78_cust_or_macro__ports_3__width_20 or_ldout0hi_b
254 (
255 .dout (ldout0hi_b[19:0]),
256 .din0 (sat_hi0_bc[19:0]),
257 .din1 (sab_hi0_bc[19:0]),
258 .din2 (ldin0hi_b[19:0])
259 );
260
261n2_l2d_dmux78_cust_or_macro__ports_3__width_19 or_ldout1lo_b
262 (
263 .dout (ldout1lo_b[18:0]),
264 .din0 (sat_lo1_bc[18:0]),
265 .din1 (sab_lo1_bc[18:0]),
266 .din2 (ldin1lo_b[18:0])
267 );
268
269
270n2_l2d_dmux78_cust_or_macro__ports_3__width_19 or_ldout1hi_b
271 (
272 .dout (ldout1hi_b[18:0]),
273 .din0 (sat_hi1_bc[18:0]),
274 .din1 (sab_hi1_bc[18:0]),
275 .din2 (ldin1hi_b[18:0])
276 );
277
278
279cl_sc1_l1hdr_12x clk_hdr (
280 .l2clk (l2clk),
281 .se (se),
282 .pce (tcu_pce),
283 .pce_ov (tcu_pce_ov),
284 .stop (tcu_clk_stop),
285 .l1clk (l1clk)
286 );
287
288
289// Redudant row modelling
290
291
292
293reg [9:0] red_odd_0;
294reg [9:0] red_odd_1;
295reg [9:0] red_even_0;
296reg [9:0] red_even_1;
297reg [7:0] red_col_0;
298reg [7:0] red_col_1;
299//reg [9:0] red_d_out_00;
300//reg [9:0] red_d_out_01;
301
302wire red_reg_clk_even_0;
303wire red_reg_clk_even_1;
304wire red_reg_clk_odd_0;
305wire red_reg_clk_odd_1;
306wire red_reg_clk_col_0;
307wire red_reg_clk_col_1;
308wire [9:0] red_data_00;
309wire [9:0] red_data_01;
310
311// Initialize the register.
312initial begin
313
314 red_odd_0[9:0] = 10'b0;
315 red_odd_1[9:0] = 10'b0;
316 red_even_0[9:0]= 10'b0;
317 red_even_1[9:0]= 10'b0;
318 red_col_0[7:0] = 8'b0;
319 red_col_1[7:0] = 8'b0;
320end
321
322assign red_reg_clk_even_0 =~((~l1clk & fuse_l2d_wren_00 & (fuse_l2d_rid_00[2:0]==3'b000) & sel_quad_00) | ~fuse_l2d_reset_00_l);
323assign red_reg_clk_even_1 =~((~l1clk & fuse_l2d_wren_00 & (fuse_l2d_rid_00[2:0]==3'b010) & sel_quad_00) | ~fuse_l2d_reset_00_l);
324assign red_reg_clk_col_0 =~((~l1clk & fuse_l2d_wren_00 & (fuse_l2d_rid_00[2:0]==3'b100) & sel_quad_00) | ~fuse_l2d_reset_00_l);
325
326assign red_reg_clk_odd_0 =~((~l1clk &fuse_l2d_wren_01& (fuse_l2d_rid_01[2:0]==3'b001) & sel_quad_01) | ~fuse_l2d_reset_01_l);
327assign red_reg_clk_odd_1 =~((~l1clk &fuse_l2d_wren_01& (fuse_l2d_rid_01[2:0]==3'b011) & sel_quad_01) | ~fuse_l2d_reset_01_l);
328assign red_reg_clk_col_1 =~((~l1clk &fuse_l2d_wren_01& (fuse_l2d_rid_01[2:0]==3'b101) & sel_quad_01) | ~fuse_l2d_reset_01_l);
329
330assign red_data_00[9:0] = red_d_in_00[9:0] & {10{fuse_l2d_reset_00_l}};
331assign red_data_01[9:0] = red_d_in_01[9:0] & {10{fuse_l2d_reset_01_l}};
332
333always @(red_reg_clk_even_0 or red_reg_clk_even_1 or red_reg_clk_col_0 or red_reg_clk_odd_0 or red_reg_clk_odd_1 or red_reg_clk_col_1 or red_d_in_00 or red_d_in_01) begin
334 if (~red_reg_clk_even_0) begin
335 red_even_0[9:0] <= red_data_00[9:0];
336 end
337
338 if (~red_reg_clk_even_1) begin
339 red_even_1[9:0] <= red_data_00[9:0];
340 end
341
342 if (~red_reg_clk_col_0) begin
343 red_col_0[7:0] <= {red_data_00[9:8],red_data_00[5:0]};
344 end
345
346 if (~red_reg_clk_odd_0) begin
347 red_odd_0[9:0] <= red_data_01[9:0];
348 end
349
350 if (~red_reg_clk_odd_1) begin
351 red_odd_1[9:0] <= red_data_01[9:0];
352 end
353
354 if (~red_reg_clk_col_1) begin
355 red_col_1[7:0] <= {red_data_01[9:8],red_data_01[5:0]};
356 end
357end
358
359
360// 00 = bot and 01 = top
361
362//always@(fuse_l2d_wren_00 or fuse_l2d_wren_01 or fuse_l2d_rid_01 or fuse_l2d_rid_00
363// or red_d_in_00 or red_d_in_01 or sel_quad_00 or sel_quad_01)
364//begin
365// if(fuse_l2d_wren_00 & ~fuse_l2d_rid_00[0] & set_bot_c3b[8] & (fuse_l2d_rid_00[2:1]==2'b00) & sel_quad_00)
366// red_even_0 <= red_d_in_00;
367// else if(fuse_l2d_wren_00 & ~fuse_l2d_rid_00[0] & set_top_c3b[8] & (fuse_l2d_rid_01[2:1]==2'b01) & sel_quad_00)
368// red_even_1 <= red_d_in_00;
369// else if(fuse_l2d_wren_00 & ~fuse_l2d_rid_00[0] & (fuse_l2d_rid_01[2:1]==2'b10) & sel_quad_00)
370// red_col_0 <= red_d_in_00[7:0];
371//
372// if(fuse_l2d_wren_01 & fuse_l2d_rid_01[0] & set_top_c3b[8] & (fuse_l2d_rid_01[2:1]==2'b00) & sel_quad_01)
373// red_odd_0 <= red_d_in_01;
374// else if(fuse_l2d_wren_01 & fuse_l2d_rid_01[0] & set_bot_c3b[8] & (fuse_l2d_rid_01[2:1]==2'b01) & sel_quad_01)
375// red_odd_1 <= red_d_in_01;
376// else if(fuse_l2d_wren_01 & fuse_l2d_rid_01[0] & (fuse_l2d_rid_01[2:1]==2'b10) & sel_quad_01)
377// red_col_1 <= red_d_in_01[7:0];
378//end
379//
380
381//assign red_addr_top = set_top_c3b[0] ? red_odd_0 : red_even_0;
382//assign red_addr_bot = set_top_c3b[0] ? red_odd_1 : red_even_1;
383assign red_addr_top = set_top_c3b[0] ? red_odd_1 : red_even_1;
384assign red_addr_bot = set_top_c3b[0] ? red_odd_0 : red_even_0;
385
386assign red_d_out_00[7:0] = (red_even_0[7:0] & {8{fuse_l2d_rid_00[2:0]==3'b000}}) |
387 (red_even_1[7:0] & {8{fuse_l2d_rid_00[2:0]==3'b010}}) |
388 ({2'b0,(red_col_0[5:0] & {6{fuse_l2d_rid_00[2:0]==3'b100}})}) |
389 (red_top_d_00[7:0] & {8{~sel_quad_00}});
390
391assign red_d_out_00[9:8] = (red_even_0[9:8] & {2{fuse_l2d_rid_00[2:0]==3'b000}}) |
392 (red_even_1[9:8] & {2{fuse_l2d_rid_00[2:0]==3'b010}}) |
393 (red_col_0[7:6] & {2{fuse_l2d_rid_00[2:0]==3'b100}}) |
394 (red_top_d_00[9:8] & {2{~sel_quad_00}});
395
396
397
398
399assign red_d_out_01[7:0] = (red_odd_0[7:0] & {8{fuse_l2d_rid_01[2:0]==3'b001}}) |
400 (red_odd_1[7:0] & {8{fuse_l2d_rid_01[2:0]==3'b011}}) |
401 ({2'b0,(red_col_1[5:0] & {6{fuse_l2d_rid_01[2:0]==3'b101}})}) |
402 (red_top_d_01[7:0] & {8{~sel_quad_01}});
403
404assign red_d_out_01[9:8] = (red_odd_0[9:8] & {2{fuse_l2d_rid_01[2:0]==3'b001}}) |
405 (red_odd_1[9:8] & {2{fuse_l2d_rid_01[2:0]==3'b011}}) |
406 (red_col_1[7:6] & {2{fuse_l2d_rid_01[2:0]==3'b101}}) |
407 (red_top_d_01[9:8] & {2{~sel_quad_01}});
408
409
410
411//always@(fuse_l2d_rid_00)
412//begin
413//case(fuse_l2d_rid_00)
414//3'b000 : begin
415// red_d_out_00 = red_even_0;
416// red_d_out_01 = 10'b0;
417// end
418//3'b010 : begin
419// red_d_out_00 = red_even_1;
420// red_d_out_01 = 10'b0;
421// end
422//3'b100 : begin
423// red_d_out_00 = {2'b0,red_col_0};
424// red_d_out_01 = 10'b0;
425// end
426//
427//3'b001 : begin
428// red_d_out_01 = red_odd_0;
429// red_d_out_00 = 10'b0;
430// end
431//3'b011 : begin
432// red_d_out_01 = red_odd_1;
433// red_d_out_00 = 10'b0;
434// end
435//3'b101 : begin
436// red_d_out_01 = {2'b0,red_col_1};
437// red_d_out_00 = 10'b0;
438// end
439//
440//default : begin
441// red_d_out_00 = red_top_d_00;
442// red_d_out_01 = red_top_d_01;
443// end
444//endcase
445//end
446
447// Col redudancy
448
449//reg [7:0] red_col_0;
450//reg [7:0] red_col_1;
451
452reg [38:0] cred0;
453reg [38:0] cred1;
454
455// Initialize cred0, cred1
456initial begin
457 cred0[38:0] = 39'b0;
458 cred1[38:0] = 39'b0;
459end
460
461always@(red_col_0)
462if(red_col_0[7] & red_col_0[6] & ~red_col_0[5])
463case(red_col_0)
4648'b11_0_00000 : cred0[18:0] = 19'b111_1111_1111_1111_1111; //0
4658'b11_0_00001 : cred0[18:0] = 19'b111_1111_1111_1111_1110; //1
4668'b11_0_00010 : cred0[18:0] = 19'b111_1111_1111_1111_1100; //2
4678'b11_0_00011 : cred0[18:0] = 19'b111_1111_1111_1111_1000; //3
4688'b11_0_00100 : cred0[18:0] = 19'b111_1111_1111_1111_0000; //4
4698'b11_0_00101 : cred0[18:0] = 19'b111_1111_1111_1110_0000; //5
4708'b11_0_00110 : cred0[18:0] = 19'b111_1111_1111_1100_0000; //6
4718'b11_0_00111 : cred0[18:0] = 19'b111_1111_1111_1000_0000; //7
4728'b11_0_01000 : cred0[18:0] = 19'b111_1111_1111_0000_0000; //8
4738'b11_0_01001 : cred0[18:0] = 19'b111_1111_1110_0000_0000; //9
4748'b11_0_01010 : cred0[18:0] = 19'b111_1111_1100_0000_0000; //10
4758'b11_0_01011 : cred0[18:0] = 19'b111_1111_1000_0000_0000; //11
4768'b11_0_01100 : cred0[18:0] = 19'b111_1111_0000_0000_0000; //12
4778'b11_0_01101 : cred0[18:0] = 19'b111_1110_0000_0000_0000; //13
4788'b11_0_01110 : cred0[18:0] = 19'b111_1100_0000_0000_0000; //14
4798'b11_0_01111 : cred0[18:0] = 19'b111_1000_0000_0000_0000; //15
4808'b11_0_10000 : cred0[18:0] = 19'b111_0000_0000_0000_0000; //16
4818'b11_0_10001 : cred0[18:0] = 19'b110_0000_0000_0000_0000; //17
4828'b11_0_10010 : cred0[18:0] = 19'b100_0000_0000_0000_0000; //18
483default : cred0[18:0] = 19'b0;
484endcase
485else cred0[18:0] = 19'b0;
486
487always@(red_col_0)
488if(red_col_0[7] & red_col_0[6] & red_col_0[5])
489case(red_col_0)
4908'b11_1_00000 : cred0[38:19] = 20'b1111_1111_1111_1111_1111;//0
4918'b11_1_00001 : cred0[38:19] = 20'b0111_1111_1111_1111_1111;//1
4928'b11_1_00010 : cred0[38:19] = 20'b0011_1111_1111_1111_1111;//2
4938'b11_1_00011 : cred0[38:19] = 20'b0001_1111_1111_1111_1111;//3
4948'b11_1_00100 : cred0[38:19] = 20'b0000_1111_1111_1111_1111;//4
4958'b11_1_00101 : cred0[38:19] = 20'b0000_0111_1111_1111_1111;//5
4968'b11_1_00110 : cred0[38:19] = 20'b0000_0011_1111_1111_1111;//6
4978'b11_1_00111 : cred0[38:19] = 20'b0000_0001_1111_1111_1111;//7
4988'b11_1_01000 : cred0[38:19] = 20'b0000_0000_1111_1111_1111;//8
4998'b11_1_01001 : cred0[38:19] = 20'b0000_0000_0111_1111_1111;//9
5008'b11_1_01010 : cred0[38:19] = 20'b0000_0000_0011_1111_1111;//10
5018'b11_1_01011 : cred0[38:19] = 20'b0000_0000_0001_1111_1111;//11
5028'b11_1_01100 : cred0[38:19] = 20'b0000_0000_0000_1111_1111;//12
5038'b11_1_01101 : cred0[38:19] = 20'b0000_0000_0000_0111_1111;//13
5048'b11_1_01110 : cred0[38:19] = 20'b0000_0000_0000_0011_1111;//14
5058'b11_1_01111 : cred0[38:19] = 20'b0000_0000_0000_0001_1111;//15
5068'b11_1_10000 : cred0[38:19] = 20'b0000_0000_0000_0000_1111;//16
5078'b11_1_10001 : cred0[38:19] = 20'b0000_0000_0000_0000_0111;//17
5088'b11_1_10010 : cred0[38:19] = 20'b0000_0000_0000_0000_0011;//18
5098'b11_1_10011 : cred0[38:19] = 20'b0000_0000_0000_0000_0001;//19
510default : cred0[38:19] = 20'b0;
511endcase
512else cred0[38:19] = 20'b0;
513
514always@(red_col_1)
515if(red_col_1[7] & red_col_1[6] & red_col_1[5])
516case(red_col_1)
5178'b11_1_00000 : cred1[19:0] = 20'b1111_1111_1111_1111_1111; //0
5188'b11_1_00001 : cred1[19:0] = 20'b1111_1111_1111_1111_1110; //1
5198'b11_1_00010 : cred1[19:0] = 20'b1111_1111_1111_1111_1100; //2
5208'b11_1_00011 : cred1[19:0] = 20'b1111_1111_1111_1111_1000; //3
5218'b11_1_00100 : cred1[19:0] = 20'b1111_1111_1111_1111_0000; //4
5228'b11_1_00101 : cred1[19:0] = 20'b1111_1111_1111_1110_0000; //5
5238'b11_1_00110 : cred1[19:0] = 20'b1111_1111_1111_1100_0000; //6
5248'b11_1_00111 : cred1[19:0] = 20'b1111_1111_1111_1000_0000; //7
5258'b11_1_01000 : cred1[19:0] = 20'b1111_1111_1111_0000_0000; //8
5268'b11_1_01001 : cred1[19:0] = 20'b1111_1111_1110_0000_0000; //9
5278'b11_1_01010 : cred1[19:0] = 20'b1111_1111_1100_0000_0000; //10
5288'b11_1_01011 : cred1[19:0] = 20'b1111_1111_1000_0000_0000; //11
5298'b11_1_01100 : cred1[19:0] = 20'b1111_1111_0000_0000_0000; //12
5308'b11_1_01101 : cred1[19:0] = 20'b1111_1110_0000_0000_0000; //13
5318'b11_1_01110 : cred1[19:0] = 20'b1111_1100_0000_0000_0000; //14
5328'b11_1_01111 : cred1[19:0] = 20'b1111_1000_0000_0000_0000; //15
5338'b11_1_10000 : cred1[19:0] = 20'b1111_0000_0000_0000_0000; //16
5348'b11_1_10001 : cred1[19:0] = 20'b1110_0000_0000_0000_0000; //17
5358'b11_1_10010 : cred1[19:0] = 20'b1100_0000_0000_0000_0000; //18
5368'b11_1_10011 : cred1[19:0] = 20'b1000_0000_0000_0000_0000; //19
537default : cred1[19:0] = 20'b0;
538endcase
539else cred1[19:0] = 20'b0;
540
541always@(red_col_1)
542if(red_col_1[7] & red_col_1[6] & ~red_col_1[5])
543case(red_col_1)
5448'b11_0_00000 : cred1[38:20] = 19'b111_1111_1111_1111_1111;//0
5458'b11_0_00001 : cred1[38:20] = 19'b011_1111_1111_1111_1111;//1
5468'b11_0_00010 : cred1[38:20] = 19'b001_1111_1111_1111_1111;//2
5478'b11_0_00011 : cred1[38:20] = 19'b000_1111_1111_1111_1111;//3
5488'b11_0_00100 : cred1[38:20] = 19'b000_0111_1111_1111_1111;//4
5498'b11_0_00101 : cred1[38:20] = 19'b000_0011_1111_1111_1111;//5
5508'b11_0_00110 : cred1[38:20] = 19'b000_0001_1111_1111_1111;//6
5518'b11_0_00111 : cred1[38:20] = 19'b000_0000_1111_1111_1111;//7
5528'b11_0_01000 : cred1[38:20] = 19'b000_0000_0111_1111_1111;//8
5538'b11_0_01001 : cred1[38:20] = 19'b000_0000_0011_1111_1111;//9
5548'b11_0_01010 : cred1[38:20] = 19'b000_0000_0001_1111_1111;//10
5558'b11_0_01011 : cred1[38:20] = 19'b000_0000_0000_1111_1111;//11
5568'b11_0_01100 : cred1[38:20] = 19'b000_0000_0000_0111_1111;//12
5578'b11_0_01101 : cred1[38:20] = 19'b000_0000_0000_0011_1111;//13
5588'b11_0_01110 : cred1[38:20] = 19'b000_0000_0000_0001_1111;//14
5598'b11_0_01111 : cred1[38:20] = 19'b000_0000_0000_0000_1111;//15
5608'b11_0_10000 : cred1[38:20] = 19'b000_0000_0000_0000_0111;//16
5618'b11_0_10001 : cred1[38:20] = 19'b000_0000_0000_0000_0011;//17
5628'b11_0_10010 : cred1[38:20] = 19'b000_0000_0000_0000_0001;//18
563default : cred1[38:20] = 19'b0;
564endcase
565else cred1[38:20] = 19'b0;
566
567assign cred[77:0] = {cred1[38:0], cred0[38:0]};
568//assign cred[77:0] = 78'b0;
569
570
571//assign fuse_l2d_reset_00_buf = fuse_l2d_reset_00;
572//assign fuse_l2d_reset_01_buf = fuse_l2d_reset_01;
573
574
575
576
577endmodule
578
579
580//
581// or macro for ports = 2,3
582//
583//
584
585
586
587
588
589module n2_l2d_dmux78_cust_or_macro__ports_3__width_20 (
590 din0,
591 din1,
592 din2,
593 dout);
594 input [19:0] din0;
595 input [19:0] din1;
596 input [19:0] din2;
597 output [19:0] dout;
598
599
600
601
602
603
604or3 #(20) d0_0 (
605.in0(din0[19:0]),
606.in1(din1[19:0]),
607.in2(din2[19:0]),
608.out(dout[19:0])
609);
610
611
612
613
614
615
616
617
618
619endmodule
620
621
622
623
624
625//
626// or macro for ports = 2,3
627//
628//
629
630
631
632
633
634module n2_l2d_dmux78_cust_or_macro__ports_3__width_19 (
635 din0,
636 din1,
637 din2,
638 dout);
639 input [18:0] din0;
640 input [18:0] din1;
641 input [18:0] din2;
642 output [18:0] dout;
643
644
645
646
647
648
649or3 #(19) d0_0 (
650.in0(din0[18:0]),
651.in1(din1[18:0]),
652.in2(din2[18:0]),
653.out(dout[18:0])
654);
655
656
657
658
659
660
661
662
663
664endmodule
665
666
667
668