Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: fgu_fec_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 ============================================ | |
35 | module fgu_fec_ctl ( | |
36 | l2clk, | |
37 | scan_in, | |
38 | tcu_pce_ov, | |
39 | spc_aclk, | |
40 | spc_bclk, | |
41 | tcu_scan_en, | |
42 | tcu_se_scancollar_out, | |
43 | mbi_frf_read_en, | |
44 | mbi_wdata, | |
45 | mbi_run, | |
46 | fad_mbist_cmp64_fx1, | |
47 | lsu_asi_error_inject, | |
48 | scan_out, | |
49 | fad_nombi_w2_result_fw, | |
50 | fec_w1_ecc_inject_fb, | |
51 | fec_w2_synd_fw, | |
52 | fec_r1_ecc_fx1, | |
53 | fec_mbist_wdata_1f, | |
54 | fec_mbist_wdata_3f, | |
55 | main_clken, | |
56 | coreon_clken, | |
57 | fac_frf_r1_addr_e, | |
58 | fac_dec_valid_fx1, | |
59 | fac_fgx_pdist_fx1, | |
60 | fac_ecc_trap_en_fx1, | |
61 | fac_r1_vld_fx1, | |
62 | fac_r2_vld_fx1, | |
63 | fad_r1_byp_hit_fx1, | |
64 | fad_r2_byp_hit_fx1, | |
65 | fpc_frf_store_vld_fx1, | |
66 | dec_frf_r2_addr_d, | |
67 | dec_frf_r1_32b_d, | |
68 | dec_frf_r2_32b_d, | |
69 | dec_frf_r1_odd32b_d, | |
70 | dec_frf_r2_odd32b_d, | |
71 | dec_flush_f1, | |
72 | dec_flush_f2, | |
73 | tlu_flush_fgu_b, | |
74 | fad_rs1_fx1, | |
75 | fad_rs2_fx1, | |
76 | fad_i_parity_2e_fx1, | |
77 | fad_i_parity_2o_fx1, | |
78 | fad_i_parity_1e_fx1, | |
79 | fad_i_parity_1o_fx1, | |
80 | frf_r1_ecc_e, | |
81 | frf_r2_ecc_e, | |
82 | fgu_pdist_beat2_fx1, | |
83 | fgu_ecc_addr_fx2, | |
84 | fgu_ecc_check_fx2, | |
85 | fgu_cecc_fx2, | |
86 | fec_cecc_fx2, | |
87 | fgu_uecc_fx2, | |
88 | fec_uecc_fx2, | |
89 | fgu_fst_ecc_error_fx2, | |
90 | fgu_mbi_frf_fail); | |
91 | wire pce_ov; | |
92 | wire stop; | |
93 | wire siclk; | |
94 | wire soclk; | |
95 | wire se; | |
96 | wire l1clk_pm2; | |
97 | wire l1clk_pm1; | |
98 | wire l1clk_sc; | |
99 | wire spares_scanin; | |
100 | wire spares_scanout; | |
101 | wire rs1e_ecc_valid_fx1; | |
102 | wire rs1o_ecc_valid_fx1; | |
103 | wire rs2e_ecc_valid_fx1; | |
104 | wire rs2o_ecc_valid_fx1; | |
105 | wire frf_rs1_check_flops_e_fx1_scanin; | |
106 | wire frf_rs1_check_flops_e_fx1_scanout; | |
107 | wire [13:0] r1_ecc_check_fx1; | |
108 | wire [13:0] r2_ecc_check_fx1; | |
109 | wire [13:0] r1_ecc_check_fx2; | |
110 | wire [13:0] r2_ecc_check_fx2; | |
111 | wire frf_rs1_ecc_flops_e_fx1_scanin; | |
112 | wire frf_rs1_ecc_flops_e_fx1_scanout; | |
113 | wire pre_frf_fail; | |
114 | wire mbist_frf_read_en_3f; | |
115 | wire frf_rs2_ecc_flops_e_fx1_scanin; | |
116 | wire frf_rs2_ecc_flops_e_fx1_scanout; | |
117 | wire [13:0] r2_ecc_fx1; | |
118 | wire [31:0] d1e; | |
119 | wire [6:0] p1e; | |
120 | wire [31:0] d1o; | |
121 | wire [6:0] p1o; | |
122 | wire [31:0] d2e; | |
123 | wire [6:0] p2e; | |
124 | wire [31:0] d2o; | |
125 | wire [6:0] p2o; | |
126 | wire rs1_ue_or_ce_fx1; | |
127 | wire rs1e_ne; | |
128 | wire rs1o_ne; | |
129 | wire detect_ue_fx1; | |
130 | wire rs1e_ue; | |
131 | wire rs1o_ue; | |
132 | wire rs2e_ue; | |
133 | wire rs2o_ue; | |
134 | wire detect_ce_fx1; | |
135 | wire rs1e_ce; | |
136 | wire rs1o_ce; | |
137 | wire rs2e_ce; | |
138 | wire rs2o_ce; | |
139 | wire fst_ecc_error_fx1; | |
140 | wire addr_flops_scanin; | |
141 | wire addr_flops_scanout; | |
142 | wire [4:0] r2_addr_e; | |
143 | wire r1_32b_e; | |
144 | wire r2_32b_e; | |
145 | wire r1_odd32b_e; | |
146 | wire r2_odd32b_e; | |
147 | wire detect_ce_fx2; | |
148 | wire detect_ue_fx2; | |
149 | wire mbist_frf_read_en_1f; | |
150 | wire mbist_frf_read_en_2f; | |
151 | wire [7:0] mbist_wdata_2f; | |
152 | wire [5:0] r1_expanded_addr_fx1; | |
153 | wire [5:0] r2_expanded_addr_fx1; | |
154 | wire [4:0] r1_addr_fx1; | |
155 | wire [4:0] r2_addr_fx1; | |
156 | wire r1_32b_fx1; | |
157 | wire r2_32b_fx1; | |
158 | wire r1_odd32b_fx1; | |
159 | wire r2_odd32b_fx1; | |
160 | wire fgx_pdist_fx2; | |
161 | wire dec_valid_fx2; | |
162 | wire dec_flush_fx2; | |
163 | wire dec_flush_fx3; | |
164 | wire frf_store_vld_fx2; | |
165 | wire ecc_mask_global_en; | |
166 | wire ecc_mask_frf_en; | |
167 | wire [6:0] ecc_mask_data; | |
168 | wire ecc_trap_en_fx2; | |
169 | wire detect_ce_fx3; | |
170 | wire detect_ue_fx3; | |
171 | wire tlu_flush_fgu_fx3; | |
172 | wire i_pdist_beat2_fx2; | |
173 | wire mbist_run_1f; | |
174 | wire rs1_ue_or_ce_fx2; | |
175 | wire [5:0] r1_expanded_addr_fx2; | |
176 | wire [5:0] r2_expanded_addr_fx2; | |
177 | wire addr_flops2_scanin; | |
178 | wire addr_flops2_scanout; | |
179 | wire parity_1e; | |
180 | wire [5:0] q1e; | |
181 | wire parity_1o; | |
182 | wire [5:0] q1o; | |
183 | wire parity_2e; | |
184 | wire [5:0] q2e; | |
185 | wire parity_2o; | |
186 | wire [5:0] q2o; | |
187 | wire ce_ue_fec_flops_fx1_fx2_scanin; | |
188 | wire ce_ue_fec_flops_fx1_fx2_scanout; | |
189 | wire pdist_beat2_fx2; | |
190 | wire frf_rd_vld_fx2; | |
191 | wire [31:0] w2e; | |
192 | wire [6:0] s2e; | |
193 | wire [31:0] w2o; | |
194 | wire [6:0] s2o; | |
195 | ||
196 | ||
197 | // *** Global Inputs *** | |
198 | ||
199 | input l2clk; | |
200 | input scan_in; | |
201 | input tcu_pce_ov; // scan signals | |
202 | input spc_aclk; | |
203 | input spc_bclk; | |
204 | input tcu_scan_en; | |
205 | input tcu_se_scancollar_out; | |
206 | input mbi_frf_read_en; // MBIST | |
207 | input [7:0] mbi_wdata; // MBIST | |
208 | input mbi_run; // MBIST | |
209 | input fad_mbist_cmp64_fx1; // MBIST | |
210 | input [31:0] lsu_asi_error_inject; // [31]=global inject en, [24]=FRF inject en, [7:0]=mask | |
211 | ||
212 | output scan_out; | |
213 | ||
214 | // *** Generate ECC Local Inputs *** | |
215 | ||
216 | input [63:0] fad_nombi_w2_result_fw; // FRF w2 write data w/out mbist data muxed in | |
217 | ||
218 | // *** Generate ECC Local Outputs *** | |
219 | ||
220 | output [6:0] fec_w1_ecc_inject_fb; // ECC error injection | |
221 | output [13:0] fec_w2_synd_fw; // Generated ECC to FRF W2 port | |
222 | output [13:0] fec_r1_ecc_fx1; // ASI FRF ECC read data | |
223 | ||
224 | output [7:0] fec_mbist_wdata_1f; // MBIST | |
225 | output [7:0] fec_mbist_wdata_3f; // MBIST | |
226 | ||
227 | // *** Check ECC Inputs *** | |
228 | ||
229 | input main_clken; // main clken | |
230 | input coreon_clken; // controls all "free running" flops | |
231 | input [4:0] fac_frf_r1_addr_e; | |
232 | input fac_dec_valid_fx1; | |
233 | input fac_fgx_pdist_fx1; // PDIST | |
234 | input fac_ecc_trap_en_fx1; | |
235 | input [1:0] fac_r1_vld_fx1; // FRF r1 read valid (unqualified) | |
236 | input [1:0] fac_r2_vld_fx1; // FRF r2 read valid (unqualified) | |
237 | input fad_r1_byp_hit_fx1; // r1 is bypass data | |
238 | input fad_r2_byp_hit_fx1; // r2 is bypass data | |
239 | input fpc_frf_store_vld_fx1; | |
240 | ||
241 | input [4:0] dec_frf_r2_addr_d; | |
242 | input dec_frf_r1_32b_d; // FRF r1 is 32-bit source | |
243 | input dec_frf_r2_32b_d; // FRF r2 is 32-bit source | |
244 | input dec_frf_r1_odd32b_d; // FRF r1 is odd 32-bit source (32 LSBs) | |
245 | input dec_frf_r2_odd32b_d; // FRF r2 is odd 32-bit source (32 LSBs) (incl. STF,STDF) | |
246 | input dec_flush_f1; // flush fx2 (xmit in fx1/m) | |
247 | input dec_flush_f2; // flush fx3 (xmit in fx2/b) | |
248 | input tlu_flush_fgu_b; // flush fx3, non-load (xmit in fx2/b) | |
249 | ||
250 | input [63:0] fad_rs1_fx1; // Source register data bit | |
251 | input [63:0] fad_rs2_fx1; // - available at output of flop | |
252 | input fad_i_parity_2e_fx1; // partial ECC check (parity portion), rs2 even | |
253 | input fad_i_parity_2o_fx1; // partial ECC check (parity portion), rs2 odd | |
254 | input fad_i_parity_1e_fx1; // partial ECC check (parity portion), rs1 even | |
255 | input fad_i_parity_1o_fx1; // partial ECC check (parity portion), rs1 odd | |
256 | ||
257 | input [13:0] frf_r1_ecc_e; // Source register ECC bit | |
258 | input [13:0] frf_r2_ecc_e; // - NOTE: E stage signal | |
259 | // - need to be flopped to Fx1 | |
260 | // *** Global Outputs *** | |
261 | ||
262 | output fgu_pdist_beat2_fx1; | |
263 | output [5:0] fgu_ecc_addr_fx2; // FRF cecc/uecc address (6-bit reg number format) | |
264 | output [13:0] fgu_ecc_check_fx2; // FRF ECC check bits {even[6:0],odd[6:0]} | |
265 | output fgu_cecc_fx2; // Flag: detected correctable ECC error | |
266 | output fec_cecc_fx2; // Flag: detected correctable ECC error | |
267 | output fgu_uecc_fx2; // Flag: detected uncorrectable ECC error | |
268 | output fec_uecc_fx2; // Flag: detected uncorrectable ECC error | |
269 | output fgu_fst_ecc_error_fx2; // store float FRF ECC correctable/uncorrectable error | |
270 | ||
271 | output fgu_mbi_frf_fail; // MBIST | |
272 | ||
273 | // scan renames | |
274 | assign pce_ov = tcu_pce_ov; | |
275 | assign stop = 1'b0; | |
276 | assign siclk = spc_aclk; | |
277 | assign soclk = spc_bclk; | |
278 | assign se = tcu_scan_en; | |
279 | // end scan | |
280 | ||
281 | ||
282 | fgu_fec_ctl_l1clkhdr_ctl_macro clkgen_coreon ( | |
283 | .l2clk(l2clk), | |
284 | .l1en (coreon_clken), | |
285 | .l1clk(l1clk_pm2), | |
286 | .pce_ov(pce_ov), | |
287 | .stop(stop), | |
288 | .se(se) | |
289 | ); | |
290 | ||
291 | fgu_fec_ctl_l1clkhdr_ctl_macro clkgen_main ( | |
292 | .l2clk(l2clk), | |
293 | .l1en (main_clken), | |
294 | .l1clk(l1clk_pm1), | |
295 | .pce_ov(pce_ov), | |
296 | .stop(stop), | |
297 | .se(se) | |
298 | ); | |
299 | ||
300 | fgu_fec_ctl_l1clkhdr_ctl_macro clkgen_main_sco ( | |
301 | .l2clk(l2clk), | |
302 | .l1en (main_clken), | |
303 | .se (tcu_se_scancollar_out), | |
304 | .l1clk(l1clk_sc), | |
305 | .pce_ov(pce_ov), | |
306 | .stop(stop) | |
307 | ); | |
308 | ||
309 | fgu_fec_ctl_spare_ctl_macro__num_2 spares ( // spares: 13 gates + 1 flop for each "num" | |
310 | .scan_in(spares_scanin), | |
311 | .scan_out(spares_scanout), | |
312 | .l1clk(l1clk_pm2), | |
313 | .siclk(siclk), | |
314 | .soclk(soclk) | |
315 | ); | |
316 | ||
317 | ||
318 | ///////////////////////////////////////////////////////////////////////////// | |
319 | // ECC Error Dectection Logic | |
320 | //----------------------------- | |
321 | // - Regenerate ECC [5:0] and compare against retrived ECC | |
322 | // - Check ECC [6] with parity | |
323 | // - Outputs the result of the detection: | |
324 | // - ne: no error - either no valid data to check, | |
325 | // or ECC [6:0] all matched | |
326 | // - ce: correctable error | |
327 | // - parity is 1, so an odd number of bits flipped, | |
328 | // and ECC data is valid and regenerated ECC did not match | |
329 | // - ue: uncorrectable error | |
330 | // - parity is 0, so an even number of bits flipped, | |
331 | // and ECC data is valid and regenerated ECC did not match | |
332 | // - implies more than one bit was corrupted | |
333 | // | |
334 | // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
335 | // P0 P1 d0 P2 d1 d2 d3 P3 d4 d5 d6 d7 d8 d9 d10 P4 d11 d12 d13 | |
336 | // p0 = o x x x x x x x x x | |
337 | // p1 = o x x x x x x x x x | |
338 | // p2 = o x x x x x x x | |
339 | // p3 = o x x x x x x x | |
340 | // p4 = o x x x | |
341 | // p5 = | |
342 | // p6 = x x x x x x x x x | |
343 | // -------------------------------------------------------------------------------- | |
344 | // Total 1 1 3 1 3 3 3 1 3 3 3 3 3 3 5 1 3 3 3 | |
345 | // | |
346 | // 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
347 | // d14 d15 d16 d17 d18 d19 d20 d21 d22 d23 d24 d25 P5 d26 d27 d28 d29 d30 d31 | |
348 | // p0= x x x x x x x x x | |
349 | // p1= x x x x x x x x x | |
350 | // p2= x x x x x x x x x x x | |
351 | // p3= x x x x x x x x | |
352 | // p4= x x x x x x x x x x x x | |
353 | // p5= o x x x x x x | |
354 | // p6= x x x x x x x x x | |
355 | // -------------------------------------------------------------------------------- | |
356 | // Total 3 3 3 5 3 3 3 5 3 5 5 5 1 3 3 3 3 3 3 | |
357 | // | |
358 | ///////////////////////////////////////////////////////////////////////////// | |
359 | ||
360 | // Calculating valid ECCs to check | |
361 | // - (reading out of frf rs1 even word) & (rs1 is not bypass data) | |
362 | // - (reading out of frf rs1 odd word) & (rs1 is not bypass data) | |
363 | // - (reading out of frf rs2 even word) & (rs2 is not bypass data) | |
364 | // - (reading out of frf rs2 odd word) & (rs2 is not bypass data) | |
365 | // --------------------------------------------------- | |
366 | assign rs1e_ecc_valid_fx1 = fac_r1_vld_fx1[1] & ~fad_r1_byp_hit_fx1; | |
367 | assign rs1o_ecc_valid_fx1 = fac_r1_vld_fx1[0] & ~fad_r1_byp_hit_fx1; | |
368 | assign rs2e_ecc_valid_fx1 = fac_r2_vld_fx1[1] & ~fad_r2_byp_hit_fx1; | |
369 | assign rs2o_ecc_valid_fx1 = fac_r2_vld_fx1[0] & ~fad_r2_byp_hit_fx1; | |
370 | ||
371 | fgu_fec_ctl_msff_ctl_macro__width_28 frf_rs1_check_flops_e_fx1 ( | |
372 | .scan_in(frf_rs1_check_flops_e_fx1_scanin), | |
373 | .scan_out(frf_rs1_check_flops_e_fx1_scanout), | |
374 | .l1clk(l1clk_pm1), | |
375 | .din ({r1_ecc_check_fx1[13:0], r2_ecc_check_fx1[13:0]}), | |
376 | .dout ({r1_ecc_check_fx2[13:0], r2_ecc_check_fx2[13:0]}), | |
377 | .siclk(siclk), | |
378 | .soclk(soclk)); | |
379 | ||
380 | ||
381 | fgu_fec_ctl_msff_ctl_macro__width_14 frf_rs1_ecc_flops_e_fx1 ( | |
382 | .scan_in(frf_rs1_ecc_flops_e_fx1_scanin), | |
383 | .scan_out(frf_rs1_ecc_flops_e_fx1_scanout), | |
384 | .l1clk(l1clk_sc), | |
385 | .din (frf_r1_ecc_e [13:0]), | |
386 | .dout (fec_r1_ecc_fx1[13:0]), | |
387 | .siclk(siclk), | |
388 | .soclk(soclk)); | |
389 | ||
390 | assign pre_frf_fail = | |
391 | mbist_frf_read_en_3f & | |
392 | (~fad_mbist_cmp64_fx1 | | |
393 | ({fec_mbist_wdata_3f[6:0], fec_mbist_wdata_3f[6:0]} != fec_r1_ecc_fx1[13:0])); | |
394 | ||
395 | fgu_fec_ctl_msff_ctl_macro__width_14 frf_rs2_ecc_flops_e_fx1 ( | |
396 | .scan_in(frf_rs2_ecc_flops_e_fx1_scanin), | |
397 | .scan_out(frf_rs2_ecc_flops_e_fx1_scanout), | |
398 | .l1clk(l1clk_sc), | |
399 | .din (frf_r2_ecc_e [13:0] ), | |
400 | .dout ( r2_ecc_fx1[13:0] ), | |
401 | .siclk(siclk), | |
402 | .soclk(soclk)); | |
403 | ||
404 | ||
405 | // Rename nets for shorter expressions | |
406 | // ----------------------------------------- | |
407 | assign d1e[31:0] = fad_rs1_fx1[63:32]; | |
408 | assign p1e[ 6:0] = fec_r1_ecc_fx1[13:7]; | |
409 | ||
410 | assign d1o[31:0] = fad_rs1_fx1[31:0]; | |
411 | assign p1o[ 6:0] = fec_r1_ecc_fx1[ 6:0]; | |
412 | ||
413 | assign d2e[31:0] = fad_rs2_fx1[63:32]; | |
414 | assign p2e[ 6:0] = r2_ecc_fx1[13:7]; | |
415 | ||
416 | assign d2o[31:0] = fad_rs2_fx1[31:0]; | |
417 | assign p2o[ 6:0] = r2_ecc_fx1[ 6:0]; | |
418 | ||
419 | ||
420 | // Overall error detected flags | |
421 | // ----------------------------------------- | |
422 | ||
423 | // Priority: (1) rs1_ue (2) rs1_ce (3) rs2_ue (4) rs2_ce (5) rs3_ue (6) rs3_ce | |
424 | ||
425 | assign rs1_ue_or_ce_fx1 = ~(rs1e_ne & rs1o_ne); | |
426 | ||
427 | assign detect_ue_fx1 = | |
428 | ( (rs1e_ue | rs1o_ue)) | | |
429 | (~rs1_ue_or_ce_fx1 & (rs2e_ue | rs2o_ue)) ; | |
430 | ||
431 | assign detect_ce_fx1 = | |
432 | ( (rs1e_ce | rs1o_ce) & ~detect_ue_fx1) | | |
433 | (~rs1_ue_or_ce_fx1 & (rs2e_ce | rs2o_ce) & ~detect_ue_fx1) ; | |
434 | ||
435 | // Note: lsu doesn't care about qual w/ flush, store data is rs2 only, lsu doesn't care whether error is cecc or uecc | |
436 | assign fst_ecc_error_fx1 = | |
437 | fac_ecc_trap_en_fx1 & | |
438 | fpc_frf_store_vld_fx1 & | |
439 | (rs2e_ue | rs2o_ue | rs2e_ce | rs2o_ce); | |
440 | ||
441 | fgu_fec_ctl_msff_ctl_macro__width_76 addr_flops ( | |
442 | .scan_in(addr_flops_scanin), | |
443 | .scan_out(addr_flops_scanout), | |
444 | .l1clk(l1clk_pm1), | |
445 | .din ({fac_frf_r1_addr_e[4:0], | |
446 | r2_addr_e[4:0], | |
447 | r1_32b_e, | |
448 | r2_32b_e, | |
449 | r1_odd32b_e, | |
450 | r2_odd32b_e, | |
451 | fac_fgx_pdist_fx1, | |
452 | fac_dec_valid_fx1, | |
453 | dec_flush_f1, | |
454 | dec_flush_f2, | |
455 | fpc_frf_store_vld_fx1, | |
456 | lsu_asi_error_inject[31], | |
457 | lsu_asi_error_inject[24], | |
458 | lsu_asi_error_inject[6:0], | |
459 | fac_ecc_trap_en_fx1, | |
460 | detect_ce_fx2, | |
461 | detect_ue_fx2, | |
462 | tlu_flush_fgu_b, | |
463 | fgu_pdist_beat2_fx1, | |
464 | mbi_frf_read_en, | |
465 | mbi_wdata[7:0], | |
466 | mbi_run, | |
467 | mbist_frf_read_en_1f, | |
468 | mbist_frf_read_en_2f, | |
469 | fec_mbist_wdata_1f[7:0], | |
470 | mbist_wdata_2f[7:0], | |
471 | pre_frf_fail, | |
472 | fst_ecc_error_fx1, | |
473 | rs1_ue_or_ce_fx1, | |
474 | r1_expanded_addr_fx1[5:0], | |
475 | r2_expanded_addr_fx1[5:0]}), | |
476 | .dout ({ r1_addr_fx1[4:0], | |
477 | r2_addr_fx1[4:0], | |
478 | r1_32b_fx1, | |
479 | r2_32b_fx1, | |
480 | r1_odd32b_fx1, | |
481 | r2_odd32b_fx1, | |
482 | fgx_pdist_fx2, | |
483 | dec_valid_fx2, | |
484 | dec_flush_fx2, | |
485 | dec_flush_fx3, | |
486 | frf_store_vld_fx2, | |
487 | ecc_mask_global_en, | |
488 | ecc_mask_frf_en, | |
489 | ecc_mask_data[6:0], | |
490 | ecc_trap_en_fx2, | |
491 | detect_ce_fx3, | |
492 | detect_ue_fx3, | |
493 | tlu_flush_fgu_fx3, | |
494 | i_pdist_beat2_fx2, | |
495 | mbist_frf_read_en_1f, | |
496 | fec_mbist_wdata_1f[7:0], | |
497 | mbist_run_1f, | |
498 | mbist_frf_read_en_2f, | |
499 | mbist_frf_read_en_3f, | |
500 | mbist_wdata_2f[7:0], | |
501 | fec_mbist_wdata_3f[7:0], | |
502 | fgu_mbi_frf_fail, | |
503 | fgu_fst_ecc_error_fx2, | |
504 | rs1_ue_or_ce_fx2, | |
505 | r1_expanded_addr_fx2[5:0], | |
506 | r2_expanded_addr_fx2[5:0]}), | |
507 | .siclk(siclk), | |
508 | .soclk(soclk)); | |
509 | ||
510 | fgu_fec_ctl_msff_ctl_macro__width_9 addr_flops2 ( | |
511 | .scan_in(addr_flops2_scanin), | |
512 | .scan_out(addr_flops2_scanout), | |
513 | .l1clk(l1clk_pm2), | |
514 | .din ({dec_frf_r2_addr_d[4:0], // requires free running clk or dec_fgu_decode_d en | |
515 | dec_frf_r1_32b_d, // requires free running clk or dec_fgu_decode_d en | |
516 | dec_frf_r2_32b_d, // requires free running clk or dec_fgu_decode_d en | |
517 | dec_frf_r1_odd32b_d, // requires free running clk or dec_fgu_decode_d en | |
518 | dec_frf_r2_odd32b_d}), // requires free running clk or dec_fgu_decode_d en | |
519 | .dout ({ r2_addr_e[4:0], | |
520 | r1_32b_e, | |
521 | r2_32b_e, | |
522 | r1_odd32b_e, | |
523 | r2_odd32b_e}), | |
524 | .siclk(siclk), | |
525 | .soclk(soclk)); | |
526 | ||
527 | assign r1_expanded_addr_fx1[5:0] = // expand addr to 6-bit reg number | |
528 | ({6{ r1_32b_fx1}} & {1'b0, r1_addr_fx1[3:0], r1_odd32b_fx1}) | | |
529 | ({6{~r1_32b_fx1}} & { r1_addr_fx1[4:0], 1'b0 }) ; | |
530 | ||
531 | assign r2_expanded_addr_fx1[5:0] = // expand addr to 6-bit reg number | |
532 | ({6{ r2_32b_fx1}} & {1'b0, r2_addr_fx1[3:0], r2_odd32b_fx1}) | | |
533 | ({6{~r2_32b_fx1}} & { r2_addr_fx1[4:0], 1'b0 }) ; | |
534 | ||
535 | assign r1_ecc_check_fx1[13:0] = {parity_1e, q1e[5:0], parity_1o, q1o[5:0]}; | |
536 | assign r2_ecc_check_fx1[13:0] = {parity_2e, q2e[5:0], parity_2o, q2o[5:0]}; | |
537 | ||
538 | assign fgu_pdist_beat2_fx1 = | |
539 | dec_valid_fx2 & | |
540 | fgx_pdist_fx2 & | |
541 | ~dec_flush_fx2; | |
542 | ||
543 | fgu_fec_ctl_msff_ctl_macro__width_2 ce_ue_fec_flops_fx1_fx2 ( | |
544 | .scan_in(ce_ue_fec_flops_fx1_fx2_scanin), | |
545 | .scan_out(ce_ue_fec_flops_fx1_fx2_scanout), | |
546 | .l1clk(l1clk_pm1), | |
547 | .din ({detect_ce_fx1, detect_ue_fx1}), | |
548 | .dout ({detect_ce_fx2, detect_ue_fx2}), | |
549 | .siclk(siclk), | |
550 | .soclk(soclk)); | |
551 | ||
552 | assign pdist_beat2_fx2 = i_pdist_beat2_fx2 & ~tlu_flush_fgu_fx3 & ~dec_flush_fx3; | |
553 | ||
554 | assign frf_rd_vld_fx2 = (dec_valid_fx2 | frf_store_vld_fx2) & ~dec_flush_fx2; // this eq. prevents FRF_ECC ASI diagnositc read from asserting fgu_{u,c}ecc_fx2 | |
555 | ||
556 | // For single source (or no source) fgu ops that read frf | |
557 | // ensure that unneeded frf read port isn't enabled by DEC | |
558 | // Note: | |
559 | // dec_frf_store_d, dec_fsr_store_d have rs2 only | |
560 | // 0in custom -fire (fpc_frf_store_vld_fx1 & (|fac_r1_vld_fx1[1:0])) -message "Invalid FRF rs1 read enable during store" | |
561 | ||
562 | assign fgu_cecc_fx2 = | |
563 | ecc_trap_en_fx2 & | |
564 | ((~pdist_beat2_fx2 & detect_ce_fx2 & frf_rd_vld_fx2 ) | | |
565 | ( pdist_beat2_fx2 & detect_ce_fx2 & ~(detect_ce_fx3 | detect_ue_fx3)) ); // pdist 2nd beat | |
566 | ||
567 | assign fec_cecc_fx2 = fgu_cecc_fx2; // for timing, isolate internal fgu sinks from external sinks | |
568 | ||
569 | assign fgu_uecc_fx2 = | |
570 | ecc_trap_en_fx2 & | |
571 | ((~pdist_beat2_fx2 & detect_ue_fx2 & frf_rd_vld_fx2 ) | | |
572 | ( pdist_beat2_fx2 & detect_ue_fx2 & ~(detect_ce_fx3 | detect_ue_fx3)) ); // pdist 2nd beat | |
573 | ||
574 | assign fec_uecc_fx2 = fgu_uecc_fx2; // for timing, isolate internal fgu sinks from external sinks | |
575 | ||
576 | assign fgu_ecc_addr_fx2[5:0] = | |
577 | ({6{ rs1_ue_or_ce_fx2}} & r1_expanded_addr_fx2[5:0]) | | |
578 | ({6{~rs1_ue_or_ce_fx2}} & r2_expanded_addr_fx2[5:0]) ; | |
579 | ||
580 | assign fgu_ecc_check_fx2[13:0] = | |
581 | ({14{ rs1_ue_or_ce_fx2}} & r1_ecc_check_fx2[13:0]) | | |
582 | ({14{~rs1_ue_or_ce_fx2}} & r2_ecc_check_fx2[13:0]) ; | |
583 | ||
584 | // 0in one_hot -var {rs1e_ne,rs1e_ce,rs1e_ue} | |
585 | // 0in one_hot -var {rs1o_ne,rs1o_ce,rs1o_ue} | |
586 | // 0in bits_on -max 1 -var {rs2e_ce,rs2e_ue} | |
587 | // 0in bits_on -max 1 -var {rs2o_ce,rs2o_ue} | |
588 | ||
589 | // Detection for RS1 even part [63:32] | |
590 | // ----------------------------------- | |
591 | ||
592 | assign rs1e_ne = ~rs1e_ecc_valid_fx1 | | |
593 | ~(parity_1e | q1e[5] | q1e[4] | q1e[3] | q1e[2] | q1e[1] | q1e[0]); | |
594 | ||
595 | assign rs1e_ce = rs1e_ecc_valid_fx1 & parity_1e; | |
596 | ||
597 | assign rs1e_ue = rs1e_ecc_valid_fx1 & ~parity_1e & | |
598 | (q1e[5] | q1e[4] | q1e[3] | q1e[2] | q1e[1] | q1e[0]); | |
599 | ||
600 | assign q1e[0] = d1e[0] ^ d1e[1] ^ d1e[3] ^ d1e[4] ^ d1e[6] | |
601 | ^ d1e[8] ^ d1e[10] ^ d1e[11] ^ d1e[13] ^ d1e[15] | |
602 | ^ d1e[17] ^ d1e[19] ^ d1e[21] ^ d1e[23] ^ d1e[25] | |
603 | ^ d1e[26] ^ d1e[28] ^ d1e[30] ^ p1e[0]; | |
604 | ||
605 | assign q1e[1] = d1e[0] ^ d1e[2] ^ d1e[3] ^ d1e[5] ^ d1e[6] | |
606 | ^ d1e[9] ^ d1e[10] ^ d1e[12] ^ d1e[13] ^ d1e[16] | |
607 | ^ d1e[17] ^ d1e[20] ^ d1e[21] ^ d1e[24] ^ d1e[25] | |
608 | ^ d1e[27] ^ d1e[28] ^ d1e[31] ^ p1e[1]; | |
609 | ||
610 | assign q1e[2] = d1e[1] ^ d1e[2] ^ d1e[3] ^ d1e[7] ^ d1e[8] | |
611 | ^ d1e[9] ^ d1e[10] ^ d1e[14] ^ d1e[15] ^ d1e[16] | |
612 | ^ d1e[17] ^ d1e[22] ^ d1e[23] ^ d1e[24] ^ d1e[25] | |
613 | ^ d1e[29] ^ d1e[30] ^ d1e[31] ^ p1e[2]; | |
614 | ||
615 | assign q1e[3] = d1e[4] ^ d1e[5] ^ d1e[6] ^ d1e[7] ^ d1e[8] | |
616 | ^ d1e[9] ^ d1e[10] ^ d1e[18] ^ d1e[19] ^ d1e[20] | |
617 | ^ d1e[21] ^ d1e[22] ^ d1e[23] ^ d1e[24] ^ d1e[25] | |
618 | ^ p1e[3]; | |
619 | ||
620 | assign q1e[4] = d1e[11] ^ d1e[12] ^ d1e[13] ^ d1e[14] ^ d1e[15] | |
621 | ^ d1e[16] ^ d1e[17] ^ d1e[18] ^ d1e[19] ^ d1e[20] | |
622 | ^ d1e[21] ^ d1e[22] ^ d1e[23] ^ d1e[24] ^ d1e[25] | |
623 | ^ p1e[4]; | |
624 | ||
625 | assign q1e[5] = d1e[26] ^ d1e[27] ^ d1e[28] ^ d1e[29] ^ d1e[30] ^ d1e[31] | |
626 | ^ p1e[5]; | |
627 | ||
628 | assign parity_1e = fad_i_parity_1e_fx1 ^ p1e[0] ^ p1e[1] ^ p1e[2] ^ p1e[3] ^ p1e[4] ^ p1e[5] ^ p1e[6]; | |
629 | ||
630 | ||
631 | // Detection for RS1 odd part [31:00] | |
632 | // ----------------------------------- | |
633 | ||
634 | assign rs1o_ne = ~rs1o_ecc_valid_fx1 | | |
635 | ~(parity_1o | q1o[5] | q1o[4] | q1o[3] | q1o[2] | q1o[1] | q1o[0]); | |
636 | ||
637 | assign rs1o_ce = rs1o_ecc_valid_fx1 & parity_1o; | |
638 | ||
639 | assign rs1o_ue = rs1o_ecc_valid_fx1 & ~parity_1o & | |
640 | (q1o[5] | q1o[4] | q1o[3] | q1o[2] | q1o[1] | q1o[0]); | |
641 | ||
642 | assign q1o[0] = d1o[0] ^ d1o[1] ^ d1o[3] ^ d1o[4] ^ d1o[6] | |
643 | ^ d1o[8] ^ d1o[10] ^ d1o[11] ^ d1o[13] ^ d1o[15] | |
644 | ^ d1o[17] ^ d1o[19] ^ d1o[21] ^ d1o[23] ^ d1o[25] | |
645 | ^ d1o[26] ^ d1o[28] ^ d1o[30] ^ p1o[0]; | |
646 | ||
647 | assign q1o[1] = d1o[0] ^ d1o[2] ^ d1o[3] ^ d1o[5] ^ d1o[6] | |
648 | ^ d1o[9] ^ d1o[10] ^ d1o[12] ^ d1o[13] ^ d1o[16] | |
649 | ^ d1o[17] ^ d1o[20] ^ d1o[21] ^ d1o[24] ^ d1o[25] | |
650 | ^ d1o[27] ^ d1o[28] ^ d1o[31] ^ p1o[1]; | |
651 | ||
652 | assign q1o[2] = d1o[1] ^ d1o[2] ^ d1o[3] ^ d1o[7] ^ d1o[8] | |
653 | ^ d1o[9] ^ d1o[10] ^ d1o[14] ^ d1o[15] ^ d1o[16] | |
654 | ^ d1o[17] ^ d1o[22] ^ d1o[23] ^ d1o[24] ^ d1o[25] | |
655 | ^ d1o[29] ^ d1o[30] ^ d1o[31] ^ p1o[2]; | |
656 | ||
657 | assign q1o[3] = d1o[4] ^ d1o[5] ^ d1o[6] ^ d1o[7] ^ d1o[8] | |
658 | ^ d1o[9] ^ d1o[10] ^ d1o[18] ^ d1o[19] ^ d1o[20] | |
659 | ^ d1o[21] ^ d1o[22] ^ d1o[23] ^ d1o[24] ^ d1o[25] | |
660 | ^ p1o[3]; | |
661 | ||
662 | assign q1o[4] = d1o[11] ^ d1o[12] ^ d1o[13] ^ d1o[14] ^ d1o[15] | |
663 | ^ d1o[16] ^ d1o[17] ^ d1o[18] ^ d1o[19] ^ d1o[20] | |
664 | ^ d1o[21] ^ d1o[22] ^ d1o[23] ^ d1o[24] ^ d1o[25] | |
665 | ^ p1o[4]; | |
666 | ||
667 | assign q1o[5] = d1o[26] ^ d1o[27] ^ d1o[28] ^ d1o[29] ^ d1o[30] ^ d1o[31] | |
668 | ^ p1o[5]; | |
669 | ||
670 | assign parity_1o = fad_i_parity_1o_fx1 ^ p1o[0] ^ p1o[1] ^ p1o[2] ^ p1o[3] ^ p1o[4] ^ p1o[5] ^ p1o[6]; | |
671 | ||
672 | ||
673 | // Detection for RS2 even part [63:32] | |
674 | // ----------------------------------- | |
675 | ||
676 | assign rs2e_ce = rs2e_ecc_valid_fx1 & parity_2e; | |
677 | ||
678 | assign rs2e_ue = rs2e_ecc_valid_fx1 & ~parity_2e & | |
679 | (q2e[5] | q2e[4] | q2e[3] | q2e[2] | q2e[1] | q2e[0]); | |
680 | ||
681 | assign q2e[0] = d2e[0] ^ d2e[1] ^ d2e[3] ^ d2e[4] ^ d2e[6] | |
682 | ^ d2e[8] ^ d2e[10] ^ d2e[11] ^ d2e[13] ^ d2e[15] | |
683 | ^ d2e[17] ^ d2e[19] ^ d2e[21] ^ d2e[23] ^ d2e[25] | |
684 | ^ d2e[26] ^ d2e[28] ^ d2e[30] ^ p2e[0]; | |
685 | ||
686 | assign q2e[1] = d2e[0] ^ d2e[2] ^ d2e[3] ^ d2e[5] ^ d2e[6] | |
687 | ^ d2e[9] ^ d2e[10] ^ d2e[12] ^ d2e[13] ^ d2e[16] | |
688 | ^ d2e[17] ^ d2e[20] ^ d2e[21] ^ d2e[24] ^ d2e[25] | |
689 | ^ d2e[27] ^ d2e[28] ^ d2e[31] ^ p2e[1]; | |
690 | ||
691 | assign q2e[2] = d2e[1] ^ d2e[2] ^ d2e[3] ^ d2e[7] ^ d2e[8] | |
692 | ^ d2e[9] ^ d2e[10] ^ d2e[14] ^ d2e[15] ^ d2e[16] | |
693 | ^ d2e[17] ^ d2e[22] ^ d2e[23] ^ d2e[24] ^ d2e[25] | |
694 | ^ d2e[29] ^ d2e[30] ^ d2e[31] ^ p2e[2]; | |
695 | ||
696 | assign q2e[3] = d2e[4] ^ d2e[5] ^ d2e[6] ^ d2e[7] ^ d2e[8] | |
697 | ^ d2e[9] ^ d2e[10] ^ d2e[18] ^ d2e[19] ^ d2e[20] | |
698 | ^ d2e[21] ^ d2e[22] ^ d2e[23] ^ d2e[24] ^ d2e[25] | |
699 | ^ p2e[3]; | |
700 | ||
701 | assign q2e[4] = d2e[11] ^ d2e[12] ^ d2e[13] ^ d2e[14] ^ d2e[15] | |
702 | ^ d2e[16] ^ d2e[17] ^ d2e[18] ^ d2e[19] ^ d2e[20] | |
703 | ^ d2e[21] ^ d2e[22] ^ d2e[23] ^ d2e[24] ^ d2e[25] | |
704 | ^ p2e[4]; | |
705 | ||
706 | assign q2e[5] = d2e[26] ^ d2e[27] ^ d2e[28] ^ d2e[29] ^ d2e[30] ^ d2e[31] | |
707 | ^ p2e[5]; | |
708 | ||
709 | assign parity_2e = fad_i_parity_2e_fx1 ^ p2e[0] ^ p2e[1] ^ p2e[2] ^ p2e[3] ^ p2e[4] ^ p2e[5] ^ p2e[6]; | |
710 | ||
711 | ||
712 | // Detection for RS2 odd part [31:00] | |
713 | // ----------------------------------- | |
714 | ||
715 | assign rs2o_ce = rs2o_ecc_valid_fx1 & parity_2o; | |
716 | ||
717 | assign rs2o_ue = rs2o_ecc_valid_fx1 & ~parity_2o & | |
718 | (q2o[5] | q2o[4] | q2o[3] | q2o[2] | q2o[1] | q2o[0]); | |
719 | ||
720 | assign q2o[0] = d2o[0] ^ d2o[1] ^ d2o[3] ^ d2o[4] ^ d2o[6] | |
721 | ^ d2o[8] ^ d2o[10] ^ d2o[11] ^ d2o[13] ^ d2o[15] | |
722 | ^ d2o[17] ^ d2o[19] ^ d2o[21] ^ d2o[23] ^ d2o[25] | |
723 | ^ d2o[26] ^ d2o[28] ^ d2o[30] ^ p2o[0]; | |
724 | ||
725 | assign q2o[1] = d2o[0] ^ d2o[2] ^ d2o[3] ^ d2o[5] ^ d2o[6] | |
726 | ^ d2o[9] ^ d2o[10] ^ d2o[12] ^ d2o[13] ^ d2o[16] | |
727 | ^ d2o[17] ^ d2o[20] ^ d2o[21] ^ d2o[24] ^ d2o[25] | |
728 | ^ d2o[27] ^ d2o[28] ^ d2o[31] ^ p2o[1]; | |
729 | ||
730 | assign q2o[2] = d2o[1] ^ d2o[2] ^ d2o[3] ^ d2o[7] ^ d2o[8] | |
731 | ^ d2o[9] ^ d2o[10] ^ d2o[14] ^ d2o[15] ^ d2o[16] | |
732 | ^ d2o[17] ^ d2o[22] ^ d2o[23] ^ d2o[24] ^ d2o[25] | |
733 | ^ d2o[29] ^ d2o[30] ^ d2o[31] ^ p2o[2]; | |
734 | ||
735 | assign q2o[3] = d2o[4] ^ d2o[5] ^ d2o[6] ^ d2o[7] ^ d2o[8] | |
736 | ^ d2o[9] ^ d2o[10] ^ d2o[18] ^ d2o[19] ^ d2o[20] | |
737 | ^ d2o[21] ^ d2o[22] ^ d2o[23] ^ d2o[24] ^ d2o[25] | |
738 | ^ p2o[3]; | |
739 | ||
740 | assign q2o[4] = d2o[11] ^ d2o[12] ^ d2o[13] ^ d2o[14] ^ d2o[15] | |
741 | ^ d2o[16] ^ d2o[17] ^ d2o[18] ^ d2o[19] ^ d2o[20] | |
742 | ^ d2o[21] ^ d2o[22] ^ d2o[23] ^ d2o[24] ^ d2o[25] | |
743 | ^ p2o[4]; | |
744 | ||
745 | assign q2o[5] = d2o[26] ^ d2o[27] ^ d2o[28] ^ d2o[29] ^ d2o[30] ^ d2o[31] | |
746 | ^ p2o[5]; | |
747 | ||
748 | assign parity_2o = fad_i_parity_2o_fx1 ^ p2o[0] ^ p2o[1] ^ p2o[2] ^ p2o[3] ^ p2o[4] ^ p2o[5] ^ p2o[6]; | |
749 | ||
750 | ||
751 | ///////////////////////////////////////////////////////////////////////////// | |
752 | //*************************************************************************** | |
753 | //***** ECC Generation ****************************************************** | |
754 | //*************************************************************************** | |
755 | ///////////////////////////////////////////////////////////////////////////// | |
756 | // W2 ECC Generation | |
757 | //----------------------------------- | |
758 | // - Encode the two 32-bit write data into two 7-bit Error Correction Code | |
759 | // - Trying to do encoding in one phase: | |
760 | // - FRF write happens in phase 2 of write stage | |
761 | // - If ECC takes longer than phase 1 of write stage, it could spill | |
762 | // over to phase 2 of the stage before write. | |
763 | // - W1 ECC generation is performed in FAD | |
764 | // | |
765 | ///////////////////////////////////////////////////////////////////////////// | |
766 | ||
767 | assign fec_w1_ecc_inject_fb[6:0] = ({7{ecc_mask_global_en & ecc_mask_frf_en}} & ecc_mask_data[6:0]); | |
768 | ||
769 | // W2 port even word [63:32] ECC Generation | |
770 | // ======================================== | |
771 | assign w2e[31:0] = fad_nombi_w2_result_fw[63:32]; | |
772 | assign fec_w2_synd_fw[13:7] = | |
773 | (s2e[6:0] & {7{~mbist_run_1f}}) ^ | |
774 | (({7{ecc_mask_global_en & ecc_mask_frf_en & ~mbist_run_1f}} & ecc_mask_data[6:0] ) | | |
775 | ({7{ mbist_run_1f}} & fec_mbist_wdata_1f[6:0]) ); | |
776 | ||
777 | assign s2e[0] = w2e[0] ^ w2e[1] ^ w2e[3] ^ w2e[4] ^ w2e[6] | |
778 | ^ w2e[8] ^ w2e[10] ^ w2e[11] ^ w2e[13] ^ w2e[15] | |
779 | ^ w2e[17] ^ w2e[19] ^ w2e[21] ^ w2e[23] ^ w2e[25] | |
780 | ^ w2e[26] ^ w2e[28] ^ w2e[30]; | |
781 | ||
782 | assign s2e[1] = w2e[0] ^ w2e[2] ^ w2e[3] ^ w2e[5] ^ w2e[6] | |
783 | ^ w2e[9] ^ w2e[10] ^ w2e[12] ^ w2e[13] ^ w2e[16] | |
784 | ^ w2e[17] ^ w2e[20] ^ w2e[21] ^ w2e[24] ^ w2e[25] | |
785 | ^ w2e[27] ^ w2e[28] ^ w2e[31]; | |
786 | ||
787 | assign s2e[2] = w2e[1] ^ w2e[2] ^ w2e[3] ^ w2e[7] ^ w2e[8] | |
788 | ^ w2e[9] ^ w2e[10] ^ w2e[14] ^ w2e[15] ^ w2e[16] | |
789 | ^ w2e[17] ^ w2e[22] ^ w2e[23] ^ w2e[24] ^ w2e[25] | |
790 | ^ w2e[29] ^ w2e[30] ^ w2e[31]; | |
791 | ||
792 | assign s2e[3] = w2e[4] ^ w2e[5] ^ w2e[6] ^ w2e[7] ^ w2e[8] | |
793 | ^ w2e[9] ^ w2e[10] ^ w2e[18] ^ w2e[19] ^ w2e[20] | |
794 | ^ w2e[21] ^ w2e[22] ^ w2e[23] ^ w2e[24] ^ w2e[25]; | |
795 | ||
796 | assign s2e[4] = w2e[11] ^ w2e[12] ^ w2e[13] ^ w2e[14] ^ w2e[15] | |
797 | ^ w2e[16] ^ w2e[17] ^ w2e[18] ^ w2e[19] ^ w2e[20] | |
798 | ^ w2e[21] ^ w2e[22] ^ w2e[23] ^ w2e[24] ^ w2e[25]; | |
799 | ||
800 | assign s2e[5] = w2e[26] ^ w2e[27] ^ w2e[28] ^ w2e[29] ^ w2e[30] ^ w2e[31]; | |
801 | ||
802 | assign s2e[6] = w2e[0] ^ w2e[1] ^ w2e[2] ^ w2e[4] ^ w2e[5] | |
803 | ^ w2e[7] ^ w2e[10] ^ w2e[11] ^ w2e[12] ^ w2e[14] | |
804 | ^ w2e[17] ^ w2e[18] ^ w2e[21] ^ w2e[23] ^ w2e[24] | |
805 | ^ w2e[26] ^ w2e[27] ^ w2e[29]; | |
806 | ||
807 | ||
808 | // W2 port odd word [31:00] ECC Generation | |
809 | // ======================================== | |
810 | assign w2o[31:0] = fad_nombi_w2_result_fw[31:0]; | |
811 | assign fec_w2_synd_fw[6:0] = | |
812 | (s2o[6:0] & {7{~mbist_run_1f}}) ^ | |
813 | (({7{ecc_mask_global_en & ecc_mask_frf_en & ~mbist_run_1f}} & ecc_mask_data[6:0] ) | | |
814 | ({7{ mbist_run_1f}} & fec_mbist_wdata_1f[6:0]) ); | |
815 | ||
816 | assign s2o[0] = w2o[0] ^ w2o[1] ^ w2o[3] ^ w2o[4] ^ w2o[6] | |
817 | ^ w2o[8] ^ w2o[10] ^ w2o[11] ^ w2o[13] ^ w2o[15] | |
818 | ^ w2o[17] ^ w2o[19] ^ w2o[21] ^ w2o[23] ^ w2o[25] | |
819 | ^ w2o[26] ^ w2o[28] ^ w2o[30]; | |
820 | ||
821 | assign s2o[1] = w2o[0] ^ w2o[2] ^ w2o[3] ^ w2o[5] ^ w2o[6] | |
822 | ^ w2o[9] ^ w2o[10] ^ w2o[12] ^ w2o[13] ^ w2o[16] | |
823 | ^ w2o[17] ^ w2o[20] ^ w2o[21] ^ w2o[24] ^ w2o[25] | |
824 | ^ w2o[27] ^ w2o[28] ^ w2o[31]; | |
825 | ||
826 | assign s2o[2] = w2o[1] ^ w2o[2] ^ w2o[3] ^ w2o[7] ^ w2o[8] | |
827 | ^ w2o[9] ^ w2o[10] ^ w2o[14] ^ w2o[15] ^ w2o[16] | |
828 | ^ w2o[17] ^ w2o[22] ^ w2o[23] ^ w2o[24] ^ w2o[25] | |
829 | ^ w2o[29] ^ w2o[30] ^ w2o[31]; | |
830 | ||
831 | assign s2o[3] = w2o[4] ^ w2o[5] ^ w2o[6] ^ w2o[7] ^ w2o[8] | |
832 | ^ w2o[9] ^ w2o[10] ^ w2o[18] ^ w2o[19] ^ w2o[20] | |
833 | ^ w2o[21] ^ w2o[22] ^ w2o[23] ^ w2o[24] ^ w2o[25]; | |
834 | ||
835 | assign s2o[4] = w2o[11] ^ w2o[12] ^ w2o[13] ^ w2o[14] ^ w2o[15] | |
836 | ^ w2o[16] ^ w2o[17] ^ w2o[18] ^ w2o[19] ^ w2o[20] | |
837 | ^ w2o[21] ^ w2o[22] ^ w2o[23] ^ w2o[24] ^ w2o[25]; | |
838 | ||
839 | assign s2o[5] = w2o[26] ^ w2o[27] ^ w2o[28] ^ w2o[29] ^ w2o[30] ^ w2o[31]; | |
840 | ||
841 | assign s2o[6] = w2o[0] ^ w2o[1] ^ w2o[2] ^ w2o[4] ^ w2o[5] | |
842 | ^ w2o[7] ^ w2o[10] ^ w2o[11] ^ w2o[12] ^ w2o[14] | |
843 | ^ w2o[17] ^ w2o[18] ^ w2o[21] ^ w2o[23] ^ w2o[24] | |
844 | ^ w2o[26] ^ w2o[27] ^ w2o[29]; | |
845 | ||
846 | ||
847 | supply0 vss; | |
848 | supply1 vdd; | |
849 | // fixscan start: | |
850 | assign spares_scanin = scan_in ; | |
851 | assign frf_rs1_check_flops_e_fx1_scanin = spares_scanout ; | |
852 | assign frf_rs1_ecc_flops_e_fx1_scanin = frf_rs1_check_flops_e_fx1_scanout; | |
853 | assign frf_rs2_ecc_flops_e_fx1_scanin = frf_rs1_ecc_flops_e_fx1_scanout; | |
854 | assign addr_flops_scanin = frf_rs2_ecc_flops_e_fx1_scanout; | |
855 | assign addr_flops2_scanin = addr_flops_scanout ; | |
856 | assign ce_ue_fec_flops_fx1_fx2_scanin = addr_flops2_scanout ; | |
857 | assign scan_out = ce_ue_fec_flops_fx1_fx2_scanout; | |
858 | // fixscan end: | |
859 | endmodule // fgu_fec_ctl | |
860 | ||
861 | ||
862 | ||
863 | ||
864 | ||
865 | ||
866 | // any PARAMS parms go into naming of macro | |
867 | ||
868 | module fgu_fec_ctl_l1clkhdr_ctl_macro ( | |
869 | l2clk, | |
870 | l1en, | |
871 | pce_ov, | |
872 | stop, | |
873 | se, | |
874 | l1clk); | |
875 | ||
876 | ||
877 | input l2clk; | |
878 | input l1en; | |
879 | input pce_ov; | |
880 | input stop; | |
881 | input se; | |
882 | output l1clk; | |
883 | ||
884 | ||
885 | ||
886 | ||
887 | ||
888 | cl_sc1_l1hdr_8x c_0 ( | |
889 | ||
890 | ||
891 | .l2clk(l2clk), | |
892 | .pce(l1en), | |
893 | .l1clk(l1clk), | |
894 | .se(se), | |
895 | .pce_ov(pce_ov), | |
896 | .stop(stop) | |
897 | ); | |
898 | ||
899 | ||
900 | ||
901 | endmodule | |
902 | ||
903 | ||
904 | ||
905 | ||
906 | ||
907 | ||
908 | ||
909 | ||
910 | ||
911 | // Description: Spare gate macro for control blocks | |
912 | // | |
913 | // Param num controls the number of times the macro is added | |
914 | // flops=0 can be used to use only combination spare logic | |
915 | ||
916 | ||
917 | module fgu_fec_ctl_spare_ctl_macro__num_2 ( | |
918 | l1clk, | |
919 | scan_in, | |
920 | siclk, | |
921 | soclk, | |
922 | scan_out); | |
923 | wire si_0; | |
924 | wire so_0; | |
925 | wire spare0_flop_unused; | |
926 | wire spare0_buf_32x_unused; | |
927 | wire spare0_nand3_8x_unused; | |
928 | wire spare0_inv_8x_unused; | |
929 | wire spare0_aoi22_4x_unused; | |
930 | wire spare0_buf_8x_unused; | |
931 | wire spare0_oai22_4x_unused; | |
932 | wire spare0_inv_16x_unused; | |
933 | wire spare0_nand2_16x_unused; | |
934 | wire spare0_nor3_4x_unused; | |
935 | wire spare0_nand2_8x_unused; | |
936 | wire spare0_buf_16x_unused; | |
937 | wire spare0_nor2_16x_unused; | |
938 | wire spare0_inv_32x_unused; | |
939 | wire si_1; | |
940 | wire so_1; | |
941 | wire spare1_flop_unused; | |
942 | wire spare1_buf_32x_unused; | |
943 | wire spare1_nand3_8x_unused; | |
944 | wire spare1_inv_8x_unused; | |
945 | wire spare1_aoi22_4x_unused; | |
946 | wire spare1_buf_8x_unused; | |
947 | wire spare1_oai22_4x_unused; | |
948 | wire spare1_inv_16x_unused; | |
949 | wire spare1_nand2_16x_unused; | |
950 | wire spare1_nor3_4x_unused; | |
951 | wire spare1_nand2_8x_unused; | |
952 | wire spare1_buf_16x_unused; | |
953 | wire spare1_nor2_16x_unused; | |
954 | wire spare1_inv_32x_unused; | |
955 | ||
956 | ||
957 | input l1clk; | |
958 | input scan_in; | |
959 | input siclk; | |
960 | input soclk; | |
961 | output scan_out; | |
962 | ||
963 | cl_sc1_msff_8x spare0_flop (.l1clk(l1clk), | |
964 | .siclk(siclk), | |
965 | .soclk(soclk), | |
966 | .si(si_0), | |
967 | .so(so_0), | |
968 | .d(1'b0), | |
969 | .q(spare0_flop_unused)); | |
970 | assign si_0 = scan_in; | |
971 | ||
972 | cl_u1_buf_32x spare0_buf_32x (.in(1'b1), | |
973 | .out(spare0_buf_32x_unused)); | |
974 | cl_u1_nand3_8x spare0_nand3_8x (.in0(1'b1), | |
975 | .in1(1'b1), | |
976 | .in2(1'b1), | |
977 | .out(spare0_nand3_8x_unused)); | |
978 | cl_u1_inv_8x spare0_inv_8x (.in(1'b1), | |
979 | .out(spare0_inv_8x_unused)); | |
980 | cl_u1_aoi22_4x spare0_aoi22_4x (.in00(1'b1), | |
981 | .in01(1'b1), | |
982 | .in10(1'b1), | |
983 | .in11(1'b1), | |
984 | .out(spare0_aoi22_4x_unused)); | |
985 | cl_u1_buf_8x spare0_buf_8x (.in(1'b1), | |
986 | .out(spare0_buf_8x_unused)); | |
987 | cl_u1_oai22_4x spare0_oai22_4x (.in00(1'b1), | |
988 | .in01(1'b1), | |
989 | .in10(1'b1), | |
990 | .in11(1'b1), | |
991 | .out(spare0_oai22_4x_unused)); | |
992 | cl_u1_inv_16x spare0_inv_16x (.in(1'b1), | |
993 | .out(spare0_inv_16x_unused)); | |
994 | cl_u1_nand2_16x spare0_nand2_16x (.in0(1'b1), | |
995 | .in1(1'b1), | |
996 | .out(spare0_nand2_16x_unused)); | |
997 | cl_u1_nor3_4x spare0_nor3_4x (.in0(1'b0), | |
998 | .in1(1'b0), | |
999 | .in2(1'b0), | |
1000 | .out(spare0_nor3_4x_unused)); | |
1001 | cl_u1_nand2_8x spare0_nand2_8x (.in0(1'b1), | |
1002 | .in1(1'b1), | |
1003 | .out(spare0_nand2_8x_unused)); | |
1004 | cl_u1_buf_16x spare0_buf_16x (.in(1'b1), | |
1005 | .out(spare0_buf_16x_unused)); | |
1006 | cl_u1_nor2_16x spare0_nor2_16x (.in0(1'b0), | |
1007 | .in1(1'b0), | |
1008 | .out(spare0_nor2_16x_unused)); | |
1009 | cl_u1_inv_32x spare0_inv_32x (.in(1'b1), | |
1010 | .out(spare0_inv_32x_unused)); | |
1011 | ||
1012 | cl_sc1_msff_8x spare1_flop (.l1clk(l1clk), | |
1013 | .siclk(siclk), | |
1014 | .soclk(soclk), | |
1015 | .si(si_1), | |
1016 | .so(so_1), | |
1017 | .d(1'b0), | |
1018 | .q(spare1_flop_unused)); | |
1019 | assign si_1 = so_0; | |
1020 | ||
1021 | cl_u1_buf_32x spare1_buf_32x (.in(1'b1), | |
1022 | .out(spare1_buf_32x_unused)); | |
1023 | cl_u1_nand3_8x spare1_nand3_8x (.in0(1'b1), | |
1024 | .in1(1'b1), | |
1025 | .in2(1'b1), | |
1026 | .out(spare1_nand3_8x_unused)); | |
1027 | cl_u1_inv_8x spare1_inv_8x (.in(1'b1), | |
1028 | .out(spare1_inv_8x_unused)); | |
1029 | cl_u1_aoi22_4x spare1_aoi22_4x (.in00(1'b1), | |
1030 | .in01(1'b1), | |
1031 | .in10(1'b1), | |
1032 | .in11(1'b1), | |
1033 | .out(spare1_aoi22_4x_unused)); | |
1034 | cl_u1_buf_8x spare1_buf_8x (.in(1'b1), | |
1035 | .out(spare1_buf_8x_unused)); | |
1036 | cl_u1_oai22_4x spare1_oai22_4x (.in00(1'b1), | |
1037 | .in01(1'b1), | |
1038 | .in10(1'b1), | |
1039 | .in11(1'b1), | |
1040 | .out(spare1_oai22_4x_unused)); | |
1041 | cl_u1_inv_16x spare1_inv_16x (.in(1'b1), | |
1042 | .out(spare1_inv_16x_unused)); | |
1043 | cl_u1_nand2_16x spare1_nand2_16x (.in0(1'b1), | |
1044 | .in1(1'b1), | |
1045 | .out(spare1_nand2_16x_unused)); | |
1046 | cl_u1_nor3_4x spare1_nor3_4x (.in0(1'b0), | |
1047 | .in1(1'b0), | |
1048 | .in2(1'b0), | |
1049 | .out(spare1_nor3_4x_unused)); | |
1050 | cl_u1_nand2_8x spare1_nand2_8x (.in0(1'b1), | |
1051 | .in1(1'b1), | |
1052 | .out(spare1_nand2_8x_unused)); | |
1053 | cl_u1_buf_16x spare1_buf_16x (.in(1'b1), | |
1054 | .out(spare1_buf_16x_unused)); | |
1055 | cl_u1_nor2_16x spare1_nor2_16x (.in0(1'b0), | |
1056 | .in1(1'b0), | |
1057 | .out(spare1_nor2_16x_unused)); | |
1058 | cl_u1_inv_32x spare1_inv_32x (.in(1'b1), | |
1059 | .out(spare1_inv_32x_unused)); | |
1060 | assign scan_out = so_1; | |
1061 | ||
1062 | ||
1063 | ||
1064 | endmodule | |
1065 | ||
1066 | ||
1067 | ||
1068 | ||
1069 | ||
1070 | ||
1071 | // any PARAMS parms go into naming of macro | |
1072 | ||
1073 | module fgu_fec_ctl_msff_ctl_macro__width_28 ( | |
1074 | din, | |
1075 | l1clk, | |
1076 | scan_in, | |
1077 | siclk, | |
1078 | soclk, | |
1079 | dout, | |
1080 | scan_out); | |
1081 | wire [27:0] fdin; | |
1082 | wire [26:0] so; | |
1083 | ||
1084 | input [27:0] din; | |
1085 | input l1clk; | |
1086 | input scan_in; | |
1087 | ||
1088 | ||
1089 | input siclk; | |
1090 | input soclk; | |
1091 | ||
1092 | output [27:0] dout; | |
1093 | output scan_out; | |
1094 | assign fdin[27:0] = din[27:0]; | |
1095 | ||
1096 | ||
1097 | ||
1098 | ||
1099 | ||
1100 | ||
1101 | dff #(28) d0_0 ( | |
1102 | .l1clk(l1clk), | |
1103 | .siclk(siclk), | |
1104 | .soclk(soclk), | |
1105 | .d(fdin[27:0]), | |
1106 | .si({scan_in,so[26:0]}), | |
1107 | .so({so[26:0],scan_out}), | |
1108 | .q(dout[27:0]) | |
1109 | ); | |
1110 | ||
1111 | ||
1112 | ||
1113 | ||
1114 | ||
1115 | ||
1116 | ||
1117 | ||
1118 | ||
1119 | ||
1120 | ||
1121 | ||
1122 | endmodule | |
1123 | ||
1124 | ||
1125 | ||
1126 | ||
1127 | ||
1128 | ||
1129 | ||
1130 | ||
1131 | ||
1132 | ||
1133 | ||
1134 | ||
1135 | ||
1136 | // any PARAMS parms go into naming of macro | |
1137 | ||
1138 | module fgu_fec_ctl_msff_ctl_macro__width_14 ( | |
1139 | din, | |
1140 | l1clk, | |
1141 | scan_in, | |
1142 | siclk, | |
1143 | soclk, | |
1144 | dout, | |
1145 | scan_out); | |
1146 | wire [13:0] fdin; | |
1147 | wire [12:0] so; | |
1148 | ||
1149 | input [13:0] din; | |
1150 | input l1clk; | |
1151 | input scan_in; | |
1152 | ||
1153 | ||
1154 | input siclk; | |
1155 | input soclk; | |
1156 | ||
1157 | output [13:0] dout; | |
1158 | output scan_out; | |
1159 | assign fdin[13:0] = din[13:0]; | |
1160 | ||
1161 | ||
1162 | ||
1163 | ||
1164 | ||
1165 | ||
1166 | dff #(14) d0_0 ( | |
1167 | .l1clk(l1clk), | |
1168 | .siclk(siclk), | |
1169 | .soclk(soclk), | |
1170 | .d(fdin[13:0]), | |
1171 | .si({scan_in,so[12:0]}), | |
1172 | .so({so[12:0],scan_out}), | |
1173 | .q(dout[13:0]) | |
1174 | ); | |
1175 | ||
1176 | ||
1177 | ||
1178 | ||
1179 | ||
1180 | ||
1181 | ||
1182 | ||
1183 | ||
1184 | ||
1185 | ||
1186 | ||
1187 | endmodule | |
1188 | ||
1189 | ||
1190 | ||
1191 | ||
1192 | ||
1193 | ||
1194 | ||
1195 | ||
1196 | ||
1197 | ||
1198 | ||
1199 | ||
1200 | ||
1201 | // any PARAMS parms go into naming of macro | |
1202 | ||
1203 | module fgu_fec_ctl_msff_ctl_macro__width_76 ( | |
1204 | din, | |
1205 | l1clk, | |
1206 | scan_in, | |
1207 | siclk, | |
1208 | soclk, | |
1209 | dout, | |
1210 | scan_out); | |
1211 | wire [75:0] fdin; | |
1212 | wire [74:0] so; | |
1213 | ||
1214 | input [75:0] din; | |
1215 | input l1clk; | |
1216 | input scan_in; | |
1217 | ||
1218 | ||
1219 | input siclk; | |
1220 | input soclk; | |
1221 | ||
1222 | output [75:0] dout; | |
1223 | output scan_out; | |
1224 | assign fdin[75:0] = din[75:0]; | |
1225 | ||
1226 | ||
1227 | ||
1228 | ||
1229 | ||
1230 | ||
1231 | dff #(76) d0_0 ( | |
1232 | .l1clk(l1clk), | |
1233 | .siclk(siclk), | |
1234 | .soclk(soclk), | |
1235 | .d(fdin[75:0]), | |
1236 | .si({scan_in,so[74:0]}), | |
1237 | .so({so[74:0],scan_out}), | |
1238 | .q(dout[75:0]) | |
1239 | ); | |
1240 | ||
1241 | ||
1242 | ||
1243 | ||
1244 | ||
1245 | ||
1246 | ||
1247 | ||
1248 | ||
1249 | ||
1250 | ||
1251 | ||
1252 | endmodule | |
1253 | ||
1254 | ||
1255 | ||
1256 | ||
1257 | ||
1258 | ||
1259 | ||
1260 | ||
1261 | ||
1262 | ||
1263 | ||
1264 | ||
1265 | ||
1266 | // any PARAMS parms go into naming of macro | |
1267 | ||
1268 | module fgu_fec_ctl_msff_ctl_macro__width_9 ( | |
1269 | din, | |
1270 | l1clk, | |
1271 | scan_in, | |
1272 | siclk, | |
1273 | soclk, | |
1274 | dout, | |
1275 | scan_out); | |
1276 | wire [8:0] fdin; | |
1277 | wire [7:0] so; | |
1278 | ||
1279 | input [8:0] din; | |
1280 | input l1clk; | |
1281 | input scan_in; | |
1282 | ||
1283 | ||
1284 | input siclk; | |
1285 | input soclk; | |
1286 | ||
1287 | output [8:0] dout; | |
1288 | output scan_out; | |
1289 | assign fdin[8:0] = din[8:0]; | |
1290 | ||
1291 | ||
1292 | ||
1293 | ||
1294 | ||
1295 | ||
1296 | dff #(9) d0_0 ( | |
1297 | .l1clk(l1clk), | |
1298 | .siclk(siclk), | |
1299 | .soclk(soclk), | |
1300 | .d(fdin[8:0]), | |
1301 | .si({scan_in,so[7:0]}), | |
1302 | .so({so[7:0],scan_out}), | |
1303 | .q(dout[8:0]) | |
1304 | ); | |
1305 | ||
1306 | ||
1307 | ||
1308 | ||
1309 | ||
1310 | ||
1311 | ||
1312 | ||
1313 | ||
1314 | ||
1315 | ||
1316 | ||
1317 | endmodule | |
1318 | ||
1319 | ||
1320 | ||
1321 | ||
1322 | ||
1323 | ||
1324 | ||
1325 | ||
1326 | ||
1327 | ||
1328 | ||
1329 | ||
1330 | ||
1331 | // any PARAMS parms go into naming of macro | |
1332 | ||
1333 | module fgu_fec_ctl_msff_ctl_macro__width_2 ( | |
1334 | din, | |
1335 | l1clk, | |
1336 | scan_in, | |
1337 | siclk, | |
1338 | soclk, | |
1339 | dout, | |
1340 | scan_out); | |
1341 | wire [1:0] fdin; | |
1342 | wire [0:0] so; | |
1343 | ||
1344 | input [1:0] din; | |
1345 | input l1clk; | |
1346 | input scan_in; | |
1347 | ||
1348 | ||
1349 | input siclk; | |
1350 | input soclk; | |
1351 | ||
1352 | output [1:0] dout; | |
1353 | output scan_out; | |
1354 | assign fdin[1:0] = din[1:0]; | |
1355 | ||
1356 | ||
1357 | ||
1358 | ||
1359 | ||
1360 | ||
1361 | dff #(2) d0_0 ( | |
1362 | .l1clk(l1clk), | |
1363 | .siclk(siclk), | |
1364 | .soclk(soclk), | |
1365 | .d(fdin[1:0]), | |
1366 | .si({scan_in,so[0:0]}), | |
1367 | .so({so[0:0],scan_out}), | |
1368 | .q(dout[1:0]) | |
1369 | ); | |
1370 | ||
1371 | ||
1372 | ||
1373 | ||
1374 | ||
1375 | ||
1376 | ||
1377 | ||
1378 | ||
1379 | ||
1380 | ||
1381 | ||
1382 | endmodule | |
1383 | ||
1384 | ||
1385 | ||
1386 | ||
1387 | ||
1388 | ||
1389 | ||
1390 |