Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / spc / exu / rtl / exu_rml_ctl.v
CommitLineData
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
50module 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);
136wire pce_ov;
137wire stop;
138wire siclk;
139wire soclk;
140wire se;
141wire l1clk_pm1;
142wire mbist_scanin;
143wire mbist_scanout;
144wire mbi_irf_save_en_p1;
145wire mbi_irf_restore_en_p1;
146wire mbi_run_lth;
147wire mbi_irf_read_en_p1;
148wire [9:0] mbi_addr_lth;
149wire mbi_irf_save_en_p2;
150wire mbi_irf_restore_en_p2;
151wire cwp_trap_scanin;
152wire cwp_trap_scanout;
153wire trap_ccr_cwp_valid;
154wire [1:0] trap_ccr_cwp_tid;
155wire [2:0] trap_cwp;
156wire [31:13] inst;
157wire d_return;
158wire d_save;
159wire d_restore;
160wire d_flushw;
161wire d_saved;
162wire d_restored;
163wire d_allclean;
164wire d_otherw;
165wire d_normalw;
166wire d_invalw;
167wire decoded_inst_d2e_scanin;
168wire decoded_inst_d2e_scanout;
169wire return_e;
170wire save_e;
171wire restore_e;
172wire flushw_e;
173wire saved_e;
174wire restored_e;
175wire allclean_e;
176wire otherw_e;
177wire normalw_e;
178wire invalw_e;
179wire decoded_inst_e2m_scanin;
180wire decoded_inst_e2m_scanout;
181wire return_m;
182wire save_m;
183wire restore_m;
184wire flushw_m;
185wire saved_m;
186wire restored_m;
187wire allclean_m;
188wire otherw_m;
189wire normalw_m;
190wire invalw_m;
191wire decoded_inst_m2b_scanin;
192wire decoded_inst_m2b_scanout;
193wire return_b;
194wire save_b;
195wire restore_b;
196wire saved_b;
197wire restored_b;
198wire allclean_b;
199wire otherw_b;
200wire normalw_b;
201wire invalw_b;
202wire decoded_inst_b2w_scanin;
203wire decoded_inst_b2w_scanout;
204wire return_w;
205wire save_w;
206wire restore_w;
207wire saved_w;
208wire restored_w;
209wire allclean_w;
210wire otherw_w;
211wire normalw_w;
212wire invalw_w;
213wire [3:0] tid4_d;
214wire [1:0] tid_d;
215wire tid_p2d2e2m2b2w_scanin;
216wire tid_p2d2e2m2b2w_scanout;
217wire [1:0] tid_e;
218wire [1:0] tid_m;
219wire [1:0] tid_b;
220wire [1:0] tid_w;
221wire [3:0] tid4_e;
222wire inst_vld_e2m2b2w_scanin;
223wire inst_vld_e2m2b2w_scanout;
224wire inst_vld_e;
225wire inst_vld_m;
226wire inst_vld_b;
227wire inst_vld_noflush_m;
228wire inst_vld_noflush_b;
229wire inst_vld_w;
230wire exception_detected_m;
231wire spill_detected_m;
232wire cleanwin_detected_m;
233wire address_error_detected_m;
234wire exception_detected_m2b_scanin;
235wire exception_detected_m2b_scanout;
236wire exception_detected_b;
237wire flush_exu_b2w_scanin;
238wire flush_exu_b2w_scanout;
239wire flush_exu_w;
240wire dec_flush_w;
241wire cansave_is0_m;
242wire [2:0] cansave_m;
243wire canrestore_is0_m;
244wire [2:0] canrestore_m;
245wire otherwin_is0_m;
246wire [2:0] otherwin_m;
247wire cleanwin4save_is0_m;
248wire [2:0] cleanwin_m;
249wire noflushwin_m;
250wire spill_m;
251wire cleanwin_exception_m;
252wire return_consider_m;
253wire exception_report_m2b_scanin;
254wire exception_report_m2b_scanout;
255wire spill_b;
256wire cleanwin_exception_b;
257wire otherwin_is0_b;
258wire [5:0] wstate_b;
259wire block_wrcwp;
260wire wrcwp_in_play_in;
261wire detected_wrpr_cwp;
262wire wrcwp_in_play;
263wire wrcwp_in_playf_scanin;
264wire wrcwp_in_playf_scanout;
265wire actual_wrpr_cwp;
266wire pr_wt_ff_scanin;
267wire pr_wt_ff_scanout;
268wire actual_wrpr_cwp_d;
269wire actual_wrpr_cwp_e;
270wire pr_wt_m;
271wire trap_ccr_cwp_ff_scanin;
272wire trap_ccr_cwp_ff_scanout;
273wire trap_ccr_cwp_valid_d;
274wire trap_ccr_cwp_valid_e;
275wire trap_ccr_cwp_valid_m;
276wire make_2nd_window_slot;
277wire ack_wrpr_cwp_done;
278wire rd_irf_ecc_valid;
279wire rd_irf_ecc_valid_lth;
280wire [2:0] cwp_dec1_m;
281wire [2:0] cwp_m;
282wire [2:0] cwp_inc1_m;
283wire [2:1] cwp_inc2_m;
284wire [2:0] cwp_inc2_cansave_m;
285wire [1:0] slot_tid_m;
286wire [1:0] wrpr_cwp_tid_hold;
287wire winblock_slot_tid_m2d2e2m_scanin;
288wire winblock_slot_tid_m2d2e2m_scanout;
289wire [1:0] slot_tid_d;
290wire [1:0] slot_tid_e;
291wire [1:0] old_lo_tid_m;
292wire old_lo_fetch_m;
293wire [2:0] cwp_thr0;
294wire [2:0] cwp_thr1;
295wire [2:0] cwp_thr2;
296wire [2:0] cwp_thr3;
297wire [2:0] old_lo_cwp_inc1_m;
298wire old_lo_cwp_inc1_m_unused;
299wire [2:0] slot_old_cwp_inc1_m;
300wire slot_old_cwp_inc1_m_unused;
301wire [2:0] slot_new_cwp_inc1_m;
302wire [2:0] rml_irf_new_lo_cwp_m;
303wire slot_new_cwp_inc1_m_unused;
304wire [2:0] pr_new_cwp_wt;
305wire [2:1] new_e_cwp_m;
306wire i_rml_restore_en_ff_scanin;
307wire i_rml_restore_en_ff_scanout;
308wire [1:0] rml_irf_new_agp;
309wire rml_irf_restore_even_b_ff;
310wire rml_irf_restore_odd_b_ff;
311wire rml_irf_restore_local_b_ff;
312wire rml_irf_restore_global_ff;
313wire [1:0] raw_irf_cwpswap_tid_b;
314wire [2:1] raw_irf_new_e_cwp_b;
315wire [2:0] raw_irf_new_lo_cwp_b;
316wire cwp_update_m;
317wire [1:0] cwp_tid_m;
318wire [2:0] cwp_new_m;
319wire cwp_m2b_scanin;
320wire cwp_m2b_scanout;
321wire [1:0] cwp_tid_b;
322wire [2:0] cwp_new_b;
323wire cwp_update_b;
324wire cwp_update_no_flush_exu_b;
325wire cwp_b2w_scanin;
326wire cwp_b2w_scanout;
327wire [1:0] cwp_tid_w;
328wire [2:0] cwp_new_w;
329wire cwp_update_w;
330wire [2:0] cwp_next_w;
331wire [3:0] cwp_we_w;
332wire [3:0] cwp_pr_we;
333wire [2:0] cwp_thr0_next;
334wire [2:0] cwp_thr1_next;
335wire [2:0] cwp_thr2_next;
336wire [2:0] cwp_thr3_next;
337wire gl_changed_thr0;
338wire [1:0] gl_thr0;
339wire gl_changed_thr1;
340wire [1:0] gl_thr1;
341wire gl_changed_thr2;
342wire [1:0] gl_thr2;
343wire gl_changed_thr3;
344wire [1:0] gl_thr3;
345wire [3:0] gl_we;
346wire [1:0] gl_tid;
347wire gl_changed;
348wire [1:0] gl_thr0_next;
349wire [1:0] gl_thr1_next;
350wire [1:0] gl_thr2_next;
351wire [1:0] gl_thr3_next;
352wire old_gl_ptr_wmr_scanin;
353wire old_gl_ptr_wmr_scanout;
354wire [2:0] cansave_dec1_w;
355wire [2:0] cansave_w;
356wire [2:0] cansave_inc1_w;
357wire [2:0] canrestore_dec1_w;
358wire [2:0] canrestore_w;
359wire [2:0] canrestore_inc1_w;
360wire [2:0] otherwin_dec1_w;
361wire [2:0] otherwin_w;
362wire [2:0] cleanwin_inc1_w;
363wire [2:0] cleanwin_w;
364wire otherwin_is0_w;
365wire cleanwin_is111_w;
366wire cansave_inc_w;
367wire cansave_dec_w;
368wire cansave_reset_w;
369wire cansave_update_w;
370wire [2:0] cansave_next_w;
371wire [3:0] cansave_we_w;
372wire [3:0] cansave_pr_we;
373wire [1:0] pr_tid_ctl;
374wire pr_wt_cansave_ctl;
375wire canrestore_inc_w;
376wire canrestore_dec_w;
377wire canrestore_0_w;
378wire canrestore_otherwin_w;
379wire canrestore_update_w;
380wire [2:0] canrestore_next_w;
381wire [2:0] canrestore_normalwin_data_w;
382wire [2:0] otherwin_thr0;
383wire [2:0] otherwin_thr1;
384wire [2:0] otherwin_thr2;
385wire [2:0] otherwin_thr3;
386wire [3:0] canrestore_we_w;
387wire [3:0] canrestore_pr_we;
388wire pr_wt_canrestore_ctl;
389wire otherwin_dec_w;
390wire otherwin_0_w;
391wire otherwin_canrestore_w;
392wire otherwin_update_w;
393wire [2:0] otherwin_next_w;
394wire [2:0] otherwin_otherw_data_w;
395wire [3:0] otherwin_we_w;
396wire [2:0] canrestore_thr0;
397wire [2:0] canrestore_thr1;
398wire [2:0] canrestore_thr2;
399wire [2:0] canrestore_thr3;
400wire [3:0] otherwin_pr_we;
401wire pr_wt_otherwin_ctl;
402wire cleanwin_inc_w;
403wire cleanwin_reset_w;
404wire cleanwin_update_w;
405wire [2:0] cleanwin_next_w;
406wire [3:0] cleanwin_we_w;
407wire [3:0] cleanwin_pr_we;
408wire pr_wt_cleanwin_ctl;
409wire [3:0] wstate_pr_we;
410wire pr_wt_wstate_ctl;
411wire [3:0] cwp_new_update;
412wire [3:0] cwp_flushed;
413wire [3:0] cwp_oddwin_next;
414wire [3:0] cwp_oddwin_b;
415wire cwp_speculative_scanin;
416wire cwp_speculative_scanout;
417wire [2:0] cansave_thr0_next;
418wire [63:0] data_1f;
419wire [2:0] cansave_thr0;
420wire [2:0] cansave_thr1_next;
421wire [2:0] cansave_thr1;
422wire [2:0] cansave_thr2_next;
423wire [2:0] cansave_thr2;
424wire [2:0] cansave_thr3_next;
425wire [2:0] cansave_thr3;
426wire [2:1] cansave_thr0_next_l;
427wire [2:1] cansave_thr1_next_l;
428wire [2:1] cansave_thr2_next_l;
429wire [2:1] cansave_thr3_next_l;
430wire cansave_pr_wmr_scanin;
431wire cansave_pr_wmr_scanout;
432wire [2:1] cansave_thr0_l;
433wire [2:1] cansave_thr1_l;
434wire [2:1] cansave_thr2_l;
435wire [2:1] cansave_thr3_l;
436wire [2:0] cansave_e;
437wire [2:0] cansave_pr_rd;
438wire cansave_e2m2b2w_scanin;
439wire cansave_e2m2b2w_scanout;
440wire [2:0] cansave_b;
441wire [2:0] canrestore_thr0_next;
442wire [2:0] canrestore_thr1_next;
443wire [2:0] canrestore_thr2_next;
444wire [2:0] canrestore_thr3_next;
445wire canrestore_pr_wmr_scanin;
446wire canrestore_pr_wmr_scanout;
447wire [2:0] canrestore_e;
448wire [2:0] canrestore_pr_rd;
449wire canrestore_e2m2b2w_scanin;
450wire canrestore_e2m2b2w_scanout;
451wire [2:0] canrestore_b;
452wire [2:0] otherwin_thr0_next;
453wire [2:0] otherwin_thr1_next;
454wire [2:0] otherwin_thr2_next;
455wire [2:0] otherwin_thr3_next;
456wire otherwin_pr_wmr_scanin;
457wire otherwin_pr_wmr_scanout;
458wire [2:0] otherwin_e;
459wire [2:0] otherwin_pr_rd;
460wire otherwin_e2m2b2w_scanin;
461wire otherwin_e2m2b2w_scanout;
462wire [2:0] otherwin_b;
463wire [2:0] cleanwin_thr0_next;
464wire [2:0] cleanwin_thr0;
465wire [2:0] cleanwin_thr1_next;
466wire [2:0] cleanwin_thr1;
467wire [2:0] cleanwin_thr2_next;
468wire [2:0] cleanwin_thr2;
469wire [2:0] cleanwin_thr3_next;
470wire [2:0] cleanwin_thr3;
471wire [2:0] cleanwin_thr0_next_l;
472wire [2:0] cleanwin_thr1_next_l;
473wire [2:0] cleanwin_thr2_next_l;
474wire [2:0] cleanwin_thr3_next_l;
475wire cleanwin_pr_wmr_scanin;
476wire cleanwin_pr_wmr_scanout;
477wire [2:0] cleanwin_thr0_l;
478wire [2:0] cleanwin_thr1_l;
479wire [2:0] cleanwin_thr2_l;
480wire [2:0] cleanwin_thr3_l;
481wire [2:0] cleanwin_e;
482wire [2:0] cleanwin_pr_rd;
483wire cleanwin_e2m2b2w_scanin;
484wire cleanwin_e2m2b2w_scanout;
485wire [2:0] cleanwin_b;
486wire [5:0] wstate_thr0_next;
487wire [5:0] wstate_thr0;
488wire [5:0] wstate_thr1_next;
489wire [5:0] wstate_thr1;
490wire [5:0] wstate_thr2_next;
491wire [5:0] wstate_thr2;
492wire [5:0] wstate_thr3_next;
493wire [5:0] wstate_thr3;
494wire wstate_pr_wmr_scanin;
495wire wstate_pr_wmr_scanout;
496wire [5:0] wstate_pr_rd;
497wire cwp_pr_wmr_scanin;
498wire cwp_pr_wmr_scanout;
499wire [2:0] cwp_e;
500wire [2:0] cwp_pr_rd;
501wire cwp_e2m2b2w_scanin;
502wire cwp_e2m2b2w_scanout;
503wire ctl_1f;
504wire pr_relevent;
505wire asr_relevent;
506wire asi_relevent;
507wire detected_empty_pkt;
508wire [1:0] pr_tid;
509wire match_cwp;
510wire match_cansave;
511wire match_canrestore;
512wire match_cleanwin;
513wire match_otherwin;
514wire match_wstate;
515wire match_yreg;
516wire match_ccr;
517wire match_imask;
518wire match_irf_ecc;
519wire pr_rd;
520wire [1:0] send_ack;
521wire [5:0] pr_rd_src;
522wire [5:0] pr_wt_src;
523wire detected_rd_irf_ecc;
524wire [4:0] rd_irf_ecc_addr;
525wire [4:0] pr_addr_ctl;
526wire pipe_rd_irf_ecc_valid_pp2p2d2e_scanin;
527wire pipe_rd_irf_ecc_valid_pp2p2d2e_scanout;
528wire test_valid_p;
529wire ack_irf_ecc_done;
530wire [1:0] wrpr_cwp_tid_next;
531wire save_wrpr_cwp_tid_scanin;
532wire save_wrpr_cwp_tid_scanout;
533wire [1:0] rd_irf_tid_next;
534wire [1:0] rd_irf_tid_hold;
535wire save_rd_irf_tid_scanin;
536wire save_rd_irf_tid_scanout;
537wire pr_wt_cwp_ctl;
538wire [2:0] pr_new_cwp_wt_hold;
539wire save_wrpr_cwp_scanin;
540wire save_wrpr_cwp_scanout;
541wire send_ack_wrpr_cwp;
542wire done_wrpr_cwp_hold;
543wire done_wrpr_cwp;
544wire save_done_wrpr_cwp_scanin;
545wire save_done_wrpr_cwp_scanout;
546wire send_ack_irf_ecc;
547wire done_irf_ecc_hold;
548wire done_irf_ecc;
549wire save_done_irf_ecc_scanin;
550wire save_done_irf_ecc_scanout;
551wire [7:0] irf_ecc_data;
552wire [7:0] irf_ecc_data_hold;
553wire save_irf_ecc_data_scanin;
554wire save_irf_ecc_data_scanout;
555wire pipe_ack_irf_ecc_scanin;
556wire pipe_ack_irf_ecc_scanout;
557wire send_ack_irf_ecc_piped;
558wire [2:0] asr_rd_src;
559wire [2:0] asr_wt_src;
560wire asr_ctl_scanin;
561wire asr_ctl_scanout;
562wire pr_rd_ctl;
563wire [5:0] pr_rd_src_ctl;
564wire asi_rd_imask_ctl;
565wire asr_rd_ccr_ctl;
566wire asr_rd_yreg_ctl;
567wire asi_wt_imask_ctl;
568wire asr_wt_ccr_ctl;
569wire asr_wt_yreg_ctl;
570wire l1clk_pm2;
571wire [3:0] yreg_rng_we;
572wire [3:0] yreg_w_we;
573wire [31:0] arch_yreg_tid0_in;
574wire [31:0] arch_yreg_tid0_ff;
575wire [31:0] arch_yreg_tid1_in;
576wire [31:0] arch_yreg_tid1_ff;
577wire [31:0] arch_yreg_tid2_in;
578wire [31:0] arch_yreg_tid2_ff;
579wire [31:0] arch_yreg_tid3_in;
580wire [31:0] arch_yreg_tid3_ff;
581wire i_yreg0_ff_wmr_scanin;
582wire i_yreg0_ff_wmr_scanout;
583wire i_yreg1_ff_wmr_scanin;
584wire i_yreg1_ff_wmr_scanout;
585wire i_yreg2_ff_wmr_scanin;
586wire i_yreg2_ff_wmr_scanout;
587wire i_yreg3_ff_wmr_scanin;
588wire i_yreg3_ff_wmr_scanout;
589wire spares_scanin;
590wire spares_scanout;
591
592
593// *** Global Inputs ***
594
595input l2clk;
596input scan_in;
597input wmr_scan_in;
598input tcu_pce_ov; // scan signals
599input spc_aclk;
600input spc_bclk;
601input spc_aclk_wmr;
602input tcu_scan_en;
603
604
605input [1:0] dec_tid_p; // thread ID in pick stage
606input [31:13] dec_inst_d; // WARNING: Instruction for full decode
607input dec_valid_e; // Inst is truly valid at e
608input dec_thread_group; // Static Signal : Tie 1 or 0 where cloning
609
610input tlu_flush_exu_b; // FROM TLU : flushes inst in B-stage ===> late signal
611
612input dec_flush_m; // flush signal to invalidate inst in M ===> late signal
613
614input dec_flush_b; // flush signal to invalidate inst in B
615
616input [1:0] tlu_gl_thr0; // FROM TLU : current GL value to update
617input [1:0] tlu_gl_thr1; // FROM TLU : current GL value to update
618input [1:0] tlu_gl_thr2; // FROM TLU : current GL value to update
619input [1:0] tlu_gl_thr3; // FROM TLU : current GL value to update
620
621input tlu_ccr_cwp_valid; // FROM TLU : done/retry CWP updates
622input [1:0] tlu_ccr_cwp_tid; // FROM TLU : done/retry CWP updates
623input [2:0] tlu_cwp; // FROM TLU : done/retry CWP updates
624
625input mbi_run; // MBIST
626input [9:0] mbi_addr; // MBIST
627input mbi_irf_read_en; // MBIST
628input mbi_irf_save_en; // MBIST
629input mbi_irf_restore_en; // MBIST
630
631
632// *** Local Inputs ***
633input [64:0] edp_rng_in_ff; // 65 bit control/data bus to the ASI
634
635input [63:32] edp_rd_ff_w; // Yreg write data
636
637input ect_misaligned_error_m; // assert when last 2 bit of address is non "00"
638
639input ect_yreg_wr_w;
640input [1:0] ect_tid_lth_w;
641
642input exu_lsu_va_error_m; // Address out-of-range
643
644input exu_ecc_m; // exu ecc errors detected
645
646input [7:0] edp_rs3_ecc_e; // ECC syndrom bits for irf_ecc ASI read
647
648input ect_tg_clken; // Power Management
649
650
651
652// *** Global Outputs ***
653
654output [31:0] exu_y_data_e;
655
656output exu_fill_m; // To TLU : report window fill exception
657output exu_spill_b; // To TLU : report window spill exception
658output exu_normal_b; // To TLU : report window spill/fill exception type
659 // (4 signals above: 1 gate after flop
660 // early signals)
661output exu_cleanwin_b; // To TLU : report clean window exception
662 // (straight out of flop, early signal)
663output [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)
667output [2:0] exu_cwp_thr0; // To TLU : Current Window Pointer for thr0
668output [2:0] exu_cwp_thr1; // To TLU : Current Window Pointer for thr1
669output [2:0] exu_cwp_thr2; // To TLU : Current Window Pointer for thr2
670output [2:0] exu_cwp_thr3; // To TLU : Current Window Pointer for thr3
671 // (4 signals above: straight out of flops)
672
673output [3:0] exu_oddwin_b; // To PKU : odd window indicator for 4 thrd
674
675output exu_window_block_m; // create bubble for SWAP signal for IRF
676output exu_tlu_window_block; // create bubble for SWAP signal for IRF
677
678output exu_ecc_winop_flush_m; // To MDP : flush FGU
679 // ADD part of save/restore
680 // in case of exception
681
682
683output exu_test_valid; // To PKU : ASI/BIST read of IRF
684output [1:0] exu_test_tid;
685output [4:0] exu_test_addr;
686
687
688// *** Local Outputs ***
689
690output rml_test_valid_d;
691
692output [5:0] rml_rng_data_out; // Data for PR read
693output [4:0] rml_rng_rd_ctl; // To EDP: Control for selecting PR/ASR read source
694output [1:0] rml_rng_ack_ctl; // To EDP: Control for selecting PR/ASR ack bit
695output [1:0] rml_rng_ack_cwp_tid; // To EDP: CWP write ack tid
696output [1:0] rml_rng_ack_ecc_tid; // To EDP: ECC read ack tid
697output rml_rng_ack_det_vld; // To EDP: Ack valid for deterministic access
698output rml_rng_wt_imask_ctl; // Enable for ASI write to Instruction mask reg
699output rml_rng_wt_ccr_ctl; // Enable for ASR write to CCR
700output [7:0] rml_irf_ecc_data; // To EDP: saved irf ECC data for indet. ASI access
701output rml_rng_ack_sel_ctl; // To EDP: select ack type onto ASI rng
702output [31:0] rml_rng_y_data;
703
704output [1:0] rml_irf_cwpswap_tid_m; // To IRF: local/odd/even reg swap thread ID
705output [2:0] rml_irf_old_lo_cwp_m; // To IRF: old local/odd CWP
706output [2:1] rml_irf_old_e_cwp_m; // To IRF: old even CWP
707
708output [1:0] rml_irf_cwpswap_tid_b; // To IRF: local/odd/even reg swap thread ID
709output [2:0] rml_irf_new_lo_cwp_b; // To IRF: new local/odd CWP
710output [2:1] rml_irf_new_e_cwp_b; // To IRF: old even CWP
711
712output rml_irf_save_even_m; // To IRF: swap enable for even reg
713output rml_irf_save_odd_m; // To IRF: swap enable for odd reg
714output rml_irf_save_local_m; // To IRF: swap enable for local reg
715
716output rml_irf_restore_even_b; // To IRF: swap enable for even reg
717output rml_irf_restore_odd_b; // To IRF: swap enable for odd reg
718output rml_irf_restore_local_b; // To IRF: swap enable for local reg
719
720output [1:0] rml_irf_global_tid; // To IRF: global reg swap thread ID
721output [1:0] rml_irf_global_tid_ff; // To IRF: global reg swap thread ID
722output [1:0] rml_irf_old_agp; // To IRF: old global CWP
723output [1:0] rml_irf_new_agp_ff; // To IRF: new global CWP
724output rml_irf_save_global; // To IRF: swap enable for global reg
725output rml_irf_restore_global; // To IRF: swap enable for global reg
726
727output scan_out;
728output wmr_scan_out;
729
730
731// renames
732assign pce_ov = tcu_pce_ov;
733assign stop = 1'b0;
734assign siclk = spc_aclk;
735assign soclk = spc_bclk;
736assign se = tcu_scan_en;
737
738
739exu_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
754exu_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
779exu_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 !*!*!*!*!*!*!*!*!*!*
830assign inst[31:19] = dec_inst_d[31:19];
831assign inst[13] = dec_inst_d[13];
832
833// *** SAVE/RESTORE ***
834
835assign d_return = (inst[31:30] == 2'b10) & (inst[24:19] == 6'b11_1001);
836assign d_save = (inst[31:30] == 2'b10) & (inst[24:19] == 6'b11_1100);
837assign d_restore = (inst[31:30] == 2'b10) & (inst[24:19] == 6'b11_1101);
838assign d_flushw = (inst[31:30] == 2'b10) & (inst[24:19] == 6'b10_1011) &
839 (inst[13] == 1'b0);
840
841assign d_saved = (inst[31:19] == 13'b10_00000_11_0001);
842assign d_restored = (inst[31:19] == 13'b10_00001_11_0001);
843assign d_allclean = (inst[31:19] == 13'b10_00010_11_0001);
844assign d_otherw = (inst[31:19] == 13'b10_00011_11_0001);
845assign d_normalw = (inst[31:19] == 13'b10_00100_11_0001);
846assign d_invalw = (inst[31:19] == 13'b10_00101_11_0001);
847
848exu_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
857exu_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
866exu_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
875exu_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
916assign 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
918exu_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
927exu_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
936assign inst_vld_e = dec_valid_e;
937assign inst_vld_m = inst_vld_noflush_m & ~dec_flush_m;
938
939
940// Flushing current instruction
941// ------------------------------------------------------
942assign 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
946assign 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
951exu_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
962assign inst_vld_b = inst_vld_noflush_b & ~exception_detected_b & ~tlu_flush_exu_b & ~dec_flush_b;
963
964
965exu_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//
982assign cansave_is0_m = (~cansave_m[2]) & (~cansave_m[1]) &
983 (~cansave_m[0]);
984
985assign canrestore_is0_m = (~canrestore_m[2]) & (~canrestore_m[1]) &
986 (~canrestore_m[0]);
987
988assign otherwin_is0_m = (~otherwin_m[2]) & (~otherwin_m[1]) &
989 (~otherwin_m[0]);
990
991assign cleanwin4save_is0_m = (cleanwin_m[2] ~^ canrestore_m[2]) &
992 (cleanwin_m[1] ~^ canrestore_m[1]) &
993 (cleanwin_m[0] ~^ canrestore_m[0]);
994
995assign 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//
1008assign 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//
1016assign 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//
1024assign 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//
1031assign cleanwin_detected_m = ~exu_ecc_m &
1032 (~cansave_is0_m & cleanwin4save_is0_m &
1033 inst_vld_noflush_m & save_m);
1034
1035assign spill_m = spill_detected_m & ~dec_flush_m;
1036
1037assign 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
1042assign 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//-------------------------------------------------------------
1048exu_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
1057assign exu_cleanwin_b = cleanwin_exception_b;
1058
1059assign exu_spill_b = spill_b;
1060assign exu_normal_b = otherwin_is0_b;
1061
1062assign 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// -------------------------------------------------------------
1093assign block_wrcwp = trap_ccr_cwp_valid | spill_detected_m;
1094
1095assign wrcwp_in_play_in = (detected_wrpr_cwp & block_wrcwp) | (wrcwp_in_play & block_wrcwp);
1096
1097exu_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
1106assign actual_wrpr_cwp = (detected_wrpr_cwp | wrcwp_in_play) & ~block_wrcwp;
1107
1108
1109
1110exu_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
1120exu_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
1130assign make_2nd_window_slot = spill_detected_m | pr_wt_m | trap_ccr_cwp_valid;
1131assign ack_wrpr_cwp_done = pr_wt_m;
1132
1133assign exu_window_block_m = actual_wrpr_cwp | rd_irf_ecc_valid | rd_irf_ecc_valid_lth;
1134assign 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//---------------------------------------------
1203assign cwp_dec1_m[2:0] = cwp_m[2:0] - 3'b001;
1204assign cwp_inc1_m[2:0] = cwp_m[2:0] + 3'b001;
1205assign 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)
1209assign 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
1225assign 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
1233assign 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
1248assign 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
1255exu_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
1279assign 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
1283assign old_lo_fetch_m = trap_ccr_cwp_valid | pr_wt_m;
1284
1285assign 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
1293assign old_lo_cwp_inc1_m[2:0] = rml_irf_old_lo_cwp_m[2:0] + 3'b001;
1294assign old_lo_cwp_inc1_m_unused = old_lo_cwp_inc1_m[0];
1295
1296assign 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
1302assign slot_old_cwp_inc1_m[2:0] = rml_irf_old_lo_cwp_m[2:0] + 3'b001;
1303assign slot_old_cwp_inc1_m_unused = slot_old_cwp_inc1_m[0];
1304
1305assign slot_new_cwp_inc1_m[2:0] = rml_irf_new_lo_cwp_m[2:0] + 3'b001;
1306assign 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
1317assign 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
1333assign 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
1355assign 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
1374assign 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
1390assign 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
1396exu_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
1421assign 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
1425assign 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
1429assign 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
1434assign 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);
1435assign 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);
1436assign 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);
1437assign 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
1446assign cwp_update_m = rml_irf_save_local_m & ~exu_ecc_m;
1447assign cwp_tid_m[1:0] = rml_irf_cwpswap_tid_m[1:0];
1448assign cwp_new_m[2:0] = rml_irf_new_lo_cwp_m[2:0];
1449
1450exu_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
1460assign cwp_update_no_flush_exu_b = cwp_update_b & ~tlu_flush_exu_b & ~dec_flush_b;
1461
1462exu_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
1471assign cwp_next_w[2:0] = cwp_new_w[2:0];
1472
1473assign cwp_we_w[0] = (~cwp_tid_w[1]) & (~cwp_tid_w[0]) & (cwp_update_w);
1474assign cwp_we_w[1] = (~cwp_tid_w[1]) & ( cwp_tid_w[0]) & (cwp_update_w);
1475assign cwp_we_w[2] = ( cwp_tid_w[1]) & (~cwp_tid_w[0]) & (cwp_update_w);
1476assign cwp_we_w[3] = ( cwp_tid_w[1]) & ( cwp_tid_w[0]) & (cwp_update_w);
1477
1478assign cwp_pr_we[0] = (~wrpr_cwp_tid_hold[1]) & (~wrpr_cwp_tid_hold[0]) & (pr_wt_m);
1479assign cwp_pr_we[1] = (~wrpr_cwp_tid_hold[1]) & ( wrpr_cwp_tid_hold[0]) & (pr_wt_m);
1480assign cwp_pr_we[2] = ( wrpr_cwp_tid_hold[1]) & (~wrpr_cwp_tid_hold[0]) & (pr_wt_m);
1481assign cwp_pr_we[3] = ( wrpr_cwp_tid_hold[1]) & ( wrpr_cwp_tid_hold[0]) & (pr_wt_m);
1482
1483assign 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
1487assign 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
1491assign 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
1495assign 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
1507assign gl_changed_thr0 = (tlu_gl_thr0[1]^gl_thr0[1]) | (tlu_gl_thr0[0]^gl_thr0[0]);
1508assign gl_changed_thr1 = (tlu_gl_thr1[1]^gl_thr1[1]) | (tlu_gl_thr1[0]^gl_thr1[0]);
1509assign gl_changed_thr2 = (tlu_gl_thr2[1]^gl_thr2[1]) | (tlu_gl_thr2[0]^gl_thr2[0]);
1510assign gl_changed_thr3 = (tlu_gl_thr3[1]^gl_thr3[1]) | (tlu_gl_thr3[0]^gl_thr3[0]);
1511
1512assign gl_we[0] = gl_changed_thr0;
1513assign gl_we[1] = gl_changed_thr1;
1514assign gl_we[2] = gl_changed_thr2;
1515assign 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
1522assign gl_tid[0] = gl_we[1] | gl_we[3];
1523assign gl_tid[1] = gl_we[2] | gl_we[3];
1524
1525assign gl_changed = gl_changed_thr0 | gl_changed_thr1 | gl_changed_thr2 |
1526 gl_changed_thr3;
1527
1528assign gl_thr0_next[1:0] = ({2{ gl_we[0]}} & tlu_gl_thr0[1:0]) |
1529 ({2{ ~gl_we[0]}} & gl_thr0[1:0]);
1530assign gl_thr1_next[1:0] = ({2{ gl_we[1]}} & tlu_gl_thr1[1:0]) |
1531 ({2{ ~gl_we[1]}} & gl_thr1[1:0]);
1532assign gl_thr2_next[1:0] = ({2{ gl_we[2]}} & tlu_gl_thr2[1:0]) |
1533 ({2{ ~gl_we[2]}} & gl_thr2[1:0]);
1534assign 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
1538exu_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
1557assign rml_irf_save_global = ( ~mbi_run_lth & gl_changed ) |
1558 ( mbi_run_lth & mbi_irf_save_en_p2);
1559
1560assign 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
1563assign 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
1569assign 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
1614assign cansave_dec1_w[2:0] = cansave_w[2:0] - 3'b001;
1615assign cansave_inc1_w[2:0] = cansave_w[2:0] + 3'b001;
1616assign canrestore_dec1_w[2:0] = canrestore_w[2:0] - 3'b001;
1617assign canrestore_inc1_w[2:0] = canrestore_w[2:0] + 3'b001;
1618
1619assign otherwin_dec1_w[2:0] = otherwin_w[2:0] - 3'b001;
1620assign cleanwin_inc1_w[2:0] = cleanwin_w[2:0] + 3'b001;
1621
1622assign otherwin_is0_w = ~(otherwin_w[2] | otherwin_w[1] | otherwin_w[0]);
1623assign 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
1632assign cansave_inc_w = inst_vld_w & (restore_w | saved_w | return_w) ;
1633assign cansave_dec_w = inst_vld_w &
1634 (save_w | (restored_w & otherwin_is0_w));
1635assign cansave_reset_w = inst_vld_w & invalw_w;
1636assign cansave_update_w = cansave_inc_w | cansave_dec_w | cansave_reset_w;
1637
1638assign 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
1643assign cansave_we_w[0] = (tid_w[1:0] == 2'b00) & (cansave_update_w);
1644assign cansave_we_w[1] = (tid_w[1:0] == 2'b01) & (cansave_update_w);
1645assign cansave_we_w[2] = (tid_w[1:0] == 2'b10) & (cansave_update_w);
1646assign cansave_we_w[3] = (tid_w[1:0] == 2'b11) & (cansave_update_w);
1647
1648assign cansave_pr_we[0] = (pr_tid_ctl[1:0] == 2'b00) & (pr_wt_cansave_ctl);
1649assign cansave_pr_we[1] = (pr_tid_ctl[1:0] == 2'b01) & (pr_wt_cansave_ctl);
1650assign cansave_pr_we[2] = (pr_tid_ctl[1:0] == 2'b10) & (pr_wt_cansave_ctl);
1651assign 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
1659assign canrestore_inc_w = inst_vld_w & (save_w | restored_w);
1660assign canrestore_dec_w = inst_vld_w &
1661 (restore_w | (saved_w & otherwin_is0_w) | return_w);
1662assign canrestore_0_w = inst_vld_w & (otherw_w | invalw_w);
1663assign canrestore_otherwin_w = inst_vld_w & normalw_w;
1664assign canrestore_update_w = canrestore_inc_w | canrestore_dec_w |
1665 canrestore_0_w | canrestore_otherwin_w;
1666
1667assign 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
1673assign 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
1678assign canrestore_we_w[0] = (tid_w[1:0] == 2'b00) & (canrestore_update_w);
1679assign canrestore_we_w[1] = (tid_w[1:0] == 2'b01) & (canrestore_update_w);
1680assign canrestore_we_w[2] = (tid_w[1:0] == 2'b10) & (canrestore_update_w);
1681assign canrestore_we_w[3] = (tid_w[1:0] == 2'b11) & (canrestore_update_w);
1682
1683assign canrestore_pr_we[0] = (pr_tid_ctl[1:0] == 2'b00) & (pr_wt_canrestore_ctl);
1684assign canrestore_pr_we[1] = (pr_tid_ctl[1:0] == 2'b01) & (pr_wt_canrestore_ctl);
1685assign canrestore_pr_we[2] = (pr_tid_ctl[1:0] == 2'b10) & (pr_wt_canrestore_ctl);
1686assign canrestore_pr_we[3] = (pr_tid_ctl[1:0] == 2'b11) & (pr_wt_canrestore_ctl);
1687
1688
1689// generate next cycle OTHERWIN values
1690// ---------------------------------------
1691assign otherwin_dec_w = inst_vld_w & (~otherwin_is0_w) &
1692 (saved_w | restored_w);
1693assign otherwin_0_w = inst_vld_w & (normalw_w | invalw_w);
1694assign otherwin_canrestore_w = inst_vld_w & otherw_w;
1695assign otherwin_update_w = otherwin_dec_w | otherwin_0_w | otherwin_canrestore_w;
1696
1697assign 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
1702assign otherwin_we_w[0] = (~tid_w[1]) & (~tid_w[0]) & (otherwin_update_w);
1703assign otherwin_we_w[1] = (~tid_w[1]) & ( tid_w[0]) & (otherwin_update_w);
1704assign otherwin_we_w[2] = ( tid_w[1]) & (~tid_w[0]) & (otherwin_update_w);
1705assign otherwin_we_w[3] = ( tid_w[1]) & ( tid_w[0]) & (otherwin_update_w);
1706
1707assign 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
1712assign otherwin_pr_we[0] = (pr_tid_ctl[1:0] == 2'b00) & (pr_wt_otherwin_ctl);
1713assign otherwin_pr_we[1] = (pr_tid_ctl[1:0] == 2'b01) & (pr_wt_otherwin_ctl);
1714assign otherwin_pr_we[2] = (pr_tid_ctl[1:0] == 2'b10) & (pr_wt_otherwin_ctl);
1715assign otherwin_pr_we[3] = (pr_tid_ctl[1:0] == 2'b11) & (pr_wt_otherwin_ctl);
1716
1717
1718// generate next cycle CLEANWIN values
1719// ---------------------------------------
1720assign cleanwin_inc_w = inst_vld_w & (~cleanwin_is111_w) & restored_w;
1721assign cleanwin_reset_w = inst_vld_w & allclean_w;
1722assign cleanwin_update_w = cleanwin_inc_w | cleanwin_reset_w;
1723
1724assign 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
1728assign cleanwin_we_w[0] = (tid_w[1:0] == 2'b00) & (cleanwin_update_w);
1729assign cleanwin_we_w[1] = (tid_w[1:0] == 2'b01) & (cleanwin_update_w);
1730assign cleanwin_we_w[2] = (tid_w[1:0] == 2'b10) & (cleanwin_update_w);
1731assign cleanwin_we_w[3] = (tid_w[1:0] == 2'b11) & (cleanwin_update_w);
1732
1733assign cleanwin_pr_we[0] = (pr_tid_ctl[1:0] == 2'b00) & (pr_wt_cleanwin_ctl);
1734assign cleanwin_pr_we[1] = (pr_tid_ctl[1:0] == 2'b01) & (pr_wt_cleanwin_ctl);
1735assign cleanwin_pr_we[2] = (pr_tid_ctl[1:0] == 2'b10) & (pr_wt_cleanwin_ctl);
1736assign 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// ---------------------------------------
1742assign wstate_pr_we[0] = (pr_tid_ctl[1:0] == 2'b00) & (pr_wt_wstate_ctl);
1743assign wstate_pr_we[1] = (pr_tid_ctl[1:0] == 2'b01) & (pr_wt_wstate_ctl);
1744assign wstate_pr_we[2] = (pr_tid_ctl[1:0] == 2'b10) & (pr_wt_wstate_ctl);
1745assign 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
1762assign cwp_new_update[0] = cwp_update_m & (~cwp_tid_m[1]) & (~cwp_tid_m[0]);
1763assign cwp_new_update[1] = cwp_update_m & (~cwp_tid_m[1]) & ( cwp_tid_m[0]);
1764assign cwp_new_update[2] = cwp_update_m & ( cwp_tid_m[1]) & (~cwp_tid_m[0]);
1765assign cwp_new_update[3] = cwp_update_m & ( cwp_tid_m[1]) & ( cwp_tid_m[0]);
1766
1767assign cwp_flushed [0] = (flush_exu_w | dec_flush_w) & (~tid_w[1]) & (~tid_w[0]);
1768assign cwp_flushed [1] = (flush_exu_w | dec_flush_w) & (~tid_w[1]) & ( tid_w[0]);
1769assign cwp_flushed [2] = (flush_exu_w | dec_flush_w) & ( tid_w[1]) & (~tid_w[0]);
1770assign cwp_flushed [3] = (flush_exu_w | dec_flush_w) & ( tid_w[1]) & ( tid_w[0]);
1771
1772assign 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
1776assign 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
1780assign 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
1784assign 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
1790exu_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
1799assign 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
1832assign 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
1836assign 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
1840assign 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
1844assign 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
1850assign cansave_thr0_next_l[2:1] = ~cansave_thr0_next[2:1];
1851assign cansave_thr1_next_l[2:1] = ~cansave_thr1_next[2:1];
1852assign cansave_thr2_next_l[2:1] = ~cansave_thr2_next[2:1];
1853assign cansave_thr3_next_l[2:1] = ~cansave_thr3_next[2:1];
1854
1855exu_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
1870assign cansave_thr0[2:1] = ~cansave_thr0_l[2:1];
1871assign cansave_thr1[2:1] = ~cansave_thr1_l[2:1];
1872assign cansave_thr2[2:1] = ~cansave_thr2_l[2:1];
1873assign cansave_thr3[2:1] = ~cansave_thr3_l[2:1];
1874
1875// Output the cansave value of the current thread
1876assign 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
1881assign 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
1886exu_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
1903assign 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
1907assign 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
1911assign 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
1915assign 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
1919exu_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
1935assign 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
1940assign 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
1945exu_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
1962assign 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
1966assign 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
1970assign 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
1974assign 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
1978exu_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
1994assign 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
1999assign 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
2004exu_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
2020assign 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
2024assign 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
2028assign 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
2032assign 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
2039assign cleanwin_thr0_next_l[2:0] = ~cleanwin_thr0_next[2:0];
2040assign cleanwin_thr1_next_l[2:0] = ~cleanwin_thr1_next[2:0];
2041assign cleanwin_thr2_next_l[2:0] = ~cleanwin_thr2_next[2:0];
2042assign cleanwin_thr3_next_l[2:0] = ~cleanwin_thr3_next[2:0];
2043
2044exu_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
2059assign cleanwin_thr0[2:0] = ~cleanwin_thr0_l[2:0];
2060assign cleanwin_thr1[2:0] = ~cleanwin_thr1_l[2:0];
2061assign cleanwin_thr2[2:0] = ~cleanwin_thr2_l[2:0];
2062assign cleanwin_thr3[2:0] = ~cleanwin_thr3_l[2:0];
2063
2064// Output the cleanwin value of the current thread
2065assign 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
2070assign 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
2076exu_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
2092assign 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
2095assign 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
2098assign 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
2101assign 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
2104exu_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
2120assign 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
2126assign 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
2138exu_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
2154assign 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
2159assign 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
2164assign exu_cwp_thr0[2:0] = cwp_thr0[2:0];
2165assign exu_cwp_thr1[2:0] = cwp_thr1[2:0];
2166assign exu_cwp_thr2[2:0] = cwp_thr2[2:0];
2167assign exu_cwp_thr3[2:0] = cwp_thr3[2:0];
2168
2169exu_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// ---------------------------------------------
2218assign data_1f[63:48] = edp_rng_in_ff[63:48];
2219assign data_1f[7:0] = edp_rng_in_ff[7:0];
2220assign 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
2228assign 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
2232assign 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
2236assign 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
2241assign 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
2249assign pr_tid[1:0] = data_1f[(`BUS_TID_END-1):`BUS_TID_ST];
2250
2251assign match_cwp = pr_relevent & (data_1f[52:48]==5'b01001);
2252assign match_cansave = pr_relevent & (data_1f[52:48]==5'b01010);
2253assign match_canrestore = pr_relevent & (data_1f[52:48]==5'b01011);
2254assign match_cleanwin = pr_relevent & (data_1f[52:48]==5'b01100);
2255assign match_otherwin = pr_relevent & (data_1f[52:48]==5'b01101);
2256assign match_wstate = pr_relevent & (data_1f[52:48]==5'b01110);
2257
2258assign match_yreg = asr_relevent & (data_1f[52:48]==5'b00000);
2259assign 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
2264assign match_imask = asi_relevent & (data_1f[55:48] == 8'h42) & data_1f[3];
2265assign match_irf_ecc = asi_relevent & (data_1f[55:48] == 8'h48);
2266
2267assign 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
2275assign 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
2286assign pr_rd_src[0] = ( data_1f[`BUS_RD]) & match_cwp;
2287assign pr_rd_src[1] = ( data_1f[`BUS_RD]) & match_cansave;
2288assign pr_rd_src[2] = ( data_1f[`BUS_RD]) & match_canrestore;
2289assign pr_rd_src[3] = ( data_1f[`BUS_RD]) & match_cleanwin;
2290assign pr_rd_src[4] = ( data_1f[`BUS_RD]) & match_otherwin;
2291assign pr_rd_src[5] = ( data_1f[`BUS_RD]) & match_wstate;
2292
2293assign pr_wt_src[0] = (~data_1f[`BUS_RD]) & match_cwp;
2294assign pr_wt_src[1] = (~data_1f[`BUS_RD]) & match_cansave;
2295assign pr_wt_src[2] = (~data_1f[`BUS_RD]) & match_canrestore;
2296assign pr_wt_src[3] = (~data_1f[`BUS_RD]) & match_cleanwin;
2297assign pr_wt_src[4] = (~data_1f[`BUS_RD]) & match_otherwin;
2298assign pr_wt_src[5] = (~data_1f[`BUS_RD]) & match_wstate;
2299
2300
2301assign detected_wrpr_cwp = pr_wt_src[0];
2302
2303// IRF ECC is a read-only indeterminate write
2304assign detected_rd_irf_ecc = ( data_1f[`BUS_RD]) & match_irf_ecc;
2305
2306
2307// Set rd_irf_ecc controls
2308assign rd_irf_ecc_valid = detected_rd_irf_ecc;
2309assign 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
2314assign exu_test_valid = rd_irf_ecc_valid_lth | mbi_irf_read_en_p1;
2315assign exu_test_tid[1:0] = ({2{~mbi_run_lth}} & pr_tid_ctl[1:0] ) | ({2{mbi_run_lth}} & mbi_addr_lth[6:5]);
2316assign exu_test_addr[4:0] = ({5{~mbi_run_lth}} & pr_addr_ctl[4:0] ) | ({5{mbi_run_lth}} & mbi_addr_lth[4:0]);
2317
2318exu_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
2333assign 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
2336exu_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
2350assign 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
2353exu_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
2367assign 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
2370exu_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// ---------------------------------------------
2383assign send_ack_wrpr_cwp = (ack_wrpr_cwp_done & detected_empty_pkt) |
2384 (done_wrpr_cwp_hold & detected_empty_pkt) ;
2385
2386assign done_wrpr_cwp = (~send_ack_wrpr_cwp) &
2387 ( ack_wrpr_cwp_done | done_wrpr_cwp_hold);
2388
2389exu_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
2398assign 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
2406assign 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
2410assign done_irf_ecc = (~send_ack_irf_ecc) &
2411 ( ack_irf_ecc_done | done_irf_ecc_hold);
2412
2413exu_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
2422assign 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
2425exu_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
2434exu_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
2444assign rml_irf_ecc_data[7:0] = irf_ecc_data[7:0];
2445
2446assign 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// ---------------------------------------------
2452assign asr_rd_src[0] = ( data_1f[`BUS_RD]) & match_yreg;
2453assign asr_rd_src[1] = ( data_1f[`BUS_RD]) & match_ccr;
2454assign asr_rd_src[2] = ( data_1f[`BUS_RD]) & match_imask;
2455
2456assign asr_wt_src[0] = (~data_1f[`BUS_RD]) & match_yreg;
2457assign asr_wt_src[1] = (~data_1f[`BUS_RD]) & match_ccr;
2458assign asr_wt_src[2] = (~data_1f[`BUS_RD]) & match_imask;
2459
2460// Flop controls for the next data packet
2461exu_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
2499assign 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
2506assign rml_rng_data_out[5:3] = ({3{pr_rd_src_ctl[5]}} & wstate_pr_rd[5:3]);
2507
2508assign rml_rng_wt_imask_ctl = asi_wt_imask_ctl;
2509assign rml_rng_wt_ccr_ctl = asr_wt_ccr_ctl;
2510assign 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
2512assign rml_rng_ack_ctl[1:0] = send_ack[1:0];
2513assign rml_rng_ack_cwp_tid[1:0] = wrpr_cwp_tid_hold[1:0];
2514assign rml_rng_ack_ecc_tid[1:0] = rd_irf_tid_hold[1:0];
2515
2516assign rml_rng_ack_det_vld = ~detected_wrpr_cwp & ~detected_rd_irf_ecc;
2517
2518
2519
2520
2521
2522
2523//!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*! Start : Y Register !*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!
2524
2525
2526exu_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
2534assign yreg_rng_we[0] = asr_wt_yreg_ctl & (pr_tid_ctl[1:0] == 2'b00);
2535assign yreg_rng_we[1] = asr_wt_yreg_ctl & (pr_tid_ctl[1:0] == 2'b01);
2536assign yreg_rng_we[2] = asr_wt_yreg_ctl & (pr_tid_ctl[1:0] == 2'b10);
2537assign yreg_rng_we[3] = asr_wt_yreg_ctl & (pr_tid_ctl[1:0] == 2'b11);
2538
2539assign yreg_w_we[0] = ect_yreg_wr_w & (ect_tid_lth_w[1:0] == 2'b00);
2540assign yreg_w_we[1] = ect_yreg_wr_w & (ect_tid_lth_w[1:0] == 2'b01);
2541assign yreg_w_we[2] = ect_yreg_wr_w & (ect_tid_lth_w[1:0] == 2'b10);
2542assign yreg_w_we[3] = ect_yreg_wr_w & (ect_tid_lth_w[1:0] == 2'b11);
2543
2544
2545assign 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
2549assign 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
2553assign 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
2557assign 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
2562exu_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
2571exu_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
2580exu_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
2589exu_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
2599assign 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
2604assign 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
2613exu_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
2622supply0 vss;
2623supply1 vdd;
2624
2625// fixscan start:
2626assign mbist_scanin = scan_in ;
2627assign cwp_trap_scanin = mbist_scanout ;
2628assign decoded_inst_d2e_scanin = cwp_trap_scanout ;
2629assign decoded_inst_e2m_scanin = decoded_inst_d2e_scanout ;
2630assign decoded_inst_m2b_scanin = decoded_inst_e2m_scanout ;
2631assign decoded_inst_b2w_scanin = decoded_inst_m2b_scanout ;
2632assign tid_p2d2e2m2b2w_scanin = decoded_inst_b2w_scanout ;
2633assign inst_vld_e2m2b2w_scanin = tid_p2d2e2m2b2w_scanout ;
2634assign exception_detected_m2b_scanin = inst_vld_e2m2b2w_scanout ;
2635assign flush_exu_b2w_scanin = exception_detected_m2b_scanout;
2636assign exception_report_m2b_scanin = flush_exu_b2w_scanout ;
2637assign wrcwp_in_playf_scanin = exception_report_m2b_scanout;
2638assign pr_wt_ff_scanin = wrcwp_in_playf_scanout ;
2639assign trap_ccr_cwp_ff_scanin = pr_wt_ff_scanout ;
2640assign winblock_slot_tid_m2d2e2m_scanin = trap_ccr_cwp_ff_scanout ;
2641assign i_rml_restore_en_ff_scanin = winblock_slot_tid_m2d2e2m_scanout;
2642assign cwp_m2b_scanin = i_rml_restore_en_ff_scanout;
2643assign cwp_b2w_scanin = cwp_m2b_scanout ;
2644assign cwp_speculative_scanin = cwp_b2w_scanout ;
2645assign cansave_e2m2b2w_scanin = cwp_speculative_scanout ;
2646assign canrestore_e2m2b2w_scanin = cansave_e2m2b2w_scanout ;
2647assign otherwin_e2m2b2w_scanin = canrestore_e2m2b2w_scanout;
2648assign cleanwin_e2m2b2w_scanin = otherwin_e2m2b2w_scanout ;
2649assign cwp_e2m2b2w_scanin = cleanwin_e2m2b2w_scanout ;
2650assign pipe_rd_irf_ecc_valid_pp2p2d2e_scanin = cwp_e2m2b2w_scanout ;
2651assign save_wrpr_cwp_tid_scanin = pipe_rd_irf_ecc_valid_pp2p2d2e_scanout;
2652assign save_rd_irf_tid_scanin = save_wrpr_cwp_tid_scanout;
2653assign save_wrpr_cwp_scanin = save_rd_irf_tid_scanout ;
2654assign save_done_wrpr_cwp_scanin = save_wrpr_cwp_scanout ;
2655assign save_done_irf_ecc_scanin = save_done_wrpr_cwp_scanout;
2656assign save_irf_ecc_data_scanin = save_done_irf_ecc_scanout;
2657assign pipe_ack_irf_ecc_scanin = save_irf_ecc_data_scanout;
2658assign asr_ctl_scanin = pipe_ack_irf_ecc_scanout ;
2659assign spares_scanin = asr_ctl_scanout ;
2660assign scan_out = spares_scanout ;
2661
2662assign old_gl_ptr_wmr_scanin = wmr_scan_in ;
2663assign cansave_pr_wmr_scanin = old_gl_ptr_wmr_scanout ;
2664assign canrestore_pr_wmr_scanin = cansave_pr_wmr_scanout ;
2665assign otherwin_pr_wmr_scanin = canrestore_pr_wmr_scanout;
2666assign cleanwin_pr_wmr_scanin = otherwin_pr_wmr_scanout ;
2667assign wstate_pr_wmr_scanin = cleanwin_pr_wmr_scanout ;
2668assign cwp_pr_wmr_scanin = wstate_pr_wmr_scanout ;
2669assign i_yreg0_ff_wmr_scanin = cwp_pr_wmr_scanout ;
2670assign i_yreg1_ff_wmr_scanin = i_yreg0_ff_wmr_scanout ;
2671assign i_yreg2_ff_wmr_scanin = i_yreg1_ff_wmr_scanout ;
2672assign i_yreg3_ff_wmr_scanin = i_yreg2_ff_wmr_scanout ;
2673assign wmr_scan_out = i_yreg3_ff_wmr_scanout ;
2674// fixscan end:
2675endmodule
2676
2677
2678
2679
2680
2681
2682// any PARAMS parms go into naming of macro
2683
2684module 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
2704cl_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
2717endmodule
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731// any PARAMS parms go into naming of macro
2732
2733module exu_rml_ctl_msff_ctl_macro__width_16 (
2734 din,
2735 l1clk,
2736 scan_in,
2737 siclk,
2738 soclk,
2739 dout,
2740 scan_out);
2741wire [15:0] fdin;
2742wire [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;
2754assign fdin[15:0] = din[15:0];
2755
2756
2757
2758
2759
2760
2761dff #(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
2782endmodule
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796// any PARAMS parms go into naming of macro
2797
2798module exu_rml_ctl_msff_ctl_macro__width_6 (
2799 din,
2800 l1clk,
2801 scan_in,
2802 siclk,
2803 soclk,
2804 dout,
2805 scan_out);
2806wire [5:0] fdin;
2807wire [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;
2819assign fdin[5:0] = din[5:0];
2820
2821
2822
2823
2824
2825
2826dff #(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
2847endmodule
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861// any PARAMS parms go into naming of macro
2862
2863module exu_rml_ctl_msff_ctl_macro__width_10 (
2864 din,
2865 l1clk,
2866 scan_in,
2867 siclk,
2868 soclk,
2869 dout,
2870 scan_out);
2871wire [9:0] fdin;
2872wire [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;
2884assign fdin[9:0] = din[9:0];
2885
2886
2887
2888
2889
2890
2891dff #(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
2912endmodule
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926// any PARAMS parms go into naming of macro
2927
2928module exu_rml_ctl_msff_ctl_macro__width_9 (
2929 din,
2930 l1clk,
2931 scan_in,
2932 siclk,
2933 soclk,
2934 dout,
2935 scan_out);
2936wire [8:0] fdin;
2937wire [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;
2949assign fdin[8:0] = din[8:0];
2950
2951
2952
2953
2954
2955
2956dff #(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
2977endmodule
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991// any PARAMS parms go into naming of macro
2992
2993module exu_rml_ctl_msff_ctl_macro__width_14 (
2994 din,
2995 l1clk,
2996 scan_in,
2997 siclk,
2998 soclk,
2999 dout,
3000 scan_out);
3001wire [13:0] fdin;
3002wire [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;
3014assign fdin[13:0] = din[13:0];
3015
3016
3017
3018
3019
3020
3021dff #(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
3042endmodule
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056// any PARAMS parms go into naming of macro
3057
3058module exu_rml_ctl_msff_ctl_macro__width_3 (
3059 din,
3060 l1clk,
3061 scan_in,
3062 siclk,
3063 soclk,
3064 dout,
3065 scan_out);
3066wire [2:0] fdin;
3067wire [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;
3079assign fdin[2:0] = din[2:0];
3080
3081
3082
3083
3084
3085
3086dff #(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
3107endmodule
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121// any PARAMS parms go into naming of macro
3122
3123module exu_rml_ctl_msff_ctl_macro__width_1 (
3124 din,
3125 l1clk,
3126 scan_in,
3127 siclk,
3128 soclk,
3129 dout,
3130 scan_out);
3131wire [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;
3143assign fdin[0:0] = din[0:0];
3144
3145
3146
3147
3148
3149
3150dff #(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
3171endmodule
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185// any PARAMS parms go into naming of macro
3186
3187module exu_rml_ctl_msff_ctl_macro__width_2 (
3188 din,
3189 l1clk,
3190 scan_in,
3191 siclk,
3192 soclk,
3193 dout,
3194 scan_out);
3195wire [1:0] fdin;
3196wire [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;
3208assign fdin[1:0] = din[1:0];
3209
3210
3211
3212
3213
3214
3215dff #(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
3236endmodule
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250// any PARAMS parms go into naming of macro
3251
3252module exu_rml_ctl_msff_ctl_macro__width_15 (
3253 din,
3254 l1clk,
3255 scan_in,
3256 siclk,
3257 soclk,
3258 dout,
3259 scan_out);
3260wire [14:0] fdin;
3261wire [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;
3273assign fdin[14:0] = din[14:0];
3274
3275
3276
3277
3278
3279
3280dff #(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
3301endmodule
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315// any PARAMS parms go into naming of macro
3316
3317module exu_rml_ctl_msff_ctl_macro__width_8 (
3318 din,
3319 l1clk,
3320 scan_in,
3321 siclk,
3322 soclk,
3323 dout,
3324 scan_out);
3325wire [7:0] fdin;
3326wire [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;
3338assign fdin[7:0] = din[7:0];
3339
3340
3341
3342
3343
3344
3345dff #(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
3366endmodule
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380// any PARAMS parms go into naming of macro
3381
3382module exu_rml_ctl_msff_ctl_macro__width_4 (
3383 din,
3384 l1clk,
3385 scan_in,
3386 siclk,
3387 soclk,
3388 dout,
3389 scan_out);
3390wire [3:0] fdin;
3391wire [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;
3403assign fdin[3:0] = din[3:0];
3404
3405
3406
3407
3408
3409
3410dff #(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
3431endmodule
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445// any PARAMS parms go into naming of macro
3446
3447module exu_rml_ctl_msff_ctl_macro__width_12 (
3448 din,
3449 l1clk,
3450 scan_in,
3451 siclk,
3452 soclk,
3453 dout,
3454 scan_out);
3455wire [11:0] fdin;
3456wire [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;
3468assign fdin[11:0] = din[11:0];
3469
3470
3471
3472
3473
3474
3475dff #(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
3496endmodule
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510// any PARAMS parms go into naming of macro
3511
3512module exu_rml_ctl_msff_ctl_macro__width_24 (
3513 din,
3514 l1clk,
3515 scan_in,
3516 siclk,
3517 soclk,
3518 dout,
3519 scan_out);
3520wire [23:0] fdin;
3521wire [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;
3533assign fdin[23:0] = din[23:0];
3534
3535
3536
3537
3538
3539
3540dff #(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
3561endmodule
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575// any PARAMS parms go into naming of macro
3576
3577module exu_rml_ctl_msff_ctl_macro__width_26 (
3578 din,
3579 l1clk,
3580 scan_in,
3581 siclk,
3582 soclk,
3583 dout,
3584 scan_out);
3585wire [25:0] fdin;
3586wire [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;
3598assign fdin[25:0] = din[25:0];
3599
3600
3601
3602
3603
3604
3605dff #(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
3626endmodule
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640// any PARAMS parms go into naming of macro
3641
3642module exu_rml_ctl_msff_ctl_macro__width_32 (
3643 din,
3644 l1clk,
3645 scan_in,
3646 siclk,
3647 soclk,
3648 dout,
3649 scan_out);
3650wire [31:0] fdin;
3651wire [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;
3663assign fdin[31:0] = din[31:0];
3664
3665
3666
3667
3668
3669
3670dff #(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
3691endmodule
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
3707module exu_rml_ctl_spare_ctl_macro__num_6 (
3708 l1clk,
3709 scan_in,
3710 siclk,
3711 soclk,
3712 scan_out);
3713wire si_0;
3714wire so_0;
3715wire spare0_flop_unused;
3716wire spare0_buf_32x_unused;
3717wire spare0_nand3_8x_unused;
3718wire spare0_inv_8x_unused;
3719wire spare0_aoi22_4x_unused;
3720wire spare0_buf_8x_unused;
3721wire spare0_oai22_4x_unused;
3722wire spare0_inv_16x_unused;
3723wire spare0_nand2_16x_unused;
3724wire spare0_nor3_4x_unused;
3725wire spare0_nand2_8x_unused;
3726wire spare0_buf_16x_unused;
3727wire spare0_nor2_16x_unused;
3728wire spare0_inv_32x_unused;
3729wire si_1;
3730wire so_1;
3731wire spare1_flop_unused;
3732wire spare1_buf_32x_unused;
3733wire spare1_nand3_8x_unused;
3734wire spare1_inv_8x_unused;
3735wire spare1_aoi22_4x_unused;
3736wire spare1_buf_8x_unused;
3737wire spare1_oai22_4x_unused;
3738wire spare1_inv_16x_unused;
3739wire spare1_nand2_16x_unused;
3740wire spare1_nor3_4x_unused;
3741wire spare1_nand2_8x_unused;
3742wire spare1_buf_16x_unused;
3743wire spare1_nor2_16x_unused;
3744wire spare1_inv_32x_unused;
3745wire si_2;
3746wire so_2;
3747wire spare2_flop_unused;
3748wire spare2_buf_32x_unused;
3749wire spare2_nand3_8x_unused;
3750wire spare2_inv_8x_unused;
3751wire spare2_aoi22_4x_unused;
3752wire spare2_buf_8x_unused;
3753wire spare2_oai22_4x_unused;
3754wire spare2_inv_16x_unused;
3755wire spare2_nand2_16x_unused;
3756wire spare2_nor3_4x_unused;
3757wire spare2_nand2_8x_unused;
3758wire spare2_buf_16x_unused;
3759wire spare2_nor2_16x_unused;
3760wire spare2_inv_32x_unused;
3761wire si_3;
3762wire so_3;
3763wire spare3_flop_unused;
3764wire spare3_buf_32x_unused;
3765wire spare3_nand3_8x_unused;
3766wire spare3_inv_8x_unused;
3767wire spare3_aoi22_4x_unused;
3768wire spare3_buf_8x_unused;
3769wire spare3_oai22_4x_unused;
3770wire spare3_inv_16x_unused;
3771wire spare3_nand2_16x_unused;
3772wire spare3_nor3_4x_unused;
3773wire spare3_nand2_8x_unused;
3774wire spare3_buf_16x_unused;
3775wire spare3_nor2_16x_unused;
3776wire spare3_inv_32x_unused;
3777wire si_4;
3778wire so_4;
3779wire spare4_flop_unused;
3780wire spare4_buf_32x_unused;
3781wire spare4_nand3_8x_unused;
3782wire spare4_inv_8x_unused;
3783wire spare4_aoi22_4x_unused;
3784wire spare4_buf_8x_unused;
3785wire spare4_oai22_4x_unused;
3786wire spare4_inv_16x_unused;
3787wire spare4_nand2_16x_unused;
3788wire spare4_nor3_4x_unused;
3789wire spare4_nand2_8x_unused;
3790wire spare4_buf_16x_unused;
3791wire spare4_nor2_16x_unused;
3792wire spare4_inv_32x_unused;
3793wire si_5;
3794wire so_5;
3795wire spare5_flop_unused;
3796wire spare5_buf_32x_unused;
3797wire spare5_nand3_8x_unused;
3798wire spare5_inv_8x_unused;
3799wire spare5_aoi22_4x_unused;
3800wire spare5_buf_8x_unused;
3801wire spare5_oai22_4x_unused;
3802wire spare5_inv_16x_unused;
3803wire spare5_nand2_16x_unused;
3804wire spare5_nor3_4x_unused;
3805wire spare5_nand2_8x_unused;
3806wire spare5_buf_16x_unused;
3807wire spare5_nor2_16x_unused;
3808wire spare5_inv_32x_unused;
3809
3810
3811input l1clk;
3812input scan_in;
3813input siclk;
3814input soclk;
3815output scan_out;
3816
3817cl_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));
3824assign si_0 = scan_in;
3825
3826cl_u1_buf_32x spare0_buf_32x (.in(1'b1),
3827 .out(spare0_buf_32x_unused));
3828cl_u1_nand3_8x spare0_nand3_8x (.in0(1'b1),
3829 .in1(1'b1),
3830 .in2(1'b1),
3831 .out(spare0_nand3_8x_unused));
3832cl_u1_inv_8x spare0_inv_8x (.in(1'b1),
3833 .out(spare0_inv_8x_unused));
3834cl_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));
3839cl_u1_buf_8x spare0_buf_8x (.in(1'b1),
3840 .out(spare0_buf_8x_unused));
3841cl_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));
3846cl_u1_inv_16x spare0_inv_16x (.in(1'b1),
3847 .out(spare0_inv_16x_unused));
3848cl_u1_nand2_16x spare0_nand2_16x (.in0(1'b1),
3849 .in1(1'b1),
3850 .out(spare0_nand2_16x_unused));
3851cl_u1_nor3_4x spare0_nor3_4x (.in0(1'b0),
3852 .in1(1'b0),
3853 .in2(1'b0),
3854 .out(spare0_nor3_4x_unused));
3855cl_u1_nand2_8x spare0_nand2_8x (.in0(1'b1),
3856 .in1(1'b1),
3857 .out(spare0_nand2_8x_unused));
3858cl_u1_buf_16x spare0_buf_16x (.in(1'b1),
3859 .out(spare0_buf_16x_unused));
3860cl_u1_nor2_16x spare0_nor2_16x (.in0(1'b0),
3861 .in1(1'b0),
3862 .out(spare0_nor2_16x_unused));
3863cl_u1_inv_32x spare0_inv_32x (.in(1'b1),
3864 .out(spare0_inv_32x_unused));
3865
3866cl_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));
3873assign si_1 = so_0;
3874
3875cl_u1_buf_32x spare1_buf_32x (.in(1'b1),
3876 .out(spare1_buf_32x_unused));
3877cl_u1_nand3_8x spare1_nand3_8x (.in0(1'b1),
3878 .in1(1'b1),
3879 .in2(1'b1),
3880 .out(spare1_nand3_8x_unused));
3881cl_u1_inv_8x spare1_inv_8x (.in(1'b1),
3882 .out(spare1_inv_8x_unused));
3883cl_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));
3888cl_u1_buf_8x spare1_buf_8x (.in(1'b1),
3889 .out(spare1_buf_8x_unused));
3890cl_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));
3895cl_u1_inv_16x spare1_inv_16x (.in(1'b1),
3896 .out(spare1_inv_16x_unused));
3897cl_u1_nand2_16x spare1_nand2_16x (.in0(1'b1),
3898 .in1(1'b1),
3899 .out(spare1_nand2_16x_unused));
3900cl_u1_nor3_4x spare1_nor3_4x (.in0(1'b0),
3901 .in1(1'b0),
3902 .in2(1'b0),
3903 .out(spare1_nor3_4x_unused));
3904cl_u1_nand2_8x spare1_nand2_8x (.in0(1'b1),
3905 .in1(1'b1),
3906 .out(spare1_nand2_8x_unused));
3907cl_u1_buf_16x spare1_buf_16x (.in(1'b1),
3908 .out(spare1_buf_16x_unused));
3909cl_u1_nor2_16x spare1_nor2_16x (.in0(1'b0),
3910 .in1(1'b0),
3911 .out(spare1_nor2_16x_unused));
3912cl_u1_inv_32x spare1_inv_32x (.in(1'b1),
3913 .out(spare1_inv_32x_unused));
3914
3915cl_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));
3922assign si_2 = so_1;
3923
3924cl_u1_buf_32x spare2_buf_32x (.in(1'b1),
3925 .out(spare2_buf_32x_unused));
3926cl_u1_nand3_8x spare2_nand3_8x (.in0(1'b1),
3927 .in1(1'b1),
3928 .in2(1'b1),
3929 .out(spare2_nand3_8x_unused));
3930cl_u1_inv_8x spare2_inv_8x (.in(1'b1),
3931 .out(spare2_inv_8x_unused));
3932cl_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));
3937cl_u1_buf_8x spare2_buf_8x (.in(1'b1),
3938 .out(spare2_buf_8x_unused));
3939cl_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));
3944cl_u1_inv_16x spare2_inv_16x (.in(1'b1),
3945 .out(spare2_inv_16x_unused));
3946cl_u1_nand2_16x spare2_nand2_16x (.in0(1'b1),
3947 .in1(1'b1),
3948 .out(spare2_nand2_16x_unused));
3949cl_u1_nor3_4x spare2_nor3_4x (.in0(1'b0),
3950 .in1(1'b0),
3951 .in2(1'b0),
3952 .out(spare2_nor3_4x_unused));
3953cl_u1_nand2_8x spare2_nand2_8x (.in0(1'b1),
3954 .in1(1'b1),
3955 .out(spare2_nand2_8x_unused));
3956cl_u1_buf_16x spare2_buf_16x (.in(1'b1),
3957 .out(spare2_buf_16x_unused));
3958cl_u1_nor2_16x spare2_nor2_16x (.in0(1'b0),
3959 .in1(1'b0),
3960 .out(spare2_nor2_16x_unused));
3961cl_u1_inv_32x spare2_inv_32x (.in(1'b1),
3962 .out(spare2_inv_32x_unused));
3963
3964cl_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));
3971assign si_3 = so_2;
3972
3973cl_u1_buf_32x spare3_buf_32x (.in(1'b1),
3974 .out(spare3_buf_32x_unused));
3975cl_u1_nand3_8x spare3_nand3_8x (.in0(1'b1),
3976 .in1(1'b1),
3977 .in2(1'b1),
3978 .out(spare3_nand3_8x_unused));
3979cl_u1_inv_8x spare3_inv_8x (.in(1'b1),
3980 .out(spare3_inv_8x_unused));
3981cl_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));
3986cl_u1_buf_8x spare3_buf_8x (.in(1'b1),
3987 .out(spare3_buf_8x_unused));
3988cl_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));
3993cl_u1_inv_16x spare3_inv_16x (.in(1'b1),
3994 .out(spare3_inv_16x_unused));
3995cl_u1_nand2_16x spare3_nand2_16x (.in0(1'b1),
3996 .in1(1'b1),
3997 .out(spare3_nand2_16x_unused));
3998cl_u1_nor3_4x spare3_nor3_4x (.in0(1'b0),
3999 .in1(1'b0),
4000 .in2(1'b0),
4001 .out(spare3_nor3_4x_unused));
4002cl_u1_nand2_8x spare3_nand2_8x (.in0(1'b1),
4003 .in1(1'b1),
4004 .out(spare3_nand2_8x_unused));
4005cl_u1_buf_16x spare3_buf_16x (.in(1'b1),
4006 .out(spare3_buf_16x_unused));
4007cl_u1_nor2_16x spare3_nor2_16x (.in0(1'b0),
4008 .in1(1'b0),
4009 .out(spare3_nor2_16x_unused));
4010cl_u1_inv_32x spare3_inv_32x (.in(1'b1),
4011 .out(spare3_inv_32x_unused));
4012
4013cl_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));
4020assign si_4 = so_3;
4021
4022cl_u1_buf_32x spare4_buf_32x (.in(1'b1),
4023 .out(spare4_buf_32x_unused));
4024cl_u1_nand3_8x spare4_nand3_8x (.in0(1'b1),
4025 .in1(1'b1),
4026 .in2(1'b1),
4027 .out(spare4_nand3_8x_unused));
4028cl_u1_inv_8x spare4_inv_8x (.in(1'b1),
4029 .out(spare4_inv_8x_unused));
4030cl_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));
4035cl_u1_buf_8x spare4_buf_8x (.in(1'b1),
4036 .out(spare4_buf_8x_unused));
4037cl_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));
4042cl_u1_inv_16x spare4_inv_16x (.in(1'b1),
4043 .out(spare4_inv_16x_unused));
4044cl_u1_nand2_16x spare4_nand2_16x (.in0(1'b1),
4045 .in1(1'b1),
4046 .out(spare4_nand2_16x_unused));
4047cl_u1_nor3_4x spare4_nor3_4x (.in0(1'b0),
4048 .in1(1'b0),
4049 .in2(1'b0),
4050 .out(spare4_nor3_4x_unused));
4051cl_u1_nand2_8x spare4_nand2_8x (.in0(1'b1),
4052 .in1(1'b1),
4053 .out(spare4_nand2_8x_unused));
4054cl_u1_buf_16x spare4_buf_16x (.in(1'b1),
4055 .out(spare4_buf_16x_unused));
4056cl_u1_nor2_16x spare4_nor2_16x (.in0(1'b0),
4057 .in1(1'b0),
4058 .out(spare4_nor2_16x_unused));
4059cl_u1_inv_32x spare4_inv_32x (.in(1'b1),
4060 .out(spare4_inv_32x_unused));
4061
4062cl_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));
4069assign si_5 = so_4;
4070
4071cl_u1_buf_32x spare5_buf_32x (.in(1'b1),
4072 .out(spare5_buf_32x_unused));
4073cl_u1_nand3_8x spare5_nand3_8x (.in0(1'b1),
4074 .in1(1'b1),
4075 .in2(1'b1),
4076 .out(spare5_nand3_8x_unused));
4077cl_u1_inv_8x spare5_inv_8x (.in(1'b1),
4078 .out(spare5_inv_8x_unused));
4079cl_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));
4084cl_u1_buf_8x spare5_buf_8x (.in(1'b1),
4085 .out(spare5_buf_8x_unused));
4086cl_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));
4091cl_u1_inv_16x spare5_inv_16x (.in(1'b1),
4092 .out(spare5_inv_16x_unused));
4093cl_u1_nand2_16x spare5_nand2_16x (.in0(1'b1),
4094 .in1(1'b1),
4095 .out(spare5_nand2_16x_unused));
4096cl_u1_nor3_4x spare5_nor3_4x (.in0(1'b0),
4097 .in1(1'b0),
4098 .in2(1'b0),
4099 .out(spare5_nor3_4x_unused));
4100cl_u1_nand2_8x spare5_nand2_8x (.in0(1'b1),
4101 .in1(1'b1),
4102 .out(spare5_nand2_8x_unused));
4103cl_u1_buf_16x spare5_buf_16x (.in(1'b1),
4104 .out(spare5_buf_16x_unused));
4105cl_u1_nor2_16x spare5_nor2_16x (.in0(1'b0),
4106 .in1(1'b0),
4107 .out(spare5_nor2_16x_unused));
4108cl_u1_inv_32x spare5_inv_32x (.in(1'b1),
4109 .out(spare5_inv_32x_unused));
4110assign scan_out = so_5;
4111
4112
4113
4114endmodule
4115