Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: exu_rml_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 | `define BUS_CTL 64 | |
36 | `define BUS_VLD 63 | |
37 | `define BUS_ACK 62 | |
38 | `define BUS_REGID_END 61 | |
39 | `define BUS_REGID_ST 60 | |
40 | `define BUS_RD 59 | |
41 | `define BUS_TID_END 58 | |
42 | `define BUS_TID_ST 56 | |
43 | `define BUS_ASI_END 55 | |
44 | `define BUS_ASI_ST 48 | |
45 | `define ASI 2'b00 | |
46 | `define ASR 2'b01 | |
47 | `define PR 2'b10 | |
48 | ||
49 | ||
50 | module exu_rml_ctl ( | |
51 | l2clk, | |
52 | scan_in, | |
53 | wmr_scan_in, | |
54 | tcu_pce_ov, | |
55 | spc_aclk, | |
56 | spc_bclk, | |
57 | spc_aclk_wmr, | |
58 | tcu_scan_en, | |
59 | dec_tid_p, | |
60 | dec_inst_d, | |
61 | dec_valid_e, | |
62 | dec_thread_group, | |
63 | tlu_flush_exu_b, | |
64 | dec_flush_m, | |
65 | dec_flush_b, | |
66 | tlu_gl_thr0, | |
67 | tlu_gl_thr1, | |
68 | tlu_gl_thr2, | |
69 | tlu_gl_thr3, | |
70 | tlu_ccr_cwp_valid, | |
71 | tlu_ccr_cwp_tid, | |
72 | tlu_cwp, | |
73 | mbi_run, | |
74 | mbi_addr, | |
75 | mbi_irf_read_en, | |
76 | mbi_irf_save_en, | |
77 | mbi_irf_restore_en, | |
78 | edp_rng_in_ff, | |
79 | edp_rd_ff_w, | |
80 | ect_misaligned_error_m, | |
81 | ect_yreg_wr_w, | |
82 | ect_tid_lth_w, | |
83 | exu_lsu_va_error_m, | |
84 | exu_ecc_m, | |
85 | edp_rs3_ecc_e, | |
86 | ect_tg_clken, | |
87 | exu_y_data_e, | |
88 | exu_fill_m, | |
89 | exu_spill_b, | |
90 | exu_normal_b, | |
91 | exu_cleanwin_b, | |
92 | exu_wstate_b, | |
93 | exu_cwp_thr0, | |
94 | exu_cwp_thr1, | |
95 | exu_cwp_thr2, | |
96 | exu_cwp_thr3, | |
97 | exu_oddwin_b, | |
98 | exu_window_block_m, | |
99 | exu_tlu_window_block, | |
100 | exu_ecc_winop_flush_m, | |
101 | exu_test_valid, | |
102 | exu_test_tid, | |
103 | exu_test_addr, | |
104 | rml_test_valid_d, | |
105 | rml_rng_data_out, | |
106 | rml_rng_rd_ctl, | |
107 | rml_rng_ack_ctl, | |
108 | rml_rng_ack_cwp_tid, | |
109 | rml_rng_ack_ecc_tid, | |
110 | rml_rng_ack_det_vld, | |
111 | rml_rng_wt_imask_ctl, | |
112 | rml_rng_wt_ccr_ctl, | |
113 | rml_irf_ecc_data, | |
114 | rml_rng_ack_sel_ctl, | |
115 | rml_rng_y_data, | |
116 | rml_irf_cwpswap_tid_m, | |
117 | rml_irf_old_lo_cwp_m, | |
118 | rml_irf_old_e_cwp_m, | |
119 | rml_irf_cwpswap_tid_b, | |
120 | rml_irf_new_lo_cwp_b, | |
121 | rml_irf_new_e_cwp_b, | |
122 | rml_irf_save_even_m, | |
123 | rml_irf_save_odd_m, | |
124 | rml_irf_save_local_m, | |
125 | rml_irf_restore_even_b, | |
126 | rml_irf_restore_odd_b, | |
127 | rml_irf_restore_local_b, | |
128 | rml_irf_global_tid, | |
129 | rml_irf_global_tid_ff, | |
130 | rml_irf_old_agp, | |
131 | rml_irf_new_agp_ff, | |
132 | rml_irf_save_global, | |
133 | rml_irf_restore_global, | |
134 | scan_out, | |
135 | wmr_scan_out); | |
136 | wire pce_ov; | |
137 | wire stop; | |
138 | wire siclk; | |
139 | wire soclk; | |
140 | wire se; | |
141 | wire l1clk_pm1; | |
142 | wire mbist_scanin; | |
143 | wire mbist_scanout; | |
144 | wire mbi_irf_save_en_p1; | |
145 | wire mbi_irf_restore_en_p1; | |
146 | wire mbi_run_lth; | |
147 | wire mbi_irf_read_en_p1; | |
148 | wire [9:0] mbi_addr_lth; | |
149 | wire mbi_irf_save_en_p2; | |
150 | wire mbi_irf_restore_en_p2; | |
151 | wire cwp_trap_scanin; | |
152 | wire cwp_trap_scanout; | |
153 | wire trap_ccr_cwp_valid; | |
154 | wire [1:0] trap_ccr_cwp_tid; | |
155 | wire [2:0] trap_cwp; | |
156 | wire [31:13] inst; | |
157 | wire d_return; | |
158 | wire d_save; | |
159 | wire d_restore; | |
160 | wire d_flushw; | |
161 | wire d_saved; | |
162 | wire d_restored; | |
163 | wire d_allclean; | |
164 | wire d_otherw; | |
165 | wire d_normalw; | |
166 | wire d_invalw; | |
167 | wire decoded_inst_d2e_scanin; | |
168 | wire decoded_inst_d2e_scanout; | |
169 | wire return_e; | |
170 | wire save_e; | |
171 | wire restore_e; | |
172 | wire flushw_e; | |
173 | wire saved_e; | |
174 | wire restored_e; | |
175 | wire allclean_e; | |
176 | wire otherw_e; | |
177 | wire normalw_e; | |
178 | wire invalw_e; | |
179 | wire decoded_inst_e2m_scanin; | |
180 | wire decoded_inst_e2m_scanout; | |
181 | wire return_m; | |
182 | wire save_m; | |
183 | wire restore_m; | |
184 | wire flushw_m; | |
185 | wire saved_m; | |
186 | wire restored_m; | |
187 | wire allclean_m; | |
188 | wire otherw_m; | |
189 | wire normalw_m; | |
190 | wire invalw_m; | |
191 | wire decoded_inst_m2b_scanin; | |
192 | wire decoded_inst_m2b_scanout; | |
193 | wire return_b; | |
194 | wire save_b; | |
195 | wire restore_b; | |
196 | wire saved_b; | |
197 | wire restored_b; | |
198 | wire allclean_b; | |
199 | wire otherw_b; | |
200 | wire normalw_b; | |
201 | wire invalw_b; | |
202 | wire decoded_inst_b2w_scanin; | |
203 | wire decoded_inst_b2w_scanout; | |
204 | wire return_w; | |
205 | wire save_w; | |
206 | wire restore_w; | |
207 | wire saved_w; | |
208 | wire restored_w; | |
209 | wire allclean_w; | |
210 | wire otherw_w; | |
211 | wire normalw_w; | |
212 | wire invalw_w; | |
213 | wire [3:0] tid4_d; | |
214 | wire [1:0] tid_d; | |
215 | wire tid_p2d2e2m2b2w_scanin; | |
216 | wire tid_p2d2e2m2b2w_scanout; | |
217 | wire [1:0] tid_e; | |
218 | wire [1:0] tid_m; | |
219 | wire [1:0] tid_b; | |
220 | wire [1:0] tid_w; | |
221 | wire [3:0] tid4_e; | |
222 | wire inst_vld_e2m2b2w_scanin; | |
223 | wire inst_vld_e2m2b2w_scanout; | |
224 | wire inst_vld_e; | |
225 | wire inst_vld_m; | |
226 | wire inst_vld_b; | |
227 | wire inst_vld_noflush_m; | |
228 | wire inst_vld_noflush_b; | |
229 | wire inst_vld_w; | |
230 | wire exception_detected_m; | |
231 | wire spill_detected_m; | |
232 | wire cleanwin_detected_m; | |
233 | wire address_error_detected_m; | |
234 | wire exception_detected_m2b_scanin; | |
235 | wire exception_detected_m2b_scanout; | |
236 | wire exception_detected_b; | |
237 | wire flush_exu_b2w_scanin; | |
238 | wire flush_exu_b2w_scanout; | |
239 | wire flush_exu_w; | |
240 | wire dec_flush_w; | |
241 | wire cansave_is0_m; | |
242 | wire [2:0] cansave_m; | |
243 | wire canrestore_is0_m; | |
244 | wire [2:0] canrestore_m; | |
245 | wire otherwin_is0_m; | |
246 | wire [2:0] otherwin_m; | |
247 | wire cleanwin4save_is0_m; | |
248 | wire [2:0] cleanwin_m; | |
249 | wire noflushwin_m; | |
250 | wire spill_m; | |
251 | wire cleanwin_exception_m; | |
252 | wire return_consider_m; | |
253 | wire exception_report_m2b_scanin; | |
254 | wire exception_report_m2b_scanout; | |
255 | wire spill_b; | |
256 | wire cleanwin_exception_b; | |
257 | wire otherwin_is0_b; | |
258 | wire [5:0] wstate_b; | |
259 | wire block_wrcwp; | |
260 | wire wrcwp_in_play_in; | |
261 | wire detected_wrpr_cwp; | |
262 | wire wrcwp_in_play; | |
263 | wire wrcwp_in_playf_scanin; | |
264 | wire wrcwp_in_playf_scanout; | |
265 | wire actual_wrpr_cwp; | |
266 | wire pr_wt_ff_scanin; | |
267 | wire pr_wt_ff_scanout; | |
268 | wire actual_wrpr_cwp_d; | |
269 | wire actual_wrpr_cwp_e; | |
270 | wire pr_wt_m; | |
271 | wire trap_ccr_cwp_ff_scanin; | |
272 | wire trap_ccr_cwp_ff_scanout; | |
273 | wire trap_ccr_cwp_valid_d; | |
274 | wire trap_ccr_cwp_valid_e; | |
275 | wire trap_ccr_cwp_valid_m; | |
276 | wire make_2nd_window_slot; | |
277 | wire ack_wrpr_cwp_done; | |
278 | wire rd_irf_ecc_valid; | |
279 | wire rd_irf_ecc_valid_lth; | |
280 | wire [2:0] cwp_dec1_m; | |
281 | wire [2:0] cwp_m; | |
282 | wire [2:0] cwp_inc1_m; | |
283 | wire [2:1] cwp_inc2_m; | |
284 | wire [2:0] cwp_inc2_cansave_m; | |
285 | wire [1:0] slot_tid_m; | |
286 | wire [1:0] wrpr_cwp_tid_hold; | |
287 | wire winblock_slot_tid_m2d2e2m_scanin; | |
288 | wire winblock_slot_tid_m2d2e2m_scanout; | |
289 | wire [1:0] slot_tid_d; | |
290 | wire [1:0] slot_tid_e; | |
291 | wire [1:0] old_lo_tid_m; | |
292 | wire old_lo_fetch_m; | |
293 | wire [2:0] cwp_thr0; | |
294 | wire [2:0] cwp_thr1; | |
295 | wire [2:0] cwp_thr2; | |
296 | wire [2:0] cwp_thr3; | |
297 | wire [2:0] old_lo_cwp_inc1_m; | |
298 | wire old_lo_cwp_inc1_m_unused; | |
299 | wire [2:0] slot_old_cwp_inc1_m; | |
300 | wire slot_old_cwp_inc1_m_unused; | |
301 | wire [2:0] slot_new_cwp_inc1_m; | |
302 | wire [2:0] rml_irf_new_lo_cwp_m; | |
303 | wire slot_new_cwp_inc1_m_unused; | |
304 | wire [2:0] pr_new_cwp_wt; | |
305 | wire [2:1] new_e_cwp_m; | |
306 | wire i_rml_restore_en_ff_scanin; | |
307 | wire i_rml_restore_en_ff_scanout; | |
308 | wire [1:0] rml_irf_new_agp; | |
309 | wire rml_irf_restore_even_b_ff; | |
310 | wire rml_irf_restore_odd_b_ff; | |
311 | wire rml_irf_restore_local_b_ff; | |
312 | wire rml_irf_restore_global_ff; | |
313 | wire [1:0] raw_irf_cwpswap_tid_b; | |
314 | wire [2:1] raw_irf_new_e_cwp_b; | |
315 | wire [2:0] raw_irf_new_lo_cwp_b; | |
316 | wire cwp_update_m; | |
317 | wire [1:0] cwp_tid_m; | |
318 | wire [2:0] cwp_new_m; | |
319 | wire cwp_m2b_scanin; | |
320 | wire cwp_m2b_scanout; | |
321 | wire [1:0] cwp_tid_b; | |
322 | wire [2:0] cwp_new_b; | |
323 | wire cwp_update_b; | |
324 | wire cwp_update_no_flush_exu_b; | |
325 | wire cwp_b2w_scanin; | |
326 | wire cwp_b2w_scanout; | |
327 | wire [1:0] cwp_tid_w; | |
328 | wire [2:0] cwp_new_w; | |
329 | wire cwp_update_w; | |
330 | wire [2:0] cwp_next_w; | |
331 | wire [3:0] cwp_we_w; | |
332 | wire [3:0] cwp_pr_we; | |
333 | wire [2:0] cwp_thr0_next; | |
334 | wire [2:0] cwp_thr1_next; | |
335 | wire [2:0] cwp_thr2_next; | |
336 | wire [2:0] cwp_thr3_next; | |
337 | wire gl_changed_thr0; | |
338 | wire [1:0] gl_thr0; | |
339 | wire gl_changed_thr1; | |
340 | wire [1:0] gl_thr1; | |
341 | wire gl_changed_thr2; | |
342 | wire [1:0] gl_thr2; | |
343 | wire gl_changed_thr3; | |
344 | wire [1:0] gl_thr3; | |
345 | wire [3:0] gl_we; | |
346 | wire [1:0] gl_tid; | |
347 | wire gl_changed; | |
348 | wire [1:0] gl_thr0_next; | |
349 | wire [1:0] gl_thr1_next; | |
350 | wire [1:0] gl_thr2_next; | |
351 | wire [1:0] gl_thr3_next; | |
352 | wire old_gl_ptr_wmr_scanin; | |
353 | wire old_gl_ptr_wmr_scanout; | |
354 | wire [2:0] cansave_dec1_w; | |
355 | wire [2:0] cansave_w; | |
356 | wire [2:0] cansave_inc1_w; | |
357 | wire [2:0] canrestore_dec1_w; | |
358 | wire [2:0] canrestore_w; | |
359 | wire [2:0] canrestore_inc1_w; | |
360 | wire [2:0] otherwin_dec1_w; | |
361 | wire [2:0] otherwin_w; | |
362 | wire [2:0] cleanwin_inc1_w; | |
363 | wire [2:0] cleanwin_w; | |
364 | wire otherwin_is0_w; | |
365 | wire cleanwin_is111_w; | |
366 | wire cansave_inc_w; | |
367 | wire cansave_dec_w; | |
368 | wire cansave_reset_w; | |
369 | wire cansave_update_w; | |
370 | wire [2:0] cansave_next_w; | |
371 | wire [3:0] cansave_we_w; | |
372 | wire [3:0] cansave_pr_we; | |
373 | wire [1:0] pr_tid_ctl; | |
374 | wire pr_wt_cansave_ctl; | |
375 | wire canrestore_inc_w; | |
376 | wire canrestore_dec_w; | |
377 | wire canrestore_0_w; | |
378 | wire canrestore_otherwin_w; | |
379 | wire canrestore_update_w; | |
380 | wire [2:0] canrestore_next_w; | |
381 | wire [2:0] canrestore_normalwin_data_w; | |
382 | wire [2:0] otherwin_thr0; | |
383 | wire [2:0] otherwin_thr1; | |
384 | wire [2:0] otherwin_thr2; | |
385 | wire [2:0] otherwin_thr3; | |
386 | wire [3:0] canrestore_we_w; | |
387 | wire [3:0] canrestore_pr_we; | |
388 | wire pr_wt_canrestore_ctl; | |
389 | wire otherwin_dec_w; | |
390 | wire otherwin_0_w; | |
391 | wire otherwin_canrestore_w; | |
392 | wire otherwin_update_w; | |
393 | wire [2:0] otherwin_next_w; | |
394 | wire [2:0] otherwin_otherw_data_w; | |
395 | wire [3:0] otherwin_we_w; | |
396 | wire [2:0] canrestore_thr0; | |
397 | wire [2:0] canrestore_thr1; | |
398 | wire [2:0] canrestore_thr2; | |
399 | wire [2:0] canrestore_thr3; | |
400 | wire [3:0] otherwin_pr_we; | |
401 | wire pr_wt_otherwin_ctl; | |
402 | wire cleanwin_inc_w; | |
403 | wire cleanwin_reset_w; | |
404 | wire cleanwin_update_w; | |
405 | wire [2:0] cleanwin_next_w; | |
406 | wire [3:0] cleanwin_we_w; | |
407 | wire [3:0] cleanwin_pr_we; | |
408 | wire pr_wt_cleanwin_ctl; | |
409 | wire [3:0] wstate_pr_we; | |
410 | wire pr_wt_wstate_ctl; | |
411 | wire [3:0] cwp_new_update; | |
412 | wire [3:0] cwp_flushed; | |
413 | wire [3:0] cwp_oddwin_next; | |
414 | wire [3:0] cwp_oddwin_b; | |
415 | wire cwp_speculative_scanin; | |
416 | wire cwp_speculative_scanout; | |
417 | wire [2:0] cansave_thr0_next; | |
418 | wire [63:0] data_1f; | |
419 | wire [2:0] cansave_thr0; | |
420 | wire [2:0] cansave_thr1_next; | |
421 | wire [2:0] cansave_thr1; | |
422 | wire [2:0] cansave_thr2_next; | |
423 | wire [2:0] cansave_thr2; | |
424 | wire [2:0] cansave_thr3_next; | |
425 | wire [2:0] cansave_thr3; | |
426 | wire [2:1] cansave_thr0_next_l; | |
427 | wire [2:1] cansave_thr1_next_l; | |
428 | wire [2:1] cansave_thr2_next_l; | |
429 | wire [2:1] cansave_thr3_next_l; | |
430 | wire cansave_pr_wmr_scanin; | |
431 | wire cansave_pr_wmr_scanout; | |
432 | wire [2:1] cansave_thr0_l; | |
433 | wire [2:1] cansave_thr1_l; | |
434 | wire [2:1] cansave_thr2_l; | |
435 | wire [2:1] cansave_thr3_l; | |
436 | wire [2:0] cansave_e; | |
437 | wire [2:0] cansave_pr_rd; | |
438 | wire cansave_e2m2b2w_scanin; | |
439 | wire cansave_e2m2b2w_scanout; | |
440 | wire [2:0] cansave_b; | |
441 | wire [2:0] canrestore_thr0_next; | |
442 | wire [2:0] canrestore_thr1_next; | |
443 | wire [2:0] canrestore_thr2_next; | |
444 | wire [2:0] canrestore_thr3_next; | |
445 | wire canrestore_pr_wmr_scanin; | |
446 | wire canrestore_pr_wmr_scanout; | |
447 | wire [2:0] canrestore_e; | |
448 | wire [2:0] canrestore_pr_rd; | |
449 | wire canrestore_e2m2b2w_scanin; | |
450 | wire canrestore_e2m2b2w_scanout; | |
451 | wire [2:0] canrestore_b; | |
452 | wire [2:0] otherwin_thr0_next; | |
453 | wire [2:0] otherwin_thr1_next; | |
454 | wire [2:0] otherwin_thr2_next; | |
455 | wire [2:0] otherwin_thr3_next; | |
456 | wire otherwin_pr_wmr_scanin; | |
457 | wire otherwin_pr_wmr_scanout; | |
458 | wire [2:0] otherwin_e; | |
459 | wire [2:0] otherwin_pr_rd; | |
460 | wire otherwin_e2m2b2w_scanin; | |
461 | wire otherwin_e2m2b2w_scanout; | |
462 | wire [2:0] otherwin_b; | |
463 | wire [2:0] cleanwin_thr0_next; | |
464 | wire [2:0] cleanwin_thr0; | |
465 | wire [2:0] cleanwin_thr1_next; | |
466 | wire [2:0] cleanwin_thr1; | |
467 | wire [2:0] cleanwin_thr2_next; | |
468 | wire [2:0] cleanwin_thr2; | |
469 | wire [2:0] cleanwin_thr3_next; | |
470 | wire [2:0] cleanwin_thr3; | |
471 | wire [2:0] cleanwin_thr0_next_l; | |
472 | wire [2:0] cleanwin_thr1_next_l; | |
473 | wire [2:0] cleanwin_thr2_next_l; | |
474 | wire [2:0] cleanwin_thr3_next_l; | |
475 | wire cleanwin_pr_wmr_scanin; | |
476 | wire cleanwin_pr_wmr_scanout; | |
477 | wire [2:0] cleanwin_thr0_l; | |
478 | wire [2:0] cleanwin_thr1_l; | |
479 | wire [2:0] cleanwin_thr2_l; | |
480 | wire [2:0] cleanwin_thr3_l; | |
481 | wire [2:0] cleanwin_e; | |
482 | wire [2:0] cleanwin_pr_rd; | |
483 | wire cleanwin_e2m2b2w_scanin; | |
484 | wire cleanwin_e2m2b2w_scanout; | |
485 | wire [2:0] cleanwin_b; | |
486 | wire [5:0] wstate_thr0_next; | |
487 | wire [5:0] wstate_thr0; | |
488 | wire [5:0] wstate_thr1_next; | |
489 | wire [5:0] wstate_thr1; | |
490 | wire [5:0] wstate_thr2_next; | |
491 | wire [5:0] wstate_thr2; | |
492 | wire [5:0] wstate_thr3_next; | |
493 | wire [5:0] wstate_thr3; | |
494 | wire wstate_pr_wmr_scanin; | |
495 | wire wstate_pr_wmr_scanout; | |
496 | wire [5:0] wstate_pr_rd; | |
497 | wire cwp_pr_wmr_scanin; | |
498 | wire cwp_pr_wmr_scanout; | |
499 | wire [2:0] cwp_e; | |
500 | wire [2:0] cwp_pr_rd; | |
501 | wire cwp_e2m2b2w_scanin; | |
502 | wire cwp_e2m2b2w_scanout; | |
503 | wire ctl_1f; | |
504 | wire pr_relevent; | |
505 | wire asr_relevent; | |
506 | wire asi_relevent; | |
507 | wire detected_empty_pkt; | |
508 | wire [1:0] pr_tid; | |
509 | wire match_cwp; | |
510 | wire match_cansave; | |
511 | wire match_canrestore; | |
512 | wire match_cleanwin; | |
513 | wire match_otherwin; | |
514 | wire match_wstate; | |
515 | wire match_yreg; | |
516 | wire match_ccr; | |
517 | wire match_imask; | |
518 | wire match_irf_ecc; | |
519 | wire pr_rd; | |
520 | wire [1:0] send_ack; | |
521 | wire [5:0] pr_rd_src; | |
522 | wire [5:0] pr_wt_src; | |
523 | wire detected_rd_irf_ecc; | |
524 | wire [4:0] rd_irf_ecc_addr; | |
525 | wire [4:0] pr_addr_ctl; | |
526 | wire pipe_rd_irf_ecc_valid_pp2p2d2e_scanin; | |
527 | wire pipe_rd_irf_ecc_valid_pp2p2d2e_scanout; | |
528 | wire test_valid_p; | |
529 | wire ack_irf_ecc_done; | |
530 | wire [1:0] wrpr_cwp_tid_next; | |
531 | wire save_wrpr_cwp_tid_scanin; | |
532 | wire save_wrpr_cwp_tid_scanout; | |
533 | wire [1:0] rd_irf_tid_next; | |
534 | wire [1:0] rd_irf_tid_hold; | |
535 | wire save_rd_irf_tid_scanin; | |
536 | wire save_rd_irf_tid_scanout; | |
537 | wire pr_wt_cwp_ctl; | |
538 | wire [2:0] pr_new_cwp_wt_hold; | |
539 | wire save_wrpr_cwp_scanin; | |
540 | wire save_wrpr_cwp_scanout; | |
541 | wire send_ack_wrpr_cwp; | |
542 | wire done_wrpr_cwp_hold; | |
543 | wire done_wrpr_cwp; | |
544 | wire save_done_wrpr_cwp_scanin; | |
545 | wire save_done_wrpr_cwp_scanout; | |
546 | wire send_ack_irf_ecc; | |
547 | wire done_irf_ecc_hold; | |
548 | wire done_irf_ecc; | |
549 | wire save_done_irf_ecc_scanin; | |
550 | wire save_done_irf_ecc_scanout; | |
551 | wire [7:0] irf_ecc_data; | |
552 | wire [7:0] irf_ecc_data_hold; | |
553 | wire save_irf_ecc_data_scanin; | |
554 | wire save_irf_ecc_data_scanout; | |
555 | wire pipe_ack_irf_ecc_scanin; | |
556 | wire pipe_ack_irf_ecc_scanout; | |
557 | wire send_ack_irf_ecc_piped; | |
558 | wire [2:0] asr_rd_src; | |
559 | wire [2:0] asr_wt_src; | |
560 | wire asr_ctl_scanin; | |
561 | wire asr_ctl_scanout; | |
562 | wire pr_rd_ctl; | |
563 | wire [5:0] pr_rd_src_ctl; | |
564 | wire asi_rd_imask_ctl; | |
565 | wire asr_rd_ccr_ctl; | |
566 | wire asr_rd_yreg_ctl; | |
567 | wire asi_wt_imask_ctl; | |
568 | wire asr_wt_ccr_ctl; | |
569 | wire asr_wt_yreg_ctl; | |
570 | wire l1clk_pm2; | |
571 | wire [3:0] yreg_rng_we; | |
572 | wire [3:0] yreg_w_we; | |
573 | wire [31:0] arch_yreg_tid0_in; | |
574 | wire [31:0] arch_yreg_tid0_ff; | |
575 | wire [31:0] arch_yreg_tid1_in; | |
576 | wire [31:0] arch_yreg_tid1_ff; | |
577 | wire [31:0] arch_yreg_tid2_in; | |
578 | wire [31:0] arch_yreg_tid2_ff; | |
579 | wire [31:0] arch_yreg_tid3_in; | |
580 | wire [31:0] arch_yreg_tid3_ff; | |
581 | wire i_yreg0_ff_wmr_scanin; | |
582 | wire i_yreg0_ff_wmr_scanout; | |
583 | wire i_yreg1_ff_wmr_scanin; | |
584 | wire i_yreg1_ff_wmr_scanout; | |
585 | wire i_yreg2_ff_wmr_scanin; | |
586 | wire i_yreg2_ff_wmr_scanout; | |
587 | wire i_yreg3_ff_wmr_scanin; | |
588 | wire i_yreg3_ff_wmr_scanout; | |
589 | wire spares_scanin; | |
590 | wire spares_scanout; | |
591 | ||
592 | ||
593 | // *** Global Inputs *** | |
594 | ||
595 | input l2clk; | |
596 | input scan_in; | |
597 | input wmr_scan_in; | |
598 | input tcu_pce_ov; // scan signals | |
599 | input spc_aclk; | |
600 | input spc_bclk; | |
601 | input spc_aclk_wmr; | |
602 | input tcu_scan_en; | |
603 | ||
604 | ||
605 | input [1:0] dec_tid_p; // thread ID in pick stage | |
606 | input [31:13] dec_inst_d; // WARNING: Instruction for full decode | |
607 | input dec_valid_e; // Inst is truly valid at e | |
608 | input dec_thread_group; // Static Signal : Tie 1 or 0 where cloning | |
609 | ||
610 | input tlu_flush_exu_b; // FROM TLU : flushes inst in B-stage ===> late signal | |
611 | ||
612 | input dec_flush_m; // flush signal to invalidate inst in M ===> late signal | |
613 | ||
614 | input dec_flush_b; // flush signal to invalidate inst in B | |
615 | ||
616 | input [1:0] tlu_gl_thr0; // FROM TLU : current GL value to update | |
617 | input [1:0] tlu_gl_thr1; // FROM TLU : current GL value to update | |
618 | input [1:0] tlu_gl_thr2; // FROM TLU : current GL value to update | |
619 | input [1:0] tlu_gl_thr3; // FROM TLU : current GL value to update | |
620 | ||
621 | input tlu_ccr_cwp_valid; // FROM TLU : done/retry CWP updates | |
622 | input [1:0] tlu_ccr_cwp_tid; // FROM TLU : done/retry CWP updates | |
623 | input [2:0] tlu_cwp; // FROM TLU : done/retry CWP updates | |
624 | ||
625 | input mbi_run; // MBIST | |
626 | input [9:0] mbi_addr; // MBIST | |
627 | input mbi_irf_read_en; // MBIST | |
628 | input mbi_irf_save_en; // MBIST | |
629 | input mbi_irf_restore_en; // MBIST | |
630 | ||
631 | ||
632 | // *** Local Inputs *** | |
633 | input [64:0] edp_rng_in_ff; // 65 bit control/data bus to the ASI | |
634 | ||
635 | input [63:32] edp_rd_ff_w; // Yreg write data | |
636 | ||
637 | input ect_misaligned_error_m; // assert when last 2 bit of address is non "00" | |
638 | ||
639 | input ect_yreg_wr_w; | |
640 | input [1:0] ect_tid_lth_w; | |
641 | ||
642 | input exu_lsu_va_error_m; // Address out-of-range | |
643 | ||
644 | input exu_ecc_m; // exu ecc errors detected | |
645 | ||
646 | input [7:0] edp_rs3_ecc_e; // ECC syndrom bits for irf_ecc ASI read | |
647 | ||
648 | input ect_tg_clken; // Power Management | |
649 | ||
650 | ||
651 | ||
652 | // *** Global Outputs *** | |
653 | ||
654 | output [31:0] exu_y_data_e; | |
655 | ||
656 | output exu_fill_m; // To TLU : report window fill exception | |
657 | output exu_spill_b; // To TLU : report window spill exception | |
658 | output exu_normal_b; // To TLU : report window spill/fill exception type | |
659 | // (4 signals above: 1 gate after flop | |
660 | // early signals) | |
661 | output exu_cleanwin_b; // To TLU : report clean window exception | |
662 | // (straight out of flop, early signal) | |
663 | output [2:0] exu_wstate_b; // To TLU : report fill/spill vector to use | |
664 | // - if otherwin=0: wstate.normal | |
665 | // - else : wstate.other | |
666 | // (2 gate after flop, early) | |
667 | output [2:0] exu_cwp_thr0; // To TLU : Current Window Pointer for thr0 | |
668 | output [2:0] exu_cwp_thr1; // To TLU : Current Window Pointer for thr1 | |
669 | output [2:0] exu_cwp_thr2; // To TLU : Current Window Pointer for thr2 | |
670 | output [2:0] exu_cwp_thr3; // To TLU : Current Window Pointer for thr3 | |
671 | // (4 signals above: straight out of flops) | |
672 | ||
673 | output [3:0] exu_oddwin_b; // To PKU : odd window indicator for 4 thrd | |
674 | ||
675 | output exu_window_block_m; // create bubble for SWAP signal for IRF | |
676 | output exu_tlu_window_block; // create bubble for SWAP signal for IRF | |
677 | ||
678 | output exu_ecc_winop_flush_m; // To MDP : flush FGU | |
679 | // ADD part of save/restore | |
680 | // in case of exception | |
681 | ||
682 | ||
683 | output exu_test_valid; // To PKU : ASI/BIST read of IRF | |
684 | output [1:0] exu_test_tid; | |
685 | output [4:0] exu_test_addr; | |
686 | ||
687 | ||
688 | // *** Local Outputs *** | |
689 | ||
690 | output rml_test_valid_d; | |
691 | ||
692 | output [5:0] rml_rng_data_out; // Data for PR read | |
693 | output [4:0] rml_rng_rd_ctl; // To EDP: Control for selecting PR/ASR read source | |
694 | output [1:0] rml_rng_ack_ctl; // To EDP: Control for selecting PR/ASR ack bit | |
695 | output [1:0] rml_rng_ack_cwp_tid; // To EDP: CWP write ack tid | |
696 | output [1:0] rml_rng_ack_ecc_tid; // To EDP: ECC read ack tid | |
697 | output rml_rng_ack_det_vld; // To EDP: Ack valid for deterministic access | |
698 | output rml_rng_wt_imask_ctl; // Enable for ASI write to Instruction mask reg | |
699 | output rml_rng_wt_ccr_ctl; // Enable for ASR write to CCR | |
700 | output [7:0] rml_irf_ecc_data; // To EDP: saved irf ECC data for indet. ASI access | |
701 | output rml_rng_ack_sel_ctl; // To EDP: select ack type onto ASI rng | |
702 | output [31:0] rml_rng_y_data; | |
703 | ||
704 | output [1:0] rml_irf_cwpswap_tid_m; // To IRF: local/odd/even reg swap thread ID | |
705 | output [2:0] rml_irf_old_lo_cwp_m; // To IRF: old local/odd CWP | |
706 | output [2:1] rml_irf_old_e_cwp_m; // To IRF: old even CWP | |
707 | ||
708 | output [1:0] rml_irf_cwpswap_tid_b; // To IRF: local/odd/even reg swap thread ID | |
709 | output [2:0] rml_irf_new_lo_cwp_b; // To IRF: new local/odd CWP | |
710 | output [2:1] rml_irf_new_e_cwp_b; // To IRF: old even CWP | |
711 | ||
712 | output rml_irf_save_even_m; // To IRF: swap enable for even reg | |
713 | output rml_irf_save_odd_m; // To IRF: swap enable for odd reg | |
714 | output rml_irf_save_local_m; // To IRF: swap enable for local reg | |
715 | ||
716 | output rml_irf_restore_even_b; // To IRF: swap enable for even reg | |
717 | output rml_irf_restore_odd_b; // To IRF: swap enable for odd reg | |
718 | output rml_irf_restore_local_b; // To IRF: swap enable for local reg | |
719 | ||
720 | output [1:0] rml_irf_global_tid; // To IRF: global reg swap thread ID | |
721 | output [1:0] rml_irf_global_tid_ff; // To IRF: global reg swap thread ID | |
722 | output [1:0] rml_irf_old_agp; // To IRF: old global CWP | |
723 | output [1:0] rml_irf_new_agp_ff; // To IRF: new global CWP | |
724 | output rml_irf_save_global; // To IRF: swap enable for global reg | |
725 | output rml_irf_restore_global; // To IRF: swap enable for global reg | |
726 | ||
727 | output scan_out; | |
728 | output wmr_scan_out; | |
729 | ||
730 | ||
731 | // renames | |
732 | assign pce_ov = tcu_pce_ov; | |
733 | assign stop = 1'b0; | |
734 | assign siclk = spc_aclk; | |
735 | assign soclk = spc_bclk; | |
736 | assign se = tcu_scan_en; | |
737 | ||
738 | ||
739 | exu_rml_ctl_l1clkhdr_ctl_macro clkgen_pm1 ( | |
740 | .l2clk( l2clk ), | |
741 | .l1en ( ect_tg_clken ), | |
742 | .l1clk( l1clk_pm1 ), | |
743 | .pce_ov(pce_ov), | |
744 | .stop(stop), | |
745 | .se(se)); | |
746 | ||
747 | ||
748 | // Make sure exception-input are for valid instructions | |
749 | ||
750 | ||
751 | ||
752 | // Flop all inputs from Mbist engine | |
753 | ||
754 | exu_rml_ctl_msff_ctl_macro__width_16 mbist ( | |
755 | .scan_in(mbist_scanin), | |
756 | .scan_out(mbist_scanout), | |
757 | .l1clk( l1clk_pm1 ), | |
758 | .din ({mbi_run , | |
759 | mbi_irf_read_en , | |
760 | mbi_irf_save_en , | |
761 | mbi_irf_restore_en , | |
762 | mbi_addr[9:0] , | |
763 | mbi_irf_save_en_p1 , | |
764 | mbi_irf_restore_en_p1} ), | |
765 | .dout ({mbi_run_lth , | |
766 | mbi_irf_read_en_p1 , | |
767 | mbi_irf_save_en_p1 , | |
768 | mbi_irf_restore_en_p1 , | |
769 | mbi_addr_lth[9:0] , | |
770 | mbi_irf_save_en_p2 , | |
771 | mbi_irf_restore_en_p2} ), | |
772 | .siclk(siclk), | |
773 | .soclk(soclk)); | |
774 | ||
775 | ||
776 | ||
777 | // Flop all inputs from the TLU to have the expected timings | |
778 | ||
779 | exu_rml_ctl_msff_ctl_macro__width_6 cwp_trap ( | |
780 | .scan_in(cwp_trap_scanin), | |
781 | .scan_out(cwp_trap_scanout), | |
782 | .l1clk(l1clk_pm1), | |
783 | .din ({tlu_ccr_cwp_valid,tlu_ccr_cwp_tid[1:0],tlu_cwp[2:0]}), | |
784 | .dout ({trap_ccr_cwp_valid,trap_ccr_cwp_tid[1:0],trap_cwp[2:0]}), | |
785 | .siclk(siclk), | |
786 | .soclk(soclk)); | |
787 | ||
788 | ||
789 | // Never have tlu assert valid in the same thread trailing each other within 3 cycles | |
790 | ||
791 | ||
792 | ||
793 | // ============================================================================= | |
794 | // Instruction Flow | |
795 | // ----------------------------------------------------------------------------- | |
796 | // D stage: - decode instructions | |
797 | // | |
798 | // E stage: - read Privileged Registers | |
799 | // - acquires instruction valid signal | |
800 | // - generate IRF Control signals | |
801 | // - checks for Trap conditions | |
802 | // | |
803 | // M stage: - generate IRF Control signals | |
804 | // - checks for Trap conditions | |
805 | // | |
806 | // B stage: - report possible trap at beginning of the cycle | |
807 | // - invalidate instruction if it causes a trap | |
808 | // - generate Priviledged Registers write-back values | |
809 | // | |
810 | // W stage: - Write-back Priviledged Registers | |
811 | // | |
812 | // |----D----|----E----|----M----|----B----|----W----| | |
813 | // | |
814 | // Decode Inst |<------->| | |
815 | // Read PR |<->| | |
816 | // Inst_vld available ---->] | |
817 | // IRF ctl |<------------->|-> to IRF | |
818 | // Trap Chk |<----------------->|--> to TLU | |
819 | // Flash Trap |<------->| | |
820 | // Write-back Gen. |<------->| | |
821 | // Write back Trap_kil -->| |<->| | |
822 | ||
823 | ||
824 | ||
825 | // ============================================================================= | |
826 | // Instrution Decode | |
827 | // ----------------------------------------------------------------------------- | |
828 | ||
829 | //!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*! Start : Decode !*!*!*!*!*!*!*!*!*!* | |
830 | assign inst[31:19] = dec_inst_d[31:19]; | |
831 | assign inst[13] = dec_inst_d[13]; | |
832 | ||
833 | // *** SAVE/RESTORE *** | |
834 | ||
835 | assign d_return = (inst[31:30] == 2'b10) & (inst[24:19] == 6'b11_1001); | |
836 | assign d_save = (inst[31:30] == 2'b10) & (inst[24:19] == 6'b11_1100); | |
837 | assign d_restore = (inst[31:30] == 2'b10) & (inst[24:19] == 6'b11_1101); | |
838 | assign d_flushw = (inst[31:30] == 2'b10) & (inst[24:19] == 6'b10_1011) & | |
839 | (inst[13] == 1'b0); | |
840 | ||
841 | assign d_saved = (inst[31:19] == 13'b10_00000_11_0001); | |
842 | assign d_restored = (inst[31:19] == 13'b10_00001_11_0001); | |
843 | assign d_allclean = (inst[31:19] == 13'b10_00010_11_0001); | |
844 | assign d_otherw = (inst[31:19] == 13'b10_00011_11_0001); | |
845 | assign d_normalw = (inst[31:19] == 13'b10_00100_11_0001); | |
846 | assign d_invalw = (inst[31:19] == 13'b10_00101_11_0001); | |
847 | ||
848 | exu_rml_ctl_msff_ctl_macro__width_10 decoded_inst_d2e ( | |
849 | .scan_in(decoded_inst_d2e_scanin), | |
850 | .scan_out(decoded_inst_d2e_scanout), | |
851 | .l1clk(l1clk_pm1), | |
852 | .din ({d_return, d_save, d_restore, d_flushw, d_saved, d_restored, d_allclean, d_otherw, d_normalw, d_invalw}), | |
853 | .dout ({return_e, save_e, restore_e, flushw_e, saved_e, restored_e, allclean_e, otherw_e, normalw_e, invalw_e}), | |
854 | .siclk(siclk), | |
855 | .soclk(soclk)); | |
856 | ||
857 | exu_rml_ctl_msff_ctl_macro__width_10 decoded_inst_e2m ( | |
858 | .scan_in(decoded_inst_e2m_scanin), | |
859 | .scan_out(decoded_inst_e2m_scanout), | |
860 | .l1clk(l1clk_pm1), | |
861 | .din ({return_e, save_e, restore_e, flushw_e, saved_e, restored_e, allclean_e, otherw_e, normalw_e, invalw_e}), | |
862 | .dout ({return_m, save_m, restore_m, flushw_m, saved_m, restored_m, allclean_m, otherw_m, normalw_m, invalw_m}), | |
863 | .siclk(siclk), | |
864 | .soclk(soclk)); | |
865 | ||
866 | exu_rml_ctl_msff_ctl_macro__width_9 decoded_inst_m2b ( | |
867 | .scan_in(decoded_inst_m2b_scanin), | |
868 | .scan_out(decoded_inst_m2b_scanout), | |
869 | .l1clk(l1clk_pm1), | |
870 | .din ({return_m, save_m, restore_m, saved_m, restored_m, allclean_m, otherw_m, normalw_m, invalw_m}), | |
871 | .dout ({return_b, save_b, restore_b, saved_b, restored_b, allclean_b, otherw_b, normalw_b, invalw_b}), | |
872 | .siclk(siclk), | |
873 | .soclk(soclk)); | |
874 | ||
875 | exu_rml_ctl_msff_ctl_macro__width_9 decoded_inst_b2w ( | |
876 | .scan_in(decoded_inst_b2w_scanin), | |
877 | .scan_out(decoded_inst_b2w_scanout), | |
878 | .l1clk(l1clk_pm1), | |
879 | .din ({return_b, save_b, restore_b, saved_b, restored_b, allclean_b, otherw_b, normalw_b, invalw_b}), | |
880 | .dout ({return_w, save_w, restore_w, saved_w, restored_w, allclean_w, otherw_w, normalw_w, invalw_w}), | |
881 | .siclk(siclk), | |
882 | .soclk(soclk)); | |
883 | ||
884 | // check for decoding logic, make sure one opcode is not decoded into 2 inst | |
885 | ||
886 | //!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*! End : Decode !*!*!*!*!*!*!*!*!*!*! | |
887 | ||
888 | ||
889 | ||
890 | ||
891 | // ============================================================================= | |
892 | // Pass through the control signals | |
893 | // ----------------------------------------------------------------------------- | |
894 | // Timing vld_e vld_m vld_b vld_w vld_noflush_w | |
895 | // ---------------------------------------------------------------------------- | |
896 | // | |
897 | // + internal exception | |
898 | // - clean_window early 1 1 0 0 1 | |
899 | // - fill early 1 1 0 0 1 | |
900 | // - spill early 1 1 0 0 1 | |
901 | // - spill_flush early 1 1 0 0 1 | |
902 | // | |
903 | // + external exceptions | |
904 | // - exu_ecc_m early 1 1 0 0 1 | |
905 | // - misaligned_noflush_m early | |
906 | // - no other exceptions 1 1 0 0 1 | |
907 | // - w/ fill exception 1 1 (fill) (fill) 1 | |
908 | // - w/ ecc exception 1 1 (ecc) (ecc) 1 | |
909 | // | |
910 | // + external flushes | |
911 | // - tlu_flush_exu_b late 1 1 0 0 1 | |
912 | // - dec_flush_m late 1 0 0 0 1 | |
913 | // - dec_flush_b early 1 1 0 0 1 | |
914 | ||
915 | ||
916 | assign tid4_d[3:0] = {(tid_d[1:0] == 2'b11),(tid_d[1:0] == 2'b10),(tid_d[1:0] == 2'b01),(tid_d[1:0] == 2'b00)}; | |
917 | ||
918 | exu_rml_ctl_msff_ctl_macro__width_14 tid_p2d2e2m2b2w ( | |
919 | .scan_in(tid_p2d2e2m2b2w_scanin), | |
920 | .scan_out(tid_p2d2e2m2b2w_scanout), | |
921 | .l1clk(l1clk_pm1), | |
922 | .din ({dec_tid_p[1:0], tid_d[1:0], tid_e[1:0], tid_m[1:0], tid_b[1:0], tid4_d[3:0]}), | |
923 | .dout ({ tid_d[1:0], tid_e[1:0], tid_m[1:0], tid_b[1:0], tid_w[1:0], tid4_e[3:0]}), | |
924 | .siclk(siclk), | |
925 | .soclk(soclk)); | |
926 | ||
927 | exu_rml_ctl_msff_ctl_macro__width_3 inst_vld_e2m2b2w ( | |
928 | .scan_in(inst_vld_e2m2b2w_scanin), | |
929 | .scan_out(inst_vld_e2m2b2w_scanout), | |
930 | .l1clk(l1clk_pm1), | |
931 | .din ({inst_vld_e, inst_vld_m, inst_vld_b}), | |
932 | .dout ({inst_vld_noflush_m, inst_vld_noflush_b, inst_vld_w}), | |
933 | .siclk(siclk), | |
934 | .soclk(soclk)); | |
935 | ||
936 | assign inst_vld_e = dec_valid_e; | |
937 | assign inst_vld_m = inst_vld_noflush_m & ~dec_flush_m; | |
938 | ||
939 | ||
940 | // Flushing current instruction | |
941 | // ------------------------------------------------------ | |
942 | assign exception_detected_m = (spill_detected_m | exu_fill_m | | |
943 | cleanwin_detected_m | address_error_detected_m | | |
944 | exu_ecc_m) & ~dec_flush_m; | |
945 | ||
946 | assign exu_ecc_winop_flush_m = ((spill_detected_m | cleanwin_detected_m | | |
947 | exu_fill_m) & (save_m | restore_m)) | | |
948 | exu_ecc_m; | |
949 | ||
950 | ||
951 | exu_rml_ctl_msff_ctl_macro__width_1 exception_detected_m2b ( | |
952 | .scan_in(exception_detected_m2b_scanin), | |
953 | .scan_out(exception_detected_m2b_scanout), | |
954 | .l1clk(l1clk_pm1), | |
955 | .din ( exception_detected_m ), | |
956 | .dout ( exception_detected_b ), | |
957 | .siclk(siclk), | |
958 | .soclk(soclk)); | |
959 | ||
960 | ||
961 | // Flush current instruction if exception detected or tlu/dec trap flush | |
962 | assign inst_vld_b = inst_vld_noflush_b & ~exception_detected_b & ~tlu_flush_exu_b & ~dec_flush_b; | |
963 | ||
964 | ||
965 | exu_rml_ctl_msff_ctl_macro__width_2 flush_exu_b2w ( | |
966 | .scan_in(flush_exu_b2w_scanin), | |
967 | .scan_out(flush_exu_b2w_scanout), | |
968 | .l1clk(l1clk_pm1), | |
969 | .din ({tlu_flush_exu_b, dec_flush_b}), | |
970 | .dout ({flush_exu_w, dec_flush_w}), | |
971 | .siclk(siclk), | |
972 | .soclk(soclk)); | |
973 | ||
974 | ||
975 | ||
976 | // ============================================================================= | |
977 | // Trap condition detection, flush, and trap vector generation | |
978 | // ----------------------------------------------------------------------------- | |
979 | // flush window only if CANSAVE != NWINDOWS-2 | |
980 | // noflushwin_m if CANSAVE == NWINDOWS-2 = 6 = 3'b110 | |
981 | // | |
982 | assign cansave_is0_m = (~cansave_m[2]) & (~cansave_m[1]) & | |
983 | (~cansave_m[0]); | |
984 | ||
985 | assign canrestore_is0_m = (~canrestore_m[2]) & (~canrestore_m[1]) & | |
986 | (~canrestore_m[0]); | |
987 | ||
988 | assign otherwin_is0_m = (~otherwin_m[2]) & (~otherwin_m[1]) & | |
989 | (~otherwin_m[0]); | |
990 | ||
991 | assign cleanwin4save_is0_m = (cleanwin_m[2] ~^ canrestore_m[2]) & | |
992 | (cleanwin_m[1] ~^ canrestore_m[1]) & | |
993 | (cleanwin_m[0] ~^ canrestore_m[0]); | |
994 | ||
995 | assign noflushwin_m = ( cansave_m[2]) & ( cansave_m[1]) & | |
996 | (~cansave_m[0]); | |
997 | ||
998 | ||
999 | // xxx_detected_m : exception condition detected, but not qualified with dec_flush_m | |
1000 | // xxx_m : real exception, qualified with dec_flush_m | |
1001 | // exu_ecc_m exception pre-empt all other exceptions | |
1002 | // fill exception pre-empt misalign exception | |
1003 | ||
1004 | // window_spill: no ecc errors detected | |
1005 | // and: cansave = 0, and valid save instruction is issued | |
1006 | // or noflushwin_m = 0 and valid flushw instruction is issued | |
1007 | // | |
1008 | assign spill_detected_m = ~exu_ecc_m & | |
1009 | (( cansave_is0_m & inst_vld_noflush_m & save_m ) | | |
1010 | (~noflushwin_m & inst_vld_noflush_m & flushw_m)); | |
1011 | ||
1012 | // window_fill: no ecc errors detected | |
1013 | // and: canrestore = 0, and valid restore instruction is issued | |
1014 | // or canrestore = 0, and valid return instruction is issued | |
1015 | // | |
1016 | assign exu_fill_m = ~exu_ecc_m & | |
1017 | canrestore_is0_m & inst_vld_noflush_m & (restore_m | return_m); | |
1018 | ||
1019 | // misaligned_addr: no ecc errors detected | |
1020 | // and no fill condition detected | |
1021 | // and misalignment flagged by exu_ect_ctl | |
1022 | // and return instruction is issued | |
1023 | // | |
1024 | assign address_error_detected_m = ~exu_ecc_m & ~exu_fill_m & return_m & inst_vld_noflush_m & | |
1025 | (exu_lsu_va_error_m | ect_misaligned_error_m); | |
1026 | ||
1027 | // clean_window: no ecc errors detected | |
1028 | // and cansave != 0, (cleanwin - canrestore) = 0, | |
1029 | // and a valid save instruction is issued | |
1030 | // | |
1031 | assign cleanwin_detected_m = ~exu_ecc_m & | |
1032 | (~cansave_is0_m & cleanwin4save_is0_m & | |
1033 | inst_vld_noflush_m & save_m); | |
1034 | ||
1035 | assign spill_m = spill_detected_m & ~dec_flush_m; | |
1036 | ||
1037 | assign cleanwin_exception_m = cleanwin_detected_m & ~dec_flush_m; | |
1038 | ||
1039 | // check for exception detection logic, only one exception detected at a time | |
1040 | ||
1041 | ||
1042 | assign return_consider_m = (return_m & ~ect_misaligned_error_m & ~exu_lsu_va_error_m) | | |
1043 | (return_m & exu_fill_m); | |
1044 | ||
1045 | ||
1046 | // Trap vector generation in M-stage and sent to TLU in B-stage | |
1047 | //------------------------------------------------------------- | |
1048 | exu_rml_ctl_msff_ctl_macro__width_3 exception_report_m2b ( | |
1049 | .scan_in(exception_report_m2b_scanin), | |
1050 | .scan_out(exception_report_m2b_scanout), | |
1051 | .l1clk(l1clk_pm1), | |
1052 | .din ({spill_m, cleanwin_exception_m, otherwin_is0_m}), | |
1053 | .dout ({spill_b, cleanwin_exception_b, otherwin_is0_b}), | |
1054 | .siclk(siclk), | |
1055 | .soclk(soclk)); | |
1056 | ||
1057 | assign exu_cleanwin_b = cleanwin_exception_b; | |
1058 | ||
1059 | assign exu_spill_b = spill_b; | |
1060 | assign exu_normal_b = otherwin_is0_b; | |
1061 | ||
1062 | assign exu_wstate_b[2:0] = ({3{ otherwin_is0_b}} & wstate_b[2:0]) | | |
1063 | ({3{~otherwin_is0_b}} & wstate_b[5:3]); | |
1064 | ||
1065 | ||
1066 | ||
1067 | // ============================================================================= | |
1068 | // Managing window block signal to decode | |
1069 | // ----------------------------------------------------------------------------- | |
1070 | // Creating holes for full window swaps | |
1071 | // - first hole | |
1072 | // - available with any window ops | |
1073 | // - need to create for WRPR to CWP | |
1074 | // - cannot kick off a wrpr_cwp if tlu is initiating a window change the | |
1075 | // same cycle, second part of the tlu window change could conflict with | |
1076 | // the first part of the wrpr_cwp | |
1077 | // | |
1078 | // - second hole | |
1079 | // - conditions that triggers exu_window_block_m to block a potential conflicting | |
1080 | // window operation come down the pipeline in another thread | |
1081 | // - spills caused by save and flushw | |
1082 | // - WRPR to CWP | |
1083 | // - TLU is taking care of all hole creation for done/retry | |
1084 | // | |
1085 | // - for a possible spill exception | |
1086 | // - use spill_detected_m for block generation | |
1087 | // - it will be a single cycle pulse, because the inst after save/flushw | |
1088 | // in the same thread will be a NOP, garanteed by pick logic | |
1089 | ||
1090 | ||
1091 | // remember that a wrcwp is in play until it can be processed | |
1092 | // ------------------------------------------------------------- | |
1093 | assign block_wrcwp = trap_ccr_cwp_valid | spill_detected_m; | |
1094 | ||
1095 | assign wrcwp_in_play_in = (detected_wrpr_cwp & block_wrcwp) | (wrcwp_in_play & block_wrcwp); | |
1096 | ||
1097 | exu_rml_ctl_msff_ctl_macro__width_1 wrcwp_in_playf ( | |
1098 | .scan_in(wrcwp_in_playf_scanin), | |
1099 | .scan_out(wrcwp_in_playf_scanout), | |
1100 | .l1clk (l1clk_pm1), | |
1101 | .din (wrcwp_in_play_in), | |
1102 | .dout (wrcwp_in_play), | |
1103 | .siclk(siclk), | |
1104 | .soclk(soclk)); | |
1105 | ||
1106 | assign actual_wrpr_cwp = (detected_wrpr_cwp | wrcwp_in_play) & ~block_wrcwp; | |
1107 | ||
1108 | ||
1109 | ||
1110 | exu_rml_ctl_msff_ctl_macro__width_3 pr_wt_ff ( | |
1111 | .scan_in(pr_wt_ff_scanin), | |
1112 | .scan_out(pr_wt_ff_scanout), | |
1113 | .l1clk(l1clk_pm1), | |
1114 | .din ({actual_wrpr_cwp , actual_wrpr_cwp_d , actual_wrpr_cwp_e}), | |
1115 | .dout ({actual_wrpr_cwp_d , actual_wrpr_cwp_e , pr_wt_m}), | |
1116 | .siclk(siclk), | |
1117 | .soclk(soclk)); | |
1118 | ||
1119 | ||
1120 | exu_rml_ctl_msff_ctl_macro__width_3 trap_ccr_cwp_ff ( | |
1121 | .scan_in(trap_ccr_cwp_ff_scanin), | |
1122 | .scan_out(trap_ccr_cwp_ff_scanout), | |
1123 | .l1clk(l1clk_pm1), | |
1124 | .din ({trap_ccr_cwp_valid , trap_ccr_cwp_valid_d , trap_ccr_cwp_valid_e }), | |
1125 | .dout ({trap_ccr_cwp_valid_d , trap_ccr_cwp_valid_e , trap_ccr_cwp_valid_m }), | |
1126 | .siclk(siclk), | |
1127 | .soclk(soclk)); | |
1128 | ||
1129 | ||
1130 | assign make_2nd_window_slot = spill_detected_m | pr_wt_m | trap_ccr_cwp_valid; | |
1131 | assign ack_wrpr_cwp_done = pr_wt_m; | |
1132 | ||
1133 | assign exu_window_block_m = actual_wrpr_cwp | rd_irf_ecc_valid | rd_irf_ecc_valid_lth; | |
1134 | assign exu_tlu_window_block = exu_window_block_m; | |
1135 | ||
1136 | ||
1137 | ||
1138 | ||
1139 | ||
1140 | ||
1141 | // ============================================================================= | |
1142 | // Control signals to IRF | |
1143 | // ----------------------------------------------------------------------------- | |
1144 | // Three sources of control for local/even/odd register swaps: | |
1145 | // - window operation instruction | |
1146 | // - normal window swaps w/o exception | |
1147 | // - exception state preparation | |
1148 | // - WRPR to CWP from the ASI ring | |
1149 | // - CWP updates from TLU | |
1150 | // | |
1151 | // One source of control for Global register swap: | |
1152 | // - GL updates from TLU | |
1153 | // | |
1154 | ||
1155 | // - generate control signals in M stage | |
1156 | // - send to IRF in B stage | |
1157 | // - IRF decodes in B stage, saves in W stage, and restores in W2 stage | |
1158 | // | |
1159 | // | |
1160 | // old_lo old_e new_lo new_e l_en o_en e_en | |
1161 | // -------------------------------------------------------------------------- | |
1162 | // window op inst | |
1163 | // + no exception | |
1164 | // - save CWP CWP+1 CWP+1 CWP+2 o/e o e | |
1165 | // - restore CWP CWP+1 CWP-1 CWP o/e e o | |
1166 | // - saved - - - - - - - | |
1167 | // - restored - - - - - - - | |
1168 | // - flushw - - - - - - - | |
1169 | // - return CWP CWP+1 CWP-1 CWP o/e e o | |
1170 | // | |
1171 | // + exeption | |
1172 | // - clean_window CWP CWP+1 CWP+1 CWP+2 o/e o e | |
1173 | // - fill CWP CWP+1 CWP-1 CWP o/e e o | |
1174 | // | |
1175 | // - spill_1 CWP - CWP+2 - o/e o/e - | |
1176 | // spill_2 - CWP+1 - CWP+3 - - o/e | |
1177 | // | |
1178 | // - spill_flush_1 CWP - CWP+2+ - o/e o/e - | |
1179 | // CANSAVE | |
1180 | // | |
1181 | // spill_flush_2 - CWP+1 - CWP+3+ - - o/e | |
1182 | // CANSAVE | |
1183 | // | |
1184 | // WRPR to CWP | |
1185 | // - WRPR_CWP_1 CWP - NEWCWP - o/e o/e - | |
1186 | // WRPR_CWP_2 - CWP+1 - NEWCWP+1 - - o/e | |
1187 | // | |
1188 | // TLU CWP updates | |
1189 | // - TLU_CWP_1 CWP - NEWCWP - o/e o/e - | |
1190 | // TLU_CWP_2 - CWP+1 - NEWCWP+1 - - o/e | |
1191 | // | |
1192 | // | |
1193 | // - speculatively controls IRF to do SWAP in case of exception | |
1194 | // - if TLU confirms with tlu_flush_exu_b signal, | |
1195 | // continue to restore-step in the swap process | |
1196 | // - if no TLU tlu_flush_exu_b | |
1197 | // cancels the restore-step in the swap process | |
1198 | // | |
1199 | // | |
1200 | ||
1201 | // calculate possible CWP values | |
1202 | //--------------------------------------------- | |
1203 | assign cwp_dec1_m[2:0] = cwp_m[2:0] - 3'b001; | |
1204 | assign cwp_inc1_m[2:0] = cwp_m[2:0] + 3'b001; | |
1205 | assign cwp_inc2_m[2:1] = cwp_m[2:1] + 2'b01 ; | |
1206 | ||
1207 | // assign cwp_inc2_cansave_m[2:0] = cwp_m[2:0] + 3'b010 + cansave_m[2:0]; | |
1208 | // Calculating increment by 2 plus cansave (logic mapped from espresso) | |
1209 | assign cwp_inc2_cansave_m[2] = | |
1210 | ( cwp_m[2] & cwp_m[1] & cwp_m[0] & ~cansave_m[2] & cansave_m[1] & cansave_m[0]) | | |
1211 | (~cwp_m[2] & cwp_m[1] & cwp_m[0] & cansave_m[2] & cansave_m[1] & cansave_m[0]) | | |
1212 | ( cwp_m[2] & ~cwp_m[1] & ~cansave_m[2] & ~cansave_m[1] & ~cansave_m[0]) | | |
1213 | (~cwp_m[2] & ~cwp_m[1] & cansave_m[2] & ~cansave_m[1] & ~cansave_m[0]) | | |
1214 | (~cwp_m[2] & cwp_m[0] & ~cansave_m[2] & ~cansave_m[1] & cansave_m[0]) | | |
1215 | ( cwp_m[2] & cwp_m[0] & cansave_m[2] & ~cansave_m[1] & cansave_m[0]) | | |
1216 | (~cwp_m[2] & cwp_m[1] & ~cwp_m[0] & ~cansave_m[2] ) | | |
1217 | ( cwp_m[2] & cwp_m[1] & ~cwp_m[0] & cansave_m[2] ) | | |
1218 | ( cwp_m[2] & ~cwp_m[1] & ~cwp_m[0] & ~cansave_m[2] & ~cansave_m[1] ) | | |
1219 | (~cwp_m[2] & ~cwp_m[1] & ~cwp_m[0] & cansave_m[2] & ~cansave_m[1] ) | | |
1220 | (~cwp_m[2] & cwp_m[1] & ~cansave_m[2] & ~cansave_m[0]) | | |
1221 | ( cwp_m[2] & cwp_m[1] & cansave_m[2] & ~cansave_m[0]) | | |
1222 | (~cwp_m[2] & ~cwp_m[1] & ~cansave_m[2] & cansave_m[1] ) | | |
1223 | ( cwp_m[2] & ~cwp_m[1] & cansave_m[2] & cansave_m[1] ); | |
1224 | ||
1225 | assign cwp_inc2_cansave_m[1] = | |
1226 | (~cwp_m[1] & cwp_m[0] & cansave_m[1] & cansave_m[0]) | | |
1227 | ( cwp_m[1] & cwp_m[0] & ~cansave_m[1] & cansave_m[0]) | | |
1228 | ( cwp_m[1] & cansave_m[1] & ~cansave_m[0]) | | |
1229 | ( cwp_m[1] & ~cwp_m[0] & cansave_m[1] ) | | |
1230 | (~cwp_m[1] & ~cansave_m[1] & ~cansave_m[0]) | | |
1231 | (~cwp_m[1] & ~cwp_m[0] & ~cansave_m[1] ); | |
1232 | ||
1233 | assign cwp_inc2_cansave_m[0] = (cwp_m[0]& ~cansave_m[0]) | (~cwp_m[0]& cansave_m[0]); | |
1234 | ||
1235 | ||
1236 | ||
1237 | ||
1238 | // setting IRF controls | |
1239 | // -------------------------------------- | |
1240 | // Thread ID is from | |
1241 | // - TLU in case of TLU CWP updates | |
1242 | // - in case of (trap_ccr_cwp_valid_m) | |
1243 | // - the thread ID passed down the pipeline | |
1244 | // - WRPR ASI control in case of WRPR to CWP | |
1245 | // - for the first slot, TID from ASI interface | |
1246 | // - current m-stage instruction ID in all other cases | |
1247 | ||
1248 | assign rml_irf_cwpswap_tid_m[1:0] = ( {2{~mbi_run_lth & trap_ccr_cwp_valid }} & trap_ccr_cwp_tid[1:0] ) | | |
1249 | ( {2{~mbi_run_lth & ~trap_ccr_cwp_valid & trap_ccr_cwp_valid_m }} & slot_tid_m[1:0] ) | | |
1250 | ( {2{~mbi_run_lth & ~trap_ccr_cwp_valid & ~trap_ccr_cwp_valid_m & pr_wt_m}} & wrpr_cwp_tid_hold[1:0]) | | |
1251 | ( {2{~mbi_run_lth & ~trap_ccr_cwp_valid & ~trap_ccr_cwp_valid_m & ~pr_wt_m}} & tid_m[1:0] ) | | |
1252 | ( {2{ mbi_run_lth & ~mbi_irf_save_en_p2 }} & mbi_addr_lth[3:2] ) | | |
1253 | ( {2{ mbi_run_lth & mbi_irf_save_en_p2 }} & mbi_addr_lth[6:5] ); | |
1254 | ||
1255 | exu_rml_ctl_msff_ctl_macro__width_6 winblock_slot_tid_m2d2e2m ( | |
1256 | .scan_in(winblock_slot_tid_m2d2e2m_scanin), | |
1257 | .scan_out(winblock_slot_tid_m2d2e2m_scanout), | |
1258 | .l1clk(l1clk_pm1), | |
1259 | .din ({rml_irf_cwpswap_tid_m[1:0], slot_tid_d[1:0], slot_tid_e[1:0] }), | |
1260 | .dout ({slot_tid_d [1:0], slot_tid_e[1:0], slot_tid_m[1:0] }), | |
1261 | .siclk(siclk), | |
1262 | .soclk(soclk)); | |
1263 | ||
1264 | /* 0in value -var {trap_ccr_cwp_valid, pr_wt_m, trap_ccr_cwp_valid_m} | |
1265 | -val 3'b000 3'b001 3'b010 3'b100 | |
1266 | -message "TLU->CWP, WRPR->CWP & 2nd Full swap conflict in M stage exu.rml"*/ | |
1267 | ||
1268 | ||
1269 | ||
1270 | // Old CWP should always be the current CWP for the thread in processing | |
1271 | // - in case of WRPR of CWP | |
1272 | // - get the correct old CWP from priviliged register file based on wrpr_cwp_tid_hold[1:0] | |
1273 | // - in case of done/retry | |
1274 | // - get the correct old CWP from priviliged register file based on trap_ccr_cwp_tid[1:0] | |
1275 | // - in case of (trap_ccr_cwp_valid_m): | |
1276 | // - rml_irf_old_lo_cwp_m[2:0] = don't care, could just be cwp_m[2:0] | |
1277 | // - rml_irf_old_e_cwp_m[2:0] = the value passed down, incremented | |
1278 | ||
1279 | assign old_lo_tid_m[1:0] = ({2{ trap_ccr_cwp_valid}} & trap_ccr_cwp_tid[1:0] ) | | |
1280 | ({2{~trap_ccr_cwp_valid}} & {2{ pr_wt_m}} & wrpr_cwp_tid_hold[1:0]) | | |
1281 | ({2{~trap_ccr_cwp_valid}} & {2{~pr_wt_m}} & tid_m[1:0] ); | |
1282 | ||
1283 | assign old_lo_fetch_m = trap_ccr_cwp_valid | pr_wt_m; | |
1284 | ||
1285 | assign rml_irf_old_lo_cwp_m[2:0]= ({3{~mbi_run_lth & ~old_lo_fetch_m }} & cwp_m[2:0] ) | | |
1286 | ({3{~mbi_run_lth & old_lo_fetch_m & ~old_lo_tid_m[1] & ~old_lo_tid_m[0]}} & cwp_thr0[2:0] ) | | |
1287 | ({3{~mbi_run_lth & old_lo_fetch_m & ~old_lo_tid_m[1] & old_lo_tid_m[0]}} & cwp_thr1[2:0] ) | | |
1288 | ({3{~mbi_run_lth & old_lo_fetch_m & old_lo_tid_m[1] & ~old_lo_tid_m[0]}} & cwp_thr2[2:0] ) | | |
1289 | ({3{~mbi_run_lth & old_lo_fetch_m & old_lo_tid_m[1] & old_lo_tid_m[0]}} & cwp_thr3[2:0] ) | | |
1290 | ({3{ mbi_run_lth & ~mbi_irf_save_en_p2 }} & mbi_addr_lth[2:0]) | | |
1291 | ({3{ mbi_run_lth & mbi_irf_save_en_p2 }} & mbi_addr_lth[9:7]); | |
1292 | ||
1293 | assign old_lo_cwp_inc1_m[2:0] = rml_irf_old_lo_cwp_m[2:0] + 3'b001; | |
1294 | assign old_lo_cwp_inc1_m_unused = old_lo_cwp_inc1_m[0]; | |
1295 | ||
1296 | assign rml_irf_old_e_cwp_m[2:1] = ({2{~mbi_run_lth & old_lo_fetch_m }} & old_lo_cwp_inc1_m [2:1]) | | |
1297 | ({2{~mbi_run_lth & ~old_lo_fetch_m & make_2nd_window_slot}} & slot_old_cwp_inc1_m[2:1]) | | |
1298 | ({2{~mbi_run_lth & ~old_lo_fetch_m & ~make_2nd_window_slot}} & cwp_inc1_m[2:1] ) | | |
1299 | ({2{ mbi_run_lth & ~mbi_irf_save_en_p2 }} & mbi_addr_lth[1:0] ) | | |
1300 | ({2{ mbi_run_lth & mbi_irf_save_en_p2 }} & mbi_addr_lth[9:8] ); | |
1301 | ||
1302 | assign slot_old_cwp_inc1_m[2:0] = rml_irf_old_lo_cwp_m[2:0] + 3'b001; | |
1303 | assign slot_old_cwp_inc1_m_unused = slot_old_cwp_inc1_m[0]; | |
1304 | ||
1305 | assign slot_new_cwp_inc1_m[2:0] = rml_irf_new_lo_cwp_m[2:0] + 3'b001; | |
1306 | assign slot_new_cwp_inc1_m_unused = slot_new_cwp_inc1_m[0]; | |
1307 | ||
1308 | // New local/odd CWP should be: | |
1309 | // - (restore & (no_fill_exception | fill_exception): CWP-1 | |
1310 | // - (save & (no_exception | clean_window_exception)= | |
1311 | // (save & (no_spill exception): CWP+1 | |
1312 | // - spill | spill_flush: CWP+2 | |
1313 | // - WRPR_CWP: NEWCWP from WRPR | |
1314 | // - TLU CWP updates: NEWCWP from TLU | |
1315 | // - otherwise: new CWP = old CWP | |
1316 | ||
1317 | assign rml_irf_new_lo_cwp_m[2:0]= ({3{(inst_vld_m & (restore_m | return_consider_m)) }} & cwp_dec1_m[2:0] ) | | |
1318 | ({3{(inst_vld_m & save_m & ~spill_detected_m) }} & cwp_inc1_m[2:0] ) | | |
1319 | ({3{(inst_vld_m & (save_m | flushw_m) & spill_detected_m) }} & cwp_inc2_cansave_m[2:0]) | | |
1320 | ({3{ pr_wt_m }} & pr_new_cwp_wt[2:0] ) | | |
1321 | ({3{ trap_ccr_cwp_valid }} & trap_cwp[2:0] ) | | |
1322 | ({3{(~(inst_vld_m & (restore_m | return_consider_m | save_m | flushw_m)) & ~pr_wt_m & ~trap_ccr_cwp_valid)}} & cwp_m[2:0] ); | |
1323 | ||
1324 | ||
1325 | ||
1326 | // New even CWP should be: | |
1327 | // - restore/return & (no_fill_exception | fill_exception): CWP | |
1328 | // - save & (no_exception | clean_window_exception)= | |
1329 | // (save & (not_spill exception): CWP+2 | |
1330 | // - trap_ccr_cwp_valid_m: (new CWP passed down)+1 | |
1331 | // - otherwise: new CWP = old CWP | |
1332 | ||
1333 | assign new_e_cwp_m[2:1] = ({2{ (inst_vld_m & (restore_m | return_consider_m))}} & cwp_m[2:1]) | | |
1334 | ({2{ (inst_vld_m & save_m & ~spill_detected_m)}} & cwp_inc2_m[2:1]) | | |
1335 | ({2{ make_2nd_window_slot}} & slot_new_cwp_inc1_m[2:1])| | |
1336 | ({2{~(inst_vld_m & save_m & ~spill_detected_m) & ~make_2nd_window_slot}} & cwp_m[2:1]); | |
1337 | ||
1338 | // Local CWP, swap if: | |
1339 | // - valid save instruction, no exception | |
1340 | // - clean_window_exception | |
1341 | // - spill_exception | |
1342 | // ==> valid save instruction, with/without exceptions | |
1343 | // | |
1344 | // - valid restore/return instruction, no exception | |
1345 | // - fill_exception | |
1346 | // ==> valid restore/return instruction, with/without exceptions | |
1347 | // | |
1348 | // - spill_flush_exception, implies: | |
1349 | // ==> spill_detected_m, since save is all covered | |
1350 | // ==> inst_vld_m, since flushw must be valid to generate the exception | |
1351 | // | |
1352 | // - WRPR to CWP -> pr_wt_m asserted | |
1353 | // - TLU CPWP updates -> trap_ccr_cwp_valid asserted | |
1354 | ||
1355 | assign rml_irf_save_local_m = (~mbi_run_lth & inst_vld_m & ~exu_ecc_m & (save_m | restore_m | return_consider_m | spill_detected_m)) | | |
1356 | (~mbi_run_lth & (pr_wt_m | trap_ccr_cwp_valid )) | | |
1357 | ( mbi_run_lth & mbi_irf_save_en_p2 ); | |
1358 | ||
1359 | ||
1360 | // Odd CWP, swap if: | |
1361 | // - odd current CWP, with a valid save instruction and no exception | |
1362 | // - odd current CWP, with a clean_window exception | |
1363 | // ==> odd current CWP, a valid save inst (all spills are covered later) | |
1364 | // | |
1365 | // - even current CWP, with a valid restore/return instruction and no exception | |
1366 | // - even current CWP, with a fill_window exception | |
1367 | // ==> even current CWP, with a valid restore/return instruction, with/without exceptions | |
1368 | // | |
1369 | // - spill_exception | |
1370 | // - WRPR to CWP -> pr_wt_m asserted | |
1371 | // - TLU CPWP updates -> trap_ccr_cwp_valid asserted | |
1372 | ||
1373 | ||
1374 | assign rml_irf_save_odd_m = (~mbi_run_lth & inst_vld_m & ~exu_ecc_m & save_m & cwp_m[0]) | | |
1375 | (~mbi_run_lth & inst_vld_m & ~exu_ecc_m & (restore_m | return_consider_m) & ~cwp_m[0]) | | |
1376 | (~mbi_run_lth & (spill_detected_m | pr_wt_m | trap_ccr_cwp_valid)) | | |
1377 | ( mbi_run_lth & mbi_irf_save_en_p2 ); | |
1378 | ||
1379 | // Even CWP, swap if: | |
1380 | // - even current CWP, with a valid save instruction and no exception | |
1381 | // - even current CWP, with a clean_window exception | |
1382 | // ==> odd current CWP, a valid save inst and no spill (~cansave_is0_m) | |
1383 | // | |
1384 | // - odd current CWP, with a valid restore/return instruction and no exception | |
1385 | // - odd current CWP, with a fill_window exception | |
1386 | // ==> even current CWP, with a valid restore/return instruction, with/without exceptions | |
1387 | // | |
1388 | // - second round of window swaps | |
1389 | ||
1390 | assign rml_irf_save_even_m = (~mbi_run_lth & inst_vld_m & ~exu_ecc_m & save_m & ~cansave_is0_m & ~cwp_m[0]) | | |
1391 | (~mbi_run_lth & inst_vld_m & ~exu_ecc_m & (restore_m | return_consider_m) & cwp_m[0]) | | |
1392 | (~mbi_run_lth & (spill_detected_m | pr_wt_m | trap_ccr_cwp_valid)) | | |
1393 | ( mbi_run_lth & mbi_irf_save_en_p2 ); | |
1394 | ||
1395 | ||
1396 | exu_rml_ctl_msff_ctl_macro__width_15 i_rml_restore_en_ff ( | |
1397 | .scan_in(i_rml_restore_en_ff_scanin), | |
1398 | .scan_out(i_rml_restore_en_ff_scanout), | |
1399 | .l1clk(l1clk_pm1), | |
1400 | .din ({rml_irf_save_even_m , | |
1401 | rml_irf_save_odd_m , | |
1402 | rml_irf_save_local_m , | |
1403 | rml_irf_save_global , | |
1404 | rml_irf_global_tid[1:0] , | |
1405 | rml_irf_cwpswap_tid_m[1:0] , | |
1406 | new_e_cwp_m[2:1] , | |
1407 | rml_irf_new_lo_cwp_m[2:0] , | |
1408 | rml_irf_new_agp[1:0]} ), | |
1409 | .dout ({rml_irf_restore_even_b_ff , | |
1410 | rml_irf_restore_odd_b_ff , | |
1411 | rml_irf_restore_local_b_ff , | |
1412 | rml_irf_restore_global_ff , | |
1413 | rml_irf_global_tid_ff[1:0] , | |
1414 | raw_irf_cwpswap_tid_b[1:0] , | |
1415 | raw_irf_new_e_cwp_b[2:1] , | |
1416 | raw_irf_new_lo_cwp_b[2:0] , | |
1417 | rml_irf_new_agp_ff[1:0]} ), | |
1418 | .siclk(siclk), | |
1419 | .soclk(soclk)); | |
1420 | ||
1421 | assign rml_irf_cwpswap_tid_b[1:0] = ({2{~mbi_run_lth }} & raw_irf_cwpswap_tid_b[1:0]) | | |
1422 | ({2{ mbi_run_lth & ~mbi_irf_restore_en_p2}} & mbi_addr_lth[1:0] ) | | |
1423 | ({2{ mbi_run_lth & mbi_irf_restore_en_p2}} & mbi_addr_lth[6:5] ); | |
1424 | ||
1425 | assign rml_irf_new_lo_cwp_b[2:0] = ({3{~mbi_run_lth }} & raw_irf_new_lo_cwp_b[2:0] ) | | |
1426 | ({3{ mbi_run_lth & ~mbi_irf_restore_en_p2}} & mbi_addr_lth[3:1] ) | | |
1427 | ({3{ mbi_run_lth & mbi_irf_restore_en_p2}} & mbi_addr_lth[9:7] ); | |
1428 | ||
1429 | assign rml_irf_new_e_cwp_b[2:1] = ({2{~mbi_run_lth }} & raw_irf_new_e_cwp_b[2:1] ) | | |
1430 | ({2{ mbi_run_lth & ~mbi_irf_restore_en_p2}} & mbi_addr_lth[4:3] ) | | |
1431 | ({2{ mbi_run_lth & mbi_irf_restore_en_p2}} & mbi_addr_lth[9:8] ); | |
1432 | ||
1433 | ||
1434 | assign rml_irf_restore_even_b = (~mbi_run_lth & rml_irf_restore_even_b_ff & ~tlu_flush_exu_b) | ( mbi_run_lth & mbi_irf_restore_en_p2); | |
1435 | assign rml_irf_restore_odd_b = (~mbi_run_lth & rml_irf_restore_odd_b_ff & ~tlu_flush_exu_b) | ( mbi_run_lth & mbi_irf_restore_en_p2); | |
1436 | assign rml_irf_restore_local_b = (~mbi_run_lth & rml_irf_restore_local_b_ff & ~tlu_flush_exu_b) | ( mbi_run_lth & mbi_irf_restore_en_p2); | |
1437 | assign rml_irf_restore_global = (~mbi_run_lth & rml_irf_restore_global_ff ) | ( mbi_run_lth & mbi_irf_restore_en_p2); | |
1438 | ||
1439 | // Make sure no save/restore to the same thread at the same time | |
1440 | ||
1441 | ||
1442 | // generate next cycle CWP values | |
1443 | // ----------------------------------------------------- | |
1444 | // replicate the window swap destination generated by IRF control | |
1445 | ||
1446 | assign cwp_update_m = rml_irf_save_local_m & ~exu_ecc_m; | |
1447 | assign cwp_tid_m[1:0] = rml_irf_cwpswap_tid_m[1:0]; | |
1448 | assign cwp_new_m[2:0] = rml_irf_new_lo_cwp_m[2:0]; | |
1449 | ||
1450 | exu_rml_ctl_msff_ctl_macro__width_6 cwp_m2b ( | |
1451 | .scan_in(cwp_m2b_scanin), | |
1452 | .scan_out(cwp_m2b_scanout), | |
1453 | .l1clk(l1clk_pm1), | |
1454 | .din ({cwp_tid_m[1:0], cwp_new_m[2:0], cwp_update_m}), | |
1455 | .dout ({cwp_tid_b[1:0], cwp_new_b[2:0], cwp_update_b}), | |
1456 | .siclk(siclk), | |
1457 | .soclk(soclk)); | |
1458 | ||
1459 | // Cancel CWP updates if the current instruction is being flushed | |
1460 | assign cwp_update_no_flush_exu_b = cwp_update_b & ~tlu_flush_exu_b & ~dec_flush_b; | |
1461 | ||
1462 | exu_rml_ctl_msff_ctl_macro__width_6 cwp_b2w ( | |
1463 | .scan_in(cwp_b2w_scanin), | |
1464 | .scan_out(cwp_b2w_scanout), | |
1465 | .l1clk(l1clk_pm1), | |
1466 | .din ({cwp_tid_b[1:0], cwp_new_b[2:0], cwp_update_no_flush_exu_b}), | |
1467 | .dout ({cwp_tid_w[1:0], cwp_new_w[2:0], cwp_update_w}), | |
1468 | .siclk(siclk), | |
1469 | .soclk(soclk)); | |
1470 | ||
1471 | assign cwp_next_w[2:0] = cwp_new_w[2:0]; | |
1472 | ||
1473 | assign cwp_we_w[0] = (~cwp_tid_w[1]) & (~cwp_tid_w[0]) & (cwp_update_w); | |
1474 | assign cwp_we_w[1] = (~cwp_tid_w[1]) & ( cwp_tid_w[0]) & (cwp_update_w); | |
1475 | assign cwp_we_w[2] = ( cwp_tid_w[1]) & (~cwp_tid_w[0]) & (cwp_update_w); | |
1476 | assign cwp_we_w[3] = ( cwp_tid_w[1]) & ( cwp_tid_w[0]) & (cwp_update_w); | |
1477 | ||
1478 | assign cwp_pr_we[0] = (~wrpr_cwp_tid_hold[1]) & (~wrpr_cwp_tid_hold[0]) & (pr_wt_m); | |
1479 | assign cwp_pr_we[1] = (~wrpr_cwp_tid_hold[1]) & ( wrpr_cwp_tid_hold[0]) & (pr_wt_m); | |
1480 | assign cwp_pr_we[2] = ( wrpr_cwp_tid_hold[1]) & (~wrpr_cwp_tid_hold[0]) & (pr_wt_m); | |
1481 | assign cwp_pr_we[3] = ( wrpr_cwp_tid_hold[1]) & ( wrpr_cwp_tid_hold[0]) & (pr_wt_m); | |
1482 | ||
1483 | assign cwp_thr0_next[2:0] = ({3{ cwp_we_w[0] }} & cwp_next_w[2:0] ) | | |
1484 | ({3{ cwp_pr_we[0]}} & pr_new_cwp_wt[2:0]) | | |
1485 | ({3{~cwp_pr_we[0]}} & {3{~cwp_we_w[0]}} & cwp_thr0[2:0] ); | |
1486 | ||
1487 | assign cwp_thr1_next[2:0] = ({3{ cwp_we_w[1] }} & cwp_next_w[2:0] ) | | |
1488 | ({3{ cwp_pr_we[1]}} & pr_new_cwp_wt[2:0]) | | |
1489 | ({3{~cwp_pr_we[1]}} & {3{~cwp_we_w[1]}} & cwp_thr1[2:0] ); | |
1490 | ||
1491 | assign cwp_thr2_next[2:0] = ({3{ cwp_we_w[2] }} & cwp_next_w[2:0] ) | | |
1492 | ({3{ cwp_pr_we[2]}} & pr_new_cwp_wt[2:0]) | | |
1493 | ({3{~cwp_pr_we[2]}} & {3{~cwp_we_w[2]}} & cwp_thr2[2:0] ); | |
1494 | ||
1495 | assign cwp_thr3_next[2:0] = ({3{ cwp_we_w[3] }} & cwp_next_w[2:0] ) | | |
1496 | ({3{ cwp_pr_we[3]}} & pr_new_cwp_wt[2:0]) | | |
1497 | ({3{~cwp_pr_we[3]}} & {3{~cwp_we_w[3]}} & cwp_thr3[2:0] ); | |
1498 | ||
1499 | ||
1500 | ||
1501 | ||
1502 | ||
1503 | // Controls of Alternate Global Pointer | |
1504 | // ------------------------------------------------------- | |
1505 | ||
1506 | // Detect changes in thread being updated | |
1507 | assign gl_changed_thr0 = (tlu_gl_thr0[1]^gl_thr0[1]) | (tlu_gl_thr0[0]^gl_thr0[0]); | |
1508 | assign gl_changed_thr1 = (tlu_gl_thr1[1]^gl_thr1[1]) | (tlu_gl_thr1[0]^gl_thr1[0]); | |
1509 | assign gl_changed_thr2 = (tlu_gl_thr2[1]^gl_thr2[1]) | (tlu_gl_thr2[0]^gl_thr2[0]); | |
1510 | assign gl_changed_thr3 = (tlu_gl_thr3[1]^gl_thr3[1]) | (tlu_gl_thr3[0]^gl_thr3[0]); | |
1511 | ||
1512 | assign gl_we[0] = gl_changed_thr0; | |
1513 | assign gl_we[1] = gl_changed_thr1; | |
1514 | assign gl_we[2] = gl_changed_thr2; | |
1515 | assign gl_we[3] = gl_changed_thr3; | |
1516 | ||
1517 | // No more than one GL changes per cycle to RML | |
1518 | ||
1519 | // Never have GL changes in the same thread trailing each other within 3 cycles | |
1520 | ||
1521 | ||
1522 | assign gl_tid[0] = gl_we[1] | gl_we[3]; | |
1523 | assign gl_tid[1] = gl_we[2] | gl_we[3]; | |
1524 | ||
1525 | assign gl_changed = gl_changed_thr0 | gl_changed_thr1 | gl_changed_thr2 | | |
1526 | gl_changed_thr3; | |
1527 | ||
1528 | assign gl_thr0_next[1:0] = ({2{ gl_we[0]}} & tlu_gl_thr0[1:0]) | | |
1529 | ({2{ ~gl_we[0]}} & gl_thr0[1:0]); | |
1530 | assign gl_thr1_next[1:0] = ({2{ gl_we[1]}} & tlu_gl_thr1[1:0]) | | |
1531 | ({2{ ~gl_we[1]}} & gl_thr1[1:0]); | |
1532 | assign gl_thr2_next[1:0] = ({2{ gl_we[2]}} & tlu_gl_thr2[1:0]) | | |
1533 | ({2{ ~gl_we[2]}} & gl_thr2[1:0]); | |
1534 | assign gl_thr3_next[1:0] = ({2{ gl_we[3]}} & tlu_gl_thr3[1:0]) | | |
1535 | ({2{ ~gl_we[3]}} & gl_thr3[1:0]); | |
1536 | ||
1537 | ||
1538 | exu_rml_ctl_msff_ctl_macro__width_8 old_gl_ptr ( | |
1539 | .scan_in(old_gl_ptr_wmr_scanin), | |
1540 | .scan_out(old_gl_ptr_wmr_scanout), | |
1541 | .siclk(spc_aclk_wmr), | |
1542 | .l1clk(l1clk_pm1), | |
1543 | .din ({gl_thr0_next[1:0], | |
1544 | gl_thr1_next[1:0], | |
1545 | gl_thr2_next[1:0], | |
1546 | gl_thr3_next[1:0]}), | |
1547 | .dout ({gl_thr0[1:0], | |
1548 | gl_thr1[1:0], | |
1549 | gl_thr2[1:0], | |
1550 | gl_thr3[1:0]}), | |
1551 | .soclk(soclk)); | |
1552 | ||
1553 | ||
1554 | // Set IRF controls | |
1555 | // - if no valid signal, rml_irf_old_agp & rml_irf_new_agp follows [tlu_gl] | |
1556 | ||
1557 | assign rml_irf_save_global = ( ~mbi_run_lth & gl_changed ) | | |
1558 | ( mbi_run_lth & mbi_irf_save_en_p2); | |
1559 | ||
1560 | assign rml_irf_global_tid[1:0] = ({2{~mbi_run_lth}} & gl_tid[1:0] ) | | |
1561 | ({2{ mbi_run_lth}} & mbi_addr_lth[6:5] ); | |
1562 | ||
1563 | assign rml_irf_old_agp[1:0] = ({2{~mbi_run_lth & gl_we[0]}} & gl_thr0[1:0] ) | | |
1564 | ({2{~mbi_run_lth & gl_we[1]}} & gl_thr1[1:0] ) | | |
1565 | ({2{~mbi_run_lth & gl_we[2]}} & gl_thr2[1:0] ) | | |
1566 | ({2{~mbi_run_lth & gl_we[3]}} & gl_thr3[1:0] ) | | |
1567 | ({2{ mbi_run_lth }} & mbi_addr_lth[8:7]); | |
1568 | ||
1569 | assign rml_irf_new_agp[1:0] = ({2{~mbi_run_lth & gl_we[0]}} & tlu_gl_thr0[1:0] ) | | |
1570 | ({2{~mbi_run_lth & gl_we[1]}} & tlu_gl_thr1[1:0] ) | | |
1571 | ({2{~mbi_run_lth & gl_we[2]}} & tlu_gl_thr2[1:0] ) | | |
1572 | ({2{~mbi_run_lth & gl_we[3]}} & tlu_gl_thr3[1:0] ) | | |
1573 | ({2{ mbi_run_lth }} & mbi_addr_lth[8:7]); | |
1574 | ||
1575 | ||
1576 | ||
1577 | // ============================================================================= | |
1578 | // State machines to keep track of priviledged register updates | |
1579 | // ----------------------------------------------------------------------------- | |
1580 | // PR CANSAVE CANRESTORE OTHERWIN CLEANWIN CWP | |
1581 | // ----------------------------------------------------------------------------- | |
1582 | // Reset 3'b110 3'b000 3'b000 3'b111 3'b000 | |
1583 | // | |
1584 | // Save dec inc - - inc | |
1585 | // | |
1586 | // Restore inc dec - - dec | |
1587 | // | |
1588 | // Saved inc (OTHERWIN (!=0)?dec - - | |
1589 | // =0)?dec | |
1590 | // | |
1591 | // Restored (OTHERWIN inc (!=0)?dec (!=NWIN)?inc - | |
1592 | // =0)?dec | |
1593 | // | |
1594 | // Allclean (sun4v) - - - NWIN-1 - | |
1595 | // | |
1596 | // Otherw (sun4v) - 0 CANRESTORE - - | |
1597 | // | |
1598 | // Normalw (sun4v) - OTHERWIN 0 - - | |
1599 | // | |
1600 | // Invalw (sun4v) NWIN-2 0 0 - - | |
1601 | // | |
1602 | // Return inc dec - - dec | |
1603 | // | |
1604 | // Flushw - - - - - | |
1605 | // | |
1606 | // fill_trap CWP <- (CWP + CANSAVE + 2) mod NWINDOWS | |
1607 | // | |
1608 | // spill_trap CWP <- (CWP - 1) mod NWINDOWS | |
1609 | // | |
1610 | // clean_window CWP <- (CWP + 1) mod NWINDOWS | |
1611 | // ----------------------------------------------------------------------------- | |
1612 | // - Implemented in W stage, before it is written back at the end of W stage | |
1613 | ||
1614 | assign cansave_dec1_w[2:0] = cansave_w[2:0] - 3'b001; | |
1615 | assign cansave_inc1_w[2:0] = cansave_w[2:0] + 3'b001; | |
1616 | assign canrestore_dec1_w[2:0] = canrestore_w[2:0] - 3'b001; | |
1617 | assign canrestore_inc1_w[2:0] = canrestore_w[2:0] + 3'b001; | |
1618 | ||
1619 | assign otherwin_dec1_w[2:0] = otherwin_w[2:0] - 3'b001; | |
1620 | assign cleanwin_inc1_w[2:0] = cleanwin_w[2:0] + 3'b001; | |
1621 | ||
1622 | assign otherwin_is0_w = ~(otherwin_w[2] | otherwin_w[1] | otherwin_w[0]); | |
1623 | assign cleanwin_is111_w = cleanwin_w[2] & cleanwin_w[1] & cleanwin_w[0] ; | |
1624 | ||
1625 | ||
1626 | ||
1627 | // generate next cycle CANSAVE values | |
1628 | // ------------------------------------ | |
1629 | // - use the table above to decide whether to inc/dec the counter | |
1630 | // - needs to mux in ASR data path to write to the PR | |
1631 | ||
1632 | assign cansave_inc_w = inst_vld_w & (restore_w | saved_w | return_w) ; | |
1633 | assign cansave_dec_w = inst_vld_w & | |
1634 | (save_w | (restored_w & otherwin_is0_w)); | |
1635 | assign cansave_reset_w = inst_vld_w & invalw_w; | |
1636 | assign cansave_update_w = cansave_inc_w | cansave_dec_w | cansave_reset_w; | |
1637 | ||
1638 | assign cansave_next_w[2:0] = ({3{ cansave_inc_w }} & cansave_inc1_w[2:0]) | | |
1639 | ({3{ cansave_dec_w }} & cansave_dec1_w[2:0]) | | |
1640 | ({3{ cansave_reset_w }} & 3'b110 ) | | |
1641 | ({3{~cansave_update_w}} & cansave_w [2:0]) ; | |
1642 | ||
1643 | assign cansave_we_w[0] = (tid_w[1:0] == 2'b00) & (cansave_update_w); | |
1644 | assign cansave_we_w[1] = (tid_w[1:0] == 2'b01) & (cansave_update_w); | |
1645 | assign cansave_we_w[2] = (tid_w[1:0] == 2'b10) & (cansave_update_w); | |
1646 | assign cansave_we_w[3] = (tid_w[1:0] == 2'b11) & (cansave_update_w); | |
1647 | ||
1648 | assign cansave_pr_we[0] = (pr_tid_ctl[1:0] == 2'b00) & (pr_wt_cansave_ctl); | |
1649 | assign cansave_pr_we[1] = (pr_tid_ctl[1:0] == 2'b01) & (pr_wt_cansave_ctl); | |
1650 | assign cansave_pr_we[2] = (pr_tid_ctl[1:0] == 2'b10) & (pr_wt_cansave_ctl); | |
1651 | assign cansave_pr_we[3] = (pr_tid_ctl[1:0] == 2'b11) & (pr_wt_cansave_ctl); | |
1652 | ||
1653 | ||
1654 | // generate next cycle CANRESTORE values | |
1655 | // --------------------------------------- | |
1656 | // - use the table above to decide whether to inc/dec the counter | |
1657 | // - needs to mux in ASI data path to write to the PR | |
1658 | ||
1659 | assign canrestore_inc_w = inst_vld_w & (save_w | restored_w); | |
1660 | assign canrestore_dec_w = inst_vld_w & | |
1661 | (restore_w | (saved_w & otherwin_is0_w) | return_w); | |
1662 | assign canrestore_0_w = inst_vld_w & (otherw_w | invalw_w); | |
1663 | assign canrestore_otherwin_w = inst_vld_w & normalw_w; | |
1664 | assign canrestore_update_w = canrestore_inc_w | canrestore_dec_w | | |
1665 | canrestore_0_w | canrestore_otherwin_w; | |
1666 | ||
1667 | assign canrestore_next_w[2:0] = ({3{ canrestore_inc_w }} & canrestore_inc1_w[2:0]) | | |
1668 | ({3{ canrestore_dec_w }} & canrestore_dec1_w[2:0]) | | |
1669 | ({3{ canrestore_0_w }} & 3'b000 ) | | |
1670 | ({3{ canrestore_otherwin_w}} & canrestore_normalwin_data_w[2:0]) | | |
1671 | ({3{~canrestore_update_w }} & canrestore_w [2:0]) ; | |
1672 | ||
1673 | assign canrestore_normalwin_data_w[2:0] = {3{(~tid_w[1]) & (~tid_w[0])}} & (otherwin_thr0[2:0]) | | |
1674 | {3{(~tid_w[1]) & ( tid_w[0])}} & (otherwin_thr1[2:0]) | | |
1675 | {3{( tid_w[1]) & (~tid_w[0])}} & (otherwin_thr2[2:0]) | | |
1676 | {3{( tid_w[1]) & ( tid_w[0])}} & (otherwin_thr3[2:0]) ; | |
1677 | ||
1678 | assign canrestore_we_w[0] = (tid_w[1:0] == 2'b00) & (canrestore_update_w); | |
1679 | assign canrestore_we_w[1] = (tid_w[1:0] == 2'b01) & (canrestore_update_w); | |
1680 | assign canrestore_we_w[2] = (tid_w[1:0] == 2'b10) & (canrestore_update_w); | |
1681 | assign canrestore_we_w[3] = (tid_w[1:0] == 2'b11) & (canrestore_update_w); | |
1682 | ||
1683 | assign canrestore_pr_we[0] = (pr_tid_ctl[1:0] == 2'b00) & (pr_wt_canrestore_ctl); | |
1684 | assign canrestore_pr_we[1] = (pr_tid_ctl[1:0] == 2'b01) & (pr_wt_canrestore_ctl); | |
1685 | assign canrestore_pr_we[2] = (pr_tid_ctl[1:0] == 2'b10) & (pr_wt_canrestore_ctl); | |
1686 | assign canrestore_pr_we[3] = (pr_tid_ctl[1:0] == 2'b11) & (pr_wt_canrestore_ctl); | |
1687 | ||
1688 | ||
1689 | // generate next cycle OTHERWIN values | |
1690 | // --------------------------------------- | |
1691 | assign otherwin_dec_w = inst_vld_w & (~otherwin_is0_w) & | |
1692 | (saved_w | restored_w); | |
1693 | assign otherwin_0_w = inst_vld_w & (normalw_w | invalw_w); | |
1694 | assign otherwin_canrestore_w = inst_vld_w & otherw_w; | |
1695 | assign otherwin_update_w = otherwin_dec_w | otherwin_0_w | otherwin_canrestore_w; | |
1696 | ||
1697 | assign otherwin_next_w[2:0] = ({3{ otherwin_dec_w }} & otherwin_dec1_w[2:0] ) | | |
1698 | ({3{ otherwin_0_w }} & 3'b000 ) | | |
1699 | ({3{ otherwin_canrestore_w}} & otherwin_otherw_data_w[2:0]) | | |
1700 | ({3{~otherwin_update_w }} & otherwin_w[2:0] ) ; | |
1701 | ||
1702 | assign otherwin_we_w[0] = (~tid_w[1]) & (~tid_w[0]) & (otherwin_update_w); | |
1703 | assign otherwin_we_w[1] = (~tid_w[1]) & ( tid_w[0]) & (otherwin_update_w); | |
1704 | assign otherwin_we_w[2] = ( tid_w[1]) & (~tid_w[0]) & (otherwin_update_w); | |
1705 | assign otherwin_we_w[3] = ( tid_w[1]) & ( tid_w[0]) & (otherwin_update_w); | |
1706 | ||
1707 | assign otherwin_otherw_data_w[2:0] = {3{tid_w[1:0] == 2'b00}} & (canrestore_thr0[2:0]) | | |
1708 | {3{tid_w[1:0] == 2'b01}} & (canrestore_thr1[2:0]) | | |
1709 | {3{tid_w[1:0] == 2'b10}} & (canrestore_thr2[2:0]) | | |
1710 | {3{tid_w[1:0] == 2'b11}} & (canrestore_thr3[2:0]) ; | |
1711 | ||
1712 | assign otherwin_pr_we[0] = (pr_tid_ctl[1:0] == 2'b00) & (pr_wt_otherwin_ctl); | |
1713 | assign otherwin_pr_we[1] = (pr_tid_ctl[1:0] == 2'b01) & (pr_wt_otherwin_ctl); | |
1714 | assign otherwin_pr_we[2] = (pr_tid_ctl[1:0] == 2'b10) & (pr_wt_otherwin_ctl); | |
1715 | assign otherwin_pr_we[3] = (pr_tid_ctl[1:0] == 2'b11) & (pr_wt_otherwin_ctl); | |
1716 | ||
1717 | ||
1718 | // generate next cycle CLEANWIN values | |
1719 | // --------------------------------------- | |
1720 | assign cleanwin_inc_w = inst_vld_w & (~cleanwin_is111_w) & restored_w; | |
1721 | assign cleanwin_reset_w = inst_vld_w & allclean_w; | |
1722 | assign cleanwin_update_w = cleanwin_inc_w | cleanwin_reset_w; | |
1723 | ||
1724 | assign cleanwin_next_w[2:0] = ({3{ cleanwin_inc_w }} & cleanwin_inc1_w[2:0]) | | |
1725 | ({3{ cleanwin_reset_w }} & 3'b111 ) | | |
1726 | ({3{~cleanwin_update_w}} & cleanwin_w [2:0]) ; | |
1727 | ||
1728 | assign cleanwin_we_w[0] = (tid_w[1:0] == 2'b00) & (cleanwin_update_w); | |
1729 | assign cleanwin_we_w[1] = (tid_w[1:0] == 2'b01) & (cleanwin_update_w); | |
1730 | assign cleanwin_we_w[2] = (tid_w[1:0] == 2'b10) & (cleanwin_update_w); | |
1731 | assign cleanwin_we_w[3] = (tid_w[1:0] == 2'b11) & (cleanwin_update_w); | |
1732 | ||
1733 | assign cleanwin_pr_we[0] = (pr_tid_ctl[1:0] == 2'b00) & (pr_wt_cleanwin_ctl); | |
1734 | assign cleanwin_pr_we[1] = (pr_tid_ctl[1:0] == 2'b01) & (pr_wt_cleanwin_ctl); | |
1735 | assign cleanwin_pr_we[2] = (pr_tid_ctl[1:0] == 2'b10) & (pr_wt_cleanwin_ctl); | |
1736 | assign cleanwin_pr_we[3] = (pr_tid_ctl[1:0] == 2'b11) & (pr_wt_cleanwin_ctl); | |
1737 | ||
1738 | ||
1739 | ||
1740 | // generate next cycle WSTATE values | |
1741 | // --------------------------------------- | |
1742 | assign wstate_pr_we[0] = (pr_tid_ctl[1:0] == 2'b00) & (pr_wt_wstate_ctl); | |
1743 | assign wstate_pr_we[1] = (pr_tid_ctl[1:0] == 2'b01) & (pr_wt_wstate_ctl); | |
1744 | assign wstate_pr_we[2] = (pr_tid_ctl[1:0] == 2'b10) & (pr_wt_wstate_ctl); | |
1745 | assign wstate_pr_we[3] = (pr_tid_ctl[1:0] == 2'b11) & (pr_wt_wstate_ctl); | |
1746 | ||
1747 | ||
1748 | ||
1749 | ||
1750 | ||
1751 | // ============================================================================= | |
1752 | // Specutively produce oddwin indicator for Pick-stage to translate | |
1753 | // virtual architectural integer register address to physical address | |
1754 | // (involves swapping ins/outs registers for odd window pointers) | |
1755 | // --------------------------------------------------------------------- | |
1756 | // only requires LSB of CWPs | |
1757 | // - keeps a copy of CWP LSB in B stage | |
1758 | // - update oddwin indicator whenever CWP is updated | |
1759 | // - revert oddwin indicator to architected state during a flush | |
1760 | // - otherwise, hold previous value | |
1761 | ||
1762 | assign cwp_new_update[0] = cwp_update_m & (~cwp_tid_m[1]) & (~cwp_tid_m[0]); | |
1763 | assign cwp_new_update[1] = cwp_update_m & (~cwp_tid_m[1]) & ( cwp_tid_m[0]); | |
1764 | assign cwp_new_update[2] = cwp_update_m & ( cwp_tid_m[1]) & (~cwp_tid_m[0]); | |
1765 | assign cwp_new_update[3] = cwp_update_m & ( cwp_tid_m[1]) & ( cwp_tid_m[0]); | |
1766 | ||
1767 | assign cwp_flushed [0] = (flush_exu_w | dec_flush_w) & (~tid_w[1]) & (~tid_w[0]); | |
1768 | assign cwp_flushed [1] = (flush_exu_w | dec_flush_w) & (~tid_w[1]) & ( tid_w[0]); | |
1769 | assign cwp_flushed [2] = (flush_exu_w | dec_flush_w) & ( tid_w[1]) & (~tid_w[0]); | |
1770 | assign cwp_flushed [3] = (flush_exu_w | dec_flush_w) & ( tid_w[1]) & ( tid_w[0]); | |
1771 | ||
1772 | assign cwp_oddwin_next[0] = ( cwp_new_update[0] & ~cwp_flushed[0] & cwp_new_m [0]) | | |
1773 | (~cwp_new_update[0] & ~cwp_flushed[0] & cwp_oddwin_b[0]) | | |
1774 | ( cwp_flushed [0] & cwp_thr0 [0]); | |
1775 | ||
1776 | assign cwp_oddwin_next[1] = ( cwp_new_update[1] & ~cwp_flushed[1] & cwp_new_m [0]) | | |
1777 | (~cwp_new_update[1] & ~cwp_flushed[1] & cwp_oddwin_b[1]) | | |
1778 | ( cwp_flushed [1] & cwp_thr1 [0]); | |
1779 | ||
1780 | assign cwp_oddwin_next[2] = ( cwp_new_update[2] & ~cwp_flushed[2] & cwp_new_m [0]) | | |
1781 | (~cwp_new_update[2] & ~cwp_flushed[2] & cwp_oddwin_b[2]) | | |
1782 | ( cwp_flushed [2] & cwp_thr2 [0]); | |
1783 | ||
1784 | assign cwp_oddwin_next[3] = ( cwp_new_update[3] & ~cwp_flushed[3] & cwp_new_m [0]) | | |
1785 | (~cwp_new_update[3] & ~cwp_flushed[3] & cwp_oddwin_b[3]) | | |
1786 | ( cwp_flushed [3] & cwp_thr3 [0]); | |
1787 | ||
1788 | ||
1789 | ||
1790 | exu_rml_ctl_msff_ctl_macro__width_4 cwp_speculative ( | |
1791 | .scan_in(cwp_speculative_scanin), | |
1792 | .scan_out(cwp_speculative_scanout), | |
1793 | .l1clk(l1clk_pm1), | |
1794 | .din ({cwp_oddwin_next[3:0]}), | |
1795 | .dout ({cwp_oddwin_b[3:0]}), | |
1796 | .siclk(siclk), | |
1797 | .soclk(soclk)); | |
1798 | ||
1799 | assign exu_oddwin_b[3:0] = cwp_oddwin_b[3:0]; | |
1800 | ||
1801 | ||
1802 | ||
1803 | // ============================================================================= | |
1804 | // Privileged Registers | |
1805 | // ----------------------------------------------------------------------------- | |
1806 | // - maintains legal state of interger-register-window | |
1807 | // related privileged registers (See pages 57-59) | |
1808 | // - allow RDPR/WRPR to read and write to these registers | |
1809 | // - PRs read in D stage, and written in W stage | |
1810 | // - 4 sets of PR, one set for each thread in EXU | |
1811 | // - EXU only handles one thread's PR accesses per stage | |
1812 | // - needs to arbitrate between the threads | |
1813 | // | |
1814 | // PR name init. value | |
1815 | // ------------------------------------------ | |
1816 | // CANSAVE 110 | |
1817 | // CANRESTORE 000 | |
1818 | // OTHERWIN 000 | |
1819 | // CLEANWIN 111 | |
1820 | // WSTATE 000000 | |
1821 | // CWP 000 | |
1822 | // | |
1823 | ||
1824 | ||
1825 | ||
1826 | // - CANSAVE Privileged Register | |
1827 | // ---------------------------- | |
1828 | ||
1829 | // Only one thread can be writen each cycle | |
1830 | // Uses write enable to control which register to update | |
1831 | ||
1832 | assign cansave_thr0_next[2:0] = ({3{ cansave_we_w[0] }} & cansave_next_w[2:0]) | | |
1833 | ({3{ cansave_pr_we[0]}} & data_1f[2:0] ) | | |
1834 | ({3{~cansave_pr_we[0]}} & {3{~cansave_we_w[0]}} & cansave_thr0[2:0] ); | |
1835 | ||
1836 | assign cansave_thr1_next[2:0] = ({3{ cansave_we_w[1] }} & cansave_next_w[2:0]) | | |
1837 | ({3{ cansave_pr_we[1]}} & data_1f[2:0] ) | | |
1838 | ({3{~cansave_pr_we[1]}} & {3{~cansave_we_w[1]}} & cansave_thr1[2:0] ); | |
1839 | ||
1840 | assign cansave_thr2_next[2:0] = ({3{ cansave_we_w[2] }} & cansave_next_w[2:0]) | | |
1841 | ({3{ cansave_pr_we[2]}} & data_1f[2:0] ) | | |
1842 | ({3{~cansave_pr_we[2]}} & {3{~cansave_we_w[2]}} & cansave_thr2[2:0] ); | |
1843 | ||
1844 | assign cansave_thr3_next[2:0] = ({3{ cansave_we_w[3] }} & cansave_next_w[2:0]) | | |
1845 | ({3{ cansave_pr_we[3]}} & data_1f[2:0] ) | | |
1846 | ({3{~cansave_pr_we[3]}} & {3{~cansave_we_w[3]}} & cansave_thr3[2:0] ); | |
1847 | ||
1848 | // Stores negated CANSAVE values | |
1849 | // - Use POR to reset the architectural PR values to 3'b110 | |
1850 | assign cansave_thr0_next_l[2:1] = ~cansave_thr0_next[2:1]; | |
1851 | assign cansave_thr1_next_l[2:1] = ~cansave_thr1_next[2:1]; | |
1852 | assign cansave_thr2_next_l[2:1] = ~cansave_thr2_next[2:1]; | |
1853 | assign cansave_thr3_next_l[2:1] = ~cansave_thr3_next[2:1]; | |
1854 | ||
1855 | exu_rml_ctl_msff_ctl_macro__width_12 cansave_pr ( | |
1856 | .scan_in(cansave_pr_wmr_scanin), | |
1857 | .scan_out(cansave_pr_wmr_scanout), | |
1858 | .siclk(spc_aclk_wmr), | |
1859 | .l1clk(l1clk_pm1), | |
1860 | .din ({cansave_thr0_next_l[2:1], cansave_thr0_next[0], | |
1861 | cansave_thr1_next_l[2:1], cansave_thr1_next[0], | |
1862 | cansave_thr2_next_l[2:1], cansave_thr2_next[0], | |
1863 | cansave_thr3_next_l[2:1], cansave_thr3_next[0]}), | |
1864 | .dout ({cansave_thr0_l[2:1], cansave_thr0[0], | |
1865 | cansave_thr1_l[2:1], cansave_thr1[0], | |
1866 | cansave_thr2_l[2:1], cansave_thr2[0], | |
1867 | cansave_thr3_l[2:1], cansave_thr3[0]}), | |
1868 | .soclk(soclk)); | |
1869 | ||
1870 | assign cansave_thr0[2:1] = ~cansave_thr0_l[2:1]; | |
1871 | assign cansave_thr1[2:1] = ~cansave_thr1_l[2:1]; | |
1872 | assign cansave_thr2[2:1] = ~cansave_thr2_l[2:1]; | |
1873 | assign cansave_thr3[2:1] = ~cansave_thr3_l[2:1]; | |
1874 | ||
1875 | // Output the cansave value of the current thread | |
1876 | assign cansave_e[2:0] = ({3{tid_e[1:0] == 2'b00}} & cansave_thr0[2:0]) | | |
1877 | ({3{tid_e[1:0] == 2'b01}} & cansave_thr1[2:0]) | | |
1878 | ({3{tid_e[1:0] == 2'b10}} & cansave_thr2[2:0]) | | |
1879 | ({3{tid_e[1:0] == 2'b11}} & cansave_thr3[2:0]) ; | |
1880 | ||
1881 | assign cansave_pr_rd[2:0] = ({3{pr_tid_ctl[1:0] == 2'b00}} & cansave_thr0[2:0]) | | |
1882 | ({3{pr_tid_ctl[1:0] == 2'b01}} & cansave_thr1[2:0]) | | |
1883 | ({3{pr_tid_ctl[1:0] == 2'b10}} & cansave_thr2[2:0]) | | |
1884 | ({3{pr_tid_ctl[1:0] == 2'b11}} & cansave_thr3[2:0]) ; | |
1885 | ||
1886 | exu_rml_ctl_msff_ctl_macro__width_9 cansave_e2m2b2w ( | |
1887 | .scan_in(cansave_e2m2b2w_scanin), | |
1888 | .scan_out(cansave_e2m2b2w_scanout), | |
1889 | .l1clk(l1clk_pm1), | |
1890 | .din ({cansave_e[2:0], cansave_m[2:0], cansave_b[2:0]}), | |
1891 | .dout ({cansave_m[2:0], cansave_b[2:0], cansave_w[2:0]}), | |
1892 | .siclk(siclk), | |
1893 | .soclk(soclk)); | |
1894 | ||
1895 | ||
1896 | ||
1897 | // - CANRESTORE Privileged Register | |
1898 | // ------------------------------- | |
1899 | ||
1900 | // Only one thread can be writen each cycle | |
1901 | // Uses write enable to control which register to update | |
1902 | ||
1903 | assign canrestore_thr0_next[2:0] = ({3{ canrestore_we_w[0] }} & canrestore_next_w[2:0]) | | |
1904 | ({3{ canrestore_pr_we[0]}} & data_1f[2:0] ) | | |
1905 | ({3{~canrestore_pr_we[0]}} & {3{~canrestore_we_w[0]}} & canrestore_thr0[2:0] ); | |
1906 | ||
1907 | assign canrestore_thr1_next[2:0] = ({3{ canrestore_we_w[1] }} & canrestore_next_w[2:0]) | | |
1908 | ({3{ canrestore_pr_we[1]}} & data_1f[2:0] ) | | |
1909 | ({3{~canrestore_pr_we[1]}} & {3{~canrestore_we_w[1]}} & canrestore_thr1[2:0] ); | |
1910 | ||
1911 | assign canrestore_thr2_next[2:0] = ({3{ canrestore_we_w[2] }} & canrestore_next_w[2:0]) | | |
1912 | ({3{ canrestore_pr_we[2]}} & data_1f[2:0] ) | | |
1913 | ({3{~canrestore_pr_we[2]}} & {3{~canrestore_we_w[2]}} & canrestore_thr2[2:0] ); | |
1914 | ||
1915 | assign canrestore_thr3_next[2:0] = ({3{ canrestore_we_w[3] }} & canrestore_next_w[2:0]) | | |
1916 | ({3{ canrestore_pr_we[3]}} & data_1f[2:0] ) | | |
1917 | ({3{~canrestore_pr_we[3]}} & {3{~canrestore_we_w[3]}} & canrestore_thr3[2:0] ); | |
1918 | ||
1919 | exu_rml_ctl_msff_ctl_macro__width_12 canrestore_pr ( | |
1920 | .scan_in(canrestore_pr_wmr_scanin), | |
1921 | .scan_out(canrestore_pr_wmr_scanout), | |
1922 | .siclk(spc_aclk_wmr), | |
1923 | .l1clk(l1clk_pm1), | |
1924 | .din ({canrestore_thr0_next[2:0], | |
1925 | canrestore_thr1_next[2:0], | |
1926 | canrestore_thr2_next[2:0], | |
1927 | canrestore_thr3_next[2:0]}), | |
1928 | .dout ({canrestore_thr0[2:0], | |
1929 | canrestore_thr1[2:0], | |
1930 | canrestore_thr2[2:0], | |
1931 | canrestore_thr3[2:0]}), | |
1932 | .soclk(soclk)); | |
1933 | ||
1934 | // Output the canrestore value of the current thread | |
1935 | assign canrestore_e[2:0] = ({3{tid_e[1:0] == 2'b00}} & canrestore_thr0[2:0]) | | |
1936 | ({3{tid_e[1:0] == 2'b01}} & canrestore_thr1[2:0]) | | |
1937 | ({3{tid_e[1:0] == 2'b10}} & canrestore_thr2[2:0]) | | |
1938 | ({3{tid_e[1:0] == 2'b11}} & canrestore_thr3[2:0]) ; | |
1939 | ||
1940 | assign canrestore_pr_rd[2:0] = ({3{pr_tid_ctl[1:0] == 2'b00}} & canrestore_thr0[2:0]) | | |
1941 | ({3{pr_tid_ctl[1:0] == 2'b01}} & canrestore_thr1[2:0]) | | |
1942 | ({3{pr_tid_ctl[1:0] == 2'b10}} & canrestore_thr2[2:0]) | | |
1943 | ({3{pr_tid_ctl[1:0] == 2'b11}} & canrestore_thr3[2:0]) ; | |
1944 | ||
1945 | exu_rml_ctl_msff_ctl_macro__width_9 canrestore_e2m2b2w ( | |
1946 | .scan_in(canrestore_e2m2b2w_scanin), | |
1947 | .scan_out(canrestore_e2m2b2w_scanout), | |
1948 | .l1clk(l1clk_pm1), | |
1949 | .din ({canrestore_e[2:0], canrestore_m[2:0], canrestore_b[2:0]}), | |
1950 | .dout ({canrestore_m[2:0], canrestore_b[2:0], canrestore_w[2:0]}), | |
1951 | .siclk(siclk), | |
1952 | .soclk(soclk)); | |
1953 | ||
1954 | ||
1955 | ||
1956 | // - OTHERWIN Privileged Register | |
1957 | // ----------------------------- | |
1958 | ||
1959 | // Only one thread can be writen each cycle | |
1960 | // Uses write enable to control which register to update | |
1961 | ||
1962 | assign otherwin_thr0_next[2:0] = ({3{ otherwin_we_w[0] }} & otherwin_next_w[2:0]) | | |
1963 | ({3{ otherwin_pr_we[0]}} & data_1f [2:0]) | | |
1964 | ({3{~otherwin_pr_we[0]}} & {3{~otherwin_we_w[0]}} & otherwin_thr0 [2:0]); | |
1965 | ||
1966 | assign otherwin_thr1_next[2:0] = ({3{ otherwin_we_w[1] }} & otherwin_next_w[2:0]) | | |
1967 | ({3{ otherwin_pr_we[1]}} & data_1f [2:0]) | | |
1968 | ({3{~otherwin_pr_we[1]}} & {3{~otherwin_we_w[1]}} & otherwin_thr1 [2:0]); | |
1969 | ||
1970 | assign otherwin_thr2_next[2:0] = ({3{ otherwin_we_w[2] }} & otherwin_next_w[2:0]) | | |
1971 | ({3{ otherwin_pr_we[2]}} & data_1f [2:0]) | | |
1972 | ({3{~otherwin_pr_we[2]}} & {3{~otherwin_we_w[2]}} & otherwin_thr2 [2:0]); | |
1973 | ||
1974 | assign otherwin_thr3_next[2:0] = ({3{ otherwin_we_w[3] }} & otherwin_next_w[2:0]) | | |
1975 | ({3{ otherwin_pr_we[3]}} & data_1f [2:0]) | | |
1976 | ({3{~otherwin_pr_we[3]}} & {3{~otherwin_we_w[3]}} & otherwin_thr3 [2:0]); | |
1977 | ||
1978 | exu_rml_ctl_msff_ctl_macro__width_12 otherwin_pr ( | |
1979 | .scan_in(otherwin_pr_wmr_scanin), | |
1980 | .scan_out(otherwin_pr_wmr_scanout), | |
1981 | .siclk(spc_aclk_wmr), | |
1982 | .l1clk(l1clk_pm1), | |
1983 | .din ({otherwin_thr0_next[2:0], | |
1984 | otherwin_thr1_next[2:0], | |
1985 | otherwin_thr2_next[2:0], | |
1986 | otherwin_thr3_next[2:0]}), | |
1987 | .dout ({otherwin_thr0[2:0], | |
1988 | otherwin_thr1[2:0], | |
1989 | otherwin_thr2[2:0], | |
1990 | otherwin_thr3[2:0]}), | |
1991 | .soclk(soclk)); | |
1992 | ||
1993 | // Output the otherwin value of the current thread | |
1994 | assign otherwin_e[2:0] = ({3{tid_e[1:0] == 2'b00}} & otherwin_thr0[2:0]) | | |
1995 | ({3{tid_e[1:0] == 2'b01}} & otherwin_thr1[2:0]) | | |
1996 | ({3{tid_e[1:0] == 2'b10}} & otherwin_thr2[2:0]) | | |
1997 | ({3{tid_e[1:0] == 2'b11}} & otherwin_thr3[2:0]) ; | |
1998 | ||
1999 | assign otherwin_pr_rd[2:0] = ({3{pr_tid_ctl[1:0] == 2'b00}} & otherwin_thr0[2:0]) | | |
2000 | ({3{pr_tid_ctl[1:0] == 2'b01}} & otherwin_thr1[2:0]) | | |
2001 | ({3{pr_tid_ctl[1:0] == 2'b10}} & otherwin_thr2[2:0]) | | |
2002 | ({3{pr_tid_ctl[1:0] == 2'b11}} & otherwin_thr3[2:0]) ; | |
2003 | ||
2004 | exu_rml_ctl_msff_ctl_macro__width_9 otherwin_e2m2b2w ( | |
2005 | .scan_in(otherwin_e2m2b2w_scanin), | |
2006 | .scan_out(otherwin_e2m2b2w_scanout), | |
2007 | .l1clk(l1clk_pm1), | |
2008 | .din ({otherwin_e[2:0], otherwin_m[2:0], otherwin_b[2:0]}), | |
2009 | .dout ({otherwin_m[2:0], otherwin_b[2:0], otherwin_w[2:0]}), | |
2010 | .siclk(siclk), | |
2011 | .soclk(soclk)); | |
2012 | ||
2013 | ||
2014 | ||
2015 | // - CLEANWIN Privileged Register | |
2016 | // ---------------------------- | |
2017 | // Only one thread can be writen each cycle | |
2018 | // Uses write enable to control which register to update | |
2019 | ||
2020 | assign cleanwin_thr0_next[2:0] = ({3{ cleanwin_we_w[0] }} & cleanwin_next_w[2:0]) | | |
2021 | ({3{ cleanwin_pr_we[0]}} & data_1f [2:0]) | | |
2022 | ({3{~cleanwin_pr_we[0]}} & {3{~cleanwin_we_w[0]}} & cleanwin_thr0 [2:0]) ; | |
2023 | ||
2024 | assign cleanwin_thr1_next[2:0] = ({3{ cleanwin_we_w[1] }} & cleanwin_next_w[2:0]) | | |
2025 | ({3{ cleanwin_pr_we[1]}} & data_1f [2:0]) | | |
2026 | ({3{~cleanwin_pr_we[1]}} & {3{~cleanwin_we_w[1]}} & cleanwin_thr1 [2:0]) ; | |
2027 | ||
2028 | assign cleanwin_thr2_next[2:0] = ({3{ cleanwin_we_w[2] }} & cleanwin_next_w[2:0]) | | |
2029 | ({3{ cleanwin_pr_we[2]}} & data_1f [2:0]) | | |
2030 | ({3{~cleanwin_pr_we[2]}} & {3{~cleanwin_we_w[2]}} & cleanwin_thr2 [2:0]) ; | |
2031 | ||
2032 | assign cleanwin_thr3_next[2:0] = ({3{ cleanwin_we_w[3] }} & cleanwin_next_w[2:0]) | | |
2033 | ({3{ cleanwin_pr_we[3]}} & data_1f [2:0]) | | |
2034 | ({3{~cleanwin_pr_we[3]}} & {3{~cleanwin_we_w[3]}} & cleanwin_thr3 [2:0]) ; | |
2035 | ||
2036 | ||
2037 | // Stores negated CLEANWIN values | |
2038 | // - Use POR to reset the architectural PR values to 3'b111 | |
2039 | assign cleanwin_thr0_next_l[2:0] = ~cleanwin_thr0_next[2:0]; | |
2040 | assign cleanwin_thr1_next_l[2:0] = ~cleanwin_thr1_next[2:0]; | |
2041 | assign cleanwin_thr2_next_l[2:0] = ~cleanwin_thr2_next[2:0]; | |
2042 | assign cleanwin_thr3_next_l[2:0] = ~cleanwin_thr3_next[2:0]; | |
2043 | ||
2044 | exu_rml_ctl_msff_ctl_macro__width_12 cleanwin_pr ( | |
2045 | .scan_in(cleanwin_pr_wmr_scanin), | |
2046 | .scan_out(cleanwin_pr_wmr_scanout), | |
2047 | .siclk(spc_aclk_wmr), | |
2048 | .l1clk(l1clk_pm1), | |
2049 | .din ({cleanwin_thr0_next_l[2:0], | |
2050 | cleanwin_thr1_next_l[2:0], | |
2051 | cleanwin_thr2_next_l[2:0], | |
2052 | cleanwin_thr3_next_l[2:0]}), | |
2053 | .dout ({cleanwin_thr0_l[2:0], | |
2054 | cleanwin_thr1_l[2:0], | |
2055 | cleanwin_thr2_l[2:0], | |
2056 | cleanwin_thr3_l[2:0]}), | |
2057 | .soclk(soclk)); | |
2058 | ||
2059 | assign cleanwin_thr0[2:0] = ~cleanwin_thr0_l[2:0]; | |
2060 | assign cleanwin_thr1[2:0] = ~cleanwin_thr1_l[2:0]; | |
2061 | assign cleanwin_thr2[2:0] = ~cleanwin_thr2_l[2:0]; | |
2062 | assign cleanwin_thr3[2:0] = ~cleanwin_thr3_l[2:0]; | |
2063 | ||
2064 | // Output the cleanwin value of the current thread | |
2065 | assign cleanwin_e[2:0] = ({3{tid_e[1:0] == 2'b00}} & cleanwin_thr0[2:0]) | | |
2066 | ({3{tid_e[1:0] == 2'b01}} & cleanwin_thr1[2:0]) | | |
2067 | ({3{tid_e[1:0] == 2'b10}} & cleanwin_thr2[2:0]) | | |
2068 | ({3{tid_e[1:0] == 2'b11}} & cleanwin_thr3[2:0]) ; | |
2069 | ||
2070 | assign cleanwin_pr_rd[2:0] = ({3{pr_tid_ctl[1:0] == 2'b00}} & cleanwin_thr0[2:0]) | | |
2071 | ({3{pr_tid_ctl[1:0] == 2'b01}} & cleanwin_thr1[2:0]) | | |
2072 | ({3{pr_tid_ctl[1:0] == 2'b10}} & cleanwin_thr2[2:0]) | | |
2073 | ({3{pr_tid_ctl[1:0] == 2'b11}} & cleanwin_thr3[2:0]) ; | |
2074 | ||
2075 | ||
2076 | exu_rml_ctl_msff_ctl_macro__width_9 cleanwin_e2m2b2w ( | |
2077 | .scan_in(cleanwin_e2m2b2w_scanin), | |
2078 | .scan_out(cleanwin_e2m2b2w_scanout), | |
2079 | .l1clk(l1clk_pm1), | |
2080 | .din ({cleanwin_e[2:0], cleanwin_m[2:0], cleanwin_b[2:0]}), | |
2081 | .dout ({cleanwin_m[2:0], cleanwin_b[2:0], cleanwin_w[2:0]}), | |
2082 | .siclk(siclk), | |
2083 | .soclk(soclk)); | |
2084 | ||
2085 | ||
2086 | // - WSTATE Privileged Register | |
2087 | // ------------------------------- | |
2088 | ||
2089 | // Only one thread can be writen each cycle | |
2090 | // Uses write enable to control which register to update | |
2091 | ||
2092 | assign wstate_thr0_next[5:0] = ({6{ wstate_pr_we[0]}} & data_1f [5:0]) | | |
2093 | ({6{~wstate_pr_we[0]}} & wstate_thr0 [5:0]); | |
2094 | ||
2095 | assign wstate_thr1_next[5:0] = ({6{ wstate_pr_we[1]}} & data_1f [5:0]) | | |
2096 | ({6{~wstate_pr_we[1]}} & wstate_thr1 [5:0]); | |
2097 | ||
2098 | assign wstate_thr2_next[5:0] = ({6{ wstate_pr_we[2]}} & data_1f [5:0]) | | |
2099 | ({6{~wstate_pr_we[2]}} & wstate_thr2 [5:0]); | |
2100 | ||
2101 | assign wstate_thr3_next[5:0] = ({6{ wstate_pr_we[3]}} & data_1f [5:0]) | | |
2102 | ({6{~wstate_pr_we[3]}} & wstate_thr3 [5:0]); | |
2103 | ||
2104 | exu_rml_ctl_msff_ctl_macro__width_24 wstate_pr ( | |
2105 | .scan_in(wstate_pr_wmr_scanin), | |
2106 | .scan_out(wstate_pr_wmr_scanout), | |
2107 | .siclk(spc_aclk_wmr), | |
2108 | .l1clk(l1clk_pm1), | |
2109 | .din ({wstate_thr0_next[5:0], | |
2110 | wstate_thr1_next[5:0], | |
2111 | wstate_thr2_next[5:0], | |
2112 | wstate_thr3_next[5:0]}), | |
2113 | .dout ({wstate_thr0[5:0], | |
2114 | wstate_thr1[5:0], | |
2115 | wstate_thr2[5:0], | |
2116 | wstate_thr3[5:0]}), | |
2117 | .soclk(soclk)); | |
2118 | ||
2119 | // Output the wstate value of the current thread | |
2120 | assign wstate_b[5:0] = ({6{tid_b[1:0] == 2'b00}} & wstate_thr0[5:0]) | | |
2121 | ({6{tid_b[1:0] == 2'b01}} & wstate_thr1[5:0]) | | |
2122 | ({6{tid_b[1:0] == 2'b10}} & wstate_thr2[5:0]) | | |
2123 | ({6{tid_b[1:0] == 2'b11}} & wstate_thr3[5:0]) ; | |
2124 | ||
2125 | ||
2126 | assign wstate_pr_rd[5:0] = ({6{pr_tid_ctl[1:0] == 2'b00}} & wstate_thr0[5:0]) | | |
2127 | ({6{pr_tid_ctl[1:0] == 2'b01}} & wstate_thr1[5:0]) | | |
2128 | ({6{pr_tid_ctl[1:0] == 2'b10}} & wstate_thr2[5:0]) | | |
2129 | ({6{pr_tid_ctl[1:0] == 2'b11}} & wstate_thr3[5:0]) ; | |
2130 | ||
2131 | ||
2132 | // - CWP Privileged Register | |
2133 | // ------------------------------- | |
2134 | ||
2135 | // Only one thread can be writen each cycle | |
2136 | // Uses write enable to control which register to update | |
2137 | ||
2138 | exu_rml_ctl_msff_ctl_macro__width_12 cwp_pr ( | |
2139 | .scan_in(cwp_pr_wmr_scanin), | |
2140 | .scan_out(cwp_pr_wmr_scanout), | |
2141 | .siclk(spc_aclk_wmr), | |
2142 | .l1clk(l1clk_pm1), | |
2143 | .din ({cwp_thr0_next[2:0], | |
2144 | cwp_thr1_next[2:0], | |
2145 | cwp_thr2_next[2:0], | |
2146 | cwp_thr3_next[2:0]}), | |
2147 | .dout ({cwp_thr0[2:0], | |
2148 | cwp_thr1[2:0], | |
2149 | cwp_thr2[2:0], | |
2150 | cwp_thr3[2:0]}), | |
2151 | .soclk(soclk)); | |
2152 | ||
2153 | // Output the cwp value of the current thread | |
2154 | assign cwp_e[2:0] = ({3{tid_e[1:0] == 2'b00}} & cwp_thr0[2:0]) | | |
2155 | ({3{tid_e[1:0] == 2'b01}} & cwp_thr1[2:0]) | | |
2156 | ({3{tid_e[1:0] == 2'b10}} & cwp_thr2[2:0]) | | |
2157 | ({3{tid_e[1:0] == 2'b11}} & cwp_thr3[2:0]) ; | |
2158 | ||
2159 | assign cwp_pr_rd[2:0] = ({3{pr_tid_ctl[1:0] == 2'b00}} & cwp_thr0[2:0]) | | |
2160 | ({3{pr_tid_ctl[1:0] == 2'b01}} & cwp_thr1[2:0]) | | |
2161 | ({3{pr_tid_ctl[1:0] == 2'b10}} & cwp_thr2[2:0]) | | |
2162 | ({3{pr_tid_ctl[1:0] == 2'b11}} & cwp_thr3[2:0]) ; | |
2163 | ||
2164 | assign exu_cwp_thr0[2:0] = cwp_thr0[2:0]; | |
2165 | assign exu_cwp_thr1[2:0] = cwp_thr1[2:0]; | |
2166 | assign exu_cwp_thr2[2:0] = cwp_thr2[2:0]; | |
2167 | assign exu_cwp_thr3[2:0] = cwp_thr3[2:0]; | |
2168 | ||
2169 | exu_rml_ctl_msff_ctl_macro__width_3 cwp_e2m2b2w ( | |
2170 | .scan_in(cwp_e2m2b2w_scanin), | |
2171 | .scan_out(cwp_e2m2b2w_scanout), | |
2172 | .l1clk(l1clk_pm1), | |
2173 | .din (cwp_e[2:0]), | |
2174 | .dout (cwp_m[2:0]), | |
2175 | .siclk(siclk), | |
2176 | .soclk(soclk)); | |
2177 | ||
2178 | ||
2179 | ||
2180 | // ============================================================================= | |
2181 | // Priviledged Registers ASI access | |
2182 | // ============================================================================= | |
2183 | // - Control cycle and data cycles are interleaved | |
2184 | // - Control cycles are identified by a "1" in bit [64] | |
2185 | // - ASI reads and writes are single cycle operations | |
2186 | // - control is decoded in one cycle and data is directed in the next | |
2187 | // ============================================================================= | |
2188 | // assertion: ASI access should not happen when there is valid instruction | |
2189 | // in the pipeline. | |
2190 | // ============================================================================= | |
2191 | // | |
2192 | // | |
2193 | // Pipeline: | |
2194 | // -------------------------------------- | |
2195 | // > latch incoming ctl/data packet | |
2196 | // -------------------------------------- | |
2197 | // detect ctl relevence | | |
2198 | // generate control | | |
2199 | // (send ctl for IRF_ECC to pick) | | |
2200 | // ------------------------- Data | |
2201 | // > Latch ctl | | |
2202 | // ------------------------- | | |
2203 | // setup read/write ctl in datapath | | |
2204 | // <---------+ | |
2205 | // ------------------------- | |
2206 | // > read/write data | |
2207 | // ------------------------- | |
2208 | // assemble return data packet | |
2209 | // | |
2210 | // ------------------------- | |
2211 | // > ASI Data out | |
2212 | // ------------------------- | |
2213 | ||
2214 | ||
2215 | ||
2216 | // Packet parsing and recognition | |
2217 | // --------------------------------------------- | |
2218 | assign data_1f[63:48] = edp_rng_in_ff[63:48]; | |
2219 | assign data_1f[7:0] = edp_rng_in_ff[7:0]; | |
2220 | assign ctl_1f = edp_rng_in_ff[64]; | |
2221 | ||
2222 | // decode the packet, packet must be: | |
2223 | // - a valid, control packet for reading/writing | |
2224 | // - a PR operation | |
2225 | // - for the current thread group | |
2226 | // - to one of the targeted PRs | |
2227 | ||
2228 | assign pr_relevent = ctl_1f & data_1f[`BUS_VLD] & (~data_1f[`BUS_ACK]) & | |
2229 | (data_1f[`BUS_REGID_END:`BUS_REGID_ST] == `PR) & | |
2230 | (data_1f[`BUS_TID_END] == dec_thread_group); | |
2231 | ||
2232 | assign asr_relevent = ctl_1f & data_1f[`BUS_VLD] & (~data_1f[`BUS_ACK]) & | |
2233 | (data_1f[`BUS_REGID_END:`BUS_REGID_ST] == `ASR)& | |
2234 | (data_1f[`BUS_TID_END] == dec_thread_group); | |
2235 | ||
2236 | assign asi_relevent = ctl_1f & data_1f[`BUS_VLD] & (~data_1f[`BUS_ACK]) & | |
2237 | (data_1f[`BUS_REGID_END:`BUS_REGID_ST] == `ASI) & | |
2238 | (data_1f[`BUS_TID_END] == dec_thread_group) & | |
2239 | (data_1f[54] & (data_1f[51] | data_1f[49]) ); | |
2240 | ||
2241 | assign detected_empty_pkt = ctl_1f & ~data_1f[`BUS_VLD]; | |
2242 | ||
2243 | ||
2244 | // Computing controls in the current cycle | |
2245 | // --------------------------------------------- | |
2246 | // - then flop controls to the next cycle to control the next packet | |
2247 | // - the signals become *_ctl once they are flopped and appear in | |
2248 | // in the data cycle | |
2249 | assign pr_tid[1:0] = data_1f[(`BUS_TID_END-1):`BUS_TID_ST]; | |
2250 | ||
2251 | assign match_cwp = pr_relevent & (data_1f[52:48]==5'b01001); | |
2252 | assign match_cansave = pr_relevent & (data_1f[52:48]==5'b01010); | |
2253 | assign match_canrestore = pr_relevent & (data_1f[52:48]==5'b01011); | |
2254 | assign match_cleanwin = pr_relevent & (data_1f[52:48]==5'b01100); | |
2255 | assign match_otherwin = pr_relevent & (data_1f[52:48]==5'b01101); | |
2256 | assign match_wstate = pr_relevent & (data_1f[52:48]==5'b01110); | |
2257 | ||
2258 | assign match_yreg = asr_relevent & (data_1f[52:48]==5'b00000); | |
2259 | assign match_ccr = asr_relevent & (data_1f[52:48]==5'b00010); | |
2260 | ||
2261 | // ASI == 42; VA == 08 | |
2262 | // use assertion to check that when data_1f[3], VA == 0x08 | |
2263 | ||
2264 | assign match_imask = asi_relevent & (data_1f[55:48] == 8'h42) & data_1f[3]; | |
2265 | assign match_irf_ecc = asi_relevent & (data_1f[55:48] == 8'h48); | |
2266 | ||
2267 | assign pr_rd = ( data_1f[`BUS_RD]) & | |
2268 | (match_cwp | | |
2269 | match_cansave | | |
2270 | match_canrestore | | |
2271 | match_cleanwin | | |
2272 | match_otherwin | | |
2273 | match_wstate ); | |
2274 | ||
2275 | assign send_ack[0] = match_cwp | | |
2276 | match_cansave | | |
2277 | match_canrestore | | |
2278 | match_cleanwin | | |
2279 | match_otherwin | | |
2280 | match_wstate | | |
2281 | match_yreg | | |
2282 | match_ccr | | |
2283 | match_imask | | |
2284 | match_irf_ecc; | |
2285 | ||
2286 | assign pr_rd_src[0] = ( data_1f[`BUS_RD]) & match_cwp; | |
2287 | assign pr_rd_src[1] = ( data_1f[`BUS_RD]) & match_cansave; | |
2288 | assign pr_rd_src[2] = ( data_1f[`BUS_RD]) & match_canrestore; | |
2289 | assign pr_rd_src[3] = ( data_1f[`BUS_RD]) & match_cleanwin; | |
2290 | assign pr_rd_src[4] = ( data_1f[`BUS_RD]) & match_otherwin; | |
2291 | assign pr_rd_src[5] = ( data_1f[`BUS_RD]) & match_wstate; | |
2292 | ||
2293 | assign pr_wt_src[0] = (~data_1f[`BUS_RD]) & match_cwp; | |
2294 | assign pr_wt_src[1] = (~data_1f[`BUS_RD]) & match_cansave; | |
2295 | assign pr_wt_src[2] = (~data_1f[`BUS_RD]) & match_canrestore; | |
2296 | assign pr_wt_src[3] = (~data_1f[`BUS_RD]) & match_cleanwin; | |
2297 | assign pr_wt_src[4] = (~data_1f[`BUS_RD]) & match_otherwin; | |
2298 | assign pr_wt_src[5] = (~data_1f[`BUS_RD]) & match_wstate; | |
2299 | ||
2300 | ||
2301 | assign detected_wrpr_cwp = pr_wt_src[0]; | |
2302 | ||
2303 | // IRF ECC is a read-only indeterminate write | |
2304 | assign detected_rd_irf_ecc = ( data_1f[`BUS_RD]) & match_irf_ecc; | |
2305 | ||
2306 | ||
2307 | // Set rd_irf_ecc controls | |
2308 | assign rd_irf_ecc_valid = detected_rd_irf_ecc; | |
2309 | assign rd_irf_ecc_addr[4:0] = data_1f[7:3]; | |
2310 | ||
2311 | // Output control to Pick | |
2312 | // --------------------------------------------- | |
2313 | // MUX-IN BIST FOR IRF TEST PORT HERE | |
2314 | assign exu_test_valid = rd_irf_ecc_valid_lth | mbi_irf_read_en_p1; | |
2315 | assign exu_test_tid[1:0] = ({2{~mbi_run_lth}} & pr_tid_ctl[1:0] ) | ({2{mbi_run_lth}} & mbi_addr_lth[6:5]); | |
2316 | assign exu_test_addr[4:0] = ({5{~mbi_run_lth}} & pr_addr_ctl[4:0] ) | ({5{mbi_run_lth}} & mbi_addr_lth[4:0]); | |
2317 | ||
2318 | exu_rml_ctl_msff_ctl_macro__width_4 pipe_rd_irf_ecc_valid_pp2p2d2e ( | |
2319 | .scan_in(pipe_rd_irf_ecc_valid_pp2p2d2e_scanin), | |
2320 | .scan_out(pipe_rd_irf_ecc_valid_pp2p2d2e_scanout), | |
2321 | .l1clk (l1clk_pm1), | |
2322 | .din ({rd_irf_ecc_valid , exu_test_valid , test_valid_p , rml_test_valid_d}), | |
2323 | .dout ({rd_irf_ecc_valid_lth , test_valid_p , rml_test_valid_d , ack_irf_ecc_done}), | |
2324 | .siclk(siclk), | |
2325 | .soclk(soclk)); | |
2326 | ||
2327 | ||
2328 | ||
2329 | // Save thread ID for WRPR CWP | |
2330 | // --------------------------------------------- | |
2331 | // save control value in the first ASI stub cycle | |
2332 | ||
2333 | assign wrpr_cwp_tid_next[1:0] = ({2{ detected_wrpr_cwp}} & pr_tid [1:0]) | | |
2334 | ({2{~detected_wrpr_cwp}} & wrpr_cwp_tid_hold[1:0]) ; | |
2335 | ||
2336 | exu_rml_ctl_msff_ctl_macro__width_2 save_wrpr_cwp_tid ( | |
2337 | .scan_in(save_wrpr_cwp_tid_scanin), | |
2338 | .scan_out(save_wrpr_cwp_tid_scanout), | |
2339 | .l1clk (l1clk_pm1), | |
2340 | .din ({wrpr_cwp_tid_next[1:0]}), | |
2341 | .dout ({wrpr_cwp_tid_hold[1:0]}), | |
2342 | .siclk(siclk), | |
2343 | .soclk(soclk)); | |
2344 | ||
2345 | ||
2346 | // Save thread ID for RD_IRF_ECC | |
2347 | // --------------------------------------------- | |
2348 | // save control value in the first ASI stub cycle | |
2349 | ||
2350 | assign rd_irf_tid_next[1:0] = ({2{ detected_rd_irf_ecc}} & pr_tid [1:0]) | | |
2351 | ({2{~detected_rd_irf_ecc}} & rd_irf_tid_hold[1:0]) ; | |
2352 | ||
2353 | exu_rml_ctl_msff_ctl_macro__width_2 save_rd_irf_tid ( | |
2354 | .scan_in(save_rd_irf_tid_scanin), | |
2355 | .scan_out(save_rd_irf_tid_scanout), | |
2356 | .l1clk (l1clk_pm1), | |
2357 | .din ({rd_irf_tid_next[1:0]}), | |
2358 | .dout ({rd_irf_tid_hold[1:0]}), | |
2359 | .siclk(siclk), | |
2360 | .soclk(soclk)); | |
2361 | ||
2362 | ||
2363 | // Save new CWP when there is a write to CWP PR | |
2364 | // --------------------------------------------- | |
2365 | // save new CWP data in second ASI stub cycle | |
2366 | ||
2367 | assign pr_new_cwp_wt[2:0] = ({3{ pr_wt_cwp_ctl}} & data_1f[2:0]) | | |
2368 | ({3{~pr_wt_cwp_ctl}} & pr_new_cwp_wt_hold[2:0]); | |
2369 | ||
2370 | exu_rml_ctl_msff_ctl_macro__width_3 save_wrpr_cwp ( | |
2371 | .scan_in(save_wrpr_cwp_scanin), | |
2372 | .scan_out(save_wrpr_cwp_scanout), | |
2373 | .l1clk (l1clk_pm1), | |
2374 | .din ({pr_new_cwp_wt[2:0]}), | |
2375 | .dout ({pr_new_cwp_wt_hold[2:0] }), | |
2376 | .siclk(siclk), | |
2377 | .soclk(soclk)); | |
2378 | ||
2379 | ||
2380 | ||
2381 | // WRPR_done indicator to be sent out on the next empty packet | |
2382 | // --------------------------------------------- | |
2383 | assign send_ack_wrpr_cwp = (ack_wrpr_cwp_done & detected_empty_pkt) | | |
2384 | (done_wrpr_cwp_hold & detected_empty_pkt) ; | |
2385 | ||
2386 | assign done_wrpr_cwp = (~send_ack_wrpr_cwp) & | |
2387 | ( ack_wrpr_cwp_done | done_wrpr_cwp_hold); | |
2388 | ||
2389 | exu_rml_ctl_msff_ctl_macro__width_1 save_done_wrpr_cwp ( | |
2390 | .scan_in(save_done_wrpr_cwp_scanin), | |
2391 | .scan_out(save_done_wrpr_cwp_scanout), | |
2392 | .l1clk (l1clk_pm1), | |
2393 | .din ({done_wrpr_cwp}), | |
2394 | .dout ({done_wrpr_cwp_hold}), | |
2395 | .siclk(siclk), | |
2396 | .soclk(soclk)); | |
2397 | ||
2398 | assign send_ack[1] = send_ack_wrpr_cwp; | |
2399 | ||
2400 | ||
2401 | // IRF_ECC done indicator to be sent out on the next empty packet | |
2402 | // --------------------------------------------- | |
2403 | // - WRPR has higher priorty | |
2404 | // - need to hold back sending irf_ecc ack | |
2405 | ||
2406 | assign send_ack_irf_ecc = ~send_ack_wrpr_cwp & | |
2407 | ((ack_irf_ecc_done & detected_empty_pkt) | | |
2408 | (done_irf_ecc_hold & detected_empty_pkt)); | |
2409 | ||
2410 | assign done_irf_ecc = (~send_ack_irf_ecc) & | |
2411 | ( ack_irf_ecc_done | done_irf_ecc_hold); | |
2412 | ||
2413 | exu_rml_ctl_msff_ctl_macro__width_1 save_done_irf_ecc ( | |
2414 | .scan_in(save_done_irf_ecc_scanin), | |
2415 | .scan_out(save_done_irf_ecc_scanout), | |
2416 | .l1clk (l1clk_pm1), | |
2417 | .din ({done_irf_ecc}), | |
2418 | .dout ({done_irf_ecc_hold}), | |
2419 | .siclk(siclk), | |
2420 | .soclk(soclk)); | |
2421 | ||
2422 | assign irf_ecc_data[7:0] = ({8{ ack_irf_ecc_done}} & edp_rs3_ecc_e[7:0] ) | | |
2423 | ({8{~ack_irf_ecc_done}} & irf_ecc_data_hold[7:0]) ; | |
2424 | ||
2425 | exu_rml_ctl_msff_ctl_macro__width_8 save_irf_ecc_data ( | |
2426 | .scan_in(save_irf_ecc_data_scanin), | |
2427 | .scan_out(save_irf_ecc_data_scanout), | |
2428 | .l1clk (l1clk_pm1), | |
2429 | .din ({irf_ecc_data[7:0]}), | |
2430 | .dout ({irf_ecc_data_hold[7:0]}), | |
2431 | .siclk(siclk), | |
2432 | .soclk(soclk)); | |
2433 | ||
2434 | exu_rml_ctl_msff_ctl_macro__width_1 pipe_ack_irf_ecc ( | |
2435 | .scan_in(pipe_ack_irf_ecc_scanin), | |
2436 | .scan_out(pipe_ack_irf_ecc_scanout), | |
2437 | .l1clk (l1clk_pm1), | |
2438 | .din ({send_ack_irf_ecc}), | |
2439 | .dout ({send_ack_irf_ecc_piped}), | |
2440 | .siclk(siclk), | |
2441 | .soclk(soclk)); | |
2442 | ||
2443 | ||
2444 | assign rml_irf_ecc_data[7:0] = irf_ecc_data[7:0]; | |
2445 | ||
2446 | assign rml_rng_ack_sel_ctl = send_ack[0] | send_ack_irf_ecc | send_ack_wrpr_cwp; | |
2447 | ||
2448 | ||
2449 | ||
2450 | // EDP control signals for passing down DATA/CTL packets | |
2451 | // --------------------------------------------- | |
2452 | assign asr_rd_src[0] = ( data_1f[`BUS_RD]) & match_yreg; | |
2453 | assign asr_rd_src[1] = ( data_1f[`BUS_RD]) & match_ccr; | |
2454 | assign asr_rd_src[2] = ( data_1f[`BUS_RD]) & match_imask; | |
2455 | ||
2456 | assign asr_wt_src[0] = (~data_1f[`BUS_RD]) & match_yreg; | |
2457 | assign asr_wt_src[1] = (~data_1f[`BUS_RD]) & match_ccr; | |
2458 | assign asr_wt_src[2] = (~data_1f[`BUS_RD]) & match_imask; | |
2459 | ||
2460 | // Flop controls for the next data packet | |
2461 | exu_rml_ctl_msff_ctl_macro__width_26 asr_ctl ( | |
2462 | .scan_in(asr_ctl_scanin), | |
2463 | .scan_out(asr_ctl_scanout), | |
2464 | .l1clk (l1clk_pm1), | |
2465 | ||
2466 | .din ({pr_tid[1:0], | |
2467 | rd_irf_ecc_addr[4:0], | |
2468 | pr_rd, | |
2469 | pr_rd_src[5:0], | |
2470 | asr_rd_src[2:0], | |
2471 | pr_wt_src[5:0], | |
2472 | asr_wt_src[2:0]}), | |
2473 | ||
2474 | .dout ({pr_tid_ctl[1:0], | |
2475 | pr_addr_ctl[4:0], | |
2476 | pr_rd_ctl, | |
2477 | pr_rd_src_ctl[5:0], | |
2478 | asi_rd_imask_ctl, | |
2479 | asr_rd_ccr_ctl, | |
2480 | asr_rd_yreg_ctl, | |
2481 | pr_wt_wstate_ctl, | |
2482 | pr_wt_otherwin_ctl, | |
2483 | pr_wt_cleanwin_ctl, | |
2484 | pr_wt_canrestore_ctl, | |
2485 | pr_wt_cansave_ctl, | |
2486 | pr_wt_cwp_ctl, | |
2487 | asi_wt_imask_ctl, | |
2488 | asr_wt_ccr_ctl, | |
2489 | asr_wt_yreg_ctl }), | |
2490 | .siclk(siclk), | |
2491 | .soclk(soclk)); | |
2492 | ||
2493 | ||
2494 | ||
2495 | // ASR datapath | |
2496 | // ------------------------ | |
2497 | ||
2498 | ||
2499 | assign rml_rng_data_out[2:0] = ({3{pr_rd_src_ctl[0]}} & cwp_pr_rd[2:0] ) | | |
2500 | ({3{pr_rd_src_ctl[1]}} & cansave_pr_rd[2:0] ) | | |
2501 | ({3{pr_rd_src_ctl[2]}} & canrestore_pr_rd[2:0]) | | |
2502 | ({3{pr_rd_src_ctl[3]}} & cleanwin_pr_rd[2:0] ) | | |
2503 | ({3{pr_rd_src_ctl[4]}} & otherwin_pr_rd[2:0] ) | | |
2504 | ({3{pr_rd_src_ctl[5]}} & wstate_pr_rd[2:0] ); | |
2505 | ||
2506 | assign rml_rng_data_out[5:3] = ({3{pr_rd_src_ctl[5]}} & wstate_pr_rd[5:3]); | |
2507 | ||
2508 | assign rml_rng_wt_imask_ctl = asi_wt_imask_ctl; | |
2509 | assign rml_rng_wt_ccr_ctl = asr_wt_ccr_ctl; | |
2510 | assign rml_rng_rd_ctl[4:0] = {send_ack_irf_ecc_piped, asi_rd_imask_ctl,asr_rd_yreg_ctl, asr_rd_ccr_ctl, pr_rd_ctl}; | |
2511 | ||
2512 | assign rml_rng_ack_ctl[1:0] = send_ack[1:0]; | |
2513 | assign rml_rng_ack_cwp_tid[1:0] = wrpr_cwp_tid_hold[1:0]; | |
2514 | assign rml_rng_ack_ecc_tid[1:0] = rd_irf_tid_hold[1:0]; | |
2515 | ||
2516 | assign rml_rng_ack_det_vld = ~detected_wrpr_cwp & ~detected_rd_irf_ecc; | |
2517 | ||
2518 | ||
2519 | ||
2520 | ||
2521 | ||
2522 | ||
2523 | //!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*! Start : Y Register !*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*! | |
2524 | ||
2525 | ||
2526 | exu_rml_ctl_l1clkhdr_ctl_macro clkgen_pm2 ( | |
2527 | .l2clk( l2clk ), | |
2528 | .l1en ( asr_wt_yreg_ctl | ect_yreg_wr_w ), | |
2529 | .l1clk( l1clk_pm2 ), | |
2530 | .pce_ov(pce_ov), | |
2531 | .stop(stop), | |
2532 | .se(se)); | |
2533 | ||
2534 | assign yreg_rng_we[0] = asr_wt_yreg_ctl & (pr_tid_ctl[1:0] == 2'b00); | |
2535 | assign yreg_rng_we[1] = asr_wt_yreg_ctl & (pr_tid_ctl[1:0] == 2'b01); | |
2536 | assign yreg_rng_we[2] = asr_wt_yreg_ctl & (pr_tid_ctl[1:0] == 2'b10); | |
2537 | assign yreg_rng_we[3] = asr_wt_yreg_ctl & (pr_tid_ctl[1:0] == 2'b11); | |
2538 | ||
2539 | assign yreg_w_we[0] = ect_yreg_wr_w & (ect_tid_lth_w[1:0] == 2'b00); | |
2540 | assign yreg_w_we[1] = ect_yreg_wr_w & (ect_tid_lth_w[1:0] == 2'b01); | |
2541 | assign yreg_w_we[2] = ect_yreg_wr_w & (ect_tid_lth_w[1:0] == 2'b10); | |
2542 | assign yreg_w_we[3] = ect_yreg_wr_w & (ect_tid_lth_w[1:0] == 2'b11); | |
2543 | ||
2544 | ||
2545 | assign arch_yreg_tid0_in[31:0] = ({32{ yreg_rng_we[0] }} & edp_rng_in_ff[31:0] ) | | |
2546 | ({32{ yreg_w_we[0]}} & edp_rd_ff_w[63:32] ) | | |
2547 | ({32{~yreg_rng_we[0] & ~yreg_w_we[0]}} & arch_yreg_tid0_ff[31:0]); | |
2548 | ||
2549 | assign arch_yreg_tid1_in[31:0] = ({32{ yreg_rng_we[1] }} & edp_rng_in_ff[31:0] ) | | |
2550 | ({32{ yreg_w_we[1]}} & edp_rd_ff_w[63:32] ) | | |
2551 | ({32{~yreg_rng_we[1] & ~yreg_w_we[1]}} & arch_yreg_tid1_ff[31:0]); | |
2552 | ||
2553 | assign arch_yreg_tid2_in[31:0] = ({32{ yreg_rng_we[2] }} & edp_rng_in_ff[31:0] ) | | |
2554 | ({32{ yreg_w_we[2]}} & edp_rd_ff_w[63:32] ) | | |
2555 | ({32{~yreg_rng_we[2] & ~yreg_w_we[2]}} & arch_yreg_tid2_ff[31:0]); | |
2556 | ||
2557 | assign arch_yreg_tid3_in[31:0] = ({32{ yreg_rng_we[3] }} & edp_rng_in_ff[31:0] ) | | |
2558 | ({32{ yreg_w_we[3]}} & edp_rd_ff_w[63:32] ) | | |
2559 | ({32{~yreg_rng_we[3] & ~yreg_w_we[3]}} & arch_yreg_tid3_ff[31:0]); | |
2560 | ||
2561 | ||
2562 | exu_rml_ctl_msff_ctl_macro__width_32 i_yreg0_ff ( | |
2563 | .scan_in(i_yreg0_ff_wmr_scanin), | |
2564 | .scan_out(i_yreg0_ff_wmr_scanout), | |
2565 | .siclk(spc_aclk_wmr), | |
2566 | .l1clk( l1clk_pm2 ), | |
2567 | .din ( arch_yreg_tid0_in[31:0] ), | |
2568 | .dout ( arch_yreg_tid0_ff[31:0] ), | |
2569 | .soclk(soclk)); | |
2570 | ||
2571 | exu_rml_ctl_msff_ctl_macro__width_32 i_yreg1_ff ( | |
2572 | .scan_in(i_yreg1_ff_wmr_scanin), | |
2573 | .scan_out(i_yreg1_ff_wmr_scanout), | |
2574 | .siclk(spc_aclk_wmr), | |
2575 | .l1clk( l1clk_pm2 ), | |
2576 | .din ( arch_yreg_tid1_in[31:0] ), | |
2577 | .dout ( arch_yreg_tid1_ff[31:0] ), | |
2578 | .soclk(soclk)); | |
2579 | ||
2580 | exu_rml_ctl_msff_ctl_macro__width_32 i_yreg2_ff ( | |
2581 | .scan_in(i_yreg2_ff_wmr_scanin), | |
2582 | .scan_out(i_yreg2_ff_wmr_scanout), | |
2583 | .siclk(spc_aclk_wmr), | |
2584 | .l1clk( l1clk_pm2 ), | |
2585 | .din ( arch_yreg_tid2_in[31:0] ), | |
2586 | .dout ( arch_yreg_tid2_ff[31:0] ), | |
2587 | .soclk(soclk)); | |
2588 | ||
2589 | exu_rml_ctl_msff_ctl_macro__width_32 i_yreg3_ff ( | |
2590 | .scan_in(i_yreg3_ff_wmr_scanin), | |
2591 | .scan_out(i_yreg3_ff_wmr_scanout), | |
2592 | .siclk(spc_aclk_wmr), | |
2593 | .l1clk( l1clk_pm2 ), | |
2594 | .din ( arch_yreg_tid3_in[31:0] ), | |
2595 | .dout ( arch_yreg_tid3_ff[31:0] ), | |
2596 | .soclk(soclk)); | |
2597 | ||
2598 | ||
2599 | assign exu_y_data_e[31:0] = ({32{tid4_e[0]}} & arch_yreg_tid0_ff[31:0]) | | |
2600 | ({32{tid4_e[1]}} & arch_yreg_tid1_ff[31:0]) | | |
2601 | ({32{tid4_e[2]}} & arch_yreg_tid2_ff[31:0]) | | |
2602 | ({32{tid4_e[3]}} & arch_yreg_tid3_ff[31:0]); | |
2603 | ||
2604 | assign rml_rng_y_data[31:0] = ({32{pr_tid_ctl[1:0] == 2'b00}} & arch_yreg_tid0_ff[31:0]) | | |
2605 | ({32{pr_tid_ctl[1:0] == 2'b01}} & arch_yreg_tid1_ff[31:0]) | | |
2606 | ({32{pr_tid_ctl[1:0] == 2'b10}} & arch_yreg_tid2_ff[31:0]) | | |
2607 | ({32{pr_tid_ctl[1:0] == 2'b11}} & arch_yreg_tid3_ff[31:0]); | |
2608 | ||
2609 | ||
2610 | //!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*! End : Y Register !*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*! | |
2611 | ||
2612 | ||
2613 | exu_rml_ctl_spare_ctl_macro__num_6 spares ( | |
2614 | .scan_in(spares_scanin), | |
2615 | .scan_out(spares_scanout), | |
2616 | .l1clk (l1clk_pm1), | |
2617 | .siclk(siclk), | |
2618 | .soclk(soclk)); | |
2619 | ||
2620 | ||
2621 | ||
2622 | supply0 vss; | |
2623 | supply1 vdd; | |
2624 | ||
2625 | // fixscan start: | |
2626 | assign mbist_scanin = scan_in ; | |
2627 | assign cwp_trap_scanin = mbist_scanout ; | |
2628 | assign decoded_inst_d2e_scanin = cwp_trap_scanout ; | |
2629 | assign decoded_inst_e2m_scanin = decoded_inst_d2e_scanout ; | |
2630 | assign decoded_inst_m2b_scanin = decoded_inst_e2m_scanout ; | |
2631 | assign decoded_inst_b2w_scanin = decoded_inst_m2b_scanout ; | |
2632 | assign tid_p2d2e2m2b2w_scanin = decoded_inst_b2w_scanout ; | |
2633 | assign inst_vld_e2m2b2w_scanin = tid_p2d2e2m2b2w_scanout ; | |
2634 | assign exception_detected_m2b_scanin = inst_vld_e2m2b2w_scanout ; | |
2635 | assign flush_exu_b2w_scanin = exception_detected_m2b_scanout; | |
2636 | assign exception_report_m2b_scanin = flush_exu_b2w_scanout ; | |
2637 | assign wrcwp_in_playf_scanin = exception_report_m2b_scanout; | |
2638 | assign pr_wt_ff_scanin = wrcwp_in_playf_scanout ; | |
2639 | assign trap_ccr_cwp_ff_scanin = pr_wt_ff_scanout ; | |
2640 | assign winblock_slot_tid_m2d2e2m_scanin = trap_ccr_cwp_ff_scanout ; | |
2641 | assign i_rml_restore_en_ff_scanin = winblock_slot_tid_m2d2e2m_scanout; | |
2642 | assign cwp_m2b_scanin = i_rml_restore_en_ff_scanout; | |
2643 | assign cwp_b2w_scanin = cwp_m2b_scanout ; | |
2644 | assign cwp_speculative_scanin = cwp_b2w_scanout ; | |
2645 | assign cansave_e2m2b2w_scanin = cwp_speculative_scanout ; | |
2646 | assign canrestore_e2m2b2w_scanin = cansave_e2m2b2w_scanout ; | |
2647 | assign otherwin_e2m2b2w_scanin = canrestore_e2m2b2w_scanout; | |
2648 | assign cleanwin_e2m2b2w_scanin = otherwin_e2m2b2w_scanout ; | |
2649 | assign cwp_e2m2b2w_scanin = cleanwin_e2m2b2w_scanout ; | |
2650 | assign pipe_rd_irf_ecc_valid_pp2p2d2e_scanin = cwp_e2m2b2w_scanout ; | |
2651 | assign save_wrpr_cwp_tid_scanin = pipe_rd_irf_ecc_valid_pp2p2d2e_scanout; | |
2652 | assign save_rd_irf_tid_scanin = save_wrpr_cwp_tid_scanout; | |
2653 | assign save_wrpr_cwp_scanin = save_rd_irf_tid_scanout ; | |
2654 | assign save_done_wrpr_cwp_scanin = save_wrpr_cwp_scanout ; | |
2655 | assign save_done_irf_ecc_scanin = save_done_wrpr_cwp_scanout; | |
2656 | assign save_irf_ecc_data_scanin = save_done_irf_ecc_scanout; | |
2657 | assign pipe_ack_irf_ecc_scanin = save_irf_ecc_data_scanout; | |
2658 | assign asr_ctl_scanin = pipe_ack_irf_ecc_scanout ; | |
2659 | assign spares_scanin = asr_ctl_scanout ; | |
2660 | assign scan_out = spares_scanout ; | |
2661 | ||
2662 | assign old_gl_ptr_wmr_scanin = wmr_scan_in ; | |
2663 | assign cansave_pr_wmr_scanin = old_gl_ptr_wmr_scanout ; | |
2664 | assign canrestore_pr_wmr_scanin = cansave_pr_wmr_scanout ; | |
2665 | assign otherwin_pr_wmr_scanin = canrestore_pr_wmr_scanout; | |
2666 | assign cleanwin_pr_wmr_scanin = otherwin_pr_wmr_scanout ; | |
2667 | assign wstate_pr_wmr_scanin = cleanwin_pr_wmr_scanout ; | |
2668 | assign cwp_pr_wmr_scanin = wstate_pr_wmr_scanout ; | |
2669 | assign i_yreg0_ff_wmr_scanin = cwp_pr_wmr_scanout ; | |
2670 | assign i_yreg1_ff_wmr_scanin = i_yreg0_ff_wmr_scanout ; | |
2671 | assign i_yreg2_ff_wmr_scanin = i_yreg1_ff_wmr_scanout ; | |
2672 | assign i_yreg3_ff_wmr_scanin = i_yreg2_ff_wmr_scanout ; | |
2673 | assign wmr_scan_out = i_yreg3_ff_wmr_scanout ; | |
2674 | // fixscan end: | |
2675 | endmodule | |
2676 | ||
2677 | ||
2678 | ||
2679 | ||
2680 | ||
2681 | ||
2682 | // any PARAMS parms go into naming of macro | |
2683 | ||
2684 | module exu_rml_ctl_l1clkhdr_ctl_macro ( | |
2685 | l2clk, | |
2686 | l1en, | |
2687 | pce_ov, | |
2688 | stop, | |
2689 | se, | |
2690 | l1clk); | |
2691 | ||
2692 | ||
2693 | input l2clk; | |
2694 | input l1en; | |
2695 | input pce_ov; | |
2696 | input stop; | |
2697 | input se; | |
2698 | output l1clk; | |
2699 | ||
2700 | ||
2701 | ||
2702 | ||
2703 | ||
2704 | cl_sc1_l1hdr_8x c_0 ( | |
2705 | ||
2706 | ||
2707 | .l2clk(l2clk), | |
2708 | .pce(l1en), | |
2709 | .l1clk(l1clk), | |
2710 | .se(se), | |
2711 | .pce_ov(pce_ov), | |
2712 | .stop(stop) | |
2713 | ); | |
2714 | ||
2715 | ||
2716 | ||
2717 | endmodule | |
2718 | ||
2719 | ||
2720 | ||
2721 | ||
2722 | ||
2723 | ||
2724 | ||
2725 | ||
2726 | ||
2727 | ||
2728 | ||
2729 | ||
2730 | ||
2731 | // any PARAMS parms go into naming of macro | |
2732 | ||
2733 | module exu_rml_ctl_msff_ctl_macro__width_16 ( | |
2734 | din, | |
2735 | l1clk, | |
2736 | scan_in, | |
2737 | siclk, | |
2738 | soclk, | |
2739 | dout, | |
2740 | scan_out); | |
2741 | wire [15:0] fdin; | |
2742 | wire [14:0] so; | |
2743 | ||
2744 | input [15:0] din; | |
2745 | input l1clk; | |
2746 | input scan_in; | |
2747 | ||
2748 | ||
2749 | input siclk; | |
2750 | input soclk; | |
2751 | ||
2752 | output [15:0] dout; | |
2753 | output scan_out; | |
2754 | assign fdin[15:0] = din[15:0]; | |
2755 | ||
2756 | ||
2757 | ||
2758 | ||
2759 | ||
2760 | ||
2761 | dff #(16) d0_0 ( | |
2762 | .l1clk(l1clk), | |
2763 | .siclk(siclk), | |
2764 | .soclk(soclk), | |
2765 | .d(fdin[15:0]), | |
2766 | .si({scan_in,so[14:0]}), | |
2767 | .so({so[14:0],scan_out}), | |
2768 | .q(dout[15:0]) | |
2769 | ); | |
2770 | ||
2771 | ||
2772 | ||
2773 | ||
2774 | ||
2775 | ||
2776 | ||
2777 | ||
2778 | ||
2779 | ||
2780 | ||
2781 | ||
2782 | endmodule | |
2783 | ||
2784 | ||
2785 | ||
2786 | ||
2787 | ||
2788 | ||
2789 | ||
2790 | ||
2791 | ||
2792 | ||
2793 | ||
2794 | ||
2795 | ||
2796 | // any PARAMS parms go into naming of macro | |
2797 | ||
2798 | module exu_rml_ctl_msff_ctl_macro__width_6 ( | |
2799 | din, | |
2800 | l1clk, | |
2801 | scan_in, | |
2802 | siclk, | |
2803 | soclk, | |
2804 | dout, | |
2805 | scan_out); | |
2806 | wire [5:0] fdin; | |
2807 | wire [4:0] so; | |
2808 | ||
2809 | input [5:0] din; | |
2810 | input l1clk; | |
2811 | input scan_in; | |
2812 | ||
2813 | ||
2814 | input siclk; | |
2815 | input soclk; | |
2816 | ||
2817 | output [5:0] dout; | |
2818 | output scan_out; | |
2819 | assign fdin[5:0] = din[5:0]; | |
2820 | ||
2821 | ||
2822 | ||
2823 | ||
2824 | ||
2825 | ||
2826 | dff #(6) d0_0 ( | |
2827 | .l1clk(l1clk), | |
2828 | .siclk(siclk), | |
2829 | .soclk(soclk), | |
2830 | .d(fdin[5:0]), | |
2831 | .si({scan_in,so[4:0]}), | |
2832 | .so({so[4:0],scan_out}), | |
2833 | .q(dout[5:0]) | |
2834 | ); | |
2835 | ||
2836 | ||
2837 | ||
2838 | ||
2839 | ||
2840 | ||
2841 | ||
2842 | ||
2843 | ||
2844 | ||
2845 | ||
2846 | ||
2847 | endmodule | |
2848 | ||
2849 | ||
2850 | ||
2851 | ||
2852 | ||
2853 | ||
2854 | ||
2855 | ||
2856 | ||
2857 | ||
2858 | ||
2859 | ||
2860 | ||
2861 | // any PARAMS parms go into naming of macro | |
2862 | ||
2863 | module exu_rml_ctl_msff_ctl_macro__width_10 ( | |
2864 | din, | |
2865 | l1clk, | |
2866 | scan_in, | |
2867 | siclk, | |
2868 | soclk, | |
2869 | dout, | |
2870 | scan_out); | |
2871 | wire [9:0] fdin; | |
2872 | wire [8:0] so; | |
2873 | ||
2874 | input [9:0] din; | |
2875 | input l1clk; | |
2876 | input scan_in; | |
2877 | ||
2878 | ||
2879 | input siclk; | |
2880 | input soclk; | |
2881 | ||
2882 | output [9:0] dout; | |
2883 | output scan_out; | |
2884 | assign fdin[9:0] = din[9:0]; | |
2885 | ||
2886 | ||
2887 | ||
2888 | ||
2889 | ||
2890 | ||
2891 | dff #(10) d0_0 ( | |
2892 | .l1clk(l1clk), | |
2893 | .siclk(siclk), | |
2894 | .soclk(soclk), | |
2895 | .d(fdin[9:0]), | |
2896 | .si({scan_in,so[8:0]}), | |
2897 | .so({so[8:0],scan_out}), | |
2898 | .q(dout[9:0]) | |
2899 | ); | |
2900 | ||
2901 | ||
2902 | ||
2903 | ||
2904 | ||
2905 | ||
2906 | ||
2907 | ||
2908 | ||
2909 | ||
2910 | ||
2911 | ||
2912 | endmodule | |
2913 | ||
2914 | ||
2915 | ||
2916 | ||
2917 | ||
2918 | ||
2919 | ||
2920 | ||
2921 | ||
2922 | ||
2923 | ||
2924 | ||
2925 | ||
2926 | // any PARAMS parms go into naming of macro | |
2927 | ||
2928 | module exu_rml_ctl_msff_ctl_macro__width_9 ( | |
2929 | din, | |
2930 | l1clk, | |
2931 | scan_in, | |
2932 | siclk, | |
2933 | soclk, | |
2934 | dout, | |
2935 | scan_out); | |
2936 | wire [8:0] fdin; | |
2937 | wire [7:0] so; | |
2938 | ||
2939 | input [8:0] din; | |
2940 | input l1clk; | |
2941 | input scan_in; | |
2942 | ||
2943 | ||
2944 | input siclk; | |
2945 | input soclk; | |
2946 | ||
2947 | output [8:0] dout; | |
2948 | output scan_out; | |
2949 | assign fdin[8:0] = din[8:0]; | |
2950 | ||
2951 | ||
2952 | ||
2953 | ||
2954 | ||
2955 | ||
2956 | dff #(9) d0_0 ( | |
2957 | .l1clk(l1clk), | |
2958 | .siclk(siclk), | |
2959 | .soclk(soclk), | |
2960 | .d(fdin[8:0]), | |
2961 | .si({scan_in,so[7:0]}), | |
2962 | .so({so[7:0],scan_out}), | |
2963 | .q(dout[8:0]) | |
2964 | ); | |
2965 | ||
2966 | ||
2967 | ||
2968 | ||
2969 | ||
2970 | ||
2971 | ||
2972 | ||
2973 | ||
2974 | ||
2975 | ||
2976 | ||
2977 | endmodule | |
2978 | ||
2979 | ||
2980 | ||
2981 | ||
2982 | ||
2983 | ||
2984 | ||
2985 | ||
2986 | ||
2987 | ||
2988 | ||
2989 | ||
2990 | ||
2991 | // any PARAMS parms go into naming of macro | |
2992 | ||
2993 | module exu_rml_ctl_msff_ctl_macro__width_14 ( | |
2994 | din, | |
2995 | l1clk, | |
2996 | scan_in, | |
2997 | siclk, | |
2998 | soclk, | |
2999 | dout, | |
3000 | scan_out); | |
3001 | wire [13:0] fdin; | |
3002 | wire [12:0] so; | |
3003 | ||
3004 | input [13:0] din; | |
3005 | input l1clk; | |
3006 | input scan_in; | |
3007 | ||
3008 | ||
3009 | input siclk; | |
3010 | input soclk; | |
3011 | ||
3012 | output [13:0] dout; | |
3013 | output scan_out; | |
3014 | assign fdin[13:0] = din[13:0]; | |
3015 | ||
3016 | ||
3017 | ||
3018 | ||
3019 | ||
3020 | ||
3021 | dff #(14) d0_0 ( | |
3022 | .l1clk(l1clk), | |
3023 | .siclk(siclk), | |
3024 | .soclk(soclk), | |
3025 | .d(fdin[13:0]), | |
3026 | .si({scan_in,so[12:0]}), | |
3027 | .so({so[12:0],scan_out}), | |
3028 | .q(dout[13:0]) | |
3029 | ); | |
3030 | ||
3031 | ||
3032 | ||
3033 | ||
3034 | ||
3035 | ||
3036 | ||
3037 | ||
3038 | ||
3039 | ||
3040 | ||
3041 | ||
3042 | endmodule | |
3043 | ||
3044 | ||
3045 | ||
3046 | ||
3047 | ||
3048 | ||
3049 | ||
3050 | ||
3051 | ||
3052 | ||
3053 | ||
3054 | ||
3055 | ||
3056 | // any PARAMS parms go into naming of macro | |
3057 | ||
3058 | module exu_rml_ctl_msff_ctl_macro__width_3 ( | |
3059 | din, | |
3060 | l1clk, | |
3061 | scan_in, | |
3062 | siclk, | |
3063 | soclk, | |
3064 | dout, | |
3065 | scan_out); | |
3066 | wire [2:0] fdin; | |
3067 | wire [1:0] so; | |
3068 | ||
3069 | input [2:0] din; | |
3070 | input l1clk; | |
3071 | input scan_in; | |
3072 | ||
3073 | ||
3074 | input siclk; | |
3075 | input soclk; | |
3076 | ||
3077 | output [2:0] dout; | |
3078 | output scan_out; | |
3079 | assign fdin[2:0] = din[2:0]; | |
3080 | ||
3081 | ||
3082 | ||
3083 | ||
3084 | ||
3085 | ||
3086 | dff #(3) d0_0 ( | |
3087 | .l1clk(l1clk), | |
3088 | .siclk(siclk), | |
3089 | .soclk(soclk), | |
3090 | .d(fdin[2:0]), | |
3091 | .si({scan_in,so[1:0]}), | |
3092 | .so({so[1:0],scan_out}), | |
3093 | .q(dout[2:0]) | |
3094 | ); | |
3095 | ||
3096 | ||
3097 | ||
3098 | ||
3099 | ||
3100 | ||
3101 | ||
3102 | ||
3103 | ||
3104 | ||
3105 | ||
3106 | ||
3107 | endmodule | |
3108 | ||
3109 | ||
3110 | ||
3111 | ||
3112 | ||
3113 | ||
3114 | ||
3115 | ||
3116 | ||
3117 | ||
3118 | ||
3119 | ||
3120 | ||
3121 | // any PARAMS parms go into naming of macro | |
3122 | ||
3123 | module exu_rml_ctl_msff_ctl_macro__width_1 ( | |
3124 | din, | |
3125 | l1clk, | |
3126 | scan_in, | |
3127 | siclk, | |
3128 | soclk, | |
3129 | dout, | |
3130 | scan_out); | |
3131 | wire [0:0] fdin; | |
3132 | ||
3133 | input [0:0] din; | |
3134 | input l1clk; | |
3135 | input scan_in; | |
3136 | ||
3137 | ||
3138 | input siclk; | |
3139 | input soclk; | |
3140 | ||
3141 | output [0:0] dout; | |
3142 | output scan_out; | |
3143 | assign fdin[0:0] = din[0:0]; | |
3144 | ||
3145 | ||
3146 | ||
3147 | ||
3148 | ||
3149 | ||
3150 | dff #(1) d0_0 ( | |
3151 | .l1clk(l1clk), | |
3152 | .siclk(siclk), | |
3153 | .soclk(soclk), | |
3154 | .d(fdin[0:0]), | |
3155 | .si(scan_in), | |
3156 | .so(scan_out), | |
3157 | .q(dout[0:0]) | |
3158 | ); | |
3159 | ||
3160 | ||
3161 | ||
3162 | ||
3163 | ||
3164 | ||
3165 | ||
3166 | ||
3167 | ||
3168 | ||
3169 | ||
3170 | ||
3171 | endmodule | |
3172 | ||
3173 | ||
3174 | ||
3175 | ||
3176 | ||
3177 | ||
3178 | ||
3179 | ||
3180 | ||
3181 | ||
3182 | ||
3183 | ||
3184 | ||
3185 | // any PARAMS parms go into naming of macro | |
3186 | ||
3187 | module exu_rml_ctl_msff_ctl_macro__width_2 ( | |
3188 | din, | |
3189 | l1clk, | |
3190 | scan_in, | |
3191 | siclk, | |
3192 | soclk, | |
3193 | dout, | |
3194 | scan_out); | |
3195 | wire [1:0] fdin; | |
3196 | wire [0:0] so; | |
3197 | ||
3198 | input [1:0] din; | |
3199 | input l1clk; | |
3200 | input scan_in; | |
3201 | ||
3202 | ||
3203 | input siclk; | |
3204 | input soclk; | |
3205 | ||
3206 | output [1:0] dout; | |
3207 | output scan_out; | |
3208 | assign fdin[1:0] = din[1:0]; | |
3209 | ||
3210 | ||
3211 | ||
3212 | ||
3213 | ||
3214 | ||
3215 | dff #(2) d0_0 ( | |
3216 | .l1clk(l1clk), | |
3217 | .siclk(siclk), | |
3218 | .soclk(soclk), | |
3219 | .d(fdin[1:0]), | |
3220 | .si({scan_in,so[0:0]}), | |
3221 | .so({so[0:0],scan_out}), | |
3222 | .q(dout[1:0]) | |
3223 | ); | |
3224 | ||
3225 | ||
3226 | ||
3227 | ||
3228 | ||
3229 | ||
3230 | ||
3231 | ||
3232 | ||
3233 | ||
3234 | ||
3235 | ||
3236 | endmodule | |
3237 | ||
3238 | ||
3239 | ||
3240 | ||
3241 | ||
3242 | ||
3243 | ||
3244 | ||
3245 | ||
3246 | ||
3247 | ||
3248 | ||
3249 | ||
3250 | // any PARAMS parms go into naming of macro | |
3251 | ||
3252 | module exu_rml_ctl_msff_ctl_macro__width_15 ( | |
3253 | din, | |
3254 | l1clk, | |
3255 | scan_in, | |
3256 | siclk, | |
3257 | soclk, | |
3258 | dout, | |
3259 | scan_out); | |
3260 | wire [14:0] fdin; | |
3261 | wire [13:0] so; | |
3262 | ||
3263 | input [14:0] din; | |
3264 | input l1clk; | |
3265 | input scan_in; | |
3266 | ||
3267 | ||
3268 | input siclk; | |
3269 | input soclk; | |
3270 | ||
3271 | output [14:0] dout; | |
3272 | output scan_out; | |
3273 | assign fdin[14:0] = din[14:0]; | |
3274 | ||
3275 | ||
3276 | ||
3277 | ||
3278 | ||
3279 | ||
3280 | dff #(15) d0_0 ( | |
3281 | .l1clk(l1clk), | |
3282 | .siclk(siclk), | |
3283 | .soclk(soclk), | |
3284 | .d(fdin[14:0]), | |
3285 | .si({scan_in,so[13:0]}), | |
3286 | .so({so[13:0],scan_out}), | |
3287 | .q(dout[14:0]) | |
3288 | ); | |
3289 | ||
3290 | ||
3291 | ||
3292 | ||
3293 | ||
3294 | ||
3295 | ||
3296 | ||
3297 | ||
3298 | ||
3299 | ||
3300 | ||
3301 | endmodule | |
3302 | ||
3303 | ||
3304 | ||
3305 | ||
3306 | ||
3307 | ||
3308 | ||
3309 | ||
3310 | ||
3311 | ||
3312 | ||
3313 | ||
3314 | ||
3315 | // any PARAMS parms go into naming of macro | |
3316 | ||
3317 | module exu_rml_ctl_msff_ctl_macro__width_8 ( | |
3318 | din, | |
3319 | l1clk, | |
3320 | scan_in, | |
3321 | siclk, | |
3322 | soclk, | |
3323 | dout, | |
3324 | scan_out); | |
3325 | wire [7:0] fdin; | |
3326 | wire [6:0] so; | |
3327 | ||
3328 | input [7:0] din; | |
3329 | input l1clk; | |
3330 | input scan_in; | |
3331 | ||
3332 | ||
3333 | input siclk; | |
3334 | input soclk; | |
3335 | ||
3336 | output [7:0] dout; | |
3337 | output scan_out; | |
3338 | assign fdin[7:0] = din[7:0]; | |
3339 | ||
3340 | ||
3341 | ||
3342 | ||
3343 | ||
3344 | ||
3345 | dff #(8) d0_0 ( | |
3346 | .l1clk(l1clk), | |
3347 | .siclk(siclk), | |
3348 | .soclk(soclk), | |
3349 | .d(fdin[7:0]), | |
3350 | .si({scan_in,so[6:0]}), | |
3351 | .so({so[6:0],scan_out}), | |
3352 | .q(dout[7:0]) | |
3353 | ); | |
3354 | ||
3355 | ||
3356 | ||
3357 | ||
3358 | ||
3359 | ||
3360 | ||
3361 | ||
3362 | ||
3363 | ||
3364 | ||
3365 | ||
3366 | endmodule | |
3367 | ||
3368 | ||
3369 | ||
3370 | ||
3371 | ||
3372 | ||
3373 | ||
3374 | ||
3375 | ||
3376 | ||
3377 | ||
3378 | ||
3379 | ||
3380 | // any PARAMS parms go into naming of macro | |
3381 | ||
3382 | module exu_rml_ctl_msff_ctl_macro__width_4 ( | |
3383 | din, | |
3384 | l1clk, | |
3385 | scan_in, | |
3386 | siclk, | |
3387 | soclk, | |
3388 | dout, | |
3389 | scan_out); | |
3390 | wire [3:0] fdin; | |
3391 | wire [2:0] so; | |
3392 | ||
3393 | input [3:0] din; | |
3394 | input l1clk; | |
3395 | input scan_in; | |
3396 | ||
3397 | ||
3398 | input siclk; | |
3399 | input soclk; | |
3400 | ||
3401 | output [3:0] dout; | |
3402 | output scan_out; | |
3403 | assign fdin[3:0] = din[3:0]; | |
3404 | ||
3405 | ||
3406 | ||
3407 | ||
3408 | ||
3409 | ||
3410 | dff #(4) d0_0 ( | |
3411 | .l1clk(l1clk), | |
3412 | .siclk(siclk), | |
3413 | .soclk(soclk), | |
3414 | .d(fdin[3:0]), | |
3415 | .si({scan_in,so[2:0]}), | |
3416 | .so({so[2:0],scan_out}), | |
3417 | .q(dout[3:0]) | |
3418 | ); | |
3419 | ||
3420 | ||
3421 | ||
3422 | ||
3423 | ||
3424 | ||
3425 | ||
3426 | ||
3427 | ||
3428 | ||
3429 | ||
3430 | ||
3431 | endmodule | |
3432 | ||
3433 | ||
3434 | ||
3435 | ||
3436 | ||
3437 | ||
3438 | ||
3439 | ||
3440 | ||
3441 | ||
3442 | ||
3443 | ||
3444 | ||
3445 | // any PARAMS parms go into naming of macro | |
3446 | ||
3447 | module exu_rml_ctl_msff_ctl_macro__width_12 ( | |
3448 | din, | |
3449 | l1clk, | |
3450 | scan_in, | |
3451 | siclk, | |
3452 | soclk, | |
3453 | dout, | |
3454 | scan_out); | |
3455 | wire [11:0] fdin; | |
3456 | wire [10:0] so; | |
3457 | ||
3458 | input [11:0] din; | |
3459 | input l1clk; | |
3460 | input scan_in; | |
3461 | ||
3462 | ||
3463 | input siclk; | |
3464 | input soclk; | |
3465 | ||
3466 | output [11:0] dout; | |
3467 | output scan_out; | |
3468 | assign fdin[11:0] = din[11:0]; | |
3469 | ||
3470 | ||
3471 | ||
3472 | ||
3473 | ||
3474 | ||
3475 | dff #(12) d0_0 ( | |
3476 | .l1clk(l1clk), | |
3477 | .siclk(siclk), | |
3478 | .soclk(soclk), | |
3479 | .d(fdin[11:0]), | |
3480 | .si({scan_in,so[10:0]}), | |
3481 | .so({so[10:0],scan_out}), | |
3482 | .q(dout[11:0]) | |
3483 | ); | |
3484 | ||
3485 | ||
3486 | ||
3487 | ||
3488 | ||
3489 | ||
3490 | ||
3491 | ||
3492 | ||
3493 | ||
3494 | ||
3495 | ||
3496 | endmodule | |
3497 | ||
3498 | ||
3499 | ||
3500 | ||
3501 | ||
3502 | ||
3503 | ||
3504 | ||
3505 | ||
3506 | ||
3507 | ||
3508 | ||
3509 | ||
3510 | // any PARAMS parms go into naming of macro | |
3511 | ||
3512 | module exu_rml_ctl_msff_ctl_macro__width_24 ( | |
3513 | din, | |
3514 | l1clk, | |
3515 | scan_in, | |
3516 | siclk, | |
3517 | soclk, | |
3518 | dout, | |
3519 | scan_out); | |
3520 | wire [23:0] fdin; | |
3521 | wire [22:0] so; | |
3522 | ||
3523 | input [23:0] din; | |
3524 | input l1clk; | |
3525 | input scan_in; | |
3526 | ||
3527 | ||
3528 | input siclk; | |
3529 | input soclk; | |
3530 | ||
3531 | output [23:0] dout; | |
3532 | output scan_out; | |
3533 | assign fdin[23:0] = din[23:0]; | |
3534 | ||
3535 | ||
3536 | ||
3537 | ||
3538 | ||
3539 | ||
3540 | dff #(24) d0_0 ( | |
3541 | .l1clk(l1clk), | |
3542 | .siclk(siclk), | |
3543 | .soclk(soclk), | |
3544 | .d(fdin[23:0]), | |
3545 | .si({scan_in,so[22:0]}), | |
3546 | .so({so[22:0],scan_out}), | |
3547 | .q(dout[23:0]) | |
3548 | ); | |
3549 | ||
3550 | ||
3551 | ||
3552 | ||
3553 | ||
3554 | ||
3555 | ||
3556 | ||
3557 | ||
3558 | ||
3559 | ||
3560 | ||
3561 | endmodule | |
3562 | ||
3563 | ||
3564 | ||
3565 | ||
3566 | ||
3567 | ||
3568 | ||
3569 | ||
3570 | ||
3571 | ||
3572 | ||
3573 | ||
3574 | ||
3575 | // any PARAMS parms go into naming of macro | |
3576 | ||
3577 | module exu_rml_ctl_msff_ctl_macro__width_26 ( | |
3578 | din, | |
3579 | l1clk, | |
3580 | scan_in, | |
3581 | siclk, | |
3582 | soclk, | |
3583 | dout, | |
3584 | scan_out); | |
3585 | wire [25:0] fdin; | |
3586 | wire [24:0] so; | |
3587 | ||
3588 | input [25:0] din; | |
3589 | input l1clk; | |
3590 | input scan_in; | |
3591 | ||
3592 | ||
3593 | input siclk; | |
3594 | input soclk; | |
3595 | ||
3596 | output [25:0] dout; | |
3597 | output scan_out; | |
3598 | assign fdin[25:0] = din[25:0]; | |
3599 | ||
3600 | ||
3601 | ||
3602 | ||
3603 | ||
3604 | ||
3605 | dff #(26) d0_0 ( | |
3606 | .l1clk(l1clk), | |
3607 | .siclk(siclk), | |
3608 | .soclk(soclk), | |
3609 | .d(fdin[25:0]), | |
3610 | .si({scan_in,so[24:0]}), | |
3611 | .so({so[24:0],scan_out}), | |
3612 | .q(dout[25:0]) | |
3613 | ); | |
3614 | ||
3615 | ||
3616 | ||
3617 | ||
3618 | ||
3619 | ||
3620 | ||
3621 | ||
3622 | ||
3623 | ||
3624 | ||
3625 | ||
3626 | endmodule | |
3627 | ||
3628 | ||
3629 | ||
3630 | ||
3631 | ||
3632 | ||
3633 | ||
3634 | ||
3635 | ||
3636 | ||
3637 | ||
3638 | ||
3639 | ||
3640 | // any PARAMS parms go into naming of macro | |
3641 | ||
3642 | module exu_rml_ctl_msff_ctl_macro__width_32 ( | |
3643 | din, | |
3644 | l1clk, | |
3645 | scan_in, | |
3646 | siclk, | |
3647 | soclk, | |
3648 | dout, | |
3649 | scan_out); | |
3650 | wire [31:0] fdin; | |
3651 | wire [30:0] so; | |
3652 | ||
3653 | input [31:0] din; | |
3654 | input l1clk; | |
3655 | input scan_in; | |
3656 | ||
3657 | ||
3658 | input siclk; | |
3659 | input soclk; | |
3660 | ||
3661 | output [31:0] dout; | |
3662 | output scan_out; | |
3663 | assign fdin[31:0] = din[31:0]; | |
3664 | ||
3665 | ||
3666 | ||
3667 | ||
3668 | ||
3669 | ||
3670 | dff #(32) d0_0 ( | |
3671 | .l1clk(l1clk), | |
3672 | .siclk(siclk), | |
3673 | .soclk(soclk), | |
3674 | .d(fdin[31:0]), | |
3675 | .si({scan_in,so[30:0]}), | |
3676 | .so({so[30:0],scan_out}), | |
3677 | .q(dout[31:0]) | |
3678 | ); | |
3679 | ||
3680 | ||
3681 | ||
3682 | ||
3683 | ||
3684 | ||
3685 | ||
3686 | ||
3687 | ||
3688 | ||
3689 | ||
3690 | ||
3691 | endmodule | |
3692 | ||
3693 | ||
3694 | ||
3695 | ||
3696 | ||
3697 | ||
3698 | ||
3699 | ||
3700 | ||
3701 | // Description: Spare gate macro for control blocks | |
3702 | // | |
3703 | // Param num controls the number of times the macro is added | |
3704 | // flops=0 can be used to use only combination spare logic | |
3705 | ||
3706 | ||
3707 | module exu_rml_ctl_spare_ctl_macro__num_6 ( | |
3708 | l1clk, | |
3709 | scan_in, | |
3710 | siclk, | |
3711 | soclk, | |
3712 | scan_out); | |
3713 | wire si_0; | |
3714 | wire so_0; | |
3715 | wire spare0_flop_unused; | |
3716 | wire spare0_buf_32x_unused; | |
3717 | wire spare0_nand3_8x_unused; | |
3718 | wire spare0_inv_8x_unused; | |
3719 | wire spare0_aoi22_4x_unused; | |
3720 | wire spare0_buf_8x_unused; | |
3721 | wire spare0_oai22_4x_unused; | |
3722 | wire spare0_inv_16x_unused; | |
3723 | wire spare0_nand2_16x_unused; | |
3724 | wire spare0_nor3_4x_unused; | |
3725 | wire spare0_nand2_8x_unused; | |
3726 | wire spare0_buf_16x_unused; | |
3727 | wire spare0_nor2_16x_unused; | |
3728 | wire spare0_inv_32x_unused; | |
3729 | wire si_1; | |
3730 | wire so_1; | |
3731 | wire spare1_flop_unused; | |
3732 | wire spare1_buf_32x_unused; | |
3733 | wire spare1_nand3_8x_unused; | |
3734 | wire spare1_inv_8x_unused; | |
3735 | wire spare1_aoi22_4x_unused; | |
3736 | wire spare1_buf_8x_unused; | |
3737 | wire spare1_oai22_4x_unused; | |
3738 | wire spare1_inv_16x_unused; | |
3739 | wire spare1_nand2_16x_unused; | |
3740 | wire spare1_nor3_4x_unused; | |
3741 | wire spare1_nand2_8x_unused; | |
3742 | wire spare1_buf_16x_unused; | |
3743 | wire spare1_nor2_16x_unused; | |
3744 | wire spare1_inv_32x_unused; | |
3745 | wire si_2; | |
3746 | wire so_2; | |
3747 | wire spare2_flop_unused; | |
3748 | wire spare2_buf_32x_unused; | |
3749 | wire spare2_nand3_8x_unused; | |
3750 | wire spare2_inv_8x_unused; | |
3751 | wire spare2_aoi22_4x_unused; | |
3752 | wire spare2_buf_8x_unused; | |
3753 | wire spare2_oai22_4x_unused; | |
3754 | wire spare2_inv_16x_unused; | |
3755 | wire spare2_nand2_16x_unused; | |
3756 | wire spare2_nor3_4x_unused; | |
3757 | wire spare2_nand2_8x_unused; | |
3758 | wire spare2_buf_16x_unused; | |
3759 | wire spare2_nor2_16x_unused; | |
3760 | wire spare2_inv_32x_unused; | |
3761 | wire si_3; | |
3762 | wire so_3; | |
3763 | wire spare3_flop_unused; | |
3764 | wire spare3_buf_32x_unused; | |
3765 | wire spare3_nand3_8x_unused; | |
3766 | wire spare3_inv_8x_unused; | |
3767 | wire spare3_aoi22_4x_unused; | |
3768 | wire spare3_buf_8x_unused; | |
3769 | wire spare3_oai22_4x_unused; | |
3770 | wire spare3_inv_16x_unused; | |
3771 | wire spare3_nand2_16x_unused; | |
3772 | wire spare3_nor3_4x_unused; | |
3773 | wire spare3_nand2_8x_unused; | |
3774 | wire spare3_buf_16x_unused; | |
3775 | wire spare3_nor2_16x_unused; | |
3776 | wire spare3_inv_32x_unused; | |
3777 | wire si_4; | |
3778 | wire so_4; | |
3779 | wire spare4_flop_unused; | |
3780 | wire spare4_buf_32x_unused; | |
3781 | wire spare4_nand3_8x_unused; | |
3782 | wire spare4_inv_8x_unused; | |
3783 | wire spare4_aoi22_4x_unused; | |
3784 | wire spare4_buf_8x_unused; | |
3785 | wire spare4_oai22_4x_unused; | |
3786 | wire spare4_inv_16x_unused; | |
3787 | wire spare4_nand2_16x_unused; | |
3788 | wire spare4_nor3_4x_unused; | |
3789 | wire spare4_nand2_8x_unused; | |
3790 | wire spare4_buf_16x_unused; | |
3791 | wire spare4_nor2_16x_unused; | |
3792 | wire spare4_inv_32x_unused; | |
3793 | wire si_5; | |
3794 | wire so_5; | |
3795 | wire spare5_flop_unused; | |
3796 | wire spare5_buf_32x_unused; | |
3797 | wire spare5_nand3_8x_unused; | |
3798 | wire spare5_inv_8x_unused; | |
3799 | wire spare5_aoi22_4x_unused; | |
3800 | wire spare5_buf_8x_unused; | |
3801 | wire spare5_oai22_4x_unused; | |
3802 | wire spare5_inv_16x_unused; | |
3803 | wire spare5_nand2_16x_unused; | |
3804 | wire spare5_nor3_4x_unused; | |
3805 | wire spare5_nand2_8x_unused; | |
3806 | wire spare5_buf_16x_unused; | |
3807 | wire spare5_nor2_16x_unused; | |
3808 | wire spare5_inv_32x_unused; | |
3809 | ||
3810 | ||
3811 | input l1clk; | |
3812 | input scan_in; | |
3813 | input siclk; | |
3814 | input soclk; | |
3815 | output scan_out; | |
3816 | ||
3817 | cl_sc1_msff_8x spare0_flop (.l1clk(l1clk), | |
3818 | .siclk(siclk), | |
3819 | .soclk(soclk), | |
3820 | .si(si_0), | |
3821 | .so(so_0), | |
3822 | .d(1'b0), | |
3823 | .q(spare0_flop_unused)); | |
3824 | assign si_0 = scan_in; | |
3825 | ||
3826 | cl_u1_buf_32x spare0_buf_32x (.in(1'b1), | |
3827 | .out(spare0_buf_32x_unused)); | |
3828 | cl_u1_nand3_8x spare0_nand3_8x (.in0(1'b1), | |
3829 | .in1(1'b1), | |
3830 | .in2(1'b1), | |
3831 | .out(spare0_nand3_8x_unused)); | |
3832 | cl_u1_inv_8x spare0_inv_8x (.in(1'b1), | |
3833 | .out(spare0_inv_8x_unused)); | |
3834 | cl_u1_aoi22_4x spare0_aoi22_4x (.in00(1'b1), | |
3835 | .in01(1'b1), | |
3836 | .in10(1'b1), | |
3837 | .in11(1'b1), | |
3838 | .out(spare0_aoi22_4x_unused)); | |
3839 | cl_u1_buf_8x spare0_buf_8x (.in(1'b1), | |
3840 | .out(spare0_buf_8x_unused)); | |
3841 | cl_u1_oai22_4x spare0_oai22_4x (.in00(1'b1), | |
3842 | .in01(1'b1), | |
3843 | .in10(1'b1), | |
3844 | .in11(1'b1), | |
3845 | .out(spare0_oai22_4x_unused)); | |
3846 | cl_u1_inv_16x spare0_inv_16x (.in(1'b1), | |
3847 | .out(spare0_inv_16x_unused)); | |
3848 | cl_u1_nand2_16x spare0_nand2_16x (.in0(1'b1), | |
3849 | .in1(1'b1), | |
3850 | .out(spare0_nand2_16x_unused)); | |
3851 | cl_u1_nor3_4x spare0_nor3_4x (.in0(1'b0), | |
3852 | .in1(1'b0), | |
3853 | .in2(1'b0), | |
3854 | .out(spare0_nor3_4x_unused)); | |
3855 | cl_u1_nand2_8x spare0_nand2_8x (.in0(1'b1), | |
3856 | .in1(1'b1), | |
3857 | .out(spare0_nand2_8x_unused)); | |
3858 | cl_u1_buf_16x spare0_buf_16x (.in(1'b1), | |
3859 | .out(spare0_buf_16x_unused)); | |
3860 | cl_u1_nor2_16x spare0_nor2_16x (.in0(1'b0), | |
3861 | .in1(1'b0), | |
3862 | .out(spare0_nor2_16x_unused)); | |
3863 | cl_u1_inv_32x spare0_inv_32x (.in(1'b1), | |
3864 | .out(spare0_inv_32x_unused)); | |
3865 | ||
3866 | cl_sc1_msff_8x spare1_flop (.l1clk(l1clk), | |
3867 | .siclk(siclk), | |
3868 | .soclk(soclk), | |
3869 | .si(si_1), | |
3870 | .so(so_1), | |
3871 | .d(1'b0), | |
3872 | .q(spare1_flop_unused)); | |
3873 | assign si_1 = so_0; | |
3874 | ||
3875 | cl_u1_buf_32x spare1_buf_32x (.in(1'b1), | |
3876 | .out(spare1_buf_32x_unused)); | |
3877 | cl_u1_nand3_8x spare1_nand3_8x (.in0(1'b1), | |
3878 | .in1(1'b1), | |
3879 | .in2(1'b1), | |
3880 | .out(spare1_nand3_8x_unused)); | |
3881 | cl_u1_inv_8x spare1_inv_8x (.in(1'b1), | |
3882 | .out(spare1_inv_8x_unused)); | |
3883 | cl_u1_aoi22_4x spare1_aoi22_4x (.in00(1'b1), | |
3884 | .in01(1'b1), | |
3885 | .in10(1'b1), | |
3886 | .in11(1'b1), | |
3887 | .out(spare1_aoi22_4x_unused)); | |
3888 | cl_u1_buf_8x spare1_buf_8x (.in(1'b1), | |
3889 | .out(spare1_buf_8x_unused)); | |
3890 | cl_u1_oai22_4x spare1_oai22_4x (.in00(1'b1), | |
3891 | .in01(1'b1), | |
3892 | .in10(1'b1), | |
3893 | .in11(1'b1), | |
3894 | .out(spare1_oai22_4x_unused)); | |
3895 | cl_u1_inv_16x spare1_inv_16x (.in(1'b1), | |
3896 | .out(spare1_inv_16x_unused)); | |
3897 | cl_u1_nand2_16x spare1_nand2_16x (.in0(1'b1), | |
3898 | .in1(1'b1), | |
3899 | .out(spare1_nand2_16x_unused)); | |
3900 | cl_u1_nor3_4x spare1_nor3_4x (.in0(1'b0), | |
3901 | .in1(1'b0), | |
3902 | .in2(1'b0), | |
3903 | .out(spare1_nor3_4x_unused)); | |
3904 | cl_u1_nand2_8x spare1_nand2_8x (.in0(1'b1), | |
3905 | .in1(1'b1), | |
3906 | .out(spare1_nand2_8x_unused)); | |
3907 | cl_u1_buf_16x spare1_buf_16x (.in(1'b1), | |
3908 | .out(spare1_buf_16x_unused)); | |
3909 | cl_u1_nor2_16x spare1_nor2_16x (.in0(1'b0), | |
3910 | .in1(1'b0), | |
3911 | .out(spare1_nor2_16x_unused)); | |
3912 | cl_u1_inv_32x spare1_inv_32x (.in(1'b1), | |
3913 | .out(spare1_inv_32x_unused)); | |
3914 | ||
3915 | cl_sc1_msff_8x spare2_flop (.l1clk(l1clk), | |
3916 | .siclk(siclk), | |
3917 | .soclk(soclk), | |
3918 | .si(si_2), | |
3919 | .so(so_2), | |
3920 | .d(1'b0), | |
3921 | .q(spare2_flop_unused)); | |
3922 | assign si_2 = so_1; | |
3923 | ||
3924 | cl_u1_buf_32x spare2_buf_32x (.in(1'b1), | |
3925 | .out(spare2_buf_32x_unused)); | |
3926 | cl_u1_nand3_8x spare2_nand3_8x (.in0(1'b1), | |
3927 | .in1(1'b1), | |
3928 | .in2(1'b1), | |
3929 | .out(spare2_nand3_8x_unused)); | |
3930 | cl_u1_inv_8x spare2_inv_8x (.in(1'b1), | |
3931 | .out(spare2_inv_8x_unused)); | |
3932 | cl_u1_aoi22_4x spare2_aoi22_4x (.in00(1'b1), | |
3933 | .in01(1'b1), | |
3934 | .in10(1'b1), | |
3935 | .in11(1'b1), | |
3936 | .out(spare2_aoi22_4x_unused)); | |
3937 | cl_u1_buf_8x spare2_buf_8x (.in(1'b1), | |
3938 | .out(spare2_buf_8x_unused)); | |
3939 | cl_u1_oai22_4x spare2_oai22_4x (.in00(1'b1), | |
3940 | .in01(1'b1), | |
3941 | .in10(1'b1), | |
3942 | .in11(1'b1), | |
3943 | .out(spare2_oai22_4x_unused)); | |
3944 | cl_u1_inv_16x spare2_inv_16x (.in(1'b1), | |
3945 | .out(spare2_inv_16x_unused)); | |
3946 | cl_u1_nand2_16x spare2_nand2_16x (.in0(1'b1), | |
3947 | .in1(1'b1), | |
3948 | .out(spare2_nand2_16x_unused)); | |
3949 | cl_u1_nor3_4x spare2_nor3_4x (.in0(1'b0), | |
3950 | .in1(1'b0), | |
3951 | .in2(1'b0), | |
3952 | .out(spare2_nor3_4x_unused)); | |
3953 | cl_u1_nand2_8x spare2_nand2_8x (.in0(1'b1), | |
3954 | .in1(1'b1), | |
3955 | .out(spare2_nand2_8x_unused)); | |
3956 | cl_u1_buf_16x spare2_buf_16x (.in(1'b1), | |
3957 | .out(spare2_buf_16x_unused)); | |
3958 | cl_u1_nor2_16x spare2_nor2_16x (.in0(1'b0), | |
3959 | .in1(1'b0), | |
3960 | .out(spare2_nor2_16x_unused)); | |
3961 | cl_u1_inv_32x spare2_inv_32x (.in(1'b1), | |
3962 | .out(spare2_inv_32x_unused)); | |
3963 | ||
3964 | cl_sc1_msff_8x spare3_flop (.l1clk(l1clk), | |
3965 | .siclk(siclk), | |
3966 | .soclk(soclk), | |
3967 | .si(si_3), | |
3968 | .so(so_3), | |
3969 | .d(1'b0), | |
3970 | .q(spare3_flop_unused)); | |
3971 | assign si_3 = so_2; | |
3972 | ||
3973 | cl_u1_buf_32x spare3_buf_32x (.in(1'b1), | |
3974 | .out(spare3_buf_32x_unused)); | |
3975 | cl_u1_nand3_8x spare3_nand3_8x (.in0(1'b1), | |
3976 | .in1(1'b1), | |
3977 | .in2(1'b1), | |
3978 | .out(spare3_nand3_8x_unused)); | |
3979 | cl_u1_inv_8x spare3_inv_8x (.in(1'b1), | |
3980 | .out(spare3_inv_8x_unused)); | |
3981 | cl_u1_aoi22_4x spare3_aoi22_4x (.in00(1'b1), | |
3982 | .in01(1'b1), | |
3983 | .in10(1'b1), | |
3984 | .in11(1'b1), | |
3985 | .out(spare3_aoi22_4x_unused)); | |
3986 | cl_u1_buf_8x spare3_buf_8x (.in(1'b1), | |
3987 | .out(spare3_buf_8x_unused)); | |
3988 | cl_u1_oai22_4x spare3_oai22_4x (.in00(1'b1), | |
3989 | .in01(1'b1), | |
3990 | .in10(1'b1), | |
3991 | .in11(1'b1), | |
3992 | .out(spare3_oai22_4x_unused)); | |
3993 | cl_u1_inv_16x spare3_inv_16x (.in(1'b1), | |
3994 | .out(spare3_inv_16x_unused)); | |
3995 | cl_u1_nand2_16x spare3_nand2_16x (.in0(1'b1), | |
3996 | .in1(1'b1), | |
3997 | .out(spare3_nand2_16x_unused)); | |
3998 | cl_u1_nor3_4x spare3_nor3_4x (.in0(1'b0), | |
3999 | .in1(1'b0), | |
4000 | .in2(1'b0), | |
4001 | .out(spare3_nor3_4x_unused)); | |
4002 | cl_u1_nand2_8x spare3_nand2_8x (.in0(1'b1), | |
4003 | .in1(1'b1), | |
4004 | .out(spare3_nand2_8x_unused)); | |
4005 | cl_u1_buf_16x spare3_buf_16x (.in(1'b1), | |
4006 | .out(spare3_buf_16x_unused)); | |
4007 | cl_u1_nor2_16x spare3_nor2_16x (.in0(1'b0), | |
4008 | .in1(1'b0), | |
4009 | .out(spare3_nor2_16x_unused)); | |
4010 | cl_u1_inv_32x spare3_inv_32x (.in(1'b1), | |
4011 | .out(spare3_inv_32x_unused)); | |
4012 | ||
4013 | cl_sc1_msff_8x spare4_flop (.l1clk(l1clk), | |
4014 | .siclk(siclk), | |
4015 | .soclk(soclk), | |
4016 | .si(si_4), | |
4017 | .so(so_4), | |
4018 | .d(1'b0), | |
4019 | .q(spare4_flop_unused)); | |
4020 | assign si_4 = so_3; | |
4021 | ||
4022 | cl_u1_buf_32x spare4_buf_32x (.in(1'b1), | |
4023 | .out(spare4_buf_32x_unused)); | |
4024 | cl_u1_nand3_8x spare4_nand3_8x (.in0(1'b1), | |
4025 | .in1(1'b1), | |
4026 | .in2(1'b1), | |
4027 | .out(spare4_nand3_8x_unused)); | |
4028 | cl_u1_inv_8x spare4_inv_8x (.in(1'b1), | |
4029 | .out(spare4_inv_8x_unused)); | |
4030 | cl_u1_aoi22_4x spare4_aoi22_4x (.in00(1'b1), | |
4031 | .in01(1'b1), | |
4032 | .in10(1'b1), | |
4033 | .in11(1'b1), | |
4034 | .out(spare4_aoi22_4x_unused)); | |
4035 | cl_u1_buf_8x spare4_buf_8x (.in(1'b1), | |
4036 | .out(spare4_buf_8x_unused)); | |
4037 | cl_u1_oai22_4x spare4_oai22_4x (.in00(1'b1), | |
4038 | .in01(1'b1), | |
4039 | .in10(1'b1), | |
4040 | .in11(1'b1), | |
4041 | .out(spare4_oai22_4x_unused)); | |
4042 | cl_u1_inv_16x spare4_inv_16x (.in(1'b1), | |
4043 | .out(spare4_inv_16x_unused)); | |
4044 | cl_u1_nand2_16x spare4_nand2_16x (.in0(1'b1), | |
4045 | .in1(1'b1), | |
4046 | .out(spare4_nand2_16x_unused)); | |
4047 | cl_u1_nor3_4x spare4_nor3_4x (.in0(1'b0), | |
4048 | .in1(1'b0), | |
4049 | .in2(1'b0), | |
4050 | .out(spare4_nor3_4x_unused)); | |
4051 | cl_u1_nand2_8x spare4_nand2_8x (.in0(1'b1), | |
4052 | .in1(1'b1), | |
4053 | .out(spare4_nand2_8x_unused)); | |
4054 | cl_u1_buf_16x spare4_buf_16x (.in(1'b1), | |
4055 | .out(spare4_buf_16x_unused)); | |
4056 | cl_u1_nor2_16x spare4_nor2_16x (.in0(1'b0), | |
4057 | .in1(1'b0), | |
4058 | .out(spare4_nor2_16x_unused)); | |
4059 | cl_u1_inv_32x spare4_inv_32x (.in(1'b1), | |
4060 | .out(spare4_inv_32x_unused)); | |
4061 | ||
4062 | cl_sc1_msff_8x spare5_flop (.l1clk(l1clk), | |
4063 | .siclk(siclk), | |
4064 | .soclk(soclk), | |
4065 | .si(si_5), | |
4066 | .so(so_5), | |
4067 | .d(1'b0), | |
4068 | .q(spare5_flop_unused)); | |
4069 | assign si_5 = so_4; | |
4070 | ||
4071 | cl_u1_buf_32x spare5_buf_32x (.in(1'b1), | |
4072 | .out(spare5_buf_32x_unused)); | |
4073 | cl_u1_nand3_8x spare5_nand3_8x (.in0(1'b1), | |
4074 | .in1(1'b1), | |
4075 | .in2(1'b1), | |
4076 | .out(spare5_nand3_8x_unused)); | |
4077 | cl_u1_inv_8x spare5_inv_8x (.in(1'b1), | |
4078 | .out(spare5_inv_8x_unused)); | |
4079 | cl_u1_aoi22_4x spare5_aoi22_4x (.in00(1'b1), | |
4080 | .in01(1'b1), | |
4081 | .in10(1'b1), | |
4082 | .in11(1'b1), | |
4083 | .out(spare5_aoi22_4x_unused)); | |
4084 | cl_u1_buf_8x spare5_buf_8x (.in(1'b1), | |
4085 | .out(spare5_buf_8x_unused)); | |
4086 | cl_u1_oai22_4x spare5_oai22_4x (.in00(1'b1), | |
4087 | .in01(1'b1), | |
4088 | .in10(1'b1), | |
4089 | .in11(1'b1), | |
4090 | .out(spare5_oai22_4x_unused)); | |
4091 | cl_u1_inv_16x spare5_inv_16x (.in(1'b1), | |
4092 | .out(spare5_inv_16x_unused)); | |
4093 | cl_u1_nand2_16x spare5_nand2_16x (.in0(1'b1), | |
4094 | .in1(1'b1), | |
4095 | .out(spare5_nand2_16x_unused)); | |
4096 | cl_u1_nor3_4x spare5_nor3_4x (.in0(1'b0), | |
4097 | .in1(1'b0), | |
4098 | .in2(1'b0), | |
4099 | .out(spare5_nor3_4x_unused)); | |
4100 | cl_u1_nand2_8x spare5_nand2_8x (.in0(1'b1), | |
4101 | .in1(1'b1), | |
4102 | .out(spare5_nand2_8x_unused)); | |
4103 | cl_u1_buf_16x spare5_buf_16x (.in(1'b1), | |
4104 | .out(spare5_buf_16x_unused)); | |
4105 | cl_u1_nor2_16x spare5_nor2_16x (.in0(1'b0), | |
4106 | .in1(1'b0), | |
4107 | .out(spare5_nor2_16x_unused)); | |
4108 | cl_u1_inv_32x spare5_inv_32x (.in(1'b1), | |
4109 | .out(spare5_inv_32x_unused)); | |
4110 | assign scan_out = so_5; | |
4111 | ||
4112 | ||
4113 | ||
4114 | endmodule | |
4115 |