1 | // ========== Copyright Header Begin ========================================== |
---|
2 | // |
---|
3 | // OpenSPARC T1 Processor File: sparc_ifu_errctl.v |
---|
4 | // Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. |
---|
5 | // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. |
---|
6 | // |
---|
7 | // The above named program is free software; you can redistribute it and/or |
---|
8 | // modify it under the terms of the GNU General Public |
---|
9 | // License version 2 as published by the Free Software Foundation. |
---|
10 | // |
---|
11 | // The above named program is distributed in the hope that it will be |
---|
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
14 | // General Public License for more details. |
---|
15 | // |
---|
16 | // You should have received a copy of the GNU General Public |
---|
17 | // License along with this work; if not, write to the Free Software |
---|
18 | // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
19 | // |
---|
20 | // ========== Copyright Header End ============================================ |
---|
21 | //////////////////////////////////////////////////////////////////////// |
---|
22 | /* |
---|
23 | // Module Name: sparc_ifu_errctl |
---|
24 | */ |
---|
25 | //////////////////////////////////////////////////////////////////////// |
---|
26 | // Global header file includes |
---|
27 | //////////////////////////////////////////////////////////////////////// |
---|
28 | |
---|
29 | `include "lsu.h" |
---|
30 | |
---|
31 | module sparc_ifu_errctl(/*AUTOARG*/ |
---|
32 | // Outputs |
---|
33 | erc_erd_pgsz_b0, erc_erd_pgsz_b1, ifu_lsu_asi_rd_unc, |
---|
34 | ifu_lsu_ldxa_tid_w2, ifu_lsu_ldxa_data_vld_w2, |
---|
35 | ifu_lsu_fwd_data_vld, ifu_lsu_error_inj, ifu_exu_ecc_mask, |
---|
36 | ifu_exu_inj_irferr, ifu_ffu_inj_frferr, ifu_exu_nceen_e, |
---|
37 | ifu_lsu_nceen, ifu_spu_nceen, erb_fcl_spu_uetrap, |
---|
38 | erb_ifq_itlberr_s1, erb_ifq_ifeterr_d1, erb_dtu_ifeterr_d1, |
---|
39 | erb_fcl_itlb_ce_d1, erb_fcl_ce_trapvec, erb_fcl_ue_trapvec, |
---|
40 | erb_fcl_ifet_uevec_d1, erc_erd_errstat_asidata, |
---|
41 | erc_erd_errinj_asidata, erc_erd_erren_asidata, |
---|
42 | erc_erd_eadr0_sel_irf_l, erc_erd_eadr0_sel_itlb_l, |
---|
43 | erc_erd_eadr0_sel_frf_l, erc_erd_eadr0_sel_lsu_l, |
---|
44 | erc_erd_asiway_s1_l, erc_erd_eadr1_sel_pcd1_l, |
---|
45 | erc_erd_eadr1_sel_l1pa_l, erc_erd_eadr1_sel_l2pa_l, |
---|
46 | erc_erd_eadr1_sel_other_l, erc_erd_eadr2_sel_mx1_l, |
---|
47 | erc_erd_eadr2_sel_wrt_l, erc_erd_eadr2_sel_mx0_l, |
---|
48 | erc_erd_eadr2_sel_old_l, erc_erd_asi_thr_l, |
---|
49 | erc_erd_asisrc_sel_icd_s_l, erc_erd_asisrc_sel_misc_s_l, |
---|
50 | erc_erd_asisrc_sel_err_s_l, erc_erd_asisrc_sel_itlb_s_l, |
---|
51 | erc_erd_errasi_sel_en_l, erc_erd_errasi_sel_stat_l, |
---|
52 | erc_erd_errasi_sel_inj_l, erc_erd_errasi_sel_addr_l, |
---|
53 | erc_erd_miscasi_sel_ict_l, erc_erd_miscasi_sel_imask_l, |
---|
54 | erc_erd_miscasi_sel_other_l, erc_erd_ld_imask, erb_reset, so, |
---|
55 | // Inputs |
---|
56 | rclk, se, si, arst_l, grst_l, erd_erc_tte_pgsz, icv_itlb_valid_f, |
---|
57 | fcl_erb_ievld_s1, fcl_erb_tevld_s1, fcl_erb_immuevld_s1, |
---|
58 | fcl_erb_inst_issue_d, fcl_erb_inst_vld_d1, ifu_tlu_inst_vld_w, |
---|
59 | ifu_lsu_thrid_s, fcl_erb_asi_tid_f, ifq_fcl_asi_tid_bf, |
---|
60 | fcl_erb_clear_iferr, fcl_erb_itlbrd_vld_s, fcl_erb_itlbrd_data_s, |
---|
61 | erd_erc_tagpe_s1, erd_erc_nirpe_s1, erd_erc_fetpe_s1, |
---|
62 | erd_erc_tlbt_pe_s1, erd_erc_tlbd_pe_s1, tlu_lsu_pstate_priv, tlu_hpstate_priv, |
---|
63 | lsu_ifu_dtlb_data_su, lsu_ifu_dtlb_data_ue, lsu_ifu_dtlb_tag_ue, |
---|
64 | lsu_ifu_dcache_data_perror, lsu_ifu_dcache_tag_perror, |
---|
65 | lsu_ifu_l2_unc_error, lsu_ifu_l2_corr_error, lsu_ifu_io_error, |
---|
66 | lsu_ifu_error_tid, spu_ifu_unc_err_w1, spu_ifu_mamem_err_w1, |
---|
67 | spu_ifu_corr_err_w2, spu_ifu_int_w2, spu_ifu_ttype_tid_w2, |
---|
68 | lsu_ifu_inj_ack, ffu_ifu_ecc_ce_w2, ffu_ifu_ecc_ue_w2, |
---|
69 | ffu_ifu_inj_ack, ffu_ifu_tid_w2, exu_ifu_ecc_ce_m, |
---|
70 | exu_ifu_ecc_ue_m, exu_ifu_inj_ack, ifq_erb_ue_rep, ifq_erb_ce_rep, |
---|
71 | ifq_erb_l2_ue, ifq_erb_io_ue, ifq_erb_ifet_ce, ifq_erb_l2err_tid, |
---|
72 | ifq_erb_rdtag_f, ifq_erb_rdinst_f, ifq_erb_asi_erren_i2, |
---|
73 | ifq_erb_asi_errstat_i2, ifq_erb_asi_errinj_i2, |
---|
74 | ifq_erb_asi_erraddr_i2, ifq_erb_asi_imask_i2, ifq_erb_asiwr_i2, |
---|
75 | ifq_fcl_asird_bf, ifq_erb_fwdrd_bf, ifq_erb_asidata_i2, |
---|
76 | ifq_erb_asiway_f |
---|
77 | ); |
---|
78 | |
---|
79 | input rclk, |
---|
80 | se, |
---|
81 | si, |
---|
82 | arst_l, |
---|
83 | grst_l; |
---|
84 | |
---|
85 | input [2:0] erd_erc_tte_pgsz; |
---|
86 | |
---|
87 | input [3:0] icv_itlb_valid_f; |
---|
88 | |
---|
89 | input fcl_erb_ievld_s1, |
---|
90 | fcl_erb_tevld_s1, |
---|
91 | fcl_erb_immuevld_s1; |
---|
92 | |
---|
93 | input fcl_erb_inst_issue_d; |
---|
94 | input fcl_erb_inst_vld_d1; |
---|
95 | |
---|
96 | input ifu_tlu_inst_vld_w; |
---|
97 | |
---|
98 | input [1:0] ifu_lsu_thrid_s, |
---|
99 | fcl_erb_asi_tid_f, |
---|
100 | ifq_fcl_asi_tid_bf; |
---|
101 | |
---|
102 | input [3:0] fcl_erb_clear_iferr; |
---|
103 | |
---|
104 | input fcl_erb_itlbrd_vld_s, |
---|
105 | fcl_erb_itlbrd_data_s; |
---|
106 | |
---|
107 | input [3:0] erd_erc_tagpe_s1; |
---|
108 | input erd_erc_nirpe_s1, |
---|
109 | erd_erc_fetpe_s1; |
---|
110 | input [1:0] erd_erc_tlbt_pe_s1, |
---|
111 | erd_erc_tlbd_pe_s1; |
---|
112 | |
---|
113 | input [3:0] tlu_lsu_pstate_priv; |
---|
114 | input [3:0] tlu_hpstate_priv; |
---|
115 | |
---|
116 | input lsu_ifu_dtlb_data_su, |
---|
117 | lsu_ifu_dtlb_data_ue, |
---|
118 | lsu_ifu_dtlb_tag_ue, |
---|
119 | lsu_ifu_dcache_data_perror, |
---|
120 | lsu_ifu_dcache_tag_perror, |
---|
121 | lsu_ifu_l2_unc_error, |
---|
122 | lsu_ifu_l2_corr_error, |
---|
123 | lsu_ifu_io_error; |
---|
124 | input [1:0] lsu_ifu_error_tid; |
---|
125 | |
---|
126 | input spu_ifu_unc_err_w1, // 1 cycle earlier for timing reasons |
---|
127 | spu_ifu_mamem_err_w1,// 1 cycle earlier for timing reasons |
---|
128 | spu_ifu_corr_err_w2, |
---|
129 | spu_ifu_int_w2; |
---|
130 | |
---|
131 | input [1:0] spu_ifu_ttype_tid_w2; |
---|
132 | |
---|
133 | input [3:0] lsu_ifu_inj_ack; |
---|
134 | |
---|
135 | input ffu_ifu_ecc_ce_w2; |
---|
136 | input ffu_ifu_ecc_ue_w2; |
---|
137 | input ffu_ifu_inj_ack; |
---|
138 | input [1:0] ffu_ifu_tid_w2; |
---|
139 | |
---|
140 | input exu_ifu_ecc_ce_m, |
---|
141 | exu_ifu_ecc_ue_m; |
---|
142 | input exu_ifu_inj_ack; |
---|
143 | |
---|
144 | input ifq_erb_ue_rep; |
---|
145 | input ifq_erb_ce_rep; |
---|
146 | input ifq_erb_l2_ue; |
---|
147 | input ifq_erb_io_ue; |
---|
148 | input ifq_erb_ifet_ce; |
---|
149 | input [1:0] ifq_erb_l2err_tid; |
---|
150 | |
---|
151 | input ifq_erb_rdtag_f; |
---|
152 | input ifq_erb_rdinst_f; |
---|
153 | input ifq_erb_asi_erren_i2; |
---|
154 | input ifq_erb_asi_errstat_i2; |
---|
155 | input ifq_erb_asi_errinj_i2; |
---|
156 | input ifq_erb_asi_erraddr_i2; |
---|
157 | input ifq_erb_asi_imask_i2; |
---|
158 | input ifq_erb_asiwr_i2; |
---|
159 | input ifq_fcl_asird_bf; |
---|
160 | input ifq_erb_fwdrd_bf; |
---|
161 | input [31:0] ifq_erb_asidata_i2; |
---|
162 | input [1:0] ifq_erb_asiway_f; |
---|
163 | |
---|
164 | output erc_erd_pgsz_b0; |
---|
165 | output erc_erd_pgsz_b1; |
---|
166 | |
---|
167 | output ifu_lsu_asi_rd_unc; |
---|
168 | output [1:0] ifu_lsu_ldxa_tid_w2; |
---|
169 | output ifu_lsu_ldxa_data_vld_w2; |
---|
170 | output ifu_lsu_fwd_data_vld; |
---|
171 | output [3:0] ifu_lsu_error_inj; |
---|
172 | |
---|
173 | output [7:0] ifu_exu_ecc_mask; |
---|
174 | output ifu_exu_inj_irferr; |
---|
175 | output ifu_ffu_inj_frferr; |
---|
176 | |
---|
177 | output ifu_exu_nceen_e; |
---|
178 | output [3:0] ifu_lsu_nceen; |
---|
179 | output [3:0] ifu_spu_nceen; // copy going north |
---|
180 | |
---|
181 | output [3:0] erb_fcl_spu_uetrap; |
---|
182 | |
---|
183 | output erb_ifq_itlberr_s1; |
---|
184 | output erb_ifq_ifeterr_d1; |
---|
185 | output erb_dtu_ifeterr_d1; |
---|
186 | output erb_fcl_itlb_ce_d1; |
---|
187 | output [3:0] erb_fcl_ce_trapvec; |
---|
188 | output [3:0] erb_fcl_ue_trapvec; |
---|
189 | output [3:0] erb_fcl_ifet_uevec_d1; |
---|
190 | |
---|
191 | output [22:0] erc_erd_errstat_asidata; |
---|
192 | output [31:0] erc_erd_errinj_asidata; |
---|
193 | output [1:0] erc_erd_erren_asidata; |
---|
194 | |
---|
195 | // mux selects |
---|
196 | output [3:0] erc_erd_eadr0_sel_irf_l, |
---|
197 | erc_erd_eadr0_sel_itlb_l, |
---|
198 | erc_erd_eadr0_sel_frf_l, |
---|
199 | erc_erd_eadr0_sel_lsu_l; |
---|
200 | |
---|
201 | output [3:0] erc_erd_asiway_s1_l; |
---|
202 | |
---|
203 | output [3:0] erc_erd_eadr1_sel_pcd1_l, |
---|
204 | erc_erd_eadr1_sel_l1pa_l, |
---|
205 | erc_erd_eadr1_sel_l2pa_l, |
---|
206 | erc_erd_eadr1_sel_other_l; |
---|
207 | |
---|
208 | output [3:0] erc_erd_eadr2_sel_mx1_l, |
---|
209 | erc_erd_eadr2_sel_wrt_l, |
---|
210 | erc_erd_eadr2_sel_mx0_l, |
---|
211 | erc_erd_eadr2_sel_old_l; |
---|
212 | |
---|
213 | output [3:0] erc_erd_asi_thr_l; |
---|
214 | |
---|
215 | output erc_erd_asisrc_sel_icd_s_l, |
---|
216 | erc_erd_asisrc_sel_misc_s_l, |
---|
217 | erc_erd_asisrc_sel_err_s_l, |
---|
218 | erc_erd_asisrc_sel_itlb_s_l; |
---|
219 | |
---|
220 | output erc_erd_errasi_sel_en_l, |
---|
221 | erc_erd_errasi_sel_stat_l, |
---|
222 | erc_erd_errasi_sel_inj_l, |
---|
223 | erc_erd_errasi_sel_addr_l; |
---|
224 | |
---|
225 | output erc_erd_miscasi_sel_ict_l, |
---|
226 | erc_erd_miscasi_sel_imask_l, |
---|
227 | erc_erd_miscasi_sel_other_l; |
---|
228 | |
---|
229 | output erc_erd_ld_imask; |
---|
230 | output erb_reset, |
---|
231 | so; |
---|
232 | |
---|
233 | // Local Signals |
---|
234 | |
---|
235 | wire spu_unc_err_w2, |
---|
236 | spu_mamem_err_w2; |
---|
237 | |
---|
238 | wire lsu_dtlb_data_su, |
---|
239 | lsu_dtlb_data_ue, |
---|
240 | lsu_dtlb_tag_ue, |
---|
241 | lsu_dcache_data_perror, |
---|
242 | lsu_dcache_tag_perror, |
---|
243 | lsu_l2_unc_error, |
---|
244 | lsu_l2_corr_error, |
---|
245 | lsu_io_error; |
---|
246 | wire [1:0] lsu_error_tid; |
---|
247 | |
---|
248 | wire [3:0] valid_s1; |
---|
249 | |
---|
250 | wire [1:0] tid_d, |
---|
251 | ffu_tid_w3, |
---|
252 | l2ierr_tid, |
---|
253 | spu_tid_w2, |
---|
254 | asi_tid_w2, |
---|
255 | asi_tid_s1; |
---|
256 | |
---|
257 | wire [3:0] thr_e, |
---|
258 | thr_d, |
---|
259 | thr_d1, |
---|
260 | thr_m, |
---|
261 | thr_w, |
---|
262 | ffu_thr_w3, |
---|
263 | asi_thr_s, |
---|
264 | asi_thr_w2, |
---|
265 | asi_thr_i2, |
---|
266 | thr_lsu_err, |
---|
267 | thr_spu_err, |
---|
268 | thr_l2ie; |
---|
269 | |
---|
270 | wire itlb_feterr_s1, |
---|
271 | tlb_feterr_d1, |
---|
272 | itlb_errtr_s1_l, |
---|
273 | itlb_errtr_d1_l; |
---|
274 | |
---|
275 | wire tlb_fet_ce_d1, |
---|
276 | tlb_fet_ue_d1; |
---|
277 | |
---|
278 | wire [3:0] alltag_err_s1; |
---|
279 | |
---|
280 | wire itlb_tagerr_s1, |
---|
281 | itlb_dataerr_s1, |
---|
282 | insterr_d1, |
---|
283 | insterr_s1, |
---|
284 | insterr_qual_d1, |
---|
285 | ictagerr_s1, |
---|
286 | ictagerr_d1, |
---|
287 | ictagerr_qual_d1; |
---|
288 | |
---|
289 | wire asi_daterr_d1, |
---|
290 | asi_tagerr_d1, |
---|
291 | asi_rd_err_d1; |
---|
292 | |
---|
293 | wire asi_ttevld_s1, |
---|
294 | asi_tdevld_s1; |
---|
295 | |
---|
296 | wire [3:0] any_tlbasi_err; |
---|
297 | |
---|
298 | wire [3:0] dmdu, |
---|
299 | dmdu_nxt, |
---|
300 | dmsu, |
---|
301 | dmsu_nxt, |
---|
302 | dmt, |
---|
303 | dmt_nxt, |
---|
304 | ddc, |
---|
305 | ddc_nxt, |
---|
306 | dtc, |
---|
307 | dtc_nxt, |
---|
308 | ldau, |
---|
309 | ldau_nxt, |
---|
310 | ncu, |
---|
311 | ncu_nxt, |
---|
312 | mau, |
---|
313 | mau_nxt, |
---|
314 | any_lsu_err, |
---|
315 | any_lsu_ue, |
---|
316 | any_lsu_ce, |
---|
317 | any_spu_ce, |
---|
318 | any_spu_ue, |
---|
319 | imt, |
---|
320 | imt_nxt, |
---|
321 | frc, |
---|
322 | frc_nxt, |
---|
323 | irc, |
---|
324 | irc_nxt, |
---|
325 | fru, |
---|
326 | fru_nxt, |
---|
327 | iru, |
---|
328 | iru_nxt, |
---|
329 | any_rf_err, |
---|
330 | any_rf_ce, |
---|
331 | any_rf_ue, |
---|
332 | any_irf_err, |
---|
333 | any_frf_err, |
---|
334 | idc, |
---|
335 | idc_nxt, |
---|
336 | itc, |
---|
337 | itc_nxt, |
---|
338 | imdu, |
---|
339 | imdu_nxt, |
---|
340 | any_err_vld, |
---|
341 | any_ue_vld, |
---|
342 | // any_ce_vld, |
---|
343 | early_idc, |
---|
344 | early_idc_nxt, |
---|
345 | early_itc, |
---|
346 | early_itc_nxt, |
---|
347 | early_imdu, |
---|
348 | early_imdu_nxt, |
---|
349 | early_ldau, |
---|
350 | early_ldau_nxt, |
---|
351 | early_ncu, |
---|
352 | early_ncu_nxt, |
---|
353 | early_l2ce, |
---|
354 | early_l2ce_nxt, |
---|
355 | any_ifu_ce, |
---|
356 | any_ifu_ue, |
---|
357 | any_ifu_err, |
---|
358 | any_iferr_vld; |
---|
359 | |
---|
360 | wire [3:0] meu, |
---|
361 | meu_nxt, |
---|
362 | mec, |
---|
363 | mec_nxt, |
---|
364 | priv, |
---|
365 | priv_nxt, |
---|
366 | early_meu, |
---|
367 | early_meu_nxt, |
---|
368 | early_mec, |
---|
369 | early_mec_nxt, |
---|
370 | early_priv, |
---|
371 | early_priv_nxt; |
---|
372 | |
---|
373 | wire [22:0] err_stat0, |
---|
374 | err_stat1, |
---|
375 | err_stat2, |
---|
376 | err_stat3; |
---|
377 | |
---|
378 | wire [3:0] ifet_ce_vld, |
---|
379 | ifet_ue_vld; |
---|
380 | |
---|
381 | wire [3:0] l2if_unc_err, |
---|
382 | l2if_corr_err; |
---|
383 | |
---|
384 | wire [3:0] ce_trapvec, |
---|
385 | ue_trapvec, |
---|
386 | ifu_ce_trap; |
---|
387 | |
---|
388 | wire wrt_errinj_i2; |
---|
389 | wire [7:0] ecc_mask, |
---|
390 | ecc_mask_nxt; |
---|
391 | |
---|
392 | wire [1:0] errinj_ctl, |
---|
393 | errinj_ctl_nxt; |
---|
394 | wire [5:0] errinj_vec, |
---|
395 | errinj_vec_nxt, |
---|
396 | corr_errinj_vec; |
---|
397 | |
---|
398 | // wire [3:0] icache_pa_err_d1; |
---|
399 | |
---|
400 | wire irf_ce_w, |
---|
401 | irf_ce_unq, |
---|
402 | irf_ue_w, |
---|
403 | irf_ue_unq; |
---|
404 | |
---|
405 | wire [3:0] sel_lsu_err, |
---|
406 | sel_ifuspu_err, |
---|
407 | sel_rftlb_err; |
---|
408 | |
---|
409 | wire clr_err_qual_e, |
---|
410 | clr_elyff_e, |
---|
411 | clr_elyff_m, |
---|
412 | clr_elyff_w; |
---|
413 | |
---|
414 | wire [3:0] early_err_vec_e, |
---|
415 | clear_ely_reg_w, |
---|
416 | mov_ely_reg_w; |
---|
417 | |
---|
418 | wire [3:0] clear_iferr_d1; |
---|
419 | |
---|
420 | wire [1:0] asi_way_s1; |
---|
421 | wire [3:0] dec_asiway_s1; |
---|
422 | |
---|
423 | wire [3:0] asi_wrt_err_stat, |
---|
424 | asi_wrt_err_en, |
---|
425 | // asi_wrt_err_inj, |
---|
426 | asi_wrt_err_addr; |
---|
427 | |
---|
428 | wire dmdu_wrt_data, |
---|
429 | dmsu_wrt_data, |
---|
430 | imdu_wrt_data, |
---|
431 | idc_wrt_data, |
---|
432 | itc_wrt_data, |
---|
433 | ddc_wrt_data, |
---|
434 | dtc_wrt_data, |
---|
435 | imt_wrt_data, |
---|
436 | dmt_wrt_data, |
---|
437 | ldau_wrt_data, |
---|
438 | ncu_wrt_data, |
---|
439 | mau_wrt_data, |
---|
440 | fru_wrt_data, |
---|
441 | frc_wrt_data, |
---|
442 | iru_wrt_data, |
---|
443 | irc_wrt_data, |
---|
444 | meu_wrt_data, |
---|
445 | mec_wrt_data, |
---|
446 | priv_wrt_data; |
---|
447 | |
---|
448 | wire nceen_wrt_data, |
---|
449 | ceen_wrt_data; |
---|
450 | |
---|
451 | wire [3:0] ceen, |
---|
452 | ceen_nxt, |
---|
453 | nceen, |
---|
454 | nceen_nxt; |
---|
455 | |
---|
456 | wire nceen_d; |
---|
457 | |
---|
458 | wire rdtag_s, |
---|
459 | rdinst_s, |
---|
460 | asi_erren_f, |
---|
461 | asi_errstat_f, |
---|
462 | asi_errinj_f, |
---|
463 | asi_erraddr_f, |
---|
464 | asi_imask_f, |
---|
465 | asi_erren_s, |
---|
466 | asi_errstat_s, |
---|
467 | asi_errinj_s, |
---|
468 | asi_erraddr_s, |
---|
469 | asi_imask_s; |
---|
470 | |
---|
471 | wire asird_f, |
---|
472 | asird_s; |
---|
473 | wire fwdrd_f, |
---|
474 | fwdrd_s, |
---|
475 | asifwd_rd_s, |
---|
476 | rdinst_f, |
---|
477 | fwdrd_d; |
---|
478 | |
---|
479 | wire ldxa_data_vld_s, |
---|
480 | ldxa_data_vld_d; |
---|
481 | |
---|
482 | wire err_asi_s; |
---|
483 | wire erb_reset_l; |
---|
484 | |
---|
485 | wire ffu_ce_w3; |
---|
486 | wire ffu_ue_w3; |
---|
487 | |
---|
488 | wire [3:0] any_lsu_ue_priv_state; |
---|
489 | wire [3:0] any_priv_state; |
---|
490 | |
---|
491 | wire clk; |
---|
492 | |
---|
493 | |
---|
494 | // |
---|
495 | // Code Begins Here |
---|
496 | // |
---|
497 | assign clk = rclk; |
---|
498 | |
---|
499 | // reset buffer |
---|
500 | dffrl_async rstff(.din (grst_l), |
---|
501 | .q (erb_reset_l), |
---|
502 | .clk (clk), .se(se), .si(), .so(), |
---|
503 | .rst_l (arst_l)); |
---|
504 | |
---|
505 | assign erb_reset = ~erb_reset_l; |
---|
506 | |
---|
507 | |
---|
508 | |
---|
509 | // need to encode page size before sending it back |
---|
510 | assign erc_erd_pgsz_b0 = (erd_erc_tte_pgsz[2] | |
---|
511 | erd_erc_tte_pgsz[1] | |
---|
512 | erd_erc_tte_pgsz[0]); |
---|
513 | |
---|
514 | assign erc_erd_pgsz_b1 = (~erd_erc_tte_pgsz[2] & |
---|
515 | erd_erc_tte_pgsz[1]); |
---|
516 | |
---|
517 | |
---|
518 | // Don't need this with SPARC_HPV_EN |
---|
519 | // default to tte_lock_d1 = 0 |
---|
520 | // 05/30/03: tlb correctible errors disabled. |
---|
521 | // so treat as if lock = 1 and force ue. |
---|
522 | // dff #(1) lk_ff(.din (erd_erc_tte_lock_s1), |
---|
523 | // .q (tte_lock_d1), |
---|
524 | // .clk (clk), .se(se), .si(), .so()); |
---|
525 | |
---|
526 | //----------------------- |
---|
527 | // Basic pipeline signals |
---|
528 | //----------------------- |
---|
529 | // thr_s1 also contains asi tid |
---|
530 | dff_s #(2) tidd_reg(.din (ifu_lsu_thrid_s), |
---|
531 | .q (tid_d), |
---|
532 | .clk (clk), .se(se), .si(), .so()); |
---|
533 | |
---|
534 | assign thr_d[0] = ~tid_d[1] & ~tid_d[0]; |
---|
535 | assign thr_d[1] = ~tid_d[1] & tid_d[0]; |
---|
536 | assign thr_d[2] = tid_d[1] & ~tid_d[0]; |
---|
537 | assign thr_d[3] = tid_d[1] & tid_d[0]; |
---|
538 | |
---|
539 | dff_s #(4) thre_reg(.din (thr_d), |
---|
540 | .q (thr_e), |
---|
541 | .clk (clk), .se(se), .si(), .so()); |
---|
542 | assign thr_d1 = thr_e; |
---|
543 | |
---|
544 | dff_s #(4) thrm_reg(.din (thr_e), |
---|
545 | .q (thr_m), |
---|
546 | .clk (clk), .se(se), .si(), .so()); |
---|
547 | dff_s #(4) thrw_reg(.din (thr_m), |
---|
548 | .q (thr_w), |
---|
549 | .clk (clk), .se(se), .si(), .so()); |
---|
550 | |
---|
551 | |
---|
552 | //----------------------------- |
---|
553 | // lsu flops (added for timing) |
---|
554 | //----------------------------- |
---|
555 | // all the lsu signals go to the final mux in the errdp, to help |
---|
556 | // with timing. This is no longer necessary, in fact it is no |
---|
557 | // longer desired, since we have added the flop below to stage all |
---|
558 | // the lsu signals. However, the design is not changed, to save |
---|
559 | // the extra effort in physical composition to rip up the errdp. |
---|
560 | dff_s #(10) lspipe_reg(.din ({lsu_ifu_dtlb_data_su, |
---|
561 | lsu_ifu_dtlb_data_ue, |
---|
562 | lsu_ifu_dtlb_tag_ue, |
---|
563 | lsu_ifu_dcache_data_perror, |
---|
564 | lsu_ifu_dcache_tag_perror, |
---|
565 | lsu_ifu_l2_unc_error, |
---|
566 | lsu_ifu_l2_corr_error, |
---|
567 | lsu_ifu_io_error, |
---|
568 | lsu_ifu_error_tid[1:0]}), |
---|
569 | .q ({lsu_dtlb_data_su, |
---|
570 | lsu_dtlb_data_ue, |
---|
571 | lsu_dtlb_tag_ue, |
---|
572 | lsu_dcache_data_perror, |
---|
573 | lsu_dcache_tag_perror, |
---|
574 | lsu_l2_unc_error, |
---|
575 | lsu_l2_corr_error, |
---|
576 | lsu_io_error, |
---|
577 | lsu_error_tid[1:0]}), |
---|
578 | .clk (clk), .se(se), .si(), .so()); |
---|
579 | |
---|
580 | assign any_priv_state = tlu_lsu_pstate_priv | tlu_hpstate_priv; |
---|
581 | |
---|
582 | //Bug 6821: added so that lsu ue's errors pickup the delayed priv level |
---|
583 | dff_s #(4) lsu_priv_reg(.din (any_priv_state), |
---|
584 | .q (any_lsu_ue_priv_state), |
---|
585 | .clk (clk), .se(se), .si(), .so()); |
---|
586 | |
---|
587 | // thread from lsu |
---|
588 | assign thr_lsu_err[0] = ~lsu_error_tid[1] & ~lsu_error_tid[0]; |
---|
589 | assign thr_lsu_err[1] = ~lsu_error_tid[1] & lsu_error_tid[0]; |
---|
590 | assign thr_lsu_err[2] = lsu_error_tid[1] & ~lsu_error_tid[0]; |
---|
591 | assign thr_lsu_err[3] = lsu_error_tid[1] & lsu_error_tid[0]; |
---|
592 | |
---|
593 | // thread from spu |
---|
594 | // From Farnad: tid is ready several cycles before everything else. |
---|
595 | // In the ifu, I will assume 1 cycle before |
---|
596 | dff_s #(2) sptid_reg(.din (spu_ifu_ttype_tid_w2), |
---|
597 | .q (spu_tid_w2), |
---|
598 | .clk (clk), .se(se), .so(), .si()); |
---|
599 | |
---|
600 | dff_s #(2) spe1_reg(.din ({spu_ifu_unc_err_w1, |
---|
601 | spu_ifu_mamem_err_w1}), |
---|
602 | .q ({spu_unc_err_w2, |
---|
603 | spu_mamem_err_w2}), |
---|
604 | .clk (clk), .se(se), .so(), .si()); |
---|
605 | |
---|
606 | assign thr_spu_err[0] = ~spu_tid_w2[1] & ~spu_tid_w2[0]; |
---|
607 | assign thr_spu_err[1] = ~spu_tid_w2[1] & spu_tid_w2[0]; |
---|
608 | assign thr_spu_err[2] = spu_tid_w2[1] & ~spu_tid_w2[0]; |
---|
609 | assign thr_spu_err[3] = spu_tid_w2[1] & spu_tid_w2[0]; |
---|
610 | |
---|
611 | // thread from ifq |
---|
612 | dff_s #(2) ifqthr_reg(.din (ifq_erb_l2err_tid), |
---|
613 | .q (l2ierr_tid), |
---|
614 | .clk (clk), .se(se), .so(), .si()); |
---|
615 | |
---|
616 | assign thr_l2ie[0] = ~l2ierr_tid[1] & ~l2ierr_tid[0]; |
---|
617 | assign thr_l2ie[1] = ~l2ierr_tid[1] & l2ierr_tid[0]; |
---|
618 | assign thr_l2ie[2] = l2ierr_tid[1] & ~l2ierr_tid[0]; |
---|
619 | assign thr_l2ie[3] = l2ierr_tid[1] & l2ierr_tid[0]; |
---|
620 | |
---|
621 | |
---|
622 | //--------------------------------------- |
---|
623 | // Error Detection -- icache errors |
---|
624 | //--------------------------------------- |
---|
625 | // itlb inst fetch errors |
---|
626 | assign itlb_feterr_s1 = (erd_erc_tlbd_pe_s1[0] ^ erd_erc_tlbd_pe_s1[1]) & |
---|
627 | fcl_erb_immuevld_s1; |
---|
628 | assign erb_ifq_itlberr_s1 = itlb_feterr_s1 & nceen_d; |
---|
629 | dff_s #(1) itfete_ff(.din (itlb_feterr_s1), |
---|
630 | .q (tlb_feterr_d1), |
---|
631 | .clk (clk), .se(se), .si(), .so()); |
---|
632 | |
---|
633 | assign itlb_errtr_s1_l = ~erb_ifq_itlberr_s1; |
---|
634 | dff_s #(1) itume_ff(.din (itlb_errtr_s1_l), |
---|
635 | .q (itlb_errtr_d1_l), |
---|
636 | .clk (clk), .se(se), .si(), .so()); |
---|
637 | |
---|
638 | // assign tlb_fet_ce_d1 = tlb_feterr_d1 & ~tte_lock_d1; |
---|
639 | // assign tlb_fet_ue_d1 = tlb_feterr_d1 & tte_lock_d1; |
---|
640 | assign tlb_fet_ce_d1 = 1'b0; |
---|
641 | assign tlb_fet_ue_d1 = tlb_feterr_d1; |
---|
642 | |
---|
643 | |
---|
644 | // instruction errors |
---|
645 | // assign insterr_s1 = (erd_erc_nirpe_s1 | erd_erc_fetpe_s1) & |
---|
646 | // fcl_erb_ievld_s1; |
---|
647 | // dff #(1) inserr_ff(.din (insterr_s1), |
---|
648 | // .q (insterr_d1), |
---|
649 | // .clk (clk), .se(se), .si(), .so()); |
---|
650 | |
---|
651 | assign insterr_s1 = (erd_erc_fetpe_s1 | erd_erc_nirpe_s1) & |
---|
652 | fcl_erb_ievld_s1; |
---|
653 | |
---|
654 | dff_s #(1) feterr_ff(.din (insterr_s1), |
---|
655 | .q (insterr_d1), |
---|
656 | .clk (clk), .se(se), .si(), .so()); |
---|
657 | // dff #(1) nirerr_ff(.din (erd_erc_nirpe_s1), |
---|
658 | // .q (nirpe_d1), |
---|
659 | // .clk (clk), .se(se), .si(), .so()); |
---|
660 | // dff #(1) ievld1_ff(.din (fcl_erb_ievld_s1), |
---|
661 | // .q (ievld_d1), |
---|
662 | // .clk (clk), .se(se), .si(), .so()); |
---|
663 | |
---|
664 | assign insterr_qual_d1 = insterr_d1 & ~tlb_feterr_d1; |
---|
665 | |
---|
666 | // tag errors |
---|
667 | dff_s #(4) vld_reg(.din (icv_itlb_valid_f), |
---|
668 | .q (valid_s1), |
---|
669 | .clk (clk), .se(se), .si(), .so()); |
---|
670 | assign alltag_err_s1 = erd_erc_tagpe_s1 & valid_s1; |
---|
671 | |
---|
672 | assign ictagerr_s1 = (|alltag_err_s1[3:0]) & fcl_erb_tevld_s1; |
---|
673 | dff_s #(1) itagerr_ff(.din (ictagerr_s1), |
---|
674 | .q (ictagerr_d1), |
---|
675 | .clk (clk), .se(se), .si(), .so()); |
---|
676 | |
---|
677 | assign ictagerr_qual_d1 = ictagerr_d1 & ~insterr_d1 & |
---|
678 | ~tlb_feterr_d1; |
---|
679 | |
---|
680 | // Corrective action for IFU errors |
---|
681 | // force an imiss if there is a inst/tag parity error |
---|
682 | assign erb_ifq_ifeterr_d1 = (ictagerr_d1 | insterr_d1) & itlb_errtr_d1_l; |
---|
683 | |
---|
684 | // moved qualification with inst_vld_d1 to the dtu. |
---|
685 | assign erb_dtu_ifeterr_d1 = erb_ifq_ifeterr_d1; |
---|
686 | //assign erb_dtu_ifeterr_d1 = erb_ifq_ifeterr_d1 & fcl_erb_inst_vld_d1; |
---|
687 | // assign icache_pa_err_d1 = {4{ictagerr_d1 | insterr_d1}} & thr_d1; |
---|
688 | |
---|
689 | // force a tlbmiss if there is a correctible tlb data parity error |
---|
690 | assign erb_fcl_itlb_ce_d1 = tlb_fet_ce_d1; |
---|
691 | |
---|
692 | // take a precise trap if there is an uncorrectible error |
---|
693 | assign erb_fcl_ifet_uevec_d1 = ({4{tlb_fet_ue_d1 & fcl_erb_inst_vld_d1}} & |
---|
694 | thr_d1 | |
---|
695 | {4{ifq_erb_l2_ue | ifq_erb_io_ue}} & |
---|
696 | thr_l2ie) & nceen; |
---|
697 | |
---|
698 | // errors in ifetch to l2 or iob |
---|
699 | assign l2if_unc_err = {4{ifq_erb_l2_ue | ifq_erb_io_ue}} & thr_l2ie; |
---|
700 | assign l2if_corr_err = {4{ifq_erb_ifet_ce}} & thr_l2ie; |
---|
701 | |
---|
702 | |
---|
703 | //------------------------------------- |
---|
704 | // Error Detection -- itlb asi errors |
---|
705 | //------------------------------------- |
---|
706 | assign itlb_tagerr_s1 = (erd_erc_tlbt_pe_s1[0] ^ erd_erc_tlbt_pe_s1[1]) & |
---|
707 | asi_ttevld_s1; |
---|
708 | assign itlb_dataerr_s1 = (erd_erc_tlbd_pe_s1[0] ^ erd_erc_tlbd_pe_s1[1]) & |
---|
709 | asi_tdevld_s1; |
---|
710 | |
---|
711 | dff_s #(1) itdate_ff(.din (itlb_dataerr_s1), |
---|
712 | .q (asi_daterr_d1), |
---|
713 | .clk (clk), .se(se), .si(), .so()); |
---|
714 | dff_s #(1) ittage_ff(.din (itlb_tagerr_s1), |
---|
715 | .q (asi_tagerr_d1), |
---|
716 | .clk (clk), .se(se), .si(), .so()); |
---|
717 | |
---|
718 | assign asi_rd_err_d1 = asi_daterr_d1 | asi_tagerr_d1; |
---|
719 | assign ifu_lsu_asi_rd_unc = asi_rd_err_d1; |
---|
720 | |
---|
721 | assign any_tlbasi_err = {4{asi_rd_err_d1}} & asi_thr_w2; |
---|
722 | |
---|
723 | |
---|
724 | //------------------------------ |
---|
725 | // RF errors |
---|
726 | //------------------------------ |
---|
727 | dff_s #(1) irfu_ff(.din (exu_ifu_ecc_ue_m), |
---|
728 | .q (irf_ue_unq), |
---|
729 | .clk (clk), .se (se), .si(), .so()); |
---|
730 | dff_s #(1) irfc_ff(.din (exu_ifu_ecc_ce_m), |
---|
731 | .q (irf_ce_unq), |
---|
732 | .clk (clk), .se (se), .si(), .so()); |
---|
733 | assign irf_ce_w = irf_ce_unq & ifu_tlu_inst_vld_w; |
---|
734 | assign irf_ue_w = irf_ue_unq & ifu_tlu_inst_vld_w; |
---|
735 | |
---|
736 | //------------------ |
---|
737 | // Error Logging |
---|
738 | //------------------ |
---|
739 | // List of all logged errors |
---|
740 | // itlbt u |
---|
741 | // itlbd u/c |
---|
742 | // ict c |
---|
743 | // icd c |
---|
744 | // irf c/u |
---|
745 | // frf c/u |
---|
746 | // dtlb d/t u |
---|
747 | // dct c |
---|
748 | // dcd c |
---|
749 | // mau u |
---|
750 | // l2-d u |
---|
751 | // l2-i u |
---|
752 | // dram u -- not any more |
---|
753 | // io u |
---|
754 | // |
---|
755 | // Errors not logged but causing a trap |
---|
756 | // l2-d c |
---|
757 | // l2-i c |
---|
758 | // l2-s c |
---|
759 | // |
---|
760 | |
---|
761 | // latest errors have highest priority |
---|
762 | // lsu is latest and sometimes asynchronous |
---|
763 | // spu has low priority |
---|
764 | // irf/frf are always "current" |
---|
765 | // ifu errors are speculative ("early") |
---|
766 | // All lsu errors are prioritised at the source |
---|
767 | assign dmdu_nxt = {4{lsu_dtlb_data_ue & ~erb_reset}} & thr_lsu_err & |
---|
768 | ~any_ue_vld | |
---|
769 | dmdu & ~({4{dmdu_wrt_data}} & asi_wrt_err_stat); |
---|
770 | // 6310 |
---|
771 | assign dmsu_nxt = {4{lsu_dtlb_data_su & ~erb_reset}} & thr_lsu_err & |
---|
772 | ~any_ue_vld | |
---|
773 | dmsu & ~({4{dmsu_wrt_data}} & asi_wrt_err_stat); |
---|
774 | assign dmt_nxt = {4{lsu_dtlb_tag_ue & ~erb_reset}} & thr_lsu_err & |
---|
775 | ~any_ue_vld | |
---|
776 | dmt & ~({4{dmt_wrt_data}} & asi_wrt_err_stat); |
---|
777 | assign ddc_nxt = {4{lsu_dcache_data_perror & ~erb_reset}} & thr_lsu_err & |
---|
778 | ~any_err_vld | |
---|
779 | ddc & ~({4{ddc_wrt_data}} & asi_wrt_err_stat); |
---|
780 | assign dtc_nxt = {4{lsu_dcache_tag_perror & ~erb_reset}} & thr_lsu_err & |
---|
781 | ~any_err_vld | |
---|
782 | dtc & ~({4{dtc_wrt_data}} & asi_wrt_err_stat); |
---|
783 | |
---|
784 | assign ldau_nxt = (mov_ely_reg_w & early_ldau | |
---|
785 | {4{lsu_l2_unc_error}} & thr_lsu_err | |
---|
786 | {4{spu_unc_err_w2}} & thr_spu_err) & |
---|
787 | ~any_ue_vld | |
---|
788 | ldau & ~({4{ldau_wrt_data}} & asi_wrt_err_stat); |
---|
789 | |
---|
790 | assign ncu_nxt = (mov_ely_reg_w & early_ncu | |
---|
791 | {4{lsu_io_error}} & thr_lsu_err) & |
---|
792 | ~any_ue_vld | |
---|
793 | ncu & ~({4{ncu_wrt_data}} & asi_wrt_err_stat); |
---|
794 | |
---|
795 | assign any_lsu_ue = thr_lsu_err & {4{lsu_dtlb_data_ue | |
---|
796 | lsu_dtlb_data_su | |
---|
797 | lsu_dtlb_tag_ue | |
---|
798 | lsu_l2_unc_error | |
---|
799 | lsu_io_error}}; |
---|
800 | |
---|
801 | assign any_lsu_ce = thr_lsu_err & |
---|
802 | {4{(lsu_dcache_data_perror | |
---|
803 | lsu_dcache_tag_perror | |
---|
804 | lsu_l2_corr_error) & |
---|
805 | ~lsu_dtlb_data_ue & |
---|
806 | ~lsu_dtlb_data_su}}; |
---|
807 | |
---|
808 | assign any_lsu_err = (any_lsu_ue | |
---|
809 | thr_lsu_err & {4{lsu_dcache_data_perror | |
---|
810 | lsu_dcache_tag_perror}}); |
---|
811 | |
---|
812 | // MAmem parity error |
---|
813 | assign mau_nxt = {4{spu_mamem_err_w2}} & thr_spu_err & |
---|
814 | ~any_ue_vld | |
---|
815 | mau & ~({4{mau_wrt_data}} & asi_wrt_err_stat); |
---|
816 | |
---|
817 | assign any_spu_ce = {4{spu_ifu_corr_err_w2 & ~spu_unc_err_w2}} & thr_spu_err; |
---|
818 | assign any_spu_ue = {4{spu_unc_err_w2 | |
---|
819 | spu_mamem_err_w2}} & thr_spu_err; |
---|
820 | |
---|
821 | // tlb asi read error |
---|
822 | assign imt_nxt = {4{asi_tagerr_d1 & ~erb_reset}} & asi_thr_w2 & |
---|
823 | ~any_ue_vld | |
---|
824 | imt & ~({4{imt_wrt_data}} & asi_wrt_err_stat); |
---|
825 | |
---|
826 | dff_s #(2) ffu_err_reg(.din ({ffu_ifu_ecc_ce_w2, |
---|
827 | ffu_ifu_ecc_ue_w2}), |
---|
828 | .q ({ffu_ce_w3, |
---|
829 | ffu_ue_w3}), |
---|
830 | .clk (clk), .se(se), .si(), .so()); |
---|
831 | |
---|
832 | dff_s #(2) fptid_reg(.din (ffu_ifu_tid_w2[1:0]), |
---|
833 | .q (ffu_tid_w3[1:0]), |
---|
834 | .clk (clk), .se(se), .si(), .so()); |
---|
835 | |
---|
836 | assign ffu_thr_w3[0] = ~ffu_tid_w3[1] & ~ffu_tid_w3[0]; |
---|
837 | assign ffu_thr_w3[1] = ~ffu_tid_w3[1] & ffu_tid_w3[0]; |
---|
838 | assign ffu_thr_w3[2] = ffu_tid_w3[1] & ~ffu_tid_w3[0]; |
---|
839 | assign ffu_thr_w3[3] = ffu_tid_w3[1] & ffu_tid_w3[0]; |
---|
840 | |
---|
841 | |
---|
842 | // regfile error |
---|
843 | //Bug6420: log frc and irc bits as well when fru and iru are detected simulatneously |
---|
844 | assign frc_nxt = {4{ffu_ce_w3 & ~erb_reset}} & |
---|
845 | ffu_thr_w3 & ~any_err_vld & ~any_lsu_err | |
---|
846 | frc & ~({4{frc_wrt_data}} & asi_wrt_err_stat); |
---|
847 | |
---|
848 | assign fru_nxt = {4{ffu_ue_w3 & ~erb_reset}} & ffu_thr_w3 & |
---|
849 | ~any_ue_vld & ~any_lsu_ue | |
---|
850 | fru & ~({4{fru_wrt_data}} & asi_wrt_err_stat); |
---|
851 | |
---|
852 | //Bug6420 |
---|
853 | assign irc_nxt = {4{irf_ce_w & ~erb_reset}} & thr_w & |
---|
854 | ~any_err_vld & ~any_lsu_err | |
---|
855 | irc & ~({4{irc_wrt_data}} & asi_wrt_err_stat); |
---|
856 | |
---|
857 | assign iru_nxt = {4{irf_ue_w & ~erb_reset}} & thr_w & |
---|
858 | ~any_ue_vld & ~any_lsu_ue | |
---|
859 | iru & ~({4{iru_wrt_data}} & asi_wrt_err_stat); |
---|
860 | |
---|
861 | assign any_irf_err = thr_w & {4{irf_ce_w | irf_ue_w}}; |
---|
862 | assign any_frf_err = ffu_thr_w3 & {4{ffu_ce_w3 | ffu_ue_w3}}; |
---|
863 | |
---|
864 | //Bug6420 |
---|
865 | assign any_rf_ce = thr_w & {4{irf_ce_w}} | |
---|
866 | ffu_thr_w3 & {4{ffu_ce_w3}}; |
---|
867 | assign any_rf_ue = thr_w & {4{irf_ue_w}} | |
---|
868 | ffu_thr_w3 & {4{ffu_ue_w3}}; |
---|
869 | assign any_rf_err = any_irf_err | any_frf_err; |
---|
870 | |
---|
871 | |
---|
872 | // ifu errors |
---|
873 | assign idc_nxt = mov_ely_reg_w & ~any_err_vld & early_idc | |
---|
874 | idc & ~({4{idc_wrt_data}} & asi_wrt_err_stat); |
---|
875 | |
---|
876 | assign itc_nxt = mov_ely_reg_w & ~any_err_vld & early_itc | |
---|
877 | itc & ~({4{itc_wrt_data}} & asi_wrt_err_stat); |
---|
878 | |
---|
879 | // bug 6310 |
---|
880 | assign imdu_nxt = (mov_ely_reg_w & early_imdu | |
---|
881 | {4{asi_daterr_d1 & ~erb_reset}} & asi_thr_w2) & |
---|
882 | ~any_ue_vld | |
---|
883 | imdu & ~({4{imdu_wrt_data}} & asi_wrt_err_stat); |
---|
884 | |
---|
885 | // assign imdc_nxt = mov_ely_reg_w & ~any_err_vld & early_imdc | |
---|
886 | // imdc & ~({4{imdc_wrt_data}} & asi_wrt_err_stat); |
---|
887 | |
---|
888 | dff_s #(64) errvec_reg(.din ({imt_nxt, imdu_nxt, idc_nxt, itc_nxt, |
---|
889 | iru_nxt, irc_nxt, fru_nxt, frc_nxt, |
---|
890 | dmt_nxt, dmdu_nxt, dmsu_nxt, ddc_nxt, dtc_nxt, |
---|
891 | ldau_nxt, ncu_nxt, mau_nxt}), |
---|
892 | .q ({imt, imdu, idc, itc, |
---|
893 | iru, irc, fru, frc, |
---|
894 | dmt, dmdu, dmsu, ddc, dtc, |
---|
895 | ldau, ncu, mau}), |
---|
896 | .clk (clk), |
---|
897 | .se (se), .si(), .so()); |
---|
898 | |
---|
899 | assign any_err_vld = imt | imdu | idc | itc | iru | irc | fru | frc | |
---|
900 | dmt | dmdu | dmsu | ddc | dtc | ldau | ncu | mau; |
---|
901 | |
---|
902 | assign any_ue_vld = imt | imdu | iru | fru | |
---|
903 | dmt | dmdu | dmsu | ldau | ncu | mau; |
---|
904 | |
---|
905 | // assign any_ce_vld = imdc | idc | itc | irc | frc | |
---|
906 | // dmdc | ddc | dtc; |
---|
907 | |
---|
908 | // IFU errors |
---|
909 | assign any_ifu_ue = {4{(ifq_erb_l2_ue | ifq_erb_io_ue) & ~erb_reset}} & |
---|
910 | thr_l2ie | |
---|
911 | {4{tlb_fet_ue_d1 & ~erb_reset}} & thr_d1; |
---|
912 | |
---|
913 | assign any_ifu_ce = {4{ifq_erb_ifet_ce & ~erb_reset}} & thr_l2ie | |
---|
914 | {4{(tlb_fet_ce_d1 | insterr_qual_d1 | |
---|
915 | ictagerr_qual_d1) & ~erb_reset}} & |
---|
916 | thr_d1; |
---|
917 | |
---|
918 | assign any_ifu_err = any_ifu_ce | any_ifu_ue; |
---|
919 | |
---|
920 | |
---|
921 | assign ifet_ce_vld = early_idc | early_itc | early_l2ce; |
---|
922 | assign ifet_ue_vld = early_imdu | early_ldau | early_ncu; |
---|
923 | |
---|
924 | // l2ce's are not logged in sparc, so leave them out |
---|
925 | assign any_iferr_vld = ifet_ue_vld | early_idc | early_itc; |
---|
926 | |
---|
927 | // Early errors |
---|
928 | assign early_idc_nxt = {4{insterr_qual_d1}} & thr_d1 & |
---|
929 | ~any_iferr_vld & ~any_rf_err & ~any_lsu_err | |
---|
930 | early_idc & ~clear_iferr_d1 & |
---|
931 | ~mov_ely_reg_w; |
---|
932 | |
---|
933 | assign early_itc_nxt = {4{ictagerr_qual_d1}} & thr_d1 & |
---|
934 | ~any_iferr_vld & ~any_rf_err & ~any_lsu_err | |
---|
935 | early_itc & ~clear_iferr_d1 & |
---|
936 | ~mov_ely_reg_w; |
---|
937 | |
---|
938 | assign early_imdu_nxt = {4{tlb_fet_ue_d1}} & thr_d1 & |
---|
939 | ~ifet_ue_vld & ~any_rf_ue & ~any_lsu_ue | |
---|
940 | early_imdu & ~clear_iferr_d1 & |
---|
941 | ~mov_ely_reg_w; |
---|
942 | |
---|
943 | // assign early_imdc_nxt = {4{tlb_fet_ce_d1}} & thr_d1 & |
---|
944 | // ~any_iferr_vld & ~any_rf_err & ~any_lsu_err | |
---|
945 | // early_imdc & ~clear_iferr_d1 & |
---|
946 | // ~mov_ely_reg_w; |
---|
947 | |
---|
948 | assign early_ldau_nxt = {4{ifq_erb_l2_ue & ~erb_reset}} & thr_l2ie & |
---|
949 | ~ifet_ue_vld & ~any_rf_ue & ~any_lsu_ue | |
---|
950 | early_ldau & ~clear_iferr_d1 & |
---|
951 | ~mov_ely_reg_w; |
---|
952 | |
---|
953 | assign early_ncu_nxt = {4{ifq_erb_io_ue & ~erb_reset}} & thr_l2ie & |
---|
954 | ~ifet_ue_vld & ~any_rf_ue & ~any_lsu_ue | |
---|
955 | early_ncu & ~clear_iferr_d1 & |
---|
956 | ~mov_ely_reg_w; |
---|
957 | |
---|
958 | assign early_l2ce_nxt = {4{ifq_erb_ifet_ce}} & thr_l2ie & |
---|
959 | ~any_iferr_vld & ~any_rf_err & ~any_lsu_err | |
---|
960 | early_l2ce & ~clear_iferr_d1 & |
---|
961 | ~mov_ely_reg_w; |
---|
962 | |
---|
963 | dffr_s #(24) elyerr_reg(.din ({early_idc_nxt, |
---|
964 | early_itc_nxt, |
---|
965 | early_imdu_nxt, |
---|
966 | early_ldau_nxt, |
---|
967 | early_ncu_nxt, |
---|
968 | early_l2ce_nxt}), |
---|
969 | .q ({early_idc, |
---|
970 | early_itc, |
---|
971 | early_imdu, |
---|
972 | early_ldau, |
---|
973 | early_ncu, |
---|
974 | early_l2ce}), |
---|
975 | .clk (clk), |
---|
976 | .rst (erb_reset), |
---|
977 | .se (se), .si(), .so()); |
---|
978 | |
---|
979 | // Multipl errors |
---|
980 | assign meu_nxt = any_ue_vld & (any_lsu_ue | any_rf_ue | any_tlbasi_err | |
---|
981 | any_spu_ue | |
---|
982 | mov_ely_reg_w & ifet_ue_vld) | |
---|
983 | // known bug - wontfix |
---|
984 | // mov_ely_reg_w & early_meu | |
---|
985 | meu & ~({4{meu_wrt_data}} & asi_wrt_err_stat); |
---|
986 | |
---|
987 | assign mec_nxt = any_err_vld & (any_lsu_ce | any_rf_ce | |
---|
988 | mov_ely_reg_w & ifet_ce_vld) | |
---|
989 | // known bug - wontfix |
---|
990 | // mov_ely_reg_w & early_mec | |
---|
991 | mec & ~({4{mec_wrt_data}} & asi_wrt_err_stat); |
---|
992 | |
---|
993 | //Bug6821 |
---|
994 | assign priv_nxt = ~any_err_vld & (any_lsu_ue_priv_state & any_lsu_ue | |
---|
995 | any_priv_state & (any_lsu_ce | any_rf_err | any_tlbasi_err) | |
---|
996 | mov_ely_reg_w & early_priv) | |
---|
997 | priv & ~({4{priv_wrt_data}} & asi_wrt_err_stat); |
---|
998 | |
---|
999 | dffr_s #(12) me_reg(.din ({meu_nxt, |
---|
1000 | mec_nxt, |
---|
1001 | priv_nxt}), |
---|
1002 | .q ({meu, |
---|
1003 | mec, |
---|
1004 | priv}), |
---|
1005 | .clk (clk), |
---|
1006 | .rst (erb_reset), |
---|
1007 | .se (se), .si(), .so()); |
---|
1008 | |
---|
1009 | // Early multiple errors |
---|
1010 | assign early_meu_nxt = any_ifu_ue & ifet_ue_vld | |
---|
1011 | early_meu & ~clear_iferr_d1 & ~mov_ely_reg_w; |
---|
1012 | |
---|
1013 | assign early_mec_nxt = any_ifu_ce & any_iferr_vld | |
---|
1014 | early_mec & ~clear_iferr_d1 & ~mov_ely_reg_w; |
---|
1015 | |
---|
1016 | // bug 6155 & 6821 |
---|
1017 | assign early_priv_nxt = any_priv_state & ~any_iferr_vld & ~any_rf_err & ~any_lsu_err & any_ifu_err | |
---|
1018 | early_priv & ~clear_iferr_d1 & ~mov_ely_reg_w; |
---|
1019 | |
---|
1020 | dffr_s #(12) elyme_reg(.din ({early_meu_nxt, |
---|
1021 | early_mec_nxt, |
---|
1022 | early_priv_nxt}), |
---|
1023 | .q ({early_meu, |
---|
1024 | early_mec, |
---|
1025 | early_priv}), |
---|
1026 | .clk (clk), |
---|
1027 | .rst (erb_reset), |
---|
1028 | .se (se), .si(), .so()); |
---|
1029 | |
---|
1030 | // pipeline progress |
---|
1031 | dff_s #(1) clre_ff(.din (fcl_erb_inst_issue_d), |
---|
1032 | .q (clr_elyff_e), |
---|
1033 | .clk (clk), .se(se), .si(), .so()); |
---|
1034 | assign early_err_vec_e = (any_iferr_vld | early_l2ce) & thr_e; |
---|
1035 | assign clr_err_qual_e = (|early_err_vec_e[3:0]) & clr_elyff_e; |
---|
1036 | |
---|
1037 | dff_s #(1) clrm_ff(.din (clr_err_qual_e), |
---|
1038 | .q (clr_elyff_m), |
---|
1039 | .clk (clk), .se(se), .si(), .so()); |
---|
1040 | dff_s #(1) clrw_ff(.din (clr_elyff_m), |
---|
1041 | .q (clr_elyff_w), |
---|
1042 | .clk (clk), .se(se), .si(), .so()); |
---|
1043 | |
---|
1044 | // fix for 6142 and 6159 |
---|
1045 | // delay err reg clear by one cycle to prevent clearing your own errors |
---|
1046 | dff_s #(4) clree_reg(.din (fcl_erb_clear_iferr), |
---|
1047 | .q (clear_iferr_d1), |
---|
1048 | .clk (clk), .se(se), .si(), .so()); |
---|
1049 | |
---|
1050 | |
---|
1051 | assign clear_ely_reg_w = {4{clr_elyff_w}} & thr_w & |
---|
1052 | (any_iferr_vld | early_l2ce); // why again? |
---|
1053 | assign mov_ely_reg_w = clear_ely_reg_w & |
---|
1054 | {4{ifu_tlu_inst_vld_w & ~erb_reset}}; |
---|
1055 | |
---|
1056 | |
---|
1057 | // asi error status output |
---|
1058 | assign err_stat0 = {meu[0], mec[0], priv[0], |
---|
1059 | 3'b100, // rw, enc, ma |
---|
1060 | imdu[0], imt[0], |
---|
1061 | dmdu[0], dmt[0], |
---|
1062 | idc[0], itc[0], ddc[0], dtc[0], |
---|
1063 | irc[0], iru[0], frc[0], fru[0], |
---|
1064 | ldau[0], ncu[0], |
---|
1065 | dmsu[0], 1'b0, mau[0]}; |
---|
1066 | |
---|
1067 | assign err_stat1 = {meu[1], mec[1], priv[1], |
---|
1068 | 3'b100, |
---|
1069 | imdu[1], imt[1], |
---|
1070 | dmdu[1], dmt[1], |
---|
1071 | idc[1], itc[1], ddc[1], dtc[1], |
---|
1072 | irc[1], iru[1], frc[1], fru[1], |
---|
1073 | ldau[1], ncu[1], |
---|
1074 | dmsu[1], 1'b0, mau[1]}; |
---|
1075 | |
---|
1076 | assign err_stat2 = {meu[2], mec[2], priv[2], |
---|
1077 | 3'b100, |
---|
1078 | imdu[2], imt[2], |
---|
1079 | dmdu[2], dmt[2], |
---|
1080 | idc[2], itc[2], ddc[2], dtc[2], |
---|
1081 | irc[2], iru[2], frc[2], fru[2], |
---|
1082 | ldau[2], ncu[2], |
---|
1083 | dmsu[2], 1'b0, mau[2]}; |
---|
1084 | |
---|
1085 | assign err_stat3 = {meu[3], mec[3], priv[3], |
---|
1086 | 3'b100, |
---|
1087 | imdu[3], imt[3], |
---|
1088 | dmdu[3], dmt[3], |
---|
1089 | idc[3], itc[3], ddc[3], dtc[3], |
---|
1090 | irc[3], iru[3], frc[3], fru[3], |
---|
1091 | ldau[3], ncu[3], |
---|
1092 | dmsu[3], 1'b0, mau[3]}; |
---|
1093 | |
---|
1094 | mux4ds #(23) err_stat_asi(.dout (erc_erd_errstat_asidata), |
---|
1095 | .in0 (err_stat0), |
---|
1096 | .in1 (err_stat1), |
---|
1097 | .in2 (err_stat2), |
---|
1098 | .in3 (err_stat3), |
---|
1099 | .sel0 (asi_thr_s[0]), |
---|
1100 | .sel1 (asi_thr_s[1]), |
---|
1101 | .sel2 (asi_thr_s[2]), |
---|
1102 | .sel3 (asi_thr_s[3])); |
---|
1103 | |
---|
1104 | //---------------------------------- |
---|
1105 | // Error Address Selection |
---|
1106 | //---------------------------------- |
---|
1107 | |
---|
1108 | // TBD: Uncorrectible errors have to overwrite correctible errors |
---|
1109 | // mux 0 |
---|
1110 | // FRF errors are mutex with everything else |
---|
1111 | // ITLB asi errors are mutex with everything else |
---|
1112 | // ASI writes are mutex with everything else |
---|
1113 | // only one of these errors could occur at a given time |
---|
1114 | assign erc_erd_eadr0_sel_lsu_l = ~(sel_lsu_err); |
---|
1115 | |
---|
1116 | assign erc_erd_eadr0_sel_irf_l = ~(~sel_lsu_err & any_irf_err); |
---|
1117 | |
---|
1118 | assign erc_erd_eadr0_sel_itlb_l = ~(~sel_lsu_err & ~any_irf_err & |
---|
1119 | any_tlbasi_err); |
---|
1120 | |
---|
1121 | assign erc_erd_eadr0_sel_frf_l = ~(~sel_lsu_err & ~any_irf_err & |
---|
1122 | ~any_tlbasi_err); |
---|
1123 | |
---|
1124 | // mux 1 |
---|
1125 | // l1 pa and tlb feterr can be simultaneous |
---|
1126 | // TBD: need to reorder and make spu lower priority? |
---|
1127 | assign erc_erd_eadr1_sel_other_l = ~(any_spu_ue); |
---|
1128 | |
---|
1129 | assign erc_erd_eadr1_sel_l2pa_l = ~(~any_spu_ue & |
---|
1130 | (l2if_unc_err | l2if_corr_err)); |
---|
1131 | |
---|
1132 | assign erc_erd_eadr1_sel_pcd1_l = ~(~l2if_unc_err & ~l2if_corr_err & |
---|
1133 | ~any_spu_ue & |
---|
1134 | thr_d1 & {4{tlb_feterr_d1}}); |
---|
1135 | |
---|
1136 | assign erc_erd_eadr1_sel_l1pa_l = ~(~l2if_unc_err & ~l2if_corr_err & |
---|
1137 | ({4{~tlb_feterr_d1}} | ~thr_d1) & |
---|
1138 | ~any_spu_ue); |
---|
1139 | |
---|
1140 | // assign erc_erd_eadr1_sel_other_l = ~(~l2if_unc_err & ~l2if_corr_err & |
---|
1141 | // {4{~tlb_feterr_d1}} & ~icache_pa_err_d1); |
---|
1142 | |
---|
1143 | |
---|
1144 | // mux2 |
---|
1145 | assign sel_lsu_err = ~any_err_vld & any_lsu_err | |
---|
1146 | ~any_ue_vld & any_lsu_ue; |
---|
1147 | |
---|
1148 | assign sel_ifuspu_err = (~any_err_vld & ~any_iferr_vld & any_ifu_err | |
---|
1149 | ~any_ue_vld & any_spu_ue | |
---|
1150 | ~any_ue_vld & ~ifet_ue_vld & any_ifu_ue); |
---|
1151 | |
---|
1152 | assign sel_rftlb_err = ~any_ue_vld & (any_rf_ue | |
---|
1153 | any_tlbasi_err) | |
---|
1154 | ~any_err_vld & any_rf_ce; |
---|
1155 | |
---|
1156 | |
---|
1157 | assign erc_erd_eadr2_sel_wrt_l = ~(asi_wrt_err_addr); |
---|
1158 | |
---|
1159 | assign erc_erd_eadr2_sel_mx0_l = ~(~asi_wrt_err_addr & |
---|
1160 | (sel_lsu_err | |
---|
1161 | sel_rftlb_err)); |
---|
1162 | |
---|
1163 | assign erc_erd_eadr2_sel_mx1_l = ~(~sel_lsu_err & |
---|
1164 | ~asi_wrt_err_addr & |
---|
1165 | ~sel_rftlb_err & |
---|
1166 | sel_ifuspu_err); |
---|
1167 | |
---|
1168 | assign erc_erd_eadr2_sel_old_l = ~(~sel_lsu_err & |
---|
1169 | ~asi_wrt_err_addr & |
---|
1170 | ~sel_rftlb_err & |
---|
1171 | ~sel_ifuspu_err); |
---|
1172 | |
---|
1173 | //----------------------------- |
---|
1174 | // Error Enable Reg |
---|
1175 | //----------------------------- |
---|
1176 | assign nceen_nxt = asi_wrt_err_en & {4{nceen_wrt_data}} | |
---|
1177 | ~asi_wrt_err_en & nceen; |
---|
1178 | |
---|
1179 | assign ceen_nxt = asi_wrt_err_en & {4{ceen_wrt_data}} | |
---|
1180 | ~asi_wrt_err_en & ceen; |
---|
1181 | |
---|
1182 | dffr_s #(8) err_en_reg(.din ({nceen_nxt, ceen_nxt}), |
---|
1183 | .q ({nceen, ceen}), |
---|
1184 | .rst (erb_reset), |
---|
1185 | .clk (clk), .se(se), .si(), .so()); |
---|
1186 | |
---|
1187 | assign nceen_d = (thr_d[0] & nceen[0] | |
---|
1188 | thr_d[1] & nceen[1] | |
---|
1189 | thr_d[2] & nceen[2] | |
---|
1190 | thr_d[3] & nceen[3]); |
---|
1191 | |
---|
1192 | dff_s #(1) nce_ff(.din (nceen_d), |
---|
1193 | .q (ifu_exu_nceen_e), |
---|
1194 | .clk (clk), .se(se), .si(), .so()); |
---|
1195 | |
---|
1196 | assign ifu_lsu_nceen = nceen; |
---|
1197 | assign ifu_spu_nceen = nceen; |
---|
1198 | |
---|
1199 | assign ifu_ce_trap = mov_ely_reg_w & ifet_ce_vld; |
---|
1200 | assign ce_trapvec = (ifu_ce_trap | |
---|
1201 | any_rf_ce | |
---|
1202 | {4{ifq_erb_ce_rep}} & thr_l2ie | |
---|
1203 | any_spu_ce | |
---|
1204 | any_lsu_ce) & ceen; |
---|
1205 | |
---|
1206 | dff_s #(4) ceint_reg(.din (ce_trapvec), |
---|
1207 | .q (erb_fcl_ce_trapvec), |
---|
1208 | .clk (clk), .se(se), .si(), .so()); |
---|
1209 | |
---|
1210 | assign ue_trapvec = ({4{ifq_erb_ue_rep}} & thr_l2ie | |
---|
1211 | any_spu_ue & {4{spu_ifu_int_w2}}) & nceen; |
---|
1212 | |
---|
1213 | assign erb_fcl_spu_uetrap = any_spu_ue & nceen; |
---|
1214 | |
---|
1215 | dff_s #(4) ueint_reg(.din (ue_trapvec), |
---|
1216 | .q (erb_fcl_ue_trapvec), |
---|
1217 | .clk (clk), .se(se), .si(), .so()); |
---|
1218 | |
---|
1219 | |
---|
1220 | mux4ds #(2) err_en_asi(.dout (erc_erd_erren_asidata), |
---|
1221 | .in0 ({nceen[0], ceen[0]}), |
---|
1222 | .in1 ({nceen[1], ceen[1]}), |
---|
1223 | .in2 ({nceen[2], ceen[2]}), |
---|
1224 | .in3 ({nceen[3], ceen[3]}), |
---|
1225 | .sel0 (asi_thr_s[0]), |
---|
1226 | .sel1 (asi_thr_s[1]), |
---|
1227 | .sel2 (asi_thr_s[2]), |
---|
1228 | .sel3 (asi_thr_s[3])); |
---|
1229 | |
---|
1230 | //------------------------- |
---|
1231 | // Error Inject |
---|
1232 | //------------------------- |
---|
1233 | assign wrt_errinj_i2 = (ifq_erb_asi_errinj_i2 & ifq_erb_asiwr_i2); |
---|
1234 | assign ecc_mask_nxt = wrt_errinj_i2 ? ifq_erb_asidata_i2[7:0] : |
---|
1235 | ecc_mask[7:0]; |
---|
1236 | |
---|
1237 | assign errinj_ctl_nxt[1:0] = wrt_errinj_i2 ? ifq_erb_asidata_i2[31:30] : |
---|
1238 | errinj_ctl[1:0]; |
---|
1239 | |
---|
1240 | // correct for single shot |
---|
1241 | assign errinj_vec_nxt[5:0] = wrt_errinj_i2 ? ifq_erb_asidata_i2[29:24] : |
---|
1242 | errinj_ctl[0] ? corr_errinj_vec : |
---|
1243 | errinj_vec; |
---|
1244 | |
---|
1245 | dffr_s #(16) errinj_reg(.din ({errinj_ctl_nxt, |
---|
1246 | errinj_vec_nxt, |
---|
1247 | ecc_mask_nxt}), |
---|
1248 | .q ({errinj_ctl, |
---|
1249 | errinj_vec, |
---|
1250 | ecc_mask}), |
---|
1251 | .rst (erb_reset), |
---|
1252 | .clk (clk), .se (se), .si(), .so()); |
---|
1253 | |
---|
1254 | assign ifu_exu_ecc_mask = ecc_mask; |
---|
1255 | assign ifu_exu_inj_irferr = errinj_vec[1] & errinj_ctl[1]; |
---|
1256 | assign ifu_ffu_inj_frferr = errinj_vec[0] & errinj_ctl[1]; |
---|
1257 | assign ifu_lsu_error_inj[3:0] = errinj_vec[5:2] & {4{errinj_ctl[1]}}; |
---|
1258 | |
---|
1259 | assign corr_errinj_vec[5:0] = errinj_vec[5:0] & ~{lsu_ifu_inj_ack[3:0], |
---|
1260 | exu_ifu_inj_ack, |
---|
1261 | ffu_ifu_inj_ack}; |
---|
1262 | assign erc_erd_errinj_asidata = {errinj_ctl, |
---|
1263 | errinj_vec, |
---|
1264 | 16'b0, |
---|
1265 | ecc_mask}; |
---|
1266 | |
---|
1267 | //-------------------------- |
---|
1268 | // ASI Stuff |
---|
1269 | //-------------------------- |
---|
1270 | |
---|
1271 | dff_s #(2) asiways_reg(.din (ifq_erb_asiway_f), |
---|
1272 | .q (asi_way_s1), |
---|
1273 | .clk (clk), .se(se), .si(), .so()); |
---|
1274 | |
---|
1275 | assign dec_asiway_s1[0] = ~asi_way_s1[1] & ~asi_way_s1[0]; |
---|
1276 | assign dec_asiway_s1[1] = ~asi_way_s1[1] & asi_way_s1[0]; |
---|
1277 | assign dec_asiway_s1[2] = asi_way_s1[1] & ~asi_way_s1[0]; |
---|
1278 | assign dec_asiway_s1[3] = asi_way_s1[1] & asi_way_s1[0]; |
---|
1279 | |
---|
1280 | assign erc_erd_asiway_s1_l = ~dec_asiway_s1; |
---|
1281 | |
---|
1282 | assign asi_thr_i2[0] = ~ifq_fcl_asi_tid_bf[1] & ~ifq_fcl_asi_tid_bf[0]; |
---|
1283 | assign asi_thr_i2[1] = ~ifq_fcl_asi_tid_bf[1] & ifq_fcl_asi_tid_bf[0]; |
---|
1284 | assign asi_thr_i2[2] = ifq_fcl_asi_tid_bf[1] & ~ifq_fcl_asi_tid_bf[0]; |
---|
1285 | assign asi_thr_i2[3] = ifq_fcl_asi_tid_bf[1] & ifq_fcl_asi_tid_bf[0]; |
---|
1286 | |
---|
1287 | dff_s #(2) asi_tids_reg(.din (fcl_erb_asi_tid_f), |
---|
1288 | .q (asi_tid_s1), |
---|
1289 | .clk (clk), .se(se), .si(), .so()); |
---|
1290 | dff_s #(2) asi_tidw2_reg(.din (asi_tid_s1), |
---|
1291 | .q (asi_tid_w2), |
---|
1292 | .clk (clk), .se(se), .si(), .so()); |
---|
1293 | assign ifu_lsu_ldxa_tid_w2 = asi_tid_w2; |
---|
1294 | |
---|
1295 | assign erc_erd_asi_thr_l = ~asi_thr_s; |
---|
1296 | |
---|
1297 | assign asi_thr_s[0] = ~asi_tid_s1[1] & ~asi_tid_s1[0]; |
---|
1298 | assign asi_thr_s[1] = ~asi_tid_s1[1] & asi_tid_s1[0]; |
---|
1299 | assign asi_thr_s[2] = asi_tid_s1[1] & ~asi_tid_s1[0]; |
---|
1300 | assign asi_thr_s[3] = asi_tid_s1[1] & asi_tid_s1[0]; |
---|
1301 | |
---|
1302 | assign asi_thr_w2[0] = ~asi_tid_w2[1] & ~asi_tid_w2[0]; |
---|
1303 | assign asi_thr_w2[1] = ~asi_tid_w2[1] & asi_tid_w2[0]; |
---|
1304 | assign asi_thr_w2[2] = asi_tid_w2[1] & ~asi_tid_w2[0]; |
---|
1305 | assign asi_thr_w2[3] = asi_tid_w2[1] & asi_tid_w2[0]; |
---|
1306 | |
---|
1307 | |
---|
1308 | // F stage flops |
---|
1309 | dff_s #(1) asi_en_ff(.din (ifq_erb_asi_erren_i2), |
---|
1310 | .q (asi_erren_f), |
---|
1311 | .clk (clk), .se(se), .si(), .so()); |
---|
1312 | |
---|
1313 | dff_s #(1) asi_stat_ff(.din (ifq_erb_asi_errstat_i2), |
---|
1314 | .q (asi_errstat_f), |
---|
1315 | .clk (clk), .se(se), .si(), .so()); |
---|
1316 | |
---|
1317 | dff_s #(1) asi_addr_ff(.din (ifq_erb_asi_erraddr_i2), |
---|
1318 | .q (asi_erraddr_f), |
---|
1319 | .clk (clk), .se(se), .si(), .so()); |
---|
1320 | |
---|
1321 | dff_s #(1) asi_inj_ff(.din (ifq_erb_asi_errinj_i2), |
---|
1322 | .q (asi_errinj_f), |
---|
1323 | .clk (clk), .se(se), .si(), .so()); |
---|
1324 | |
---|
1325 | dff_s #(1) asi_im_ff(.din (ifq_erb_asi_imask_i2), |
---|
1326 | .q (asi_imask_f), |
---|
1327 | .clk (clk), .se(se), .si(), .so()); |
---|
1328 | |
---|
1329 | // S stage Flops |
---|
1330 | dff_s #(1) asi_ens_ff(.din (asi_erren_f), |
---|
1331 | .q (asi_erren_s), |
---|
1332 | .clk (clk), .se(se), .si(), .so()); |
---|
1333 | |
---|
1334 | dff_s #(1) asi_stats_ff(.din (asi_errstat_f), |
---|
1335 | .q (asi_errstat_s), |
---|
1336 | .clk (clk), .se(se), .si(), .so()); |
---|
1337 | |
---|
1338 | dff_s #(1) asi_addrs_ff(.din (asi_erraddr_f), |
---|
1339 | .q (asi_erraddr_s), |
---|
1340 | .clk (clk), .se(se), .si(), .so()); |
---|
1341 | |
---|
1342 | dff_s #(1) asi_injs_ff(.din (asi_errinj_f), |
---|
1343 | .q (asi_errinj_s), |
---|
1344 | .clk (clk), .se(se), .si(), .so()); |
---|
1345 | |
---|
1346 | dff_s #(1) asi_ims_ff(.din (asi_imask_f), |
---|
1347 | .q (asi_imask_s), |
---|
1348 | .clk (clk), .se(se), .si(), .so()); |
---|
1349 | |
---|
1350 | // ASI Reads |
---|
1351 | // All ASI reads except TLB |
---|
1352 | dff_s #(1) asi_rdf_ff(.din (ifq_fcl_asird_bf), |
---|
1353 | .q (asird_f), |
---|
1354 | .clk (clk), .se(se), .si(), .so()); |
---|
1355 | dff_s #(1) asi_rds_ff(.din (asird_f), |
---|
1356 | .q (asird_s), |
---|
1357 | .clk (clk), .se(se), .si(), .so()); |
---|
1358 | |
---|
1359 | // fwd reads |
---|
1360 | dff_s #(1) fwd_rdf_ff(.din (ifq_erb_fwdrd_bf), |
---|
1361 | .q (fwdrd_f), |
---|
1362 | .clk (clk), .se(se), .si(), .so()); |
---|
1363 | dff_s #(1) fwd_rds_ff(.din (fwdrd_f), |
---|
1364 | .q (fwdrd_s), |
---|
1365 | .clk (clk), .se(se), .si(), .so()); |
---|
1366 | dff_s #(1) fwd_rdd_ff(.din (fwdrd_s), |
---|
1367 | .q (fwdrd_d), |
---|
1368 | .clk (clk), .se(se), .si(), .so()); |
---|
1369 | |
---|
1370 | assign ifu_lsu_fwd_data_vld = fwdrd_d; |
---|
1371 | assign asifwd_rd_s = asird_s | fwdrd_s; |
---|
1372 | |
---|
1373 | |
---|
1374 | // asi reads from icache |
---|
1375 | dff_s #(1) ic_rdts_ff(.din (ifq_erb_rdtag_f), |
---|
1376 | .q (rdtag_s), |
---|
1377 | .clk (clk), .se(se), .si(), .so()); |
---|
1378 | |
---|
1379 | // forward requests also read instruction memory |
---|
1380 | assign rdinst_f = fwdrd_f | ifq_erb_rdinst_f; |
---|
1381 | |
---|
1382 | dff_s #(1) ic_rdds_ff(.din (rdinst_f), |
---|
1383 | .q (rdinst_s), |
---|
1384 | .clk (clk), .se(se), .si(), .so()); |
---|
1385 | |
---|
1386 | |
---|
1387 | // assign rst_tri_en = 1'b0; |
---|
1388 | |
---|
1389 | // pick err asi source |
---|
1390 | assign erc_erd_errasi_sel_en_l = ~asi_erren_s; |
---|
1391 | assign erc_erd_errasi_sel_stat_l = ~asi_errstat_s | asi_erren_s; |
---|
1392 | assign erc_erd_errasi_sel_inj_l = ~asi_errinj_s | asi_errstat_s | |
---|
1393 | asi_erren_s; |
---|
1394 | assign erc_erd_errasi_sel_addr_l = asi_erren_s | asi_errstat_s | |
---|
1395 | asi_errinj_s; |
---|
1396 | |
---|
1397 | assign err_asi_s = (asi_erren_s | asi_errstat_s | asi_errinj_s | |
---|
1398 | asi_erraddr_s); |
---|
1399 | |
---|
1400 | // pick other asi source |
---|
1401 | assign erc_erd_miscasi_sel_ict_l = ~rdtag_s; |
---|
1402 | assign erc_erd_miscasi_sel_imask_l = ~asi_imask_s | rdtag_s; |
---|
1403 | assign erc_erd_miscasi_sel_other_l = rdtag_s | asi_imask_s; |
---|
1404 | |
---|
1405 | // pick source for final asi loads |
---|
1406 | assign erc_erd_asisrc_sel_icd_s_l = ~(asifwd_rd_s & rdinst_s); |
---|
1407 | assign erc_erd_asisrc_sel_err_s_l = ~(asifwd_rd_s & ~rdinst_s & err_asi_s); |
---|
1408 | assign erc_erd_asisrc_sel_misc_s_l = ~(asifwd_rd_s & ~rdinst_s & ~err_asi_s); |
---|
1409 | assign erc_erd_asisrc_sel_itlb_s_l = ~(~asifwd_rd_s); |
---|
1410 | |
---|
1411 | // is this asi read valid (for checking parity) |
---|
1412 | assign asi_ttevld_s1 = fcl_erb_itlbrd_vld_s & ~fcl_erb_itlbrd_data_s; |
---|
1413 | assign asi_tdevld_s1 = fcl_erb_itlbrd_vld_s & fcl_erb_itlbrd_data_s; |
---|
1414 | |
---|
1415 | assign ldxa_data_vld_s = fcl_erb_itlbrd_vld_s | asird_s; |
---|
1416 | // assign ifu_lsu_ldxa_data_vld_w1 = ldxa_data_vld_s; |
---|
1417 | |
---|
1418 | dff_s #(1) asirdd_ff(.din (ldxa_data_vld_s), |
---|
1419 | .q (ldxa_data_vld_d), |
---|
1420 | .clk (clk), |
---|
1421 | .se (se), .si(), .so()); |
---|
1422 | |
---|
1423 | assign ifu_lsu_ldxa_data_vld_w2 = ldxa_data_vld_d; |
---|
1424 | |
---|
1425 | |
---|
1426 | // ASI Writes |
---|
1427 | assign asi_wrt_err_en = asi_thr_i2 & {4{ifq_erb_asiwr_i2 & |
---|
1428 | ifq_erb_asi_erren_i2}}; |
---|
1429 | assign asi_wrt_err_stat = asi_thr_i2 & {4{ifq_erb_asiwr_i2 & |
---|
1430 | ifq_erb_asi_errstat_i2}}; |
---|
1431 | // err inj is common to the core |
---|
1432 | // assign asi_wrt_err_inj = asi_thr_i2 & {4{ifq_erb_asiwr_i2 & |
---|
1433 | // ifq_erb_asi_errinj_i2}}; |
---|
1434 | assign asi_wrt_err_addr = asi_thr_i2 & {4{ifq_erb_asiwr_i2 & |
---|
1435 | ifq_erb_asi_erraddr_i2}}; |
---|
1436 | |
---|
1437 | assign erc_erd_ld_imask = ifq_erb_asiwr_i2 & ifq_erb_asi_imask_i2; |
---|
1438 | |
---|
1439 | |
---|
1440 | // ASI Write Data |
---|
1441 | assign meu_wrt_data = ifq_erb_asidata_i2[31]; |
---|
1442 | assign mec_wrt_data = ifq_erb_asidata_i2[30]; |
---|
1443 | assign priv_wrt_data = ifq_erb_asidata_i2[29]; |
---|
1444 | |
---|
1445 | assign imdu_wrt_data = ifq_erb_asidata_i2[25]; |
---|
1446 | assign imt_wrt_data = ifq_erb_asidata_i2[24]; |
---|
1447 | assign dmdu_wrt_data = ifq_erb_asidata_i2[23]; |
---|
1448 | assign dmt_wrt_data = ifq_erb_asidata_i2[22]; |
---|
1449 | assign idc_wrt_data = ifq_erb_asidata_i2[21]; |
---|
1450 | assign itc_wrt_data = ifq_erb_asidata_i2[20]; |
---|
1451 | assign ddc_wrt_data = ifq_erb_asidata_i2[19]; |
---|
1452 | assign dtc_wrt_data = ifq_erb_asidata_i2[18]; |
---|
1453 | assign irc_wrt_data = ifq_erb_asidata_i2[17]; |
---|
1454 | assign iru_wrt_data = ifq_erb_asidata_i2[16]; |
---|
1455 | assign frc_wrt_data = ifq_erb_asidata_i2[15]; |
---|
1456 | assign fru_wrt_data = ifq_erb_asidata_i2[14]; |
---|
1457 | assign ldau_wrt_data = ifq_erb_asidata_i2[13]; |
---|
1458 | assign ncu_wrt_data = ifq_erb_asidata_i2[12]; |
---|
1459 | assign dmsu_wrt_data = ifq_erb_asidata_i2[11]; |
---|
1460 | assign mau_wrt_data = ifq_erb_asidata_i2[9]; |
---|
1461 | |
---|
1462 | assign nceen_wrt_data = ifq_erb_asidata_i2[1]; |
---|
1463 | assign ceen_wrt_data = ifq_erb_asidata_i2[0]; |
---|
1464 | |
---|
1465 | // |
---|
1466 | sink s0(.in (ifq_erb_asidata_i2[8])); |
---|
1467 | sink s1(.in (ifq_erb_asidata_i2[10])); |
---|
1468 | |
---|
1469 | endmodule |
---|
1470 | |
---|