Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / spc / fgu / rtl / fgu_fac_ctl.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: fgu_fac_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 ============================================
35module fgu_fac_ctl (
36 dec_frf_r1_addr_d,
37 dec_frf_r1_vld_d,
38 dec_frf_r2_vld_d,
39 dec_frf_r1_32b_d,
40 dec_frf_r2_32b_d,
41 dec_frf_r1_odd32b_d,
42 dec_frf_r2_odd32b_d,
43 dec_frf_w_vld_d,
44 dec_frf_w_addr_d,
45 dec_frf_w_32b_d,
46 dec_frf_w_odd32b_d,
47 dec_fgu_valid_e,
48 dec_exu_src_vld_d,
49 dec_irf_w_addr_d,
50 dec_spu_grant_d,
51 dec_frf_store_d,
52 dec_fsr_store_d,
53 dec_flush_f1,
54 dec_flush_f2,
55 dec_fgu_op3_d,
56 dec_fgu_opf_d,
57 dec_fgu_decode_d,
58 dec_fgu_tid_d,
59 fgu_cmp_fcc_tid_fx2,
60 fgu_fld_fcc_vld_fx3,
61 fgu_fprs_fef,
62 fgu_divide_completion,
63 tlu_flush_fgu_b,
64 tlu_ceter_pscce,
65 tlu_cerer_frf,
66 spc_core_running_status,
67 fgu_fpx_trap_tid_fw,
68 fgu_fpd_trap_tid_fw,
69 fpc_pre_div_flush_fx2,
70 fpc_div_default_res_fx2,
71 fpc_fsr_w1_vld_fx5,
72 fpc_fcc_vld_fx5,
73 fpc_fpx_unfin_fb,
74 fpc_fpd_unfin_fb,
75 fpc_stfsr_en_fx3to5,
76 fac_tlu_flush_fx3,
77 fac_dec_valid_fx1,
78 fac_fpx_itype_fx1,
79 fac_fpx_dtype_fx1,
80 fac_fpx_stype_fx1,
81 fac_fpx_sign_instr_fx1,
82 fac_fpx_rnd_trunc_fx1,
83 fac_fpx_mulscc_fx1,
84 fac_fpx_saverestore_fx1,
85 fac_fpx_nv_vld_fx1,
86 fac_fpx_of_vld_fx1,
87 fac_fpx_uf_vld_fx1,
88 fac_fpx_dz_vld_fx1,
89 fac_fpx_nx_vld_fx1,
90 fac_fpx_unfin_vld_fx1,
91 fac_fpx_sp_dest_fx1,
92 fac_fpx_sp_src_fx1,
93 fac_fgx_instr_fx4,
94 fac_w1_vld_fx1,
95 fac_w1_odd32b_fx1,
96 fac_gsr_w_vld_fx2,
97 fac_dec_valid_noflush_fx5,
98 fgd_gsr_asr_mask_fx4_b31,
99 fac_fgx_mvcond_fx2,
100 fac_fgx_mvucond_fx2,
101 fac_fgx_abs_fx2,
102 fac_fgx_neg_fx2,
103 fac_fgx_logical_fx2,
104 fac_fgx_expand_fx2,
105 fac_fgx_merge_fx2,
106 fac_fgx_align_fx2,
107 fac_fgx_shuffle_fx2,
108 fac_fgx_pack16_fx2,
109 fac_fgx_pack32_fx2,
110 fac_fgx_packfix_fx2,
111 fac_fgx_pdist_fx1,
112 fac_fgx_popc_fx2,
113 fac_fgx_siam_fx2,
114 fac_fgx_pack_sel_fx2,
115 fac_opf_fx2,
116 fac_gsr_asr_tid_fx2,
117 fac_tid_fx2,
118 fac_rng_fprs,
119 fac_rng_rd_fprs_4f,
120 fac_rng_wr_gsr_3f,
121 fac_rng_rd_gsr_4f,
122 fac_rng_rd_ecc_4f,
123 fac_rng_rd_or_wr_3f,
124 fad_w1_tid_fw,
125 fad_w1_vld_fw,
126 fad_w2_addr_fw1_b4,
127 fad_w2_tid_fw1,
128 fad_w2_vld_fw1,
129 fac_frf_r1_addr_e,
130 fac_tid_e,
131 fac_aman_fmt_sel_e,
132 fac_bman_fmt_sel_e,
133 fac_fst_fmt_sel_fx1,
134 fac_w1_addr_fb,
135 fac_fpd_addr_fb,
136 fac_w1_32b_fb,
137 fac_fpd_32b_fb,
138 fac_w1_odd32b_fb,
139 fac_fpd_odd32b_fb,
140 fac_w1_tid_fb,
141 fac_fpd_tid_fb,
142 fac_fsr_store_fx2,
143 fac_exu_src_e,
144 fac_fsr0_sel_fw,
145 fac_fsr1_sel_fw,
146 fac_fsr2_sel_fw,
147 fac_fsr3_sel_fw,
148 fac_fsr4_sel_fw,
149 fac_fsr5_sel_fw,
150 fac_fsr6_sel_fw,
151 fac_fsr7_sel_fw,
152 fac_pre_fcc_vld_fx2,
153 fac_fcmpe_fx1,
154 fac_rs2_rotate_sel_e,
155 fac_i2f_sel_e,
156 fac_force_swap_blta_fx1,
157 fac_force_noswap_blta_fx1,
158 fac_xr_mode_fx1,
159 fac_rs1_sel_fx1,
160 fac_rs2_sel_fx1,
161 fac_8x16_rnd_fx3,
162 fac_scff_sel_fx3,
163 fac_accum_sel_fx3,
164 fac_result_sel_fx4,
165 fac_ma_result_en_fx4,
166 fdc_finish_int_early,
167 fdc_finish_fltd_early,
168 fdc_finish_flts_early,
169 fac_div_flush_fx3,
170 fac_div_valid_fx1,
171 fac_divq_valid_fx1,
172 fac_div_control_fx1,
173 fac_aexp_fmt_sel_e,
174 fac_bexp_fmt_sel_e,
175 fac_aux_cin_fx1,
176 lsu_fgu_fld_vld_w,
177 lsu_fgu_fld_b,
178 lsu_fgu_fld_tid_b,
179 lsu_fgu_fld_32b_b,
180 lsu_fgu_fsr_load_b,
181 lsu_fgu_pmen,
182 lsu_asi_clken,
183 exu_fgu_gsr_vld_m,
184 exu_fgu_flush_m,
185 fgu_result_tid_fx5,
186 fgu_irf_w_addr_fx5,
187 fgu_exu_cc_vld_fx5,
188 fgu_exu_w_vld_fx5,
189 fec_cecc_fx2,
190 fec_uecc_fx2,
191 fac_r1_vld_fx1,
192 fac_r2_vld_fx1,
193 fac_ecc_trap_en_fx1,
194 fac_tid_d,
195 fac_frf_r1_addr_d,
196 fac_frf_r1_vld_d,
197 spu_fgu_fpy_ctl_d,
198 main_clken,
199 main_clken0,
200 mul_clken,
201 div_clken,
202 vis_clken,
203 asi_clken,
204 coreon_clken,
205 l2clk,
206 scan_in,
207 spc_aclk_wmr,
208 wmr_scan_in,
209 tcu_pce_ov,
210 spc_aclk,
211 spc_bclk,
212 tcu_scan_en,
213 mbi_frf_read_en,
214 mbi_addr,
215 mbi_run,
216 in_rngl_cdbus,
217 fac_mbist_addr_1f,
218 fgu_rngl_cdbus_b64,
219 fgu_rngl_cdbus_b63,
220 scan_out,
221 wmr_scan_out);
222wire pce_ov;
223wire stop;
224wire siclk;
225wire soclk;
226wire se;
227wire l1clk;
228wire l1clk_pm2;
229wire main_clken_local;
230wire l1clk_pm1;
231wire spares_scanin;
232wire spares_scanout;
233wire fgu_pmen_e;
234wire mbist_run_1f;
235wire [7:0] core_running_status_1f;
236wire fgu_decode_e;
237wire spu_grant_e;
238wire frf_store_fx1;
239wire frf_store_fx2;
240wire fsr_store_fx1;
241wire fpc_stfsr_en_fb;
242wire fpc_stfsr_en_fw;
243wire fgu_fld_fx3;
244wire fgu_fld_fx4;
245wire fgu_fld_fx5;
246wire fgu_fld_fb;
247wire fgu_decode_fx1;
248wire gsr_w_vld_fx2;
249wire gsr_w_vld_fx3;
250wire gsr_w_vld_fx4;
251wire rng_rd_or_wr_1f;
252wire rng_rd_or_wr_2f;
253wire rng_rd_or_wr_4f;
254wire rng_rd_or_wr_5f;
255wire dec_valid_fx2;
256wire dec_valid_fx3;
257wire dec_valid_noflush_fx4;
258wire dec_valid_noflush_fb;
259wire dec_valid_noflush_fw;
260wire dec_valid_noflush_fw1;
261wire dec_valid_noflush_fw2;
262wire spu_grant_fx1;
263wire spu_grant_fx2;
264wire spu_grant_fx3;
265wire spu_grant_fx4;
266wire spu_grant_fx5;
267wire div_engine_busy_fx1;
268wire div_engine_busy_fx2;
269wire divq_occupied_fx1;
270wire div_finish_fb;
271wire div_finish_fw;
272wire div_finish_fw1;
273wire div_finish_fw2;
274wire div_finish_fw3;
275wire fpx_itype_mul_e;
276wire itype_mul_fx1;
277wire itype_mul_fx2;
278wire itype_mul_fx3;
279wire dec_valid_imul_noflush_fx4;
280wire dec_valid_imul_noflush_fx5;
281wire dec_valid_imul_noflush_fb;
282wire dec_valid_imul_noflush_fw;
283wire dec_valid_imul_noflush_fw1;
284wire dec_valid_imul_noflush_fw2;
285wire fpx_itype_div_e;
286wire fgx_instr_e;
287wire fgx_instr_fx1;
288wire fgx_instr_fx2;
289wire fgx_instr_fx3;
290wire fgx_instr_fx5;
291wire fgx_instr_fb;
292wire fgx_instr_fw;
293wire fgx_instr_fw1;
294wire fgx_instr_fw2;
295wire global_asi_clken;
296wire rng_rd_ecc_2f;
297wire [2:0] rng_wr_tid_2f;
298wire [7:0] rng_data_2f_b7_0;
299wire mbist_frf_read_en_1f;
300wire e_00_scanin;
301wire e_00_scanout;
302wire e_01_scanin;
303wire e_01_scanout;
304wire [5:0] op3_e;
305wire [7:0] opf_e;
306wire r1_vld_e;
307wire r2_vld_e;
308wire r1_32b_e;
309wire r2_32b_e;
310wire r1_odd32b_e;
311wire r2_odd32b_e;
312wire frf_store_e;
313wire fsr_store_e;
314wire [4:0] irf_w_addr_e;
315wire [6:0] spu_fpy_ctl_e;
316wire e_02_scanin;
317wire e_02_scanout;
318wire w1_vld_e;
319wire [4:0] w1_addr_e;
320wire w1_32b_e;
321wire w1_odd32b_e;
322wire exu_w_vld_e;
323wire e_03_scanin;
324wire e_03_scanout;
325wire [24:5] i;
326wire [4:0] aman_fmt_sel_e;
327wire [3:0] bman_fmt_sel_e;
328wire [9:0] aexp_fmt_sel_e;
329wire [7:0] bexp_fmt_sel_e;
330wire [2:0] fpx_itype_e;
331wire [2:0] fpx_dtype_e;
332wire [1:0] fpx_stype_e;
333wire fpx_sign_instr_e;
334wire fpx_rnd_trunc_e;
335wire fpx_mulscc_e;
336wire fpx_saverestore_e;
337wire fpx_int_cc_vld_e;
338wire fpx_fmul8x16_e;
339wire fpx_fmul8x16au_e;
340wire fpx_fmul8x16al_e;
341wire fpx_fmul8sux16_e;
342wire fpx_fmul8ulx16_e;
343wire fpx_fmuld8sux16_e;
344wire fpx_fmuld8ulx16_e;
345wire fpx_nv_vld_e;
346wire fpx_of_vld_e;
347wire fpx_uf_vld_e;
348wire fpx_dz_vld_e;
349wire fpx_nx_vld_e;
350wire fpx_unfin_vld_e;
351wire fgx_mvcond_e;
352wire fgx_mvucond_e;
353wire fgx_abs_e;
354wire fgx_neg_e;
355wire fgx_logical_e;
356wire fgx_expand_e;
357wire fgx_merge_e;
358wire fgx_align_e;
359wire fgx_shuffle_e;
360wire fgx_pack16_e;
361wire fgx_pack32_e;
362wire fgx_packfix_e;
363wire fgx_pdist_e;
364wire fgx_popc_e;
365wire fgx_siam_e;
366wire q_fgx_pdist_e;
367wire [3:0] fst_fmt_sel_e;
368wire [4:1] q_aman_fmt_sel_e;
369wire [3:0] q_bman_fmt_sel_e;
370wire [8:1] q_aexp_fmt_sel_e;
371wire [3:1] q_bexp_fmt_sel_e;
372wire fpx_sp_dest_e;
373wire [1:0] q_w1_vld_e;
374wire [1:0] cc_target_e;
375wire [3:0] pre_fcc_vld_e;
376wire [2:0] i_fsr_w2_vld_fb;
377wire div_finish_fltd_fb;
378wire div_finish_flts_fb;
379wire fsr_w1_qvld_fb;
380wire [1:0] fsr_w1_vld_fb;
381wire pre_fcc_vld_fb;
382wire [3:0] fcc_vld_fb;
383wire fsr_w2_qvld_fb;
384wire [5:0] fsr0_sel_fb;
385wire [5:0] fsr1_sel_fb;
386wire [5:0] fsr2_sel_fb;
387wire [5:0] fsr3_sel_fb;
388wire [5:0] fsr4_sel_fb;
389wire [5:0] fsr5_sel_fb;
390wire [5:0] fsr6_sel_fb;
391wire [5:0] fsr7_sel_fb;
392wire [1:0] q_r1_vld_e;
393wire [1:0] q_r2_vld_e;
394wire force_swap_blta_e;
395wire force_noswap_blta_e;
396wire xr_mode_e;
397wire [4:0] rs1_sel_e;
398wire [3:0] rs2_sel_e;
399wire [1:0] rnd_8x16_e;
400wire [5:0] result_sel_e;
401wire div_valid_e;
402wire pre_div_flush_fx3;
403wire div_dec_issue_fx3;
404wire divq_valid_e;
405wire div_engine_busy_e;
406wire div_finish_early;
407wire div_dec_issue_e;
408wire div_divq_issue_e;
409wire div_divq_load_e;
410wire div_hold_e;
411wire divq_occupied_e;
412wire [2:0] div_tid_in_e;
413wire [2:0] divq_tid_fx1;
414wire [2:0] div_tid_fx1;
415wire [4:0] div_irf_addr_in_e;
416wire [4:0] divq_irf_addr_fx1;
417wire [4:0] div_irf_addr_fx1;
418wire div_cc_vld_in_e;
419wire divq_cc_vld_fx1;
420wire div_cc_vld_fx1;
421wire div_odd32b_in_e;
422wire divq_odd32b_fx1;
423wire div_odd32b_fx1;
424wire div_32b_in_e;
425wire divq_32b_fx1;
426wire div_32b_fx1;
427wire [4:0] div_frf_addr_in_e;
428wire [4:0] divq_frf_addr_fx1;
429wire [4:0] div_frf_addr_fx1;
430wire [2:0] divq_tid_in_e;
431wire [4:0] divq_irf_addr_in_e;
432wire divq_cc_vld_in_e;
433wire divq_odd32b_in_e;
434wire divq_32b_in_e;
435wire [4:0] divq_frf_addr_in_e;
436wire [4:0] div_control_e;
437wire fx1_00_scanin;
438wire fx1_00_scanout;
439wire [4:1] opf_fx1;
440wire fpx_int_cc_vld_fx1;
441wire fgx_mvcond_fx1;
442wire fgx_mvucond_fx1;
443wire fgx_abs_fx1;
444wire fgx_neg_fx1;
445wire fgx_logical_fx1;
446wire fgx_expand_fx1;
447wire fgx_merge_fx1;
448wire fgx_align_fx1;
449wire fgx_shuffle_fx1;
450wire fgx_pack16_fx1;
451wire fgx_pack32_fx1;
452wire fgx_packfix_fx1;
453wire fgx_popc_fx1;
454wire i_fgx_siam_fx1;
455wire [1:0] rnd_8x16_fx1;
456wire [5:0] result_sel_fx1;
457wire i_exu_w_vld_fx1;
458wire [4:0] irf_w_addr_fx1;
459wire div_dec_issue_fx1;
460wire div_divq_issue_fx1;
461wire [5:0] spu_fpy_ctl_fx1;
462wire fx1_01_scanin;
463wire fx1_01_scanout;
464wire [4:0] w1_addr_fx1;
465wire w1_32b_fx1;
466wire [2:0] tid_fx1;
467wire [1:0] q_w1_vld_fx1;
468wire cerer_frf_fx1;
469wire [7:0] ceter_pscce_fx1;
470wire fx1_02_scanin;
471wire fx1_02_scanout;
472wire [3:0] pre_fcc_vld_fx1;
473wire fgx_pack_sel_fx1;
474wire fgx_moves_fx1;
475wire fgx_siam_fx1;
476wire exu_w_vld_fx1;
477wire q_div_default_res_fx3;
478wire div_default_res_fx3;
479wire dec_flush_fx3;
480wire [7:0] divide_completion_fx1;
481wire [2:0] tid_fx3;
482wire fx2_00_scanin;
483wire fx2_00_scanout;
484wire [4:0] w1_addr_fx2;
485wire w1_32b_fx2;
486wire w1_odd32b_fx2;
487wire [2:0] tid_fx2;
488wire i_exu_w_vld_fx2;
489wire [4:0] irf_w_addr_fx2;
490wire fx2_01_scanin;
491wire fx2_01_scanout;
492wire [1:0] rnd_8x16_fx2;
493wire [5:0] result_sel_fx2;
494wire fpx_int_cc_vld_fx2;
495wire dec_flush_fx2;
496wire [3:0] i_pre_fcc_vld_fx2;
497wire div_dec_issue_fx2;
498wire div_divq_issue_fx2;
499wire [2:0] itype_fx2;
500wire [5:0] spu_fpy_ctl_fx2;
501wire rs2_sel_fx2_b2;
502wire fx2_02_scanin;
503wire fx2_02_scanout;
504wire exu_flush_fx2;
505wire [2:0] rng_wr_tid_3f;
506wire dec_valid_noflush_fx2;
507wire exu_w_vld_fx2;
508wire pre_fcc_vld_fx2;
509wire [1:0] i_fld_fcc_vld_fx2;
510wire [3:0] scff_sel_fx2;
511wire [6:0] accum_sel_fx2;
512wire fx3_00_scanin;
513wire fx3_00_scanout;
514wire [4:0] w1_addr_fx3;
515wire w1_32b_fx3;
516wire w1_odd32b_fx3;
517wire [5:0] result_sel_fx3;
518wire i_exu_w_vld_fx3;
519wire [4:0] irf_w_addr_fx3;
520wire fpx_int_cc_vld_fx3;
521wire i_pre_div_flush_fx3;
522wire [2:0] itype_fx3;
523wire [5:5] spu_fpy_ctl_fx3;
524wire i_pre_fcc_vld_fx3;
525wire i_dec_valid_noflush_fx3;
526wire fx3_01_scanin;
527wire fx3_01_scanout;
528wire pre_fcc_vld_fx3;
529wire dec_valid_noflush_fx3;
530wire dec_valid_imul_noflush_fx3;
531wire exu_w_vld_fx3;
532wire fx4_00_scanin;
533wire fx4_00_scanout;
534wire [4:0] w1_addr_fx4;
535wire w1_32b_fx4;
536wire w1_odd32b_fx4;
537wire [2:0] tid_fx4;
538wire exu_w_vld_fx4;
539wire [4:0] i_irf_w_addr_fx4;
540wire i_int_cc_vld_fx4;
541wire [5:5] spu_fpy_ctl_fx4;
542wire pre_fcc_vld_fx4;
543wire [2:0] irf_result_tid_fx4;
544wire [4:0] irf_w_addr_fx4;
545wire exu_cc_vld_fx4;
546wire fx5_00_scanin;
547wire fx5_00_scanout;
548wire [4:0] w1_addr_fx5;
549wire w1_32b_fx5;
550wire w1_odd32b_fx5;
551wire [2:0] tid_fx5;
552wire i_exu_w_vld_fx5;
553wire irf_result_tid_fx5_b2;
554wire exu_cc_vld_fx5;
555wire pre_fcc_vld_fx5;
556wire div_finish_int_fb;
557wire fb_00_scanin;
558wire fb_00_scanout;
559wire fw_00_scanin;
560wire fw_00_scanout;
561wire w1_addr_fw_b4;
562wire fw_01_scanin;
563wire fw_01_scanout;
564wire [3:0] i_fsr0_sel_fw;
565wire [3:0] i_fsr1_sel_fw;
566wire [3:0] i_fsr2_sel_fw;
567wire [3:0] i_fsr3_sel_fw;
568wire [3:0] i_fsr4_sel_fw;
569wire [3:0] i_fsr5_sel_fw;
570wire [3:0] i_fsr6_sel_fw;
571wire [3:0] i_fsr7_sel_fw;
572wire [2:0] lsu_fgu_fld_tid_fw;
573wire [1:0] i_fsr_w2_vld_fw;
574wire [1:0] fsr_w2_vld_fw;
575wire fprs_frf_ctl_scanin;
576wire fprs_frf_ctl_scanout;
577wire [4:4] fprs_w1_addr;
578wire [2:0] fprs_w1_tid;
579wire [1:0] fprs_w1_vld;
580wire [4:4] fprs_w2_addr;
581wire [2:0] fprs_w2_tid;
582wire [1:0] fprs_w2_vld;
583wire [3:0] fprs_tid0_sel;
584wire rng_wr_fprs_3f;
585wire [2:0] din_fprs_tid0;
586wire [2:0] fprs_tid0;
587wire fprstid0_wmr_scanin;
588wire fprstid0_wmr_scanout;
589wire [2:2] fprs_tid0_;
590wire [3:0] fprs_tid1_sel;
591wire [2:0] din_fprs_tid1;
592wire [2:0] fprs_tid1;
593wire fprstid1_wmr_scanin;
594wire fprstid1_wmr_scanout;
595wire [2:2] fprs_tid1_;
596wire [3:0] fprs_tid2_sel;
597wire [2:0] din_fprs_tid2;
598wire [2:0] fprs_tid2;
599wire fprstid2_wmr_scanin;
600wire fprstid2_wmr_scanout;
601wire [2:2] fprs_tid2_;
602wire [3:0] fprs_tid3_sel;
603wire [2:0] din_fprs_tid3;
604wire [2:0] fprs_tid3;
605wire fprstid3_wmr_scanin;
606wire fprstid3_wmr_scanout;
607wire [2:2] fprs_tid3_;
608wire [3:0] fprs_tid4_sel;
609wire [2:0] din_fprs_tid4;
610wire [2:0] fprs_tid4;
611wire fprstid4_wmr_scanin;
612wire fprstid4_wmr_scanout;
613wire [2:2] fprs_tid4_;
614wire [3:0] fprs_tid5_sel;
615wire [2:0] din_fprs_tid5;
616wire [2:0] fprs_tid5;
617wire fprstid5_wmr_scanin;
618wire fprstid5_wmr_scanout;
619wire [2:2] fprs_tid5_;
620wire [3:0] fprs_tid6_sel;
621wire [2:0] din_fprs_tid6;
622wire [2:0] fprs_tid6;
623wire fprstid6_wmr_scanin;
624wire fprstid6_wmr_scanout;
625wire [2:2] fprs_tid6_;
626wire [3:0] fprs_tid7_sel;
627wire [2:0] din_fprs_tid7;
628wire [2:0] fprs_tid7;
629wire fprstid7_wmr_scanin;
630wire fprstid7_wmr_scanout;
631wire [2:2] fprs_tid7_;
632wire [2:0] din_rng_fprs;
633wire fprs_rng_scanin;
634wire fprs_rng_scanout;
635wire rng_stg1_scanin;
636wire rng_stg1_scanout;
637wire rng_ctl_1f;
638wire rng_valid_1f;
639wire [62:48] rng_data_1f;
640wire [7:0] rng_data_1f_b7_0;
641wire rng_rd_1f;
642wire rng_wr_1f;
643wire rng_rd_gsr_1f;
644wire rng_wr_gsr_1f;
645wire rng_rd_fprs_1f;
646wire rng_wr_fprs_1f;
647wire rng_rd_ecc_1f;
648wire rng_stg2_scanin;
649wire rng_stg2_scanout;
650wire rng_wr_gsr_2f;
651wire rng_rd_gsr_2f;
652wire rng_rd_fprs_2f;
653wire rng_wr_fprs_2f;
654wire rng_6463_scanin;
655wire rng_6463_scanout;
656wire rng_ctl_2f;
657wire rng_valid_2f;
658wire rng_ctl_3f;
659wire rng_cdbus_3f_b63;
660wire rng_valid_3f;
661wire rng_stg3_scanin;
662wire rng_stg3_scanout;
663wire rng_rd_gsr_3f;
664wire rng_rd_fprs_3f;
665wire rng_rd_ecc_3f;
666wire rng_b64_default_sel;
667wire rng_stg4_scanin;
668wire rng_stg4_scanout;
669
670
671
672// ----------------------------------------------------------------------------
673// Interface with DEC
674// ----------------------------------------------------------------------------
675
676input [4:0] dec_frf_r1_addr_d;
677input dec_frf_r1_vld_d;
678input dec_frf_r2_vld_d;
679input dec_frf_r1_32b_d;
680input dec_frf_r2_32b_d;
681input dec_frf_r1_odd32b_d;
682input dec_frf_r2_odd32b_d;
683
684input dec_frf_w_vld_d;
685input [4:0] dec_frf_w_addr_d;
686input dec_frf_w_32b_d;
687input dec_frf_w_odd32b_d;
688
689input dec_fgu_valid_e;
690input dec_exu_src_vld_d;
691input [4:0] dec_irf_w_addr_d;
692
693input dec_spu_grant_d;
694input dec_frf_store_d;
695input dec_fsr_store_d;
696
697input dec_flush_f1; // flush fx2 (xmit in fx1/m)
698input dec_flush_f2; // flush fx3 (xmit in fx2/b)
699
700input [5:0] dec_fgu_op3_d;
701input [7:0] dec_fgu_opf_d;
702input dec_fgu_decode_d; // FGU instr issue valid (d stage)
703input [2:0] dec_fgu_tid_d;
704
705output [2:0] fgu_cmp_fcc_tid_fx2; // fcmp fcc data TID
706output [1:0] fgu_fld_fcc_vld_fx3; // ldfsr fcc data valid {fcc3, fcc2, fcc1}, fcc0
707output [7:0] fgu_fprs_fef; // FPRS.fef for each TID
708
709output [7:0] fgu_divide_completion; // FPD completion/TID
710
711// ----------------------------------------------------------------------------
712// Interface with TLU
713// ----------------------------------------------------------------------------
714
715input tlu_flush_fgu_b; // flush fx3, non-load (xmit in fx2/b)
716input [7:0] tlu_ceter_pscce; // core error trap enable reg precise enable
717input tlu_cerer_frf; // FRF ecc error trap enable
718input [7:0] spc_core_running_status; // thread active
719
720output [2:0] fgu_fpx_trap_tid_fw;
721output [2:0] fgu_fpd_trap_tid_fw;
722
723// ----------------------------------------------------------------------------
724// Interface with FPC
725// ----------------------------------------------------------------------------
726
727input fpc_pre_div_flush_fx2;
728input fpc_div_default_res_fx2; // fdiv/fsqrt default result
729input [1:0] fpc_fsr_w1_vld_fx5; // FSR w1 write valid
730input [3:0] fpc_fcc_vld_fx5;
731input fpc_fpx_unfin_fb;
732input fpc_fpd_unfin_fb;
733input fpc_stfsr_en_fx3to5; // store FSR clears ftt
734
735output fac_tlu_flush_fx3;
736output fac_dec_valid_fx1;
737output [2:0] fac_fpx_itype_fx1; // instr type:
738 // add=000, fpfp=001, fpint=010, intfp=011, cmp=100, mul=101, div=110, sqrt=111
739output [2:0] fac_fpx_dtype_fx1; // destination type:
740 // sp=000, dp=001, 16bit=010, 32bit=011, 64bit=100
741output [1:0] fac_fpx_stype_fx1; // source type (for conversions & FsMULd/FMULd):
742 // sp=00, dp=01, 32bit=10, 64bit=11
743output fac_fpx_sign_instr_fx1; // sign of the instr (1 if: FSUB(s,d),
744 // FPSUB{16,32}{s})
745output fac_fpx_rnd_trunc_fx1; // force rnd mode to truncate
746 // (1 if: F(s,d)TOi, F(s,d)TOx,
747 // FPADD{16,32}{s}, FPSUB{16,32}{s},
748 // IMUL, IDIV, MULScc, 8x16 mul, SAVE, RESTORE
749output fac_fpx_mulscc_fx1; // MULScc
750output fac_fpx_saverestore_fx1;// SAVE or RESTORE
751output fac_fpx_nv_vld_fx1; // set if instr updates invalid exception flag
752output fac_fpx_of_vld_fx1; // set if instr updates overflow exception flag
753output fac_fpx_uf_vld_fx1; // set if instr updates underflow exception flag
754output fac_fpx_dz_vld_fx1; // set if instr updates divide by zero exception flag
755output fac_fpx_nx_vld_fx1; // set if instr updates inexact exception flag
756output fac_fpx_unfin_vld_fx1; // set if instr can generate unfinished_FPop
757
758output fac_fpx_sp_dest_fx1; // sp destination
759output fac_fpx_sp_src_fx1; // sp source
760output fac_fgx_instr_fx4; // FGX instr decoded
761output [1:0] fac_w1_vld_fx1;
762output fac_w1_odd32b_fx1;
763output [1:0] fac_gsr_w_vld_fx2;
764output fac_dec_valid_noflush_fx5;
765
766// ----------------------------------------------------------------------------
767// Interface with FGD
768// ----------------------------------------------------------------------------
769
770input fgd_gsr_asr_mask_fx4_b31;
771
772output fac_fgx_mvcond_fx2; // FMOV (conditional upon cc or r)
773output fac_fgx_mvucond_fx2; // FMOV (unconditional)
774output fac_fgx_abs_fx2; // FABS
775output fac_fgx_neg_fx2; // FNEG
776output fac_fgx_logical_fx2; // logical instructions
777output fac_fgx_expand_fx2; // FEXPAND
778output fac_fgx_merge_fx2; // FPMERGE
779output fac_fgx_align_fx2; // FALIGNDATA
780output fac_fgx_shuffle_fx2; // BSHUFFLE
781output fac_fgx_pack16_fx2; // FPACK16
782output fac_fgx_pack32_fx2; // FPACK32
783output fac_fgx_packfix_fx2; // FPACKFIX
784output fac_fgx_pdist_fx1; // PDIST
785output fac_fgx_popc_fx2; // POPC
786output fac_fgx_siam_fx2; // SIAM
787
788output fac_fgx_pack_sel_fx2; // FPACK16,FPACK32,FPACKFIX
789
790output [4:1] fac_opf_fx2; // instr opf field
791output [2:0] fac_gsr_asr_tid_fx2;
792output [2:0] fac_tid_fx2;
793
794output [2:0] fac_rng_fprs; // ASR FPRS read data
795output fac_rng_rd_fprs_4f; // ASR FPRS read
796output fac_rng_wr_gsr_3f; // ASR GSR write valid
797output fac_rng_rd_gsr_4f; // ASR GSR read
798output fac_rng_rd_ecc_4f; // ASI FRF ECC read
799output fac_rng_rd_or_wr_3f; // ASR GSR/FPRS read or write decoded
800
801// ----------------------------------------------------------------------------
802// Interface with FAD
803// ----------------------------------------------------------------------------
804
805input [2:0] fad_w1_tid_fw; // FRF w1 write TID
806input [1:0] fad_w1_vld_fw; // FRF w1 write valid (qualified)
807input fad_w2_addr_fw1_b4; // FRF w2 write addr
808input [2:0] fad_w2_tid_fw1; // FRF w2 write TID
809input [1:0] fad_w2_vld_fw1; // FRF w2 write valid (qualified)
810
811output [4:0] fac_frf_r1_addr_e;
812output [2:0] fac_tid_e;
813output [4:0] fac_aman_fmt_sel_e; // aop mantissa format mux select
814output [4:0] fac_bman_fmt_sel_e; // bop mantissa format mux select
815output [3:0] fac_fst_fmt_sel_fx1; // store format mux select
816
817output [4:0] fac_w1_addr_fb; // FRF w1 write addr
818output [4:0] fac_fpd_addr_fb; // FRF w2 write addr (div/sqrt)
819output fac_w1_32b_fb; // FRF w1 is 32-bit dest
820output fac_fpd_32b_fb; // FRF w2 is 32-bit dest (div/sqrt)
821output fac_w1_odd32b_fb; // FRF w1 is odd 32-bit dest (32 LSBs)
822output fac_fpd_odd32b_fb; // FRF w2 is odd 32-bit dest (32 LSBs) (div/sqrt)
823
824output [2:0] fac_w1_tid_fb; // FRF w1 TID
825output [2:0] fac_fpd_tid_fb; // FRF w2 TID (div/sqrt)
826
827output fac_fsr_store_fx2;
828
829output fac_exu_src_e;
830
831output [5:0] fac_fsr0_sel_fw;
832output [5:0] fac_fsr1_sel_fw;
833output [5:0] fac_fsr2_sel_fw;
834output [5:0] fac_fsr3_sel_fw;
835output [5:0] fac_fsr4_sel_fw;
836output [5:0] fac_fsr5_sel_fw;
837output [5:0] fac_fsr6_sel_fw;
838output [5:0] fac_fsr7_sel_fw;
839
840// ----------------------------------------------------------------------------
841// Interface with FPF
842// ----------------------------------------------------------------------------
843
844output [3:0] fac_pre_fcc_vld_fx2; // must clear fcc_vld if (nv & TEM)
845output fac_fcmpe_fx1; // FCMPE, not FCMP
846output [4:0] fac_rs2_rotate_sel_e; // 001=odd FiTO(s,d), 010=even FiTO(s,d), 100=FiTO(s,d)
847output [1:0] fac_i2f_sel_e; // 01=F(i,x)TO(s,d), 10=~F(i,x)TO(s,d)
848output fac_force_swap_blta_fx1; // force the swap_blta condition
849output fac_force_noswap_blta_fx1; // force the ~swap_blta condition
850
851// ----------------------------------------------------------------------------
852// Interface with FPY
853// ----------------------------------------------------------------------------
854
855output fac_xr_mode_fx1; // 0 : Int or Float
856 // 1 : XOR mult
857
858output [4:0] fac_rs1_sel_fx1; // [0] : FMUL8SUx16 or FMULD8SUx16
859 // [1] : FMUL8x16 or FMUL8x16AU or FMUL8x16AL
860 // [2] : FMUL8ULx16 or FMULD8ULx16
861 // [3] : MA Int / XOR forward of last MA result
862 // [4] : MA Int / XOR unforwarded
863 // Def : 64 * 64 Multiply
864
865output [3:0] fac_rs2_sel_fx1; // [0] : FMUL8x16AU
866 // [1] : FMUL8x16AL
867 // [2] : all 8x16
868 // [3] : MA Int / XOR
869 // Def : 64 * 64 Multiply
870
871output [1:0] fac_8x16_rnd_fx3; // [0] : FMUL8x16 or FMUL8x16AU or FMUL8x16AL or FMUL8SUx16
872 // [1] : FMUL8ULx16
873
874output [3:0] fac_scff_sel_fx3; // [0] : Int, Float, MA Int
875 // [1] : all 8x16
876 // [2] : MA Int * 2
877 // [3] : XOR mult
878 // Def : XOR mult * 2
879
880output [6:0] fac_accum_sel_fx3; // [0] : Write ACCUM with result
881 // [1] : Add ACCUM to Mult product
882 // [2] : XOR Mult w/ ACCUM
883 // [3] : XOR Mult w/ ACCUM >> 64
884 // [4] : XOR Mult w/o ACCUM
885 // [5] : XOR Mult w/o ACCUM >> 64
886 // [6] : Int Mult w/ or w/o ACCUM
887 // Def : Int Mult w/ or w/o ACCUM >> 64
888
889output [5:0] fac_result_sel_fx4; // [0] : FMUL8x16 or FMUL8x16AU or FMUL8x16AL or FMUL8SUx16
890 // [1] : FMUL8ULx16
891 // [2] : FMULD8SUx16
892 // [3] : FMULD8ULx16
893 // [4] : XOR multiply w/ ACCUMUMATE
894 // [5] : Float
895 // Def : Integer, MA Integer w/ and w/o ACCUMULATE, XOR w/o ACCUMULATE
896
897output fac_ma_result_en_fx4; // 1 : Save last MA result in shadow flop
898
899// ----------------------------------------------------------------------------
900// Interface with FDC
901// ----------------------------------------------------------------------------
902
903input fdc_finish_int_early;
904input fdc_finish_fltd_early;
905input fdc_finish_flts_early;
906output fac_div_flush_fx3;
907output fac_div_valid_fx1;
908output fac_divq_valid_fx1;
909output [4:0] fac_div_control_fx1; // [4:0] :
910 // 0000 : Float Divide Single
911 // 0010 : Float Divide Double
912 // 0100 : Integer Unsigned - 32 bit
913 // 0101 : Integer Signed - 32 bit
914 // 0110 : Integer Unsigned - 64 bit
915 // 0111 : Integer Signed - 64 bit
916 // 1000 : Float SQRT Single
917 // 1010 : Float SQRT Double
918
919// ----------------------------------------------------------------------------
920// Interface with FPE
921// ----------------------------------------------------------------------------
922
923output [9:0] fac_aexp_fmt_sel_e; // aop exponent format mux select
924output [7:0] fac_bexp_fmt_sel_e; // bop exponent format mux select
925output fac_aux_cin_fx1; // aux exp adder cin
926
927// ----------------------------------------------------------------------------
928// Interface with LSU
929// ----------------------------------------------------------------------------
930
931input lsu_fgu_fld_vld_w;
932input lsu_fgu_fld_b; // FRF load data (unqualified)
933input [2:0] lsu_fgu_fld_tid_b;
934input lsu_fgu_fld_32b_b;
935input lsu_fgu_fsr_load_b;
936input lsu_fgu_pmen;
937input lsu_asi_clken;
938
939// ----------------------------------------------------------------------------
940// Interface with EXU
941// ----------------------------------------------------------------------------
942
943input [1:0] exu_fgu_gsr_vld_m; // GSR data valid {align,mask}
944input exu_fgu_flush_m; // EXU{1,0} src has bad ECC or exception, FGU must flush instr
945output [1:0] fgu_result_tid_fx5;
946output [4:0] fgu_irf_w_addr_fx5;
947output fgu_exu_cc_vld_fx5;
948output [1:0] fgu_exu_w_vld_fx5;
949
950// ----------------------------------------------------------------------------
951// Interface with FEC
952// ----------------------------------------------------------------------------
953
954input fec_cecc_fx2;
955input fec_uecc_fx2;
956output [1:0] fac_r1_vld_fx1; // FRF r1 read valid (unqualified)
957output [1:0] fac_r2_vld_fx1; // FRF r2 read valid (unqualified)
958output fac_ecc_trap_en_fx1;
959
960// ----------------------------------------------------------------------------
961// Interface with FRF
962// ----------------------------------------------------------------------------
963
964output [2:0] fac_tid_d;
965output [4:0] fac_frf_r1_addr_d;
966output fac_frf_r1_vld_d;
967
968// ----------------------------------------------------------------------------
969// Interface with SPU
970// ----------------------------------------------------------------------------
971
972input [6:0] spu_fgu_fpy_ctl_d; // Mult control
973
974// ----------------------------------------------------------------------------
975// Power Management Signals
976// ----------------------------------------------------------------------------
977
978output main_clken; // main clken: controls fad,fec,fpf,fpe,fac,fic,fpc
979output main_clken0; // main clken: controls fad,fec,fpf,fpe,fac,fic,fpc
980output mul_clken; // multiply clken: controls fpy
981output div_clken; // divide clken: controls fdc,fdd
982output vis_clken; // vis clken: controls fgd
983output asi_clken; // asi clken: controls ASI ring stage flops in fgd
984output coreon_clken; // coreon_clken: controls all "free running" flops in fac,fec,fpc,fad,fgd
985
986// ----------------------------------------------------------------------------
987// Global Signals
988// ----------------------------------------------------------------------------
989
990input l2clk; // clock input
991input scan_in;
992input spc_aclk_wmr;
993input wmr_scan_in;
994input tcu_pce_ov; // scan signals
995input spc_aclk;
996input spc_bclk;
997input tcu_scan_en;
998input mbi_frf_read_en; // MBIST
999input [7:0] mbi_addr; // MBIST
1000input mbi_run; // MBIST
1001input [64:0] in_rngl_cdbus; // ASI local ring
1002
1003output [7:0] fac_mbist_addr_1f; // MBIST
1004output fgu_rngl_cdbus_b64; // ASI local ring
1005output fgu_rngl_cdbus_b63; // ASI local ring
1006output scan_out;
1007output wmr_scan_out;
1008
1009// scan renames
1010assign pce_ov = tcu_pce_ov;
1011assign stop = 1'b0;
1012assign siclk = spc_aclk;
1013assign soclk = spc_bclk;
1014assign se = tcu_scan_en;
1015// end scan
1016
1017
1018fgu_fac_ctl_l1clkhdr_ctl_macro clkgen_freerun (
1019 .l2clk(l2clk),
1020 .l1en (1'b1),
1021 .l1clk(l1clk),
1022 .pce_ov(pce_ov),
1023 .stop(stop),
1024 .se(se)
1025 );
1026
1027fgu_fac_ctl_l1clkhdr_ctl_macro clkgen_coreon (
1028 .l2clk(l2clk),
1029 .l1en (coreon_clken),
1030 .l1clk(l1clk_pm2),
1031 .pce_ov(pce_ov),
1032 .stop(stop),
1033 .se(se)
1034 );
1035
1036fgu_fac_ctl_l1clkhdr_ctl_macro clkgen_main (
1037 .l2clk(l2clk),
1038 .l1en (main_clken_local),
1039 .l1clk(l1clk_pm1),
1040 .pce_ov(pce_ov),
1041 .stop(stop),
1042 .se(se)
1043 );
1044
1045fgu_fac_ctl_spare_ctl_macro__num_5 spares ( // spares: 13 gates + 1 flop for each "num"
1046 .scan_in(spares_scanin),
1047 .scan_out(spares_scanout),
1048 .l1clk(l1clk),
1049 .siclk(siclk),
1050 .soclk(soclk)
1051 );
1052
1053
1054// ------------------------------------
1055// Power management
1056// Wakeup conditions:
1057// - DEC issues FGU instr (includes frf_store, fsr_store)
1058// - DEC grants SPU access to FGU
1059// - LSU presents frf_load or fsr_load data
1060// - EXU presents bmask or alignaddress data
1061// - ASI ring accesses FGU resource (FPRS, GSR, FRF ECC check bits)
1062// - WARNING - wakeup for MBIST, Macro Test, other?
1063// Remain active conditions:
1064// - FGU instr active in any pipe stage
1065// - SPU instr active in any pipe stage
1066// - divide engine is busy (incl pre and post engine)
1067// - ASI ring bypassing non-FGU ctl/data
1068// Note: Generally, clks are allowed to remain active for 1 more cyc
1069// than the min solution to ensure that any state which controls
1070// the update of an architected facility is allowed to clear.
1071// Otherwise, when clks are re-enabled, an extra write of the
1072// architected facility may occur (but would write that same data).
1073// ------------------------------------
1074
1075// coreon_clken: controls all "free running" flops in fac,fec,fpc,fad,fgd
1076
1077assign coreon_clken =
1078
1079 ~fgu_pmen_e | // force clken=1 if FGU global power management isn't enabled
1080 mbist_run_1f | // MBIST
1081 (|core_running_status_1f[7:0]); // any of the 8 threads are active
1082
1083// 0in custom -fire ((mul_clken | div_clken | vis_clken) & ~main_clken) -message "Invalid FGU power management state"
1084
1085// main clken: controls fad,fec,fpf,fpe,fac,fic,fpc
1086
1087assign main_clken = // may be used to turn on fx1 flops
1088
1089 ~fgu_pmen_e | // force clken=1 if FGU global power management isn't enabled
1090
1091 mbist_run_1f | // MBIST
1092
1093 fgu_decode_e | // includes frf_store, fsr_store, bmask, alignaddress
1094 spu_grant_e |
1095
1096 frf_store_fx1 | // active 1 xtra cyc
1097 frf_store_fx2 | // active 2nd xtra cyc to allow fgu_{u,c}ecc_fx2 to clear
1098
1099 fsr_store_fx1 |
1100 fac_fsr_store_fx2 |
1101 fpc_stfsr_en_fx3to5 | // store FSR clears ftt
1102 fpc_stfsr_en_fb | // allow FSR update
1103 fpc_stfsr_en_fw | // active 1 xtra cyc
1104
1105 fgu_fld_fx3 | // frf_load doesn't need to turn on bypass flops because the
1106 // instr in E needing the bypass will take care of that.
1107 // fsr_load needs clks on the cyc following lsu_fgu_fsr_load_b
1108 // so the arch fsr is captured.
1109 fgu_fld_fx4 | // allow FPRS update
1110 fgu_fld_fx5 | // allow FPRS update
1111 fgu_fld_fb | // active 1 xtra cyc
1112
1113 fgu_decode_fx1 | // bmask or alignaddress
1114 gsr_w_vld_fx2 | // exu_fgu_gsr_vld_m[1:0] needs fx3 and fx4 flop clks on so the
1115 gsr_w_vld_fx3 | // arch gsr (fx4 flop) is captured
1116 gsr_w_vld_fx4 | // active 1 xtra cyc
1117
1118 rng_rd_or_wr_1f | // ASI ring accesses FGU resource
1119 rng_rd_or_wr_2f |
1120 fac_rng_rd_or_wr_3f | // FRF ECC check bits rd/wr occurs during 3f
1121 rng_rd_or_wr_4f |
1122 rng_rd_or_wr_5f | // active 1 xtra cyc
1123
1124 fac_dec_valid_fx1 | // E stage is covered in this eq. by fgu_decode_e
1125 dec_valid_fx2 |
1126 dec_valid_fx3 |
1127 dec_valid_noflush_fx4 |
1128 fac_dec_valid_noflush_fx5 |
1129 dec_valid_noflush_fb |
1130 dec_valid_noflush_fw | // allow FPRS update
1131 dec_valid_noflush_fw1 | // allow FPRS update
1132 dec_valid_noflush_fw2 | // active 1 xtra cyc
1133
1134 spu_grant_fx1 | // E stage is covered in this eq. by spu_grant_e
1135 spu_grant_fx2 |
1136 spu_grant_fx3 |
1137 spu_grant_fx4 |
1138 spu_grant_fx5 | // active 1 xtra cyc
1139
1140 div_engine_busy_fx1 | // cyc prior to engine_busy are covered in this eq. by fgu_decode_e
1141 div_engine_busy_fx2 | // ensure fdc internal engine_running_lth has 1 cyc to clear
1142 divq_occupied_fx1 |
1143 div_finish_fb |
1144 div_finish_fw |
1145 div_finish_fw1 | // allow FPRS update
1146 div_finish_fw2 | // allow FPRS update
1147 div_finish_fw3 ; // active 1 xtra cyc
1148
1149assign main_clken0 = main_clken;
1150assign main_clken_local = main_clken;
1151
1152// multiply clken: controls fpy
1153
1154assign mul_clken =
1155
1156 ~fgu_pmen_e | // force clken=1 if FGU global power management isn't enabled
1157
1158 (fgu_decode_e & fpx_itype_mul_e ) |
1159 (fac_dec_valid_fx1 & itype_mul_fx1) |
1160 (dec_valid_fx2 & itype_mul_fx2) |
1161 (dec_valid_fx3 & itype_mul_fx3) |
1162 dec_valid_imul_noflush_fx4 |
1163 dec_valid_imul_noflush_fx5 |
1164 dec_valid_imul_noflush_fb |
1165 dec_valid_imul_noflush_fw | // allow FPRS update
1166 dec_valid_imul_noflush_fw1 | // allow FPRS update
1167 dec_valid_imul_noflush_fw2 | // active 1 xtra cyc
1168
1169 spu_grant_e |
1170 spu_grant_fx1 |
1171 spu_grant_fx2 |
1172 spu_grant_fx3 |
1173 spu_grant_fx4 |
1174 spu_grant_fx5 ; // active 1 xtra cyc
1175
1176// divide clken: controls fdc,fdd
1177
1178assign div_clken =
1179
1180 ~fgu_pmen_e | // force clken=1 if FGU global power management isn't enabled
1181
1182 (fgu_decode_e & fpx_itype_div_e ) |
1183 div_engine_busy_fx1 |
1184 div_engine_busy_fx2 | // ensure fdc internal engine_running_lth has 1 cyc to clear
1185 divq_occupied_fx1 |
1186 div_finish_fb |
1187 div_finish_fw |
1188 div_finish_fw1 | // allow FPRS update
1189 div_finish_fw2 | // allow FPRS update
1190 div_finish_fw3 ; // active 1 xtra cyc
1191
1192// vis clken: controls fgd
1193
1194assign vis_clken =
1195
1196 ~fgu_pmen_e | // force clken=1 if FGU global power management isn't enabled
1197
1198 fgu_decode_fx1 | // bmask or alignaddress
1199 gsr_w_vld_fx2 | // exu_fgu_gsr_vld_m[1:0] needs fx3 and fx4 flop clks on so the
1200 gsr_w_vld_fx3 | // arch gsr (fx4 flop) is captured
1201 gsr_w_vld_fx4 | // active 1 xtra cyc
1202
1203 rng_rd_or_wr_1f | // ASI ring accesses FGU resource
1204 rng_rd_or_wr_2f |
1205 fac_rng_rd_or_wr_3f | // FRF ECC check bits rd/wr occurs during 3f
1206 rng_rd_or_wr_4f |
1207 rng_rd_or_wr_5f | // active 1 xtra cyc
1208
1209 (fgu_decode_e & fgx_instr_e ) |
1210 (fac_dec_valid_fx1 & fgx_instr_fx1 ) |
1211 (dec_valid_fx2 & fgx_instr_fx2 ) |
1212 (dec_valid_fx3 & fgx_instr_fx3 ) |
1213 (dec_valid_noflush_fx4 & fac_fgx_instr_fx4 ) |
1214 (fac_dec_valid_noflush_fx5 & fgx_instr_fx5 ) |
1215 (dec_valid_noflush_fb & fgx_instr_fb ) |
1216 (dec_valid_noflush_fw & fgx_instr_fw ) | // allow FPRS update
1217 (dec_valid_noflush_fw1 & fgx_instr_fw1 ) | // allow FPRS update
1218 (dec_valid_noflush_fw2 & fgx_instr_fw2 ) ; // active 1 xtra cyc
1219
1220
1221// ASI clken: controls ASI ring stage flops in fgd
1222
1223assign asi_clken = global_asi_clken; // can be forced active via ASI_SPARC_PWR_MGMT.misc
1224
1225
1226// ----------------------------------------------------------------------------
1227// D stage
1228// ----------------------------------------------------------------------------
1229
1230assign fac_tid_d[2:0] =
1231 ({3{ mbist_run_1f }} & fac_mbist_addr_1f[7:5]) | // MBIST
1232 ({3{~mbist_run_1f & rng_rd_ecc_2f}} & rng_wr_tid_2f[2:0] ) | // ASI
1233 ({3{~mbist_run_1f & ~rng_rd_ecc_2f}} & dec_fgu_tid_d[2:0] ) ; // functional
1234
1235assign fac_frf_r1_addr_d[4:0] =
1236 ({5{ mbist_run_1f }} & fac_mbist_addr_1f[4:0]) | // MBIST
1237 ({5{~mbist_run_1f & rng_rd_ecc_2f}} & rng_data_2f_b7_0[7:3] ) | // ASI
1238 ({5{~mbist_run_1f & ~rng_rd_ecc_2f}} & dec_frf_r1_addr_d[4:0]) ; // functional
1239
1240assign fac_frf_r1_vld_d =
1241 ( mbist_run_1f & mbist_frf_read_en_1f ) | // MBIST
1242 ( ~mbist_run_1f & rng_rd_ecc_2f ) | // ASI
1243 ( ~mbist_run_1f & ~rng_rd_ecc_2f & dec_frf_r1_vld_d ) ; // functional
1244
1245// 0in custom -fire (rng_rd_ecc_2f & (dec_frf_r1_vld_d | dec_frf_r2_vld_d) & (dec_fgu_decode_d | dec_frf_store_d | (fgx_pdist_e & dec_fgu_valid_e))) -message "FRF_ECC ASI collision with FPop"
1246
1247
1248// ----------------------------------------------------------------------------
1249// E stage
1250// ----------------------------------------------------------------------------
1251
1252fgu_fac_ctl_msff_ctl_macro__width_10 e_00 (
1253 .scan_in(e_00_scanin),
1254 .scan_out(e_00_scanout),
1255 .l1clk(l1clk),
1256 .din ({mbi_run, spc_core_running_status[7:0], lsu_fgu_pmen }), // requires free running clk
1257 .dout({mbist_run_1f, core_running_status_1f[7:0], fgu_pmen_e}),
1258 .siclk(siclk),
1259 .soclk(soclk) // requires free running clk
1260 );
1261
1262fgu_fac_ctl_msff_ctl_macro__width_37 e_01 (
1263 .scan_in(e_01_scanin),
1264 .scan_out(e_01_scanout),
1265 .l1clk(l1clk_pm2),
1266 .din ({dec_fgu_op3_d[5:0], // requires free running clk or dec_fgu_decode_d en
1267 dec_fgu_opf_d[7:0], // requires free running clk or dec_fgu_decode_d en
1268 dec_frf_r1_vld_d, // requires free running clk or dec_fgu_decode_d en
1269 dec_frf_r2_vld_d, // requires free running clk or dec_fgu_decode_d en
1270 dec_frf_r1_32b_d, // requires free running clk or dec_fgu_decode_d en
1271 dec_frf_r2_32b_d, // requires free running clk or dec_fgu_decode_d en
1272 dec_frf_r1_odd32b_d, // requires free running clk or dec_fgu_decode_d en
1273 dec_frf_r2_odd32b_d, // requires free running clk or dec_fgu_decode_d en
1274 dec_frf_store_d, // requires free running clk or dec_fgu_decode_d en
1275 dec_fsr_store_d, // requires free running clk or dec_fgu_decode_d en
1276 dec_irf_w_addr_d[4:0], // requires free running clk or dec_fgu_decode_d en
1277 dec_spu_grant_d, // requires free running clk or dec_fgu_decode_d en
1278 spu_fgu_fpy_ctl_d[6:0], // requires free running clk or dec_fgu_decode_d en
1279 dec_fgu_decode_d, // requires free running clk or dec_fgu_decode_d en
1280 lsu_asi_clken}), // requires free running clk
1281 .dout({ op3_e[5:0],
1282 opf_e[7:0],
1283 r1_vld_e,
1284 r2_vld_e,
1285 r1_32b_e,
1286 r2_32b_e,
1287 r1_odd32b_e,
1288 r2_odd32b_e,
1289 frf_store_e,
1290 fsr_store_e,
1291 irf_w_addr_e[4:0],
1292 spu_grant_e,
1293 spu_fpy_ctl_e[6:0],
1294 fgu_decode_e,
1295 global_asi_clken}),
1296 .siclk(siclk),
1297 .soclk(soclk)
1298 );
1299
1300fgu_fac_ctl_msff_ctl_macro__width_17 e_02 (
1301 .scan_in(e_02_scanin),
1302 .scan_out(e_02_scanout),
1303 .l1clk(l1clk_pm2),
1304 .din ({dec_frf_w_vld_d, // requires free running clk or dec_fgu_decode_d en
1305 dec_frf_w_addr_d[4:0], // requires free running clk or dec_fgu_decode_d en
1306 dec_frf_w_32b_d, // requires free running clk or dec_fgu_decode_d en
1307 dec_frf_w_odd32b_d, // requires free running clk or dec_fgu_decode_d en
1308 dec_fgu_tid_d[2:0], // requires free running clk or dec_fgu_decode_d en
1309 dec_frf_r1_addr_d[4:0], // requires free running clk or dec_fgu_decode_d en
1310 dec_exu_src_vld_d}), // requires free running clk or dec_fgu_decode_d en
1311 .dout({ w1_vld_e,
1312 w1_addr_e[4:0],
1313 w1_32b_e,
1314 w1_odd32b_e,
1315 fac_tid_e[2:0],
1316 fac_frf_r1_addr_e[4:0],
1317 exu_w_vld_e}),
1318 .siclk(siclk),
1319 .soclk(soclk)
1320 );
1321
1322fgu_fac_ctl_msff_ctl_macro__width_9 e_03 (
1323 .scan_in(e_03_scanin),
1324 .scan_out(e_03_scanout),
1325 .l1clk(l1clk_pm1),
1326 .din ({mbi_frf_read_en, mbi_addr[7:0] }),
1327 .dout({mbist_frf_read_en_1f, fac_mbist_addr_1f[7:0]}),
1328 .siclk(siclk),
1329 .soclk(soclk)
1330 );
1331
1332assign i[24:19] = op3_e[5:0];
1333assign i[12:5] = opf_e[7:0];
1334
1335// ------------------------------------
1336// Begin auto/program generated code
1337// ------------------------------------
1338
1339assign aman_fmt_sel_e[4] = (!i[12]&!i[11]&!i[10]) | (i[22]) | (i[19]&!i[9]) | (
1340 i[20]) | (!i[23]);
1341
1342assign aman_fmt_sel_e[3] = (!i[22]&i[20]&!i[11]&i[9]&!i[7]&!i[6]) | (i[23]&!i[22]
1343 &!i[12]&!i[11]&!i[10]&i[5]) | (!i[22]&i[19]&!i[9]&i[5]) | (!i[22]
1344 &i[20]&i[11]&i[10]&i[5]) | (!i[22]&i[20]&!i[8]&i[7]&!i[6]&i[5]) | (
1345 !i[22]&i[20]&i[11]&i[6]&i[5]) | (!i[22]&i[20]&!i[12]&!i[8]&!i[7]&i[5]);
1346
1347assign aman_fmt_sel_e[2] = (!i[22]&i[19]&i[9]&i[5]) | (i[23]&!i[22]&!i[20]&!i[19]
1348 &!i[12]&i[11]&i[5]);
1349
1350assign aman_fmt_sel_e[1] = (!i[22]&i[19]&i[9]&i[5]) | (i[23]&!i[22]&!i[20]&!i[19]
1351 &!i[12]&i[11]&i[5]);
1352
1353assign aman_fmt_sel_e[0] = (!i[22]&i[19]&i[9]&!i[5]) | (i[23]&!i[22]&!i[20]
1354 &!i[19]&!i[12]&i[11]&!i[5]);
1355
1356// assign bman_fmt_sel_e[4] = (!i[6]&!i[5]) | (!i[12]&!i[11]&!i[10]) | (i[22]) | (
1357// i[19]&!i[9]) | (i[20]) | (!i[23]);
1358
1359assign bman_fmt_sel_e[3] = (!i[22]&i[20]&!i[8]&!i[7]&i[6]&i[5]) | (i[23]&!i[22]
1360 &i[12]&i[11]&!i[6]&!i[5]) | (!i[22]&i[20]&!i[8]&i[7]&!i[6]&i[5]) | (
1361 !i[22]&i[20]&!i[11]&i[9]&i[8]&!i[7]&!i[6]) | (i[23]&!i[22]&!i[12]
1362 &!i[11]&!i[10]&i[5]) | (!i[22]&i[19]&!i[9]&i[5]) | (!i[22]&i[20]
1363 &i[11]&i[5]);
1364
1365assign bman_fmt_sel_e[2] = (!i[22]&i[19]&i[9]&i[5]) | (i[23]&!i[22]&!i[20]&!i[19]
1366 &i[12]&i[5]) | (i[23]&!i[22]&!i[20]&i[10]&!i[7]&i[5]) | (i[23]&!i[22]
1367 &!i[20]&!i[19]&i[11]&i[5]);
1368
1369assign bman_fmt_sel_e[1] = (!i[22]&i[19]&i[9]&i[5]) | (i[23]&!i[22]&!i[20]&!i[19]
1370 &i[12]&i[5]) | (i[23]&!i[22]&!i[20]&i[10]&!i[7]&i[5]) | (i[23]&!i[22]
1371 &!i[20]&!i[19]&i[11]&i[5]);
1372
1373assign bman_fmt_sel_e[0] = (!i[22]&i[19]&i[9]&!i[5]) | (i[23]&!i[22]&!i[20]
1374 &i[10]&!i[7]&!i[5]) | (i[23]&!i[22]&!i[19]&i[12]&i[6]) | (i[23]&!i[22]
1375 &!i[20]&!i[19]&i[11]&i[6]);
1376
1377assign aexp_fmt_sel_e[6] = (!i[6]);
1378
1379assign aexp_fmt_sel_e[5] = (!i[11]&i[6]);
1380
1381assign aexp_fmt_sel_e[4] = (!i[11]&i[5]);
1382
1383assign aexp_fmt_sel_e[3] = (!i[12]);
1384
1385assign aexp_fmt_sel_e[2] = (!i[12]&i[5]);
1386
1387assign aexp_fmt_sel_e[1] = (!i[12]&i[5]);
1388
1389assign aexp_fmt_sel_e[0] = (i[12]&i[7]&i[6]) | (i[12]&i[8]&i[5]) | (i[22]) | (
1390 i[19]&!i[9]) | (i[20]) | (!i[12]&!i[11]) | (!i[23]);
1391
1392assign bexp_fmt_sel_e[2] = (i[5]);
1393
1394assign bexp_fmt_sel_e[1] = (i[5]);
1395
1396assign bexp_fmt_sel_e[0] = (!i[6]&!i[5]) | (!i[12]&!i[11]&!i[10]) | (i[22]) | (
1397 i[19]&!i[9]) | (i[20]) | (!i[23]);
1398
1399assign fpx_itype_e[2] = (!i[22]&i[19]&i[9]) | (i[23]&i[20]&!i[11]&i[9]&!i[7]
1400 &!i[6]) | (i[23]&i[20]&!i[11]&i[9]&!i[8]) | (i[23]&!i[22]&!i[20]
1401 &!i[12]&i[11]&i[8]) | (!i[23]&i[19]) | (i[23]&!i[22]&!i[19]&!i[11]
1402 &i[10]&!i[9]) | (!i[24]);
1403
1404assign fpx_itype_e[1] = (i[23]&!i[22]&!i[20]&!i[11]&i[10]&!i[7]) | (i[23]&!i[22]
1405 &i[12]&!i[6]&!i[5]) | (i[23]&!i[22]&!i[20]&!i[19]&i[12]&!i[8]&!i[7]) | (
1406 !i[23]&i[21]&i[19]) | (i[23]&!i[22]&!i[20]&i[8]&i[7]) | (!i[24]&i[21]);
1407
1408assign fpx_itype_e[0] = (i[23]&!i[22]&!i[19]&i[12]&i[7]) | (!i[22]&i[20]&!i[11]
1409 &i[9]&!i[7]&!i[6]) | (i[23]&!i[22]&i[12]&!i[6]&!i[5]) | (!i[22]&i[20]
1410 &!i[11]&i[9]&!i[8]) | (i[23]&!i[22]&!i[20]&i[10]&!i[7]) | (i[23]
1411 &!i[22]&!i[20]&i[11]&i[8]&!i[7]) | (!i[21]);
1412
1413assign fpx_dtype_e[2] = (!i[20]&!i[11]&!i[8]&!i[7]) | (!i[22]&i[10]&i[9]) | (
1414 !i[23]&!i[20]) | (i[22]&!i[20]) | (!i[21]);
1415
1416assign fpx_dtype_e[1] = (i[23]&!i[22]&!i[19]&!i[10]&i[9]) | (i[22]&i[21]&i[20]) | (
1417 i[21]&i[20]&!i[9]);
1418
1419assign fpx_dtype_e[0] = (!i[22]&i[20]&!i[9]&i[7]) | (i[23]&!i[22]&i[12]&i[11]
1420 &!i[7]) | (i[23]&!i[22]&!i[12]&!i[10]&i[6]) | (i[23]&!i[22]&!i[20]
1421 &i[8]&!i[5]) | (i[22]&i[21]&i[20]) | (i[23]&!i[22]&i[11]&i[10]);
1422
1423assign fpx_stype_e[1] = (!i[6]&!i[5]);
1424
1425assign fpx_stype_e[0] = (!i[11]&!i[5]) | (i[6]);
1426
1427assign fpx_sign_instr_e = (i[23]&!i[22]&!i[19]&!i[12]&!i[10]&i[7]);
1428
1429assign fpx_rnd_trunc_e = (i[12]&!i[8]&!i[7]) | (!i[12]&!i[11]&!i[10]) | (i[22]) | (
1430 i[19]) | (i[20]) | (!i[23]);
1431
1432assign fpx_mulscc_e = (!i[23]&!i[22]);
1433
1434assign fpx_saverestore_e = (i[23]&i[22]&!i[20]);
1435
1436assign fpx_int_cc_vld_e = (!i[23]&!i[22]) | (!i[24]&i[23]);
1437
1438assign fpx_fmul8x16_e = (!i[22]&i[20]&!i[11]&i[9]&!i[8]&!i[7]&!i[6]);
1439
1440assign fpx_fmul8x16au_e = (!i[22]&i[20]&!i[11]&!i[8]&!i[7]&i[6]&i[5]);
1441
1442assign fpx_fmul8x16al_e = (!i[22]&i[20]&!i[11]&i[9]&!i[8]&i[7]&!i[6]);
1443
1444assign fpx_fmul8sux16_e = (!i[22]&i[20]&!i[11]&i[9]&!i[8]&!i[5]);
1445
1446assign fpx_fmul8ulx16_e = (!i[22]&i[20]&!i[11]&i[7]&i[6]&i[5]);
1447
1448assign fpx_fmuld8sux16_e = (!i[22]&i[20]&!i[11]&i[9]&!i[6]&!i[5]);
1449
1450assign fpx_fmuld8ulx16_e = (!i[22]&i[20]&!i[11]&i[8]&!i[7]&!i[6]&i[5]);
1451
1452assign fpx_nv_vld_e = (!i[22]&i[19]&i[9]) | (i[23]&!i[22]&!i[20]&i[10]&!i[7]) | (
1453 i[23]&!i[22]&!i[20]&!i[19]&i[11]&i[6]) | (i[23]&!i[22]&!i[20]&!i[19]
1454 &i[11]&i[5]) | (i[23]&!i[22]&!i[20]&!i[19]&i[12]&!i[8]&!i[7]);
1455
1456assign fpx_of_vld_e = (i[23]&!i[22]&!i[20]&!i[19]&!i[12]&i[11]&!i[10]) | (i[23]
1457 &!i[22]&!i[20]&!i[19]&i[11]&!i[9]&i[6]);
1458
1459assign fpx_uf_vld_e = (i[23]&!i[22]&!i[20]&!i[19]&!i[12]&i[11]&!i[10]) | (i[23]
1460 &!i[22]&!i[20]&!i[19]&i[11]&!i[9]&i[6]);
1461
1462assign fpx_dz_vld_e = (i[23]&!i[22]&!i[20]&i[8]&i[7]);
1463
1464assign fpx_nx_vld_e = (i[23]&!i[22]&i[12]&i[8]&i[5]) | (i[23]&!i[22]&!i[20]
1465 &i[10]&!i[7]) | (i[23]&!i[22]&!i[20]&!i[19]&i[12]&!i[11]) | (i[23]
1466 &!i[22]&!i[20]&!i[19]&i[11]&!i[8]) | (i[23]&!i[22]&!i[20]&!i[12]
1467 &i[11]&i[8]);
1468
1469assign fpx_unfin_vld_e = (i[23]&!i[22]&!i[20]&i[10]&!i[7]) | (i[23]&!i[22]&!i[20]
1470 &!i[19]&i[11]&i[6]) | (i[23]&!i[22]&!i[20]&!i[19]&i[12]&!i[8]&!i[7]) | (
1471 i[23]&!i[22]&!i[20]&!i[19]&i[11]&i[5]);
1472
1473assign fgx_mvcond_e = (!i[22]&i[19]&!i[9]);
1474
1475assign fgx_mvucond_e = (i[23]&!i[22]&!i[19]&!i[12]&!i[11]&!i[10]&!i[8]&!i[7]);
1476
1477assign fgx_abs_e = (i[23]&!i[22]&!i[12]&!i[11]&!i[10]&i[8]);
1478
1479assign fgx_neg_e = (i[23]&!i[22]&!i[12]&!i[11]&!i[10]&i[7]);
1480
1481assign fgx_logical_e = (!i[22]&i[20]&i[11]&i[10]);
1482
1483assign fgx_expand_e = (!i[22]&i[20]&!i[10]&i[8]&!i[6]&i[5]);
1484
1485assign fgx_merge_e = (!i[22]&i[20]&!i[10]&i[8]&i[6]);
1486
1487assign fgx_align_e = (!i[22]&i[20]&!i[10]&i[8]&!i[7]&!i[5]);
1488
1489assign fgx_shuffle_e = (!i[22]&i[20]&!i[10]&i[8]&i[7]&!i[5]);
1490
1491assign fgx_pack16_e = (!i[22]&i[20]&!i[11]&i[8]&i[6]&i[5]);
1492
1493assign fgx_pack32_e = (!i[22]&i[20]&!i[11]&i[9]&!i[7]&i[6]&!i[5]);
1494
1495assign fgx_packfix_e = (!i[22]&i[20]&!i[11]&i[8]&i[7]&i[5]);
1496
1497assign fgx_pdist_e = (!i[22]&i[20]&!i[11]&i[9]&i[8]&i[7]&!i[5]);
1498
1499assign fgx_popc_e = (i[24]&i[22]&i[20]);
1500
1501assign fgx_siam_e = (!i[22]&i[20]&i[12]);
1502
1503assign fpx_itype_mul_e = (!i[22]&i[20]&!i[11]&i[9]&!i[7]&!i[6]) | (i[23]&!i[22]
1504 &!i[20]&!i[12]&i[11]&i[8]&!i[7]) | (!i[22]&i[20]&!i[11]&i[9]&!i[8]) | (
1505 !i[21]);
1506
1507assign fpx_itype_div_e = (i[23]&!i[22]&!i[20]&!i[11]&i[10]&!i[7]) | (!i[23]
1508 &i[21]&i[19]) | (i[23]&!i[22]&!i[20]&i[8]&i[7]) | (!i[24]&i[21]);
1509
1510assign fgx_instr_e = (i[24]&i[22]&i[20]) | (!i[22]&i[20]&i[9]&i[8]&i[7]) | (
1511 !i[22]&i[20]&i[9]&i[8]&i[6]) | (i[23]&!i[22]&!i[12]&!i[11]&!i[10]) | (
1512 !i[22]&i[20]&i[11]&i[10]) | (!i[22]&i[20]&!i[10]&!i[9]) | (!i[22]
1513 &i[19]&!i[9]);
1514
1515// ------------------------------------
1516// End auto/program generated code
1517// ------------------------------------
1518
1519// For single source (or no source) fgu ops that read frf
1520// ensure that unneeded frf read port isn't enabled by DEC
1521// Note:
1522// dec_spu_grant_d, dec_exu_src_vld_d have no frf source
1523// dec_frf_store_d, dec_fsr_store_d have rs2 only
1524//
1525// rs1 only: FSRC1{s}, FNOT1{s}
1526// rs2 only: FABS(s,d), FiTO(s,d), FMOV(s,d), FMOV(s,d)cc, FMOV(s,d)r, FNEG(s,d), FSQRT(s,d), F(s,d)TOi,
1527// F(s,d)TO(d,s), F(s,d)TOx, FxTO(s,d), FSRC2{s}, FNOT2{s}, FEXPAND, FPACK16, FPACKFIX, PDIST(beat2)
1528// no frf source: FZERO{s}, FONE{s}, SIAM
1529//
1530// 0in custom -fire ( dec_fgu_valid_e & r2_vld_e & ((fgx_logical_e & (opf_e[7:1]==7'b0111010)) | (fgx_logical_e & (opf_e[7:1]==7'b0110101)) )) -message "Invalid FRF rs2 read enable"
1531//
1532// 0in custom -fire ( dec_fgu_valid_e & r1_vld_e & (fgx_abs_e | fgx_neg_e | fgx_mvcond_e | fgx_mvucond_e | (fpx_itype_e[2:0]==3'b001) | (fpx_itype_e[2:0]==3'b010) | (fpx_itype_e[2:0]==3'b011) | (fpx_itype_e[2:0]==3'b111) | fgx_expand_e | fgx_pack16_e | fgx_packfix_e | (fgx_logical_e & (opf_e[7:1]==7'b0111100)) | (fgx_logical_e & (opf_e[7:1]==7'b0110011)) )) -message "Invalid FRF rs1 read enable"
1533//
1534// 0in custom -fire ($0in_delay(fac_fgx_pdist_fx1,1) & dec_valid_fx2 & $0in_delay(r1_vld_e,1)) -message "Invalid FRF rs1 read enable during PDIST 2nd beat"
1535//
1536// 0in custom -fire ( dec_fgu_valid_e & (r1_vld_e | r2_vld_e) & ( fgx_siam_e | (fgx_logical_e & (opf_e[7:1]==7'b0110000)) | (fgx_logical_e & (opf_e[7:1]==7'b0111111)) )) -message "Invalid FRF rs1 or rs2 read enable"
1537//
1538// 0in custom -fire (exu_w_vld_e & dec_fgu_valid_e & (r1_vld_e | r2_vld_e)) -message "Invalid FRF read enable during EXU op"
1539//
1540// 0in custom -fire (spu_grant_e & (r1_vld_e | r2_vld_e)) -message "Invalid FRF read enable during SPU op"
1541
1542assign fac_exu_src_e = exu_w_vld_e & ~mbist_run_1f;
1543
1544assign q_fgx_pdist_e = fgx_pdist_e & fgu_decode_e; // pdist 2nd beat has fgu_decode_e=1'b0
1545
1546assign fst_fmt_sel_e[0] = frf_store_e & r2_odd32b_e & fgu_decode_e; // pwr mgmt: aomux free zeros
1547assign fst_fmt_sel_e[1] = frf_store_e & ~r2_odd32b_e & fgu_decode_e; // pwr mgmt: aomux free zeros
1548assign fst_fmt_sel_e[2] = fsr_store_e & ~r2_32b_e & fgu_decode_e; // pwr mgmt: aomux free zeros
1549assign fst_fmt_sel_e[3] = fsr_store_e & r2_32b_e & fgu_decode_e; // pwr mgmt: aomux free zeros
1550
1551// odd address and store handling equations
1552// these equations use predecode signals to qualify the auto/program generated format selects
1553
1554assign q_aman_fmt_sel_e[1] = aman_fmt_sel_e[1] & r1_odd32b_e;
1555assign q_aman_fmt_sel_e[2] = aman_fmt_sel_e[2] & ~r1_odd32b_e;
1556assign q_aman_fmt_sel_e[3] = aman_fmt_sel_e[3] & r1_odd32b_e;
1557assign q_aman_fmt_sel_e[4] = aman_fmt_sel_e[4] & ~r1_odd32b_e;
1558
1559assign q_bman_fmt_sel_e[0] =
1560 fgu_decode_e & // pdist 2nd beat has fgu_decode_e=1'b0
1561 bman_fmt_sel_e[0];
1562
1563assign q_bman_fmt_sel_e[1] =
1564 fgu_decode_e & // pdist 2nd beat has fgu_decode_e=1'b0
1565 bman_fmt_sel_e[1] & r2_odd32b_e;
1566
1567assign q_bman_fmt_sel_e[2] =
1568 fgu_decode_e & // pdist 2nd beat has fgu_decode_e=1'b0
1569 bman_fmt_sel_e[2] & ~r2_odd32b_e;
1570
1571assign q_bman_fmt_sel_e[3] =
1572 fgu_decode_e & // pdist 2nd beat has fgu_decode_e=1'b0
1573 bman_fmt_sel_e[3] & r2_odd32b_e;
1574
1575assign fac_aman_fmt_sel_e[4:0] = {q_aman_fmt_sel_e[4:1], aman_fmt_sel_e[0]};
1576assign fac_bman_fmt_sel_e[3:0] = q_bman_fmt_sel_e[3:0];
1577assign fac_bman_fmt_sel_e[4] = ~(|fac_bman_fmt_sel_e[3:0]);
1578
1579assign q_aexp_fmt_sel_e[1] = aexp_fmt_sel_e[1] & r1_odd32b_e;
1580assign q_bexp_fmt_sel_e[1] = bexp_fmt_sel_e[1] & r2_odd32b_e;
1581
1582assign aexp_fmt_sel_e[7] = (fpx_itype_e[2:0] == 3'b001); // FdTOs
1583
1584assign q_aexp_fmt_sel_e[8] =
1585 aexp_fmt_sel_e[1] & r1_odd32b_e & (opf_e[6:5] == 2'b11); // FsMULd
1586
1587assign aexp_fmt_sel_e[9] =
1588 aexp_fmt_sel_e[2] & (opf_e[6:5] == 2'b11); // FsMULd
1589
1590assign fac_aexp_fmt_sel_e[9:0] =
1591 { aexp_fmt_sel_e[9],
1592 q_aexp_fmt_sel_e[8],
1593 aexp_fmt_sel_e[7:2],
1594 q_aexp_fmt_sel_e[1],
1595 aexp_fmt_sel_e[0] };
1596
1597assign q_bexp_fmt_sel_e[3] =
1598 bexp_fmt_sel_e[1] & r2_odd32b_e & (fpx_itype_e[2:0] == 3'b110); // FDIV
1599
1600assign bexp_fmt_sel_e[4] =
1601 bexp_fmt_sel_e[2] & (fpx_itype_e[2:0] == 3'b110); // FDIV
1602
1603assign bexp_fmt_sel_e[5] = (fpx_itype_e[2:0] == 3'b110); // FDIV
1604
1605assign bexp_fmt_sel_e[6] =
1606 bexp_fmt_sel_e[1] & r2_odd32b_e & (opf_e[6:5] == 2'b11); // FsMULd
1607
1608assign bexp_fmt_sel_e[7] =
1609 bexp_fmt_sel_e[2] & (opf_e[6:5] == 2'b11); // FsMULd
1610
1611assign fac_bexp_fmt_sel_e[7:0] =
1612 { bexp_fmt_sel_e[7:4],
1613 q_bexp_fmt_sel_e[3],
1614 bexp_fmt_sel_e[2],
1615 q_bexp_fmt_sel_e[1],
1616 bexp_fmt_sel_e[0] };
1617
1618assign fpx_sp_dest_e =
1619 (fpx_dtype_e[2:0] == 3'b000) | // sp
1620 (fpx_dtype_e[2:0] == 3'b011) ; // 32-bit
1621
1622assign q_w1_vld_e[0] = w1_vld_e & (~w1_32b_e | (w1_32b_e & w1_odd32b_e));
1623assign q_w1_vld_e[1] = w1_vld_e & (~w1_32b_e | (w1_32b_e & ~w1_odd32b_e));
1624
1625// for FCMP: w1_addr_e[4]=cc[0], w1_addr_e[0]=cc[1]
1626assign cc_target_e[1:0] = {w1_addr_e[0], w1_addr_e[4]};
1627
1628// must later clear fcc_vld if (nv & TEM) | flush
1629
1630assign pre_fcc_vld_e[3] =
1631 dec_fgu_valid_e &
1632 (cc_target_e[1:0] == 2'b11) &
1633 (fpx_itype_e[2:0] == 3'b100) & (fpx_dtype_e[2:1] == 2'b00); // FCMP,FCMPE
1634
1635assign pre_fcc_vld_e[2] =
1636 dec_fgu_valid_e &
1637 (cc_target_e[1:0] == 2'b10) &
1638 (fpx_itype_e[2:0] == 3'b100) & (fpx_dtype_e[2:1] == 2'b00); // FCMP,FCMPE
1639
1640assign pre_fcc_vld_e[1] =
1641 dec_fgu_valid_e &
1642 (cc_target_e[1:0] == 2'b01) &
1643 (fpx_itype_e[2:0] == 3'b100) & (fpx_dtype_e[2:1] == 2'b00); // FCMP,FCMPE
1644
1645assign pre_fcc_vld_e[0] =
1646 dec_fgu_valid_e &
1647 (cc_target_e[1:0] == 2'b00) &
1648 (fpx_itype_e[2:0] == 3'b100) & (fpx_dtype_e[2:1] == 2'b00); // FCMP,FCMPE
1649
1650assign i_fsr_w2_vld_fb[0] = // load FSR 32b
1651 lsu_fgu_fsr_load_b & lsu_fgu_fld_32b_b;
1652
1653assign i_fsr_w2_vld_fb[1] = // load FSR 64b
1654 lsu_fgu_fsr_load_b & ~lsu_fgu_fld_32b_b;
1655
1656assign i_fsr_w2_vld_fb[2] =
1657 div_finish_fltd_fb | div_finish_flts_fb; // div/sqrt, load FSR doesn't update ftt
1658
1659// 0in custom -fire ((lsu_fgu_fld_vld_w & ($0in_delay((lsu_fgu_fsr_load_b & div_engine_busy_e & (lsu_fgu_fld_tid_b[2:0]==div_tid_in_e[2:0])),1))) | (lsu_fgu_fld_vld_w & ($0in_delay((lsu_fgu_fsr_load_b & (div_finish_fltd_fb | div_finish_flts_fb) & (lsu_fgu_fld_tid_b[2:0]==fac_fpd_tid_fb[2:0])),1))) | (lsu_fgu_fld_vld_w & ($0in_delay((lsu_fgu_fsr_load_b & dec_fgu_valid_e & (lsu_fgu_fld_tid_b[2:0]==fac_tid_e[2:0])),1))) | (lsu_fgu_fld_vld_w & ($0in_delay((lsu_fgu_fsr_load_b & fac_dec_valid_fx1 & (lsu_fgu_fld_tid_b[2:0]==tid_fx1[2:0])),1))) | (lsu_fgu_fld_vld_w & ($0in_delay((lsu_fgu_fsr_load_b & dec_valid_fx2 & (lsu_fgu_fld_tid_b[2:0]==tid_fx2[2:0])),1))) | (lsu_fgu_fld_vld_w & ($0in_delay((lsu_fgu_fsr_load_b & dec_valid_fx3 & (lsu_fgu_fld_tid_b[2:0]==tid_fx3[2:0])),1)))) -message "LDFSR collision with FPop"
1660
1661assign fsr_w1_qvld_fb = // other FPop w1 or fcmp with trap, not unfin
1662 ~fpc_fpx_unfin_fb &
1663 (fsr_w1_vld_fb[0] | (pre_fcc_vld_fb & ~(|fcc_vld_fb[3:0])));
1664
1665assign fsr_w2_qvld_fb =
1666 ~fpc_fpd_unfin_fb &
1667 i_fsr_w2_vld_fb[2];
1668
1669// ----------------
1670// FSR tid0 selects
1671// ----------------
1672
1673assign fsr0_sel_fb[5] =
1674 i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd0);
1675
1676assign fsr0_sel_fb[4] = // select w1 {ftt,aexc,cexc}, not fpd {ftt,aexc,cexc}
1677 (( |fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd0);
1678
1679assign fsr0_sel_fb[3] = // enable flop
1680 ( i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd0)) |
1681 (((|fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd0)) ;
1682
1683assign fsr0_sel_fb[2:0] =
1684 ({3{(fsr_w1_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd0))}} & 3'd2) | // ST(X)FSR
1685 ({3{(fpc_fpx_unfin_fb & (fac_w1_tid_fb[2:0] == 3'd0))}} & 3'd2) | // unfin w1
1686 ({3{(fpc_fpd_unfin_fb & (fac_fpd_tid_fb[2:0] == 3'd0))}} & 3'd2) | // unfin FDIV/FSQRT
1687 ({3{(fcc_vld_fb[0] & (fac_w1_tid_fb[2:0] == 3'd0))}} & 3'd3) | // FCMP(E) fcc0
1688 ({3{(fcc_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd0))}} & 3'd4) | // FCMP(E) fcc1
1689 ({3{(fcc_vld_fb[2] & (fac_w1_tid_fb[2:0] == 3'd0))}} & 3'd5) | // FCMP(E) fcc2
1690 ({3{(fcc_vld_fb[3] & (fac_w1_tid_fb[2:0] == 3'd0))}} & 3'd6) | // FCMP(E) fcc3
1691 ({3{(fsr_w1_qvld_fb & (fac_w1_tid_fb[2:0] == 3'd0))}} & 3'd7) | // other FPop w1
1692 ({3{(fsr_w2_qvld_fb & (fac_fpd_tid_fb[2:0] == 3'd0))}} & 3'd7) ; // other FPop FDIV/FSQRT
1693
1694// ----------------
1695// FSR tid1 selects
1696// ----------------
1697
1698assign fsr1_sel_fb[5] =
1699 i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd1);
1700
1701assign fsr1_sel_fb[4] = // select w1 {ftt,aexc,cexc}, not fpd {ftt,aexc,cexc}
1702 (( |fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd1);
1703
1704assign fsr1_sel_fb[3] = // enable flop
1705 ( i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd1)) |
1706 (((|fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd1)) ;
1707
1708assign fsr1_sel_fb[2:0] =
1709 ({3{(fsr_w1_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd1))}} & 3'd2) | // ST(X)FSR
1710 ({3{(fpc_fpx_unfin_fb & (fac_w1_tid_fb[2:0] == 3'd1))}} & 3'd2) | // unfin w1
1711 ({3{(fpc_fpd_unfin_fb & (fac_fpd_tid_fb[2:0] == 3'd1))}} & 3'd2) | // unfin FDIV/FSQRT
1712 ({3{(fcc_vld_fb[0] & (fac_w1_tid_fb[2:0] == 3'd1))}} & 3'd3) | // FCMP(E) fcc0
1713 ({3{(fcc_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd1))}} & 3'd4) | // FCMP(E) fcc1
1714 ({3{(fcc_vld_fb[2] & (fac_w1_tid_fb[2:0] == 3'd1))}} & 3'd5) | // FCMP(E) fcc2
1715 ({3{(fcc_vld_fb[3] & (fac_w1_tid_fb[2:0] == 3'd1))}} & 3'd6) | // FCMP(E) fcc3
1716 ({3{(fsr_w1_qvld_fb & (fac_w1_tid_fb[2:0] == 3'd1))}} & 3'd7) | // other FPop w1
1717 ({3{(fsr_w2_qvld_fb & (fac_fpd_tid_fb[2:0] == 3'd1))}} & 3'd7) ; // other FPop FDIV/FSQRT
1718
1719// ----------------
1720// FSR tid2 selects
1721// ----------------
1722
1723assign fsr2_sel_fb[5] =
1724 i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd2);
1725
1726assign fsr2_sel_fb[4] = // select w1 {ftt,aexc,cexc}, not fpd {ftt,aexc,cexc}
1727 (( |fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd2);
1728
1729assign fsr2_sel_fb[3] = // enable flop
1730 ( i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd2)) |
1731 (((|fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd2)) ;
1732
1733assign fsr2_sel_fb[2:0] =
1734 ({3{(fsr_w1_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd2))}} & 3'd2) | // ST(X)FSR
1735 ({3{(fpc_fpx_unfin_fb & (fac_w1_tid_fb[2:0] == 3'd2))}} & 3'd2) | // unfin w1
1736 ({3{(fpc_fpd_unfin_fb & (fac_fpd_tid_fb[2:0] == 3'd2))}} & 3'd2) | // unfin FDIV/FSQRT
1737 ({3{(fcc_vld_fb[0] & (fac_w1_tid_fb[2:0] == 3'd2))}} & 3'd3) | // FCMP(E) fcc0
1738 ({3{(fcc_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd2))}} & 3'd4) | // FCMP(E) fcc1
1739 ({3{(fcc_vld_fb[2] & (fac_w1_tid_fb[2:0] == 3'd2))}} & 3'd5) | // FCMP(E) fcc2
1740 ({3{(fcc_vld_fb[3] & (fac_w1_tid_fb[2:0] == 3'd2))}} & 3'd6) | // FCMP(E) fcc3
1741 ({3{(fsr_w1_qvld_fb & (fac_w1_tid_fb[2:0] == 3'd2))}} & 3'd7) | // other FPop w1
1742 ({3{(fsr_w2_qvld_fb & (fac_fpd_tid_fb[2:0] == 3'd2))}} & 3'd7) ; // other FPop FDIV/FSQRT
1743
1744// ----------------
1745// FSR tid3 selects
1746// ----------------
1747
1748assign fsr3_sel_fb[5] =
1749 i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd3);
1750
1751assign fsr3_sel_fb[4] = // select w1 {ftt,aexc,cexc}, not fpd {ftt,aexc,cexc}
1752 (( |fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd3);
1753
1754assign fsr3_sel_fb[3] = // enable flop
1755 ( i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd3)) |
1756 (((|fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd3)) ;
1757
1758assign fsr3_sel_fb[2:0] =
1759 ({3{(fsr_w1_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd3))}} & 3'd2) | // ST(X)FSR
1760 ({3{(fpc_fpx_unfin_fb & (fac_w1_tid_fb[2:0] == 3'd3))}} & 3'd2) | // unfin w1
1761 ({3{(fpc_fpd_unfin_fb & (fac_fpd_tid_fb[2:0] == 3'd3))}} & 3'd2) | // unfin FDIV/FSQRT
1762 ({3{(fcc_vld_fb[0] & (fac_w1_tid_fb[2:0] == 3'd3))}} & 3'd3) | // FCMP(E) fcc0
1763 ({3{(fcc_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd3))}} & 3'd4) | // FCMP(E) fcc1
1764 ({3{(fcc_vld_fb[2] & (fac_w1_tid_fb[2:0] == 3'd3))}} & 3'd5) | // FCMP(E) fcc2
1765 ({3{(fcc_vld_fb[3] & (fac_w1_tid_fb[2:0] == 3'd3))}} & 3'd6) | // FCMP(E) fcc3
1766 ({3{(fsr_w1_qvld_fb & (fac_w1_tid_fb[2:0] == 3'd3))}} & 3'd7) | // other FPop w1
1767 ({3{(fsr_w2_qvld_fb & (fac_fpd_tid_fb[2:0] == 3'd3))}} & 3'd7) ; // other FPop FDIV/FSQRT
1768
1769// ----------------
1770// FSR tid4 selects
1771// ----------------
1772
1773assign fsr4_sel_fb[5] =
1774 i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd4);
1775
1776assign fsr4_sel_fb[4] = // select w1 {ftt,aexc,cexc}, not fpd {ftt,aexc,cexc}
1777 (( |fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd4);
1778
1779assign fsr4_sel_fb[3] = // enable flop
1780 ( i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd4)) |
1781 (((|fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd4)) ;
1782
1783assign fsr4_sel_fb[2:0] =
1784 ({3{(fsr_w1_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd4))}} & 3'd2) | // ST(X)FSR
1785 ({3{(fpc_fpx_unfin_fb & (fac_w1_tid_fb[2:0] == 3'd4))}} & 3'd2) | // unfin w1
1786 ({3{(fpc_fpd_unfin_fb & (fac_fpd_tid_fb[2:0] == 3'd4))}} & 3'd2) | // unfin FDIV/FSQRT
1787 ({3{(fcc_vld_fb[0] & (fac_w1_tid_fb[2:0] == 3'd4))}} & 3'd3) | // FCMP(E) fcc0
1788 ({3{(fcc_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd4))}} & 3'd4) | // FCMP(E) fcc1
1789 ({3{(fcc_vld_fb[2] & (fac_w1_tid_fb[2:0] == 3'd4))}} & 3'd5) | // FCMP(E) fcc2
1790 ({3{(fcc_vld_fb[3] & (fac_w1_tid_fb[2:0] == 3'd4))}} & 3'd6) | // FCMP(E) fcc3
1791 ({3{(fsr_w1_qvld_fb & (fac_w1_tid_fb[2:0] == 3'd4))}} & 3'd7) | // other FPop w1
1792 ({3{(fsr_w2_qvld_fb & (fac_fpd_tid_fb[2:0] == 3'd4))}} & 3'd7) ; // other FPop FDIV/FSQRT
1793
1794// ----------------
1795// FSR tid5 selects
1796// ----------------
1797
1798assign fsr5_sel_fb[5] =
1799 i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd5);
1800
1801assign fsr5_sel_fb[4] = // select w1 {ftt,aexc,cexc}, not fpd {ftt,aexc,cexc}
1802 (( |fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd5);
1803
1804assign fsr5_sel_fb[3] = // enable flop
1805 ( i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd5)) |
1806 (((|fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd5)) ;
1807
1808assign fsr5_sel_fb[2:0] =
1809 ({3{(fsr_w1_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd5))}} & 3'd2) | // ST(X)FSR
1810 ({3{(fpc_fpx_unfin_fb & (fac_w1_tid_fb[2:0] == 3'd5))}} & 3'd2) | // unfin w1
1811 ({3{(fpc_fpd_unfin_fb & (fac_fpd_tid_fb[2:0] == 3'd5))}} & 3'd2) | // unfin FDIV/FSQRT
1812 ({3{(fcc_vld_fb[0] & (fac_w1_tid_fb[2:0] == 3'd5))}} & 3'd3) | // FCMP(E) fcc0
1813 ({3{(fcc_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd5))}} & 3'd4) | // FCMP(E) fcc1
1814 ({3{(fcc_vld_fb[2] & (fac_w1_tid_fb[2:0] == 3'd5))}} & 3'd5) | // FCMP(E) fcc2
1815 ({3{(fcc_vld_fb[3] & (fac_w1_tid_fb[2:0] == 3'd5))}} & 3'd6) | // FCMP(E) fcc3
1816 ({3{(fsr_w1_qvld_fb & (fac_w1_tid_fb[2:0] == 3'd5))}} & 3'd7) | // other FPop w1
1817 ({3{(fsr_w2_qvld_fb & (fac_fpd_tid_fb[2:0] == 3'd5))}} & 3'd7) ; // other FPop FDIV/FSQRT
1818
1819// ----------------
1820// FSR tid6 selects
1821// ----------------
1822
1823assign fsr6_sel_fb[5] =
1824 i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd6);
1825
1826assign fsr6_sel_fb[4] = // select w1 {ftt,aexc,cexc}, not fpd {ftt,aexc,cexc}
1827 (( |fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd6);
1828
1829assign fsr6_sel_fb[3] = // enable flop
1830 ( i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd6)) |
1831 (((|fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd6)) ;
1832
1833assign fsr6_sel_fb[2:0] =
1834 ({3{(fsr_w1_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd6))}} & 3'd2) | // ST(X)FSR
1835 ({3{(fpc_fpx_unfin_fb & (fac_w1_tid_fb[2:0] == 3'd6))}} & 3'd2) | // unfin w1
1836 ({3{(fpc_fpd_unfin_fb & (fac_fpd_tid_fb[2:0] == 3'd6))}} & 3'd2) | // unfin FDIV/FSQRT
1837 ({3{(fcc_vld_fb[0] & (fac_w1_tid_fb[2:0] == 3'd6))}} & 3'd3) | // FCMP(E) fcc0
1838 ({3{(fcc_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd6))}} & 3'd4) | // FCMP(E) fcc1
1839 ({3{(fcc_vld_fb[2] & (fac_w1_tid_fb[2:0] == 3'd6))}} & 3'd5) | // FCMP(E) fcc2
1840 ({3{(fcc_vld_fb[3] & (fac_w1_tid_fb[2:0] == 3'd6))}} & 3'd6) | // FCMP(E) fcc3
1841 ({3{(fsr_w1_qvld_fb & (fac_w1_tid_fb[2:0] == 3'd6))}} & 3'd7) | // other FPop w1
1842 ({3{(fsr_w2_qvld_fb & (fac_fpd_tid_fb[2:0] == 3'd6))}} & 3'd7) ; // other FPop FDIV/FSQRT
1843
1844// ----------------
1845// FSR tid7 selects
1846// ----------------
1847
1848assign fsr7_sel_fb[5] =
1849 i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd7);
1850
1851assign fsr7_sel_fb[4] = // select w1 {ftt,aexc,cexc}, not fpd {ftt,aexc,cexc}
1852 (( |fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd7);
1853
1854assign fsr7_sel_fb[3] = // enable flop
1855 ( i_fsr_w2_vld_fb[2] & (fac_fpd_tid_fb[2:0] == 3'd7)) |
1856 (((|fsr_w1_vld_fb[1:0]) | pre_fcc_vld_fb) & (fac_w1_tid_fb[2:0] == 3'd7)) ;
1857
1858assign fsr7_sel_fb[2:0] =
1859 ({3{(fsr_w1_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd7))}} & 3'd2) | // ST(X)FSR
1860 ({3{(fpc_fpx_unfin_fb & (fac_w1_tid_fb[2:0] == 3'd7))}} & 3'd2) | // unfin w1
1861 ({3{(fpc_fpd_unfin_fb & (fac_fpd_tid_fb[2:0] == 3'd7))}} & 3'd2) | // unfin FDIV/FSQRT
1862 ({3{(fcc_vld_fb[0] & (fac_w1_tid_fb[2:0] == 3'd7))}} & 3'd3) | // FCMP(E) fcc0
1863 ({3{(fcc_vld_fb[1] & (fac_w1_tid_fb[2:0] == 3'd7))}} & 3'd4) | // FCMP(E) fcc1
1864 ({3{(fcc_vld_fb[2] & (fac_w1_tid_fb[2:0] == 3'd7))}} & 3'd5) | // FCMP(E) fcc2
1865 ({3{(fcc_vld_fb[3] & (fac_w1_tid_fb[2:0] == 3'd7))}} & 3'd6) | // FCMP(E) fcc3
1866 ({3{(fsr_w1_qvld_fb & (fac_w1_tid_fb[2:0] == 3'd7))}} & 3'd7) | // other FPop w1
1867 ({3{(fsr_w2_qvld_fb & (fac_fpd_tid_fb[2:0] == 3'd7))}} & 3'd7) ; // other FPop FDIV/FSQRT
1868
1869assign q_r1_vld_e[0] = r1_vld_e & (~r1_32b_e | (r1_32b_e & r1_odd32b_e));
1870assign q_r1_vld_e[1] = r1_vld_e & (~r1_32b_e | (r1_32b_e & ~r1_odd32b_e));
1871assign q_r2_vld_e[0] = r2_vld_e & (~r2_32b_e | (r2_32b_e & r2_odd32b_e));
1872assign q_r2_vld_e[1] = r2_vld_e & (~r2_32b_e | (r2_32b_e & ~r2_odd32b_e));
1873
1874assign fac_rs2_rotate_sel_e[0] = // odd FiTO(s,d)
1875 (fpx_itype_e[2:0] == 3'b011) & (fpx_stype_e[1:0] == 2'b10) & r2_odd32b_e;
1876
1877assign fac_rs2_rotate_sel_e[1] = // even FiTO(s,d)
1878 (fpx_itype_e[2:0] == 3'b011) & (fpx_stype_e[1:0] == 2'b10) & ~r2_odd32b_e;
1879
1880assign fac_rs2_rotate_sel_e[2] = // FiTO(s,d)
1881 (fpx_itype_e[2:0] == 3'b011) & (fpx_stype_e[1:0] == 2'b10);
1882
1883assign fac_rs2_rotate_sel_e[3] = // odd
1884 ~fac_rs2_rotate_sel_e[2] & r2_odd32b_e;
1885
1886assign fac_rs2_rotate_sel_e[4] = // even
1887 ~fac_rs2_rotate_sel_e[2] & ~r2_odd32b_e;
1888
1889assign fac_i2f_sel_e[0] = // F(i,x)TO(s,d)
1890 (fpx_itype_e[2:0] == 3'b011);
1891
1892assign fac_i2f_sel_e[1] = // ~F(i,x)TO(s,d)
1893 ~(fpx_itype_e[2:0] == 3'b011);
1894
1895// ------------------------------------
1896// Instructions which depend on appropriate steering
1897// of rs1/rs2 thru Mse/Mle:
1898//
1899// instr desired behavior default behavior
1900// ---------------------------------------------------
1901// F(i,x)TO(s,d) rs2=Mse (B<A) ~(B<A) ??? <= rs1 is unknown
1902// F(s,d)TO(i,x) rs2=Mse (B<A) ~(B<A) ??? <= rs1 is unknown
1903// MULScc rs2=Mse (B<A) ~(B<A)
1904// SAVE rs2=Mse (B<A) ~(B<A)
1905// RESTORE rs2=Mse (B<A) ~(B<A)
1906// FPSUB{16,32}{s} rs2=Mse (B<A) ~(B<A)
1907// F(s,d)TO(d,s) rs2=Mle ~(B<A) ~(B<A) ??? <= rs1 is unknown
1908// FADD(s,d) src dependent <= no action required
1909// FSUB(s,d) src dependent <= no action required
1910//
1911// These required for NaN steering only:
1912// FsMULd src dependent <= no action required
1913// FMUL(s,d) src dependent <= no action required
1914// FDIV(s,d) src dependent <= no action required
1915// FSQRT(s,d) rs2=Mle ~(B<A) ~(B<A) ??? <= rs1 is unknown
1916//
1917// ------------------------------------
1918
1919assign force_swap_blta_e =
1920 (fpx_itype_e[2:0] == 3'b010) | // F(s,d)TO(i,x)
1921 (fpx_itype_e[2:0] == 3'b011) | // F(i,x)TO(s,d)
1922 (fpx_mulscc_e ) | // MULScc
1923 (fpx_saverestore_e ) | // SAVE or RESTORE
1924 ((fpx_dtype_e[2:1] == 2'b01) & fpx_sign_instr_e); // FPSUB{16,32}{s}
1925
1926assign force_noswap_blta_e =
1927 (fpx_itype_e[2:0] == 3'b001) | // F(s,d)TO(d,s)
1928 (fpx_itype_e[2:0] == 3'b111) ; // FSQRT(s,d)
1929
1930// ------------------------------------
1931// FPY control
1932// ------------------------------------
1933
1934// spu_fgu_fpy_ctl_d[6:0]:
1935//
1936// [0] [1] [2] [3] [4] [5] [6]
1937// --- ------------ -------------- ----------- ----- ----------------------- --------------------
1938// if == 1 XOR Add Accum Write Accum 2*(rs1*rs2) >> 64 write MA result flop bypass result to rs1
1939// if == 0 Int No Add Accum No Write Accum (rs1*rs2) >> 0 no write MA result flop no bypass result
1940
1941assign xr_mode_e = spu_grant_e & spu_fpy_ctl_e[0];
1942
1943assign rs1_sel_e[0] = ~spu_grant_e & (fpx_fmul8sux16_e | fpx_fmuld8sux16_e);
1944assign rs1_sel_e[1] = ~spu_grant_e & (fpx_fmul8x16_e | fpx_fmul8x16au_e | fpx_fmul8x16al_e);
1945assign rs1_sel_e[2] = ~spu_grant_e & (fpx_fmul8ulx16_e | fpx_fmuld8ulx16_e);
1946assign rs1_sel_e[3] = spu_grant_e & spu_fpy_ctl_e[6];
1947assign rs1_sel_e[4] = spu_grant_e;
1948
1949assign rs2_sel_e[0] = ~spu_grant_e & fpx_fmul8x16au_e;
1950assign rs2_sel_e[1] = ~spu_grant_e & fpx_fmul8x16al_e;
1951
1952assign rs2_sel_e[2] = // all 8x16
1953 ~spu_grant_e &
1954 (fpx_fmul8x16_e | fpx_fmul8x16au_e | fpx_fmul8x16al_e |
1955 fpx_fmul8sux16_e | fpx_fmul8ulx16_e | fpx_fmuld8sux16_e | fpx_fmuld8ulx16_e);
1956
1957assign rs2_sel_e[3] = spu_grant_e;
1958
1959assign rnd_8x16_e[0] =
1960 ~spu_grant_e &
1961 (fpx_fmul8x16_e | fpx_fmul8x16au_e | fpx_fmul8x16al_e | fpx_fmul8sux16_e);
1962
1963assign rnd_8x16_e[1] = ~spu_grant_e & fpx_fmul8ulx16_e;
1964
1965assign result_sel_e[0] =
1966 ~spu_grant_e &
1967 (fpx_fmul8x16_e | fpx_fmul8x16au_e | fpx_fmul8x16al_e |
1968 fpx_fmul8sux16_e);
1969
1970assign result_sel_e[1] = ~spu_grant_e & fpx_fmul8ulx16_e;
1971assign result_sel_e[2] = ~spu_grant_e & fpx_fmuld8sux16_e;
1972assign result_sel_e[3] = ~spu_grant_e & fpx_fmuld8ulx16_e;
1973assign result_sel_e[4] = spu_grant_e & spu_fpy_ctl_e[0] & spu_fpy_ctl_e[1]; // XOR mult w/ ACCUM
1974assign result_sel_e[5] = ~spu_grant_e & (fpx_dtype_e[2:1] == 2'b00); // dp or sp float
1975
1976// ------------------------------------
1977// FPD control
1978// ------------------------------------
1979
1980assign div_valid_e = // start div engine
1981 (~div_engine_busy_fx1 &
1982 (fpx_itype_e[2:1] == 2'b11) & dec_fgu_valid_e) | // DEC issued div/sqrt
1983 (~div_engine_busy_fx1 & divq_occupied_fx1 & // divq issued div/sqrt
1984 ~(pre_div_flush_fx3 & ~div_dec_issue_fx3) ) ; // and divq not flushed
1985
1986assign divq_valid_e = // load divq or start div engine from divq
1987 ( div_engine_busy_fx1 &
1988 (fpx_itype_e[2:1] == 2'b11) & dec_fgu_valid_e) | // divq load
1989 (~div_engine_busy_fx1 & divq_occupied_fx1 & // divq issued div/sqrt
1990 ~(pre_div_flush_fx3 & ~div_dec_issue_fx3) ) ; // and divq not flushed
1991
1992assign div_engine_busy_e =
1993 ( div_valid_e ) | // set (DEC/divq issued div/sqrt)
1994 ((~div_finish_early & // clear (if finish)
1995 // clear (if flush)
1996 ~fac_div_flush_fx3 ) & div_engine_busy_fx1 ) ;
1997
1998// 0in assert_timer -var div_engine_busy_e -max 50 -message "Divide engine busy > 50 cycles"; custom -fire ((dec_fgu_decode_d & div_engine_busy_e & (dec_fgu_tid_d[2:0]==div_tid_in_e[2:0])) | (dec_fgu_decode_d & (div_finish_fltd_fb | div_finish_flts_fb) & (dec_fgu_tid_d[2:0]==fac_fpd_tid_fb[2:0]))) -message "Divide engine collision with other FPop"
1999
2000assign div_dec_issue_e = div_valid_e & ~divq_valid_e;
2001assign div_divq_issue_e = div_valid_e & divq_valid_e;
2002assign div_divq_load_e = ~div_valid_e & divq_valid_e;
2003assign div_hold_e = ~div_dec_issue_e & ~div_divq_issue_e;
2004
2005assign divq_occupied_e =
2006 ( div_engine_busy_fx1 &
2007 (fpx_itype_e[2:1] == 2'b11) & dec_fgu_valid_e) | // set (divq load)
2008 ((~div_divq_issue_e & // clear (if divq issued div/sqrt)
2009 // clear (if flush divq)
2010 ~(pre_div_flush_fx3 & ~div_dec_issue_fx3)) & divq_occupied_fx1);
2011
2012// 0in custom -fire ((dec_fgu_decode_d & divq_occupied_e & (dec_fgu_tid_d[2:0]==divq_tid_in_e[2:0]))) -message "Divide queue collision with other FPop"
2013
2014// ------------
2015// capture data for instr that is entering the div engine
2016// ------------
2017
2018assign div_tid_in_e[2:0] =
2019 ( {3{div_dec_issue_e }} & fac_tid_e[2:0] ) | // load from DEC issue
2020 ( {3{div_divq_issue_e}} & divq_tid_fx1[2:0] ) | // load from divq issue
2021 ( {3{div_hold_e }} & div_tid_fx1[2:0] ) ; // hold
2022
2023assign div_irf_addr_in_e[4:0] =
2024 ( {5{div_dec_issue_e }} & irf_w_addr_e[4:0] ) | // load from DEC issue
2025 ( {5{div_divq_issue_e}} & divq_irf_addr_fx1[4:0]) | // load from divq issue
2026 ( {5{div_hold_e }} & div_irf_addr_fx1[4:0] ) ; // hold
2027
2028assign div_cc_vld_in_e =
2029 ( div_dec_issue_e & fpx_int_cc_vld_e ) | // load from DEC issue
2030 ( div_divq_issue_e & divq_cc_vld_fx1 ) | // load from divq issue
2031 ( div_hold_e & div_cc_vld_fx1 ) ; // hold
2032
2033assign div_odd32b_in_e =
2034 ( div_dec_issue_e & w1_odd32b_e ) | // load from DEC issue
2035 ( div_divq_issue_e & divq_odd32b_fx1 ) | // load from divq issue
2036 ( div_hold_e & div_odd32b_fx1 ) ; // hold
2037
2038assign div_32b_in_e =
2039 ( div_dec_issue_e & w1_32b_e ) | // load from DEC issue
2040 ( div_divq_issue_e & divq_32b_fx1 ) | // load from divq issue
2041 ( div_hold_e & div_32b_fx1 ) ; // hold
2042
2043assign div_frf_addr_in_e[4:0] =
2044 ( {5{div_dec_issue_e }} & w1_addr_e[4:0] ) | // load from DEC issue
2045 ( {5{div_divq_issue_e}} & divq_frf_addr_fx1[4:0]) | // load from divq issue
2046 ( {5{div_hold_e }} & div_frf_addr_fx1[4:0] ) ; // hold
2047
2048// ------------
2049// capture data for instr that is entering the div queue
2050// ------------
2051
2052assign divq_tid_in_e[2:0] =
2053 ( {3{ div_divq_load_e}} & fac_tid_e[2:0] ) | // load from DEC issue
2054 ( {3{~div_divq_load_e}} & divq_tid_fx1[2:0] ) ; // hold
2055
2056assign divq_irf_addr_in_e[4:0] =
2057 ( {5{ div_divq_load_e}} & irf_w_addr_e[4:0] ) | // load from DEC issue
2058 ( {5{~div_divq_load_e}} & divq_irf_addr_fx1[4:0]) ; // hold
2059
2060assign divq_cc_vld_in_e =
2061 ( div_divq_load_e & fpx_int_cc_vld_e ) | // load from DEC issue
2062 ( ~div_divq_load_e & divq_cc_vld_fx1 ) ; // hold
2063
2064assign divq_odd32b_in_e =
2065 ( div_divq_load_e & w1_odd32b_e ) | // load from DEC issue
2066 ( ~div_divq_load_e & divq_odd32b_fx1 ) ; // hold
2067
2068assign divq_32b_in_e =
2069 ( div_divq_load_e & w1_32b_e ) | // load from DEC issue
2070 ( ~div_divq_load_e & divq_32b_fx1 ) ; // hold
2071
2072assign divq_frf_addr_in_e[4:0] =
2073 ( {5{ div_divq_load_e}} & w1_addr_e[4:0] ) | // load from DEC issue
2074 ( {5{~div_divq_load_e}} & divq_frf_addr_fx1[4:0]) ; // hold
2075
2076// ------------
2077// FDC captures and holds these controls in the div queue as needed
2078// ------------
2079
2080assign div_control_e[4] = fac_tid_e[2];
2081
2082assign div_control_e[3] = (fpx_itype_e[2:0] == 3'b111); // sqrt
2083
2084assign div_control_e[2] =
2085 (fpx_dtype_e[2:0] == 3'b100) |
2086 (fpx_dtype_e[2:0] == 3'b011) ; // idiv (32/64b dest)
2087
2088assign div_control_e[1] =
2089 (fpx_dtype_e[2:0] == 3'b001) |
2090 (fpx_dtype_e[2:0] == 3'b100) ; // DP/64b dest
2091
2092assign div_control_e[0] =
2093 ((fpx_dtype_e[2:0] == 3'b011) & op3_e[0]) | // sdiv (32b dest)
2094 ((fpx_dtype_e[2:0] == 3'b100) & op3_e[5]) ; // sdivx (64b dest)
2095
2096
2097// ----------------------------------------------------------------------------
2098// FX1 stage
2099// ----------------------------------------------------------------------------
2100
2101fgu_fac_ctl_msff_ctl_macro__width_128 fx1_00 (
2102 .scan_in(fx1_00_scanin),
2103 .scan_out(fx1_00_scanout),
2104 .l1clk(l1clk_pm1),
2105 .din ({opf_e[4:1],
2106 dec_fgu_valid_e,
2107 fpx_itype_e[2:0],
2108 fpx_dtype_e[2:0],
2109 fpx_stype_e[1:0],
2110 fpx_itype_mul_e,
2111 fpx_sign_instr_e,
2112 fpx_rnd_trunc_e,
2113 fpx_mulscc_e,
2114 fpx_saverestore_e,
2115 fpx_int_cc_vld_e,
2116 fpx_nv_vld_e,
2117 fpx_of_vld_e,
2118 fpx_uf_vld_e,
2119 fpx_dz_vld_e,
2120 fpx_nx_vld_e,
2121 fpx_unfin_vld_e,
2122 fgx_mvcond_e,
2123 fgx_mvucond_e,
2124 fgx_abs_e,
2125 fgx_neg_e,
2126 fgx_logical_e,
2127 fgx_expand_e,
2128 fgx_merge_e,
2129 fgx_align_e,
2130 fgx_shuffle_e,
2131 fgx_pack16_e,
2132 fgx_pack32_e,
2133 fgx_packfix_e,
2134 q_fgx_pdist_e,
2135 fgx_popc_e,
2136 fgx_siam_e,
2137 fpx_sp_dest_e,
2138 rs1_sel_e[4:0],
2139 rs2_sel_e[3:0],
2140 rnd_8x16_e[1:0],
2141 result_sel_e[5:0],
2142 exu_w_vld_e,
2143 irf_w_addr_e[4:0],
2144 q_r1_vld_e[1:0],
2145 q_r2_vld_e[1:0],
2146 spu_grant_e,
2147 div_valid_e,
2148 divq_valid_e,
2149 divq_occupied_e,
2150 div_control_e[4:0],
2151 div_tid_in_e[2:0],
2152 div_irf_addr_in_e[4:0],
2153 div_frf_addr_in_e[4:0],
2154 div_cc_vld_in_e,
2155 div_odd32b_in_e,
2156 div_32b_in_e,
2157 divq_tid_in_e[2:0],
2158 divq_irf_addr_in_e[4:0],
2159 divq_frf_addr_in_e[4:0],
2160 divq_cc_vld_in_e,
2161 divq_odd32b_in_e,
2162 divq_32b_in_e,
2163 div_engine_busy_e,
2164 div_dec_issue_e,
2165 div_divq_issue_e,
2166 force_swap_blta_e,
2167 force_noswap_blta_e,
2168 fsr_store_e,
2169 xr_mode_e,
2170 spu_fpy_ctl_e[5:0],
2171 frf_store_e,
2172 fst_fmt_sel_e[3:0],
2173 fgu_decode_e}),
2174 .dout({opf_fx1[4:1],
2175 fac_dec_valid_fx1,
2176 fac_fpx_itype_fx1[2:0],
2177 fac_fpx_dtype_fx1[2:0],
2178 fac_fpx_stype_fx1[1:0],
2179 itype_mul_fx1,
2180 fac_fpx_sign_instr_fx1,
2181 fac_fpx_rnd_trunc_fx1,
2182 fac_fpx_mulscc_fx1,
2183 fac_fpx_saverestore_fx1,
2184 fpx_int_cc_vld_fx1,
2185 fac_fpx_nv_vld_fx1,
2186 fac_fpx_of_vld_fx1,
2187 fac_fpx_uf_vld_fx1,
2188 fac_fpx_dz_vld_fx1,
2189 fac_fpx_nx_vld_fx1,
2190 fac_fpx_unfin_vld_fx1,
2191 fgx_mvcond_fx1,
2192 fgx_mvucond_fx1,
2193 fgx_abs_fx1,
2194 fgx_neg_fx1,
2195 fgx_logical_fx1,
2196 fgx_expand_fx1,
2197 fgx_merge_fx1,
2198 fgx_align_fx1,
2199 fgx_shuffle_fx1,
2200 fgx_pack16_fx1,
2201 fgx_pack32_fx1,
2202 fgx_packfix_fx1,
2203 fac_fgx_pdist_fx1,
2204 fgx_popc_fx1,
2205 i_fgx_siam_fx1,
2206 fac_fpx_sp_dest_fx1,
2207 fac_rs1_sel_fx1[4:0],
2208 fac_rs2_sel_fx1[3:0],
2209 rnd_8x16_fx1[1:0],
2210 result_sel_fx1[5:0],
2211 i_exu_w_vld_fx1,
2212 irf_w_addr_fx1[4:0],
2213 fac_r1_vld_fx1[1:0],
2214 fac_r2_vld_fx1[1:0],
2215 spu_grant_fx1,
2216 fac_div_valid_fx1,
2217 fac_divq_valid_fx1,
2218 divq_occupied_fx1,
2219 fac_div_control_fx1[4:0],
2220 div_tid_fx1[2:0],
2221 div_irf_addr_fx1[4:0],
2222 div_frf_addr_fx1[4:0],
2223 div_cc_vld_fx1,
2224 div_odd32b_fx1,
2225 div_32b_fx1,
2226 divq_tid_fx1[2:0],
2227 divq_irf_addr_fx1[4:0],
2228 divq_frf_addr_fx1[4:0],
2229 divq_cc_vld_fx1,
2230 divq_odd32b_fx1,
2231 divq_32b_fx1,
2232 div_engine_busy_fx1,
2233 div_dec_issue_fx1,
2234 div_divq_issue_fx1,
2235 fac_force_swap_blta_fx1,
2236 fac_force_noswap_blta_fx1,
2237 fsr_store_fx1,
2238 fac_xr_mode_fx1,
2239 spu_fpy_ctl_fx1[5:0],
2240 frf_store_fx1,
2241 fac_fst_fmt_sel_fx1[3:0],
2242 fgu_decode_fx1}),
2243 .siclk(siclk),
2244 .soclk(soclk)
2245 );
2246
2247fgu_fac_ctl_msff_ctl_macro__width_21 fx1_01 (
2248 .scan_in(fx1_01_scanin),
2249 .scan_out(fx1_01_scanout),
2250 .l1clk(l1clk_pm1),
2251 .din ({w1_addr_e[4:0],
2252 w1_32b_e,
2253 w1_odd32b_e,
2254 fac_tid_e[2:0],
2255 q_w1_vld_e[1:0],
2256 tlu_cerer_frf,
2257 tlu_ceter_pscce[7:0]}),
2258 .dout({w1_addr_fx1[4:0],
2259 w1_32b_fx1,
2260 fac_w1_odd32b_fx1,
2261 tid_fx1[2:0],
2262 q_w1_vld_fx1[1:0],
2263 cerer_frf_fx1,
2264 ceter_pscce_fx1[7:0]}),
2265 .siclk(siclk),
2266 .soclk(soclk)
2267 );
2268
2269fgu_fac_ctl_msff_ctl_macro__width_4 fx1_02 (
2270 .scan_in(fx1_02_scanin),
2271 .scan_out(fx1_02_scanout),
2272 .l1clk(l1clk_pm1),
2273 .din (pre_fcc_vld_e[3:0] ),
2274 .dout(pre_fcc_vld_fx1[3:0]),
2275 .siclk(siclk),
2276 .soclk(soclk)
2277 );
2278
2279assign fgx_instr_fx1 = // note: this eq. doesn't include siam
2280 fgx_logical_fx1 |
2281 fgx_expand_fx1 |
2282 fgx_merge_fx1 |
2283 fgx_align_fx1 |
2284 fgx_shuffle_fx1 |
2285 fac_fgx_pdist_fx1 |
2286 fgx_pack_sel_fx1 |
2287 fgx_moves_fx1 |
2288 fgx_popc_fx1 ;
2289
2290assign fac_ecc_trap_en_fx1 =
2291 cerer_frf_fx1 &
2292 (((tid_fx1[2:0] == 3'd0) & ceter_pscce_fx1[0]) |
2293 ((tid_fx1[2:0] == 3'd1) & ceter_pscce_fx1[1]) |
2294 ((tid_fx1[2:0] == 3'd2) & ceter_pscce_fx1[2]) |
2295 ((tid_fx1[2:0] == 3'd3) & ceter_pscce_fx1[3]) |
2296 ((tid_fx1[2:0] == 3'd4) & ceter_pscce_fx1[4]) |
2297 ((tid_fx1[2:0] == 3'd5) & ceter_pscce_fx1[5]) |
2298 ((tid_fx1[2:0] == 3'd6) & ceter_pscce_fx1[6]) |
2299 ((tid_fx1[2:0] == 3'd7) & ceter_pscce_fx1[7]) );
2300
2301assign fgx_siam_fx1 = i_fgx_siam_fx1 & fac_dec_valid_fx1;
2302
2303assign fac_w1_vld_fx1[1:0] = q_w1_vld_fx1[1:0] & {2{fac_dec_valid_fx1}};
2304
2305assign exu_w_vld_fx1 =
2306 fac_dec_valid_fx1 &
2307 (fgx_popc_fx1 | // popc
2308 fac_fpx_mulscc_fx1 | // mulscc
2309 fac_fpx_saverestore_fx1 | // save or restore
2310 ((fac_fpx_itype_fx1[2:0] == 3'b101) & i_exu_w_vld_fx1) | // imul
2311 ((fac_fpx_itype_fx1[2:0] == 3'b100) &
2312 (fac_fpx_dtype_fx1[2:1] == 2'b01 ) ) ); // vis fcmp
2313
2314assign fac_fcmpe_fx1 = opf_fx1[2]; // FCMPE, not FCMP
2315
2316assign fac_fpx_sp_src_fx1 =
2317 ((fac_fpx_dtype_fx1[2:0] == 3'b000) &
2318 ~((fac_fpx_itype_fx1[2:0] == 3'b001) & // ~FdTOs
2319 (fac_fpx_stype_fx1[1:0] == 2'b01 )) ) |
2320 ((fac_fpx_itype_fx1[2:0] == 3'b001) &
2321 (fac_fpx_dtype_fx1[2:0] == 3'b001) ) | // FsTOd
2322 ((fac_fpx_itype_fx1[2:0] == 3'b101) &
2323 (fac_fpx_stype_fx1[1:0] == 2'b00 ) &
2324 (fac_fpx_dtype_fx1[2:0] == 3'b001) ) | // FsMULd
2325 ((fac_fpx_itype_fx1[2:0] == 3'b010) &
2326 (fac_fpx_stype_fx1[1:0] == 2'b00 ) ) ; // FsTO(i,x)
2327
2328assign fgx_moves_fx1 = fgx_mvcond_fx1 | fgx_mvucond_fx1 | fgx_abs_fx1 | fgx_neg_fx1;
2329assign fgx_pack_sel_fx1 = fgx_pack16_fx1 | fgx_pack32_fx1 | fgx_packfix_fx1;
2330
2331
2332// ------------------------------------
2333// FPD control
2334// ------------------------------------
2335
2336assign fac_aux_cin_fx1 = ~(fac_fpx_itype_fx1[2:0] == 3'b110); // ~div
2337
2338assign q_div_default_res_fx3 =
2339 div_default_res_fx3 &
2340 ~dec_flush_fx3 &
2341 ~fac_tlu_flush_fx3 ;
2342
2343assign div_finish_early =
2344 fdc_finish_flts_early | fdc_finish_fltd_early | fdc_finish_int_early;
2345
2346assign divide_completion_fx1[0] =
2347 ((div_tid_fx1[2:0] == 3'b000) & div_finish_early ) |
2348 (( tid_fx3[2:0] == 3'b000) & q_div_default_res_fx3) ;
2349
2350assign divide_completion_fx1[1] =
2351 ((div_tid_fx1[2:0] == 3'b001) & div_finish_early ) |
2352 (( tid_fx3[2:0] == 3'b001) & q_div_default_res_fx3) ;
2353
2354assign divide_completion_fx1[2] =
2355 ((div_tid_fx1[2:0] == 3'b010) & div_finish_early ) |
2356 (( tid_fx3[2:0] == 3'b010) & q_div_default_res_fx3) ;
2357
2358assign divide_completion_fx1[3] =
2359 ((div_tid_fx1[2:0] == 3'b011) & div_finish_early ) |
2360 (( tid_fx3[2:0] == 3'b011) & q_div_default_res_fx3) ;
2361
2362assign divide_completion_fx1[4] =
2363 ((div_tid_fx1[2:0] == 3'b100) & div_finish_early ) |
2364 (( tid_fx3[2:0] == 3'b100) & q_div_default_res_fx3) ;
2365
2366assign divide_completion_fx1[5] =
2367 ((div_tid_fx1[2:0] == 3'b101) & div_finish_early ) |
2368 (( tid_fx3[2:0] == 3'b101) & q_div_default_res_fx3) ;
2369
2370assign divide_completion_fx1[6] =
2371 ((div_tid_fx1[2:0] == 3'b110) & div_finish_early ) |
2372 (( tid_fx3[2:0] == 3'b110) & q_div_default_res_fx3) ;
2373
2374assign divide_completion_fx1[7] =
2375 ((div_tid_fx1[2:0] == 3'b111) & div_finish_early ) |
2376 (( tid_fx3[2:0] == 3'b111) & q_div_default_res_fx3) ;
2377
2378
2379// ----------------------------------------------------------------------------
2380// FX2 stage
2381// ----------------------------------------------------------------------------
2382
2383fgu_fac_ctl_msff_ctl_macro__width_16 fx2_00 (
2384 .scan_in(fx2_00_scanin),
2385 .scan_out(fx2_00_scanout),
2386 .l1clk(l1clk_pm1),
2387 .din ({w1_addr_fx1[4:0],
2388 w1_32b_fx1,
2389 fac_w1_odd32b_fx1,
2390 tid_fx1[2:0],
2391 exu_w_vld_fx1,
2392 irf_w_addr_fx1[4:0]}),
2393 .dout({w1_addr_fx2[4:0],
2394 w1_32b_fx2,
2395 w1_odd32b_fx2,
2396 tid_fx2[2:0],
2397 i_exu_w_vld_fx2,
2398 irf_w_addr_fx2[4:0]}),
2399 .siclk(siclk),
2400 .soclk(soclk)
2401 );
2402
2403fgu_fac_ctl_msff_ctl_macro__width_60 fx2_01 (
2404 .scan_in(fx2_01_scanin),
2405 .scan_out(fx2_01_scanout),
2406 .l1clk(l1clk_pm1),
2407 .din ({opf_fx1[4:1],
2408 fgx_mvcond_fx1,
2409 fgx_mvucond_fx1,
2410 fgx_abs_fx1,
2411 fgx_neg_fx1,
2412 fgx_logical_fx1,
2413 fgx_expand_fx1,
2414 fgx_merge_fx1,
2415 fgx_align_fx1,
2416 fgx_shuffle_fx1,
2417 fgx_pack16_fx1,
2418 fgx_pack32_fx1,
2419 fgx_packfix_fx1,
2420 fgx_popc_fx1,
2421 fgx_siam_fx1,
2422 fgx_pack_sel_fx1,
2423 rnd_8x16_fx1[1:0],
2424 result_sel_fx1[5:0],
2425 divide_completion_fx1[7:0],
2426 fpx_int_cc_vld_fx1,
2427 dec_flush_f1,
2428 pre_fcc_vld_fx1[3:0],
2429 div_dec_issue_fx1,
2430 div_divq_issue_fx1,
2431 fac_dec_valid_fx1,
2432 fac_fpx_itype_fx1[2:0],
2433 itype_mul_fx1,
2434 fsr_store_fx1,
2435 spu_grant_fx1,
2436 spu_fpy_ctl_fx1[5:0],
2437 fac_rs2_sel_fx1[2],
2438 fgx_instr_fx1,
2439 div_engine_busy_fx1,
2440 frf_store_fx1}),
2441 .dout({fac_opf_fx2[4:1],
2442 fac_fgx_mvcond_fx2,
2443 fac_fgx_mvucond_fx2,
2444 fac_fgx_abs_fx2,
2445 fac_fgx_neg_fx2,
2446 fac_fgx_logical_fx2,
2447 fac_fgx_expand_fx2,
2448 fac_fgx_merge_fx2,
2449 fac_fgx_align_fx2,
2450 fac_fgx_shuffle_fx2,
2451 fac_fgx_pack16_fx2,
2452 fac_fgx_pack32_fx2,
2453 fac_fgx_packfix_fx2,
2454 fac_fgx_popc_fx2,
2455 fac_fgx_siam_fx2,
2456 fac_fgx_pack_sel_fx2,
2457 rnd_8x16_fx2[1:0],
2458 result_sel_fx2[5:0],
2459 fgu_divide_completion[7:0],
2460 fpx_int_cc_vld_fx2,
2461 dec_flush_fx2,
2462 i_pre_fcc_vld_fx2[3:0],
2463 div_dec_issue_fx2,
2464 div_divq_issue_fx2,
2465 dec_valid_fx2,
2466 itype_fx2[2:0],
2467 itype_mul_fx2,
2468 fac_fsr_store_fx2,
2469 spu_grant_fx2,
2470 spu_fpy_ctl_fx2[5:0],
2471 rs2_sel_fx2_b2,
2472 fgx_instr_fx2,
2473 div_engine_busy_fx2,
2474 frf_store_fx2}),
2475 .siclk(siclk),
2476 .soclk(soclk)
2477 );
2478
2479fgu_fac_ctl_msff_ctl_macro__width_3 fx2_02 (
2480 .scan_in(fx2_02_scanin),
2481 .scan_out(fx2_02_scanout),
2482 .l1clk(l1clk_pm2),
2483 .din ({exu_fgu_flush_m, // requires free running clk
2484 exu_fgu_gsr_vld_m[1:0]}), // requires free running clk
2485 .dout({exu_flush_fx2,
2486 fac_gsr_w_vld_fx2[1:0]}),
2487 .siclk(siclk),
2488 .soclk(soclk)
2489 );
2490
2491assign fac_gsr_asr_tid_fx2[2:0] = rng_wr_tid_3f[2:0];
2492assign fac_tid_fx2[2:0] = tid_fx2[2:0];
2493assign gsr_w_vld_fx2 = |fac_gsr_w_vld_fx2[1:0];
2494
2495assign dec_valid_noflush_fx2 =
2496 dec_valid_fx2 &
2497 ~dec_flush_fx2 ;
2498
2499// 0in custom -fire ($0in_delay(fac_fgx_pdist_fx1,1) & dec_valid_fx2 & fac_dec_valid_fx1) -message "PDIST 2nd beat collision with other FPop"
2500
2501assign exu_w_vld_fx2 =
2502 i_exu_w_vld_fx2 &
2503 ~dec_flush_fx2 &
2504 ~exu_flush_fx2 &
2505 ~(fec_uecc_fx2 | fec_cecc_fx2);
2506
2507assign fac_pre_fcc_vld_fx2[3] =
2508 i_pre_fcc_vld_fx2[3] &
2509 ~dec_flush_fx2 &
2510 ~exu_flush_fx2 &
2511 ~dec_flush_f2 &
2512//~tlu_flush_fgu_b &
2513 ~(fec_uecc_fx2 | fec_cecc_fx2);
2514
2515assign fac_pre_fcc_vld_fx2[2] =
2516 i_pre_fcc_vld_fx2[2] &
2517 ~dec_flush_fx2 &
2518 ~exu_flush_fx2 &
2519 ~dec_flush_f2 &
2520//~tlu_flush_fgu_b &
2521 ~(fec_uecc_fx2 | fec_cecc_fx2);
2522
2523assign fac_pre_fcc_vld_fx2[1] =
2524 i_pre_fcc_vld_fx2[1] &
2525 ~dec_flush_fx2 &
2526 ~exu_flush_fx2 &
2527 ~dec_flush_f2 &
2528//~tlu_flush_fgu_b &
2529 ~(fec_uecc_fx2 | fec_cecc_fx2);
2530
2531assign fac_pre_fcc_vld_fx2[0] =
2532 i_pre_fcc_vld_fx2[0] &
2533 ~dec_flush_fx2 &
2534 ~exu_flush_fx2 &
2535 ~dec_flush_f2 &
2536//~tlu_flush_fgu_b &
2537 ~(fec_uecc_fx2 | fec_cecc_fx2);
2538
2539assign pre_fcc_vld_fx2 = |fac_pre_fcc_vld_fx2[3:0];
2540
2541assign i_fld_fcc_vld_fx2[1] = // load FSR 64b
2542 lsu_fgu_fsr_load_b &
2543 ~lsu_fgu_fld_32b_b ;
2544
2545assign i_fld_fcc_vld_fx2[0] = // load FSR 32/64b
2546 lsu_fgu_fsr_load_b;
2547
2548// ------------------------------------
2549// FPY control
2550// ------------------------------------
2551
2552// spu_fgu_fpy_ctl_d[6:0]:
2553//
2554// [0] [1] [2] [3] [4] [5] [6]
2555// --- ------------ -------------- ----------- ----- ----------------------- --------------------
2556// if == 1 XOR Add Accum Write Accum 2*(rs1*rs2) >> 64 write MA result flop bypass result to rs1
2557// if == 0 Int No Add Accum No Write Accum (rs1*rs2) >> 0 no write MA result flop no bypass result
2558
2559assign scff_sel_fx2[0] =
2560 (~spu_grant_fx2 & ~rs2_sel_fx2_b2) | // ~spu & ~8x16
2561 ( spu_grant_fx2 & ~spu_fpy_ctl_fx2[0] & ~spu_fpy_ctl_fx2[3]); // spu & MA Int * 1
2562
2563assign scff_sel_fx2[1] =
2564 (~spu_grant_fx2 & rs2_sel_fx2_b2); // all 8x16
2565
2566assign scff_sel_fx2[2] =
2567 ( spu_grant_fx2 & ~spu_fpy_ctl_fx2[0] & spu_fpy_ctl_fx2[3]); // spu & MA Int * 2
2568
2569assign scff_sel_fx2[3] =
2570 ( spu_grant_fx2 & spu_fpy_ctl_fx2[0] & ~spu_fpy_ctl_fx2[3]); // spu & XOR * 1
2571
2572// fac_accum_sel_fx3[6:0]:
2573//
2574// [0] : Write ACCUM with result
2575// [1] : Add ACCUM to Mult product
2576// [2] : XOR Mult w/ ACCUM
2577// [3] : XOR Mult w/ ACCUM >> 64
2578// [4] : XOR Mult w/o ACCUM
2579// [5] : XOR Mult w/o ACCUM >> 64
2580// [6] : Int Mult w/ or w/o ACCUM
2581// Def : Int Mult w/ or w/o ACCUM >> 64
2582
2583assign accum_sel_fx2[0] = ( spu_grant_fx2 & spu_fpy_ctl_fx2[2]);
2584assign accum_sel_fx2[1] = ( spu_grant_fx2 & spu_fpy_ctl_fx2[1]);
2585assign accum_sel_fx2[2] = ( spu_grant_fx2 & spu_fpy_ctl_fx2[0] & spu_fpy_ctl_fx2[1] & ~spu_fpy_ctl_fx2[4]);
2586assign accum_sel_fx2[3] = ( spu_grant_fx2 & spu_fpy_ctl_fx2[0] & spu_fpy_ctl_fx2[1] & spu_fpy_ctl_fx2[4]);
2587assign accum_sel_fx2[4] = ( spu_grant_fx2 & spu_fpy_ctl_fx2[0] & ~spu_fpy_ctl_fx2[1] & ~spu_fpy_ctl_fx2[4]);
2588assign accum_sel_fx2[5] = ( spu_grant_fx2 & spu_fpy_ctl_fx2[0] & ~spu_fpy_ctl_fx2[1] & spu_fpy_ctl_fx2[4]);
2589assign accum_sel_fx2[6] = ( spu_grant_fx2 & ~spu_fpy_ctl_fx2[0] & ~spu_fpy_ctl_fx2[4]);
2590
2591
2592// ----------------------------------------------------------------------------
2593// FX3 stage
2594// ----------------------------------------------------------------------------
2595
2596fgu_fac_ctl_msff_ctl_macro__width_52 fx3_00 (
2597 .scan_in(fx3_00_scanin),
2598 .scan_out(fx3_00_scanout),
2599 .l1clk(l1clk_pm1),
2600 .din ({w1_addr_fx2[4:0],
2601 w1_32b_fx2,
2602 w1_odd32b_fx2,
2603 tid_fx2[2:0],
2604 rnd_8x16_fx2[1:0],
2605 scff_sel_fx2[3:0],
2606 result_sel_fx2[5:0],
2607 exu_w_vld_fx2,
2608 irf_w_addr_fx2[4:0],
2609 fpx_int_cc_vld_fx2,
2610 dec_flush_f2,
2611 tlu_flush_fgu_b,
2612 div_dec_issue_fx2,
2613 fpc_pre_div_flush_fx2,
2614 fpc_div_default_res_fx2,
2615 dec_valid_fx2,
2616 itype_fx2[2:0],
2617 itype_mul_fx2,
2618 gsr_w_vld_fx2,
2619 spu_grant_fx2,
2620 accum_sel_fx2,
2621 spu_fpy_ctl_fx2[5],
2622 pre_fcc_vld_fx2,
2623 fgx_instr_fx2,
2624 dec_valid_noflush_fx2}),
2625 .dout({w1_addr_fx3[4:0],
2626 w1_32b_fx3,
2627 w1_odd32b_fx3,
2628 tid_fx3[2:0],
2629 fac_8x16_rnd_fx3[1:0],
2630 fac_scff_sel_fx3[3:0],
2631 result_sel_fx3[5:0],
2632 i_exu_w_vld_fx3,
2633 irf_w_addr_fx3[4:0],
2634 fpx_int_cc_vld_fx3,
2635 dec_flush_fx3,
2636 fac_tlu_flush_fx3,
2637 div_dec_issue_fx3,
2638 i_pre_div_flush_fx3,
2639 div_default_res_fx3,
2640 dec_valid_fx3,
2641 itype_fx3[2:0],
2642 itype_mul_fx3,
2643 gsr_w_vld_fx3,
2644 spu_grant_fx3,
2645 fac_accum_sel_fx3,
2646 spu_fpy_ctl_fx3[5],
2647 i_pre_fcc_vld_fx3,
2648 fgx_instr_fx3,
2649 i_dec_valid_noflush_fx3}),
2650 .siclk(siclk),
2651 .soclk(soclk)
2652 );
2653
2654fgu_fac_ctl_msff_ctl_macro__width_3 fx3_01 (
2655 .scan_in(fx3_01_scanin),
2656 .scan_out(fx3_01_scanout),
2657 .l1clk(l1clk_pm2),
2658 .din ({lsu_fgu_fld_b, // requires free running clk
2659 i_fld_fcc_vld_fx2[1:0]}), // requires free running clk
2660 .dout({ fgu_fld_fx3,
2661 fgu_fld_fcc_vld_fx3[1:0]}),
2662 .siclk(siclk),
2663 .soclk(soclk)
2664 );
2665
2666assign pre_fcc_vld_fx3 = i_pre_fcc_vld_fx3 & ~fac_tlu_flush_fx3;
2667
2668assign dec_valid_noflush_fx3 =
2669 i_dec_valid_noflush_fx3 &
2670 ~dec_flush_fx3 &
2671 ~fac_tlu_flush_fx3 ;
2672
2673assign dec_valid_imul_noflush_fx3 = dec_valid_noflush_fx3 & (itype_fx3[2:0] == 3'b101); // mul
2674
2675assign fgu_cmp_fcc_tid_fx2[2:0] = tid_fx2[2:0];
2676
2677assign exu_w_vld_fx3 =
2678 i_exu_w_vld_fx3 &
2679 ~dec_flush_fx3 &
2680 ~fac_tlu_flush_fx3;
2681
2682assign pre_div_flush_fx3 =
2683 (itype_fx3[2:1] == 2'b11) & // div/sqrt
2684 dec_valid_fx3 &
2685 (i_pre_div_flush_fx3 |
2686 div_default_res_fx3 |
2687 dec_flush_fx3 |
2688 fac_tlu_flush_fx3 ) ;
2689
2690assign fac_div_flush_fx3 =
2691 pre_div_flush_fx3 &
2692 (div_dec_issue_fx3 | // DEC issued div/sqrt
2693 div_divq_issue_fx1 | // divq issued div/sqrt
2694 div_divq_issue_fx2 ); // divq issued div/sqrt
2695
2696
2697// ----------------------------------------------------------------------------
2698// FX4 stage
2699// ----------------------------------------------------------------------------
2700
2701fgu_fac_ctl_msff_ctl_macro__width_31 fx4_00 (
2702 .scan_in(fx4_00_scanin),
2703 .scan_out(fx4_00_scanout),
2704 .l1clk(l1clk_pm1),
2705 .din ({w1_addr_fx3[4:0],
2706 w1_32b_fx3,
2707 w1_odd32b_fx3,
2708 tid_fx3[2:0],
2709 result_sel_fx3[5:0],
2710 exu_w_vld_fx3,
2711 irf_w_addr_fx3[4:0],
2712 fpx_int_cc_vld_fx3,
2713 spu_grant_fx3,
2714 spu_fpy_ctl_fx3[5],
2715 pre_fcc_vld_fx3,
2716 dec_valid_noflush_fx3,
2717 fgu_fld_fx3,
2718 gsr_w_vld_fx3,
2719 dec_valid_imul_noflush_fx3,
2720 fgx_instr_fx3}),
2721 .dout({w1_addr_fx4[4:0],
2722 w1_32b_fx4,
2723 w1_odd32b_fx4,
2724 tid_fx4[2:0],
2725 fac_result_sel_fx4[5:0],
2726 exu_w_vld_fx4,
2727 i_irf_w_addr_fx4[4:0],
2728 i_int_cc_vld_fx4,
2729 spu_grant_fx4,
2730 spu_fpy_ctl_fx4[5],
2731 pre_fcc_vld_fx4,
2732 dec_valid_noflush_fx4,
2733 fgu_fld_fx4,
2734 gsr_w_vld_fx4,
2735 dec_valid_imul_noflush_fx4,
2736 fac_fgx_instr_fx4}),
2737 .siclk(siclk),
2738 .soclk(soclk)
2739 );
2740
2741assign fac_ma_result_en_fx4 = spu_grant_fx4 & spu_fpy_ctl_fx4[5];
2742
2743assign irf_result_tid_fx4[2:0] =
2744 ({3{~exu_w_vld_fx4}} & div_tid_fx1[2:0] ) |
2745 ({3{ exu_w_vld_fx4}} & tid_fx4[2:0] ) ;
2746
2747assign irf_w_addr_fx4[4:0] =
2748 ({5{~exu_w_vld_fx4}} & div_irf_addr_fx1[4:0]) |
2749 ({5{ exu_w_vld_fx4}} & i_irf_w_addr_fx4[4:0]) ;
2750
2751assign exu_cc_vld_fx4 =
2752 ( ~exu_w_vld_fx4 & div_cc_vld_fx1 ) |
2753 ( exu_w_vld_fx4 & i_int_cc_vld_fx4 ) ;
2754
2755
2756// ----------------------------------------------------------------------------
2757// FX5 stage
2758// ----------------------------------------------------------------------------
2759
2760fgu_fac_ctl_msff_ctl_macro__width_26 fx5_00 (
2761 .scan_in(fx5_00_scanin),
2762 .scan_out(fx5_00_scanout),
2763 .l1clk(l1clk_pm1),
2764 .din ({w1_addr_fx4[4:0],
2765 w1_32b_fx4,
2766 w1_odd32b_fx4,
2767 tid_fx4[2:0],
2768 exu_w_vld_fx4,
2769 irf_w_addr_fx4[4:0],
2770 irf_result_tid_fx4[2:0],
2771 exu_cc_vld_fx4,
2772 pre_fcc_vld_fx4,
2773 dec_valid_noflush_fx4,
2774 spu_grant_fx4,
2775 fgu_fld_fx4,
2776 dec_valid_imul_noflush_fx4,
2777 fac_fgx_instr_fx4}),
2778 .dout({w1_addr_fx5[4:0],
2779 w1_32b_fx5,
2780 w1_odd32b_fx5,
2781 tid_fx5[2:0],
2782 i_exu_w_vld_fx5,
2783 fgu_irf_w_addr_fx5[4:0],
2784 irf_result_tid_fx5_b2, fgu_result_tid_fx5[1:0],
2785 exu_cc_vld_fx5,
2786 pre_fcc_vld_fx5,
2787 fac_dec_valid_noflush_fx5,
2788 spu_grant_fx5,
2789 fgu_fld_fx5,
2790 dec_valid_imul_noflush_fx5,
2791 fgx_instr_fx5}),
2792 .siclk(siclk),
2793 .soclk(soclk)
2794 );
2795
2796
2797// Note: no need for idiv0 to clear exu_w_vld or exu_cc_vld
2798// since idiv0 clears fdc_finish_int_early
2799
2800assign fgu_exu_w_vld_fx5[0] =
2801 (i_exu_w_vld_fx5 | div_finish_int_fb) & ~irf_result_tid_fx5_b2; // exu thread group 0
2802
2803assign fgu_exu_w_vld_fx5[1] =
2804 (i_exu_w_vld_fx5 | div_finish_int_fb) & irf_result_tid_fx5_b2; // exu thread group 1
2805
2806assign fgu_exu_cc_vld_fx5 = exu_cc_vld_fx5 & (i_exu_w_vld_fx5 | div_finish_int_fb);
2807
2808
2809// ----------------------------------------------------------------------------
2810// FB stage
2811// ----------------------------------------------------------------------------
2812
2813fgu_fac_ctl_msff_ctl_macro__width_25 fb_00 (
2814 .scan_in(fb_00_scanin),
2815 .scan_out(fb_00_scanout),
2816 .l1clk(l1clk_pm1),
2817 .din ({ w1_addr_fx5[4:0],
2818 w1_32b_fx5,
2819 w1_odd32b_fx5,
2820 tid_fx5[2:0],
2821 fpc_fsr_w1_vld_fx5[1:0],
2822 pre_fcc_vld_fx5,
2823 fpc_fcc_vld_fx5,
2824 fdc_finish_int_early,
2825 fdc_finish_flts_early,
2826 fdc_finish_fltd_early,
2827 fac_dec_valid_noflush_fx5,
2828 fgu_fld_fx5,
2829 dec_valid_imul_noflush_fx5,
2830 fgx_instr_fx5,
2831 fpc_stfsr_en_fx3to5}),
2832 .dout({fac_w1_addr_fb[4:0],
2833 fac_w1_32b_fb,
2834 fac_w1_odd32b_fb,
2835 fac_w1_tid_fb[2:0],
2836 fsr_w1_vld_fb[1:0],
2837 pre_fcc_vld_fb,
2838 fcc_vld_fb,
2839 div_finish_int_fb,
2840 div_finish_flts_fb,
2841 div_finish_fltd_fb,
2842 dec_valid_noflush_fb,
2843 fgu_fld_fb,
2844 dec_valid_imul_noflush_fb,
2845 fgx_instr_fb,
2846 fpc_stfsr_en_fb}),
2847 .siclk(siclk),
2848 .soclk(soclk)
2849 );
2850
2851assign fac_fpd_addr_fb[4:0] = div_frf_addr_fx1[4:0];
2852assign fac_fpd_32b_fb = div_32b_fx1;
2853assign fac_fpd_odd32b_fb = div_odd32b_fx1;
2854assign fac_fpd_tid_fb[2:0] = div_tid_fx1[2:0];
2855
2856assign div_finish_fb = div_finish_int_fb | div_finish_flts_fb | div_finish_fltd_fb;
2857
2858
2859// ----------------------------------------------------------------------------
2860// FW stage
2861// ----------------------------------------------------------------------------
2862
2863fgu_fac_ctl_msff_ctl_macro__width_21 fw_00 (
2864 .scan_in(fw_00_scanin),
2865 .scan_out(fw_00_scanout),
2866 .l1clk(l1clk_pm1),
2867 .din ({fac_fpd_tid_fb[2:0],
2868 fac_w1_tid_fb[2:0],
2869 fac_w1_addr_fb[4],
2870 dec_valid_noflush_fb,
2871 dec_valid_noflush_fw,
2872 dec_valid_noflush_fw1,
2873 div_finish_fb,
2874 div_finish_fw,
2875 div_finish_fw1,
2876 div_finish_fw2,
2877 dec_valid_imul_noflush_fb,
2878 dec_valid_imul_noflush_fw,
2879 dec_valid_imul_noflush_fw1,
2880 fgx_instr_fb,
2881 fgx_instr_fw,
2882 fgx_instr_fw1,
2883 fpc_stfsr_en_fb}),
2884 .dout({fgu_fpd_trap_tid_fw[2:0],
2885 fgu_fpx_trap_tid_fw[2:0],
2886 w1_addr_fw_b4,
2887 dec_valid_noflush_fw,
2888 dec_valid_noflush_fw1,
2889 dec_valid_noflush_fw2,
2890 div_finish_fw,
2891 div_finish_fw1,
2892 div_finish_fw2,
2893 div_finish_fw3,
2894 dec_valid_imul_noflush_fw,
2895 dec_valid_imul_noflush_fw1,
2896 dec_valid_imul_noflush_fw2,
2897 fgx_instr_fw,
2898 fgx_instr_fw1,
2899 fgx_instr_fw2,
2900 fpc_stfsr_en_fw}),
2901 .siclk(siclk),
2902 .soclk(soclk)
2903 );
2904
2905fgu_fac_ctl_msff_ctl_macro__width_53 fw_01 (
2906 .scan_in(fw_01_scanin),
2907 .scan_out(fw_01_scanout),
2908 .l1clk(l1clk_pm2),
2909 .din ({ fsr0_sel_fb[5:0], // requires free running clk
2910 fsr1_sel_fb[5:0], // requires free running clk
2911 fsr2_sel_fb[5:0], // requires free running clk
2912 fsr3_sel_fb[5:0], // requires free running clk
2913 fsr4_sel_fb[5:0], // requires free running clk
2914 fsr5_sel_fb[5:0], // requires free running clk
2915 fsr6_sel_fb[5:0], // requires free running clk
2916 fsr7_sel_fb[5:0], // requires free running clk
2917 lsu_fgu_fld_tid_b[2:0], // requires free running clk
2918 i_fsr_w2_vld_fb[1:0]}), // requires free running clk
2919 .dout({fac_fsr0_sel_fw[5:4], i_fsr0_sel_fw[3], fac_fsr0_sel_fw[2:1], i_fsr0_sel_fw[0],
2920 fac_fsr1_sel_fw[5:4], i_fsr1_sel_fw[3], fac_fsr1_sel_fw[2:1], i_fsr1_sel_fw[0],
2921 fac_fsr2_sel_fw[5:4], i_fsr2_sel_fw[3], fac_fsr2_sel_fw[2:1], i_fsr2_sel_fw[0],
2922 fac_fsr3_sel_fw[5:4], i_fsr3_sel_fw[3], fac_fsr3_sel_fw[2:1], i_fsr3_sel_fw[0],
2923 fac_fsr4_sel_fw[5:4], i_fsr4_sel_fw[3], fac_fsr4_sel_fw[2:1], i_fsr4_sel_fw[0],
2924 fac_fsr5_sel_fw[5:4], i_fsr5_sel_fw[3], fac_fsr5_sel_fw[2:1], i_fsr5_sel_fw[0],
2925 fac_fsr6_sel_fw[5:4], i_fsr6_sel_fw[3], fac_fsr6_sel_fw[2:1], i_fsr6_sel_fw[0],
2926 fac_fsr7_sel_fw[5:4], i_fsr7_sel_fw[3], fac_fsr7_sel_fw[2:1], i_fsr7_sel_fw[0],
2927 lsu_fgu_fld_tid_fw[2:0],
2928 i_fsr_w2_vld_fw[1:0]}),
2929 .siclk(siclk),
2930 .soclk(soclk)
2931 );
2932
2933assign fsr_w2_vld_fw[0] = // load FSR 32b
2934 i_fsr_w2_vld_fw[0] & lsu_fgu_fld_vld_w;
2935
2936assign fsr_w2_vld_fw[1] = // load FSR 64b
2937 i_fsr_w2_vld_fw[1] & lsu_fgu_fld_vld_w;
2938
2939assign fac_fsr0_sel_fw[3] = // enable flop
2940 i_fsr0_sel_fw[3] |
2941 (( |fsr_w2_vld_fw[1:0]) & (lsu_fgu_fld_tid_fw[2:0] == 3'd0)) ;
2942
2943assign fac_fsr1_sel_fw[3] = // enable flop
2944 i_fsr1_sel_fw[3] |
2945 (( |fsr_w2_vld_fw[1:0]) & (lsu_fgu_fld_tid_fw[2:0] == 3'd1)) ;
2946
2947assign fac_fsr2_sel_fw[3] = // enable flop
2948 i_fsr2_sel_fw[3] |
2949 (( |fsr_w2_vld_fw[1:0]) & (lsu_fgu_fld_tid_fw[2:0] == 3'd2)) ;
2950
2951assign fac_fsr3_sel_fw[3] = // enable flop
2952 i_fsr3_sel_fw[3] |
2953 (( |fsr_w2_vld_fw[1:0]) & (lsu_fgu_fld_tid_fw[2:0] == 3'd3)) ;
2954
2955assign fac_fsr4_sel_fw[3] = // enable flop
2956 i_fsr4_sel_fw[3] |
2957 (( |fsr_w2_vld_fw[1:0]) & (lsu_fgu_fld_tid_fw[2:0] == 3'd4)) ;
2958
2959assign fac_fsr5_sel_fw[3] = // enable flop
2960 i_fsr5_sel_fw[3] |
2961 (( |fsr_w2_vld_fw[1:0]) & (lsu_fgu_fld_tid_fw[2:0] == 3'd5)) ;
2962
2963assign fac_fsr6_sel_fw[3] = // enable flop
2964 i_fsr6_sel_fw[3] |
2965 (( |fsr_w2_vld_fw[1:0]) & (lsu_fgu_fld_tid_fw[2:0] == 3'd6)) ;
2966
2967assign fac_fsr7_sel_fw[3] = // enable flop
2968 i_fsr7_sel_fw[3] |
2969 (( |fsr_w2_vld_fw[1:0]) & (lsu_fgu_fld_tid_fw[2:0] == 3'd7)) ;
2970
2971assign fac_fsr0_sel_fw[0] =
2972 i_fsr0_sel_fw[0] |
2973//( (fsr_w2_vld_fw[0] & (lsu_fgu_fld_tid_fw[2:0] == 3'd0)) & 1'b0) | // LDFSR
2974 ( (fsr_w2_vld_fw[1] & (lsu_fgu_fld_tid_fw[2:0] == 3'd0)) ) ; // LDXFSR
2975
2976assign fac_fsr1_sel_fw[0] =
2977 i_fsr1_sel_fw[0] |
2978//( (fsr_w2_vld_fw[0] & (lsu_fgu_fld_tid_fw[2:0] == 3'd1)) & 1'b0) | // LDFSR
2979 ( (fsr_w2_vld_fw[1] & (lsu_fgu_fld_tid_fw[2:0] == 3'd1)) ) ; // LDXFSR
2980
2981assign fac_fsr2_sel_fw[0] =
2982 i_fsr2_sel_fw[0] |
2983//( (fsr_w2_vld_fw[0] & (lsu_fgu_fld_tid_fw[2:0] == 3'd2)) & 1'b0) | // LDFSR
2984 ( (fsr_w2_vld_fw[1] & (lsu_fgu_fld_tid_fw[2:0] == 3'd2)) ) ; // LDXFSR
2985
2986assign fac_fsr3_sel_fw[0] =
2987 i_fsr3_sel_fw[0] |
2988//( (fsr_w2_vld_fw[0] & (lsu_fgu_fld_tid_fw[2:0] == 3'd3)) & 1'b0) | // LDFSR
2989 ( (fsr_w2_vld_fw[1] & (lsu_fgu_fld_tid_fw[2:0] == 3'd3)) ) ; // LDXFSR
2990
2991assign fac_fsr4_sel_fw[0] =
2992 i_fsr4_sel_fw[0] |
2993//( (fsr_w2_vld_fw[0] & (lsu_fgu_fld_tid_fw[2:0] == 3'd4)) & 1'b0) | // LDFSR
2994 ( (fsr_w2_vld_fw[1] & (lsu_fgu_fld_tid_fw[2:0] == 3'd4)) ) ; // LDXFSR
2995
2996assign fac_fsr5_sel_fw[0] =
2997 i_fsr5_sel_fw[0] |
2998//( (fsr_w2_vld_fw[0] & (lsu_fgu_fld_tid_fw[2:0] == 3'd5)) & 1'b0) | // LDFSR
2999 ( (fsr_w2_vld_fw[1] & (lsu_fgu_fld_tid_fw[2:0] == 3'd5)) ) ; // LDXFSR
3000
3001assign fac_fsr6_sel_fw[0] =
3002 i_fsr6_sel_fw[0] |
3003//( (fsr_w2_vld_fw[0] & (lsu_fgu_fld_tid_fw[2:0] == 3'd6)) & 1'b0) | // LDFSR
3004 ( (fsr_w2_vld_fw[1] & (lsu_fgu_fld_tid_fw[2:0] == 3'd6)) ) ; // LDXFSR
3005
3006assign fac_fsr7_sel_fw[0] =
3007 i_fsr7_sel_fw[0] |
3008//( (fsr_w2_vld_fw[0] & (lsu_fgu_fld_tid_fw[2:0] == 3'd7)) & 1'b0) | // LDFSR
3009 ( (fsr_w2_vld_fw[1] & (lsu_fgu_fld_tid_fw[2:0] == 3'd7)) ) ; // LDXFSR
3010
3011// ------------------------------------
3012// FPRS
3013//
3014// FPRS[2:0] = {fef, du, dl}
3015// ------------------------------------
3016
3017fgu_fac_ctl_msff_ctl_macro__width_12 fprs_frf_ctl (
3018 .scan_in(fprs_frf_ctl_scanin),
3019 .scan_out(fprs_frf_ctl_scanout),
3020 .l1clk(l1clk_pm1),
3021 .din ({w1_addr_fw_b4,
3022 fad_w1_tid_fw[2:0],
3023 fad_w1_vld_fw[1:0],
3024 fad_w2_addr_fw1_b4,
3025 fad_w2_tid_fw1[2:0],
3026 fad_w2_vld_fw1[1:0]}),
3027 .dout({fprs_w1_addr[4],
3028 fprs_w1_tid[2:0],
3029 fprs_w1_vld[1:0],
3030 fprs_w2_addr[4],
3031 fprs_w2_tid[2:0],
3032 fprs_w2_vld[1:0]}),
3033 .siclk(siclk),
3034 .soclk(soclk)
3035 );
3036
3037// ----------
3038// FPRS tid0
3039// ----------
3040
3041assign fprs_tid0_sel[0] = rng_wr_fprs_3f & (rng_wr_tid_3f[2:0] == 3'd0); // ASR FPRS write
3042assign fprs_tid0_sel[1] = |fprs_w1_vld[1:0] & (fprs_w1_tid[2:0] == 3'd0); // FRF w1 write
3043assign fprs_tid0_sel[2] = |fprs_w2_vld[1:0] & (fprs_w2_tid[2:0] == 3'd0); // FRF w2 write
3044assign fprs_tid0_sel[3] = ~(|fprs_tid0_sel[2:0]); // hold
3045
3046assign din_fprs_tid0[0] = // dirty lower
3047 ( fprs_tid0_sel[0] & rng_data_2f_b7_0[0] ) | // ASR FPRS write
3048 ( fprs_tid0_sel[1] & (fprs_tid0[0] | ~fprs_w1_addr[4])) | // FRF w1 write
3049 ( fprs_tid0_sel[2] & (fprs_tid0[0] | ~fprs_w2_addr[4])) | // FRF w2 write
3050 ( fprs_tid0_sel[3] & fprs_tid0[0] ) ; // hold
3051
3052assign din_fprs_tid0[1] = // dirty upper
3053 ( fprs_tid0_sel[0] & rng_data_2f_b7_0[1] ) | // ASR FPRS write
3054 ( fprs_tid0_sel[1] & (fprs_tid0[1] | fprs_w1_addr[4])) | // FRF w1 write
3055 ( fprs_tid0_sel[2] & (fprs_tid0[1] | fprs_w2_addr[4])) | // FRF w2 write
3056 ( fprs_tid0_sel[3] & fprs_tid0[1] ) ; // hold
3057
3058assign din_fprs_tid0[2] = // enable fp (POR value is 1'b1)
3059 ~(( fprs_tid0_sel[0] & rng_data_2f_b7_0[2]) | // ASR FPRS write
3060 (~fprs_tid0_sel[0] & fprs_tid0[2] ) ); // hold
3061
3062fgu_fac_ctl_msff_ctl_macro__width_3 fprstid0 ( // FS:wmr_protect
3063 .scan_in(fprstid0_wmr_scanin),
3064 .scan_out(fprstid0_wmr_scanout),
3065 .siclk(spc_aclk_wmr),
3066 .l1clk(l1clk_pm1),
3067 .din (din_fprs_tid0[2:0]),
3068 .dout({fprs_tid0_[2], fprs_tid0[1:0]}),
3069 .soclk(soclk)
3070 );
3071
3072assign fprs_tid0[2] = ~fprs_tid0_[2];
3073
3074// ----------
3075// FPRS tid1
3076// ----------
3077
3078assign fprs_tid1_sel[0] = rng_wr_fprs_3f & (rng_wr_tid_3f[2:0] == 3'd1); // ASR FPRS write
3079assign fprs_tid1_sel[1] = |fprs_w1_vld[1:0] & (fprs_w1_tid[2:0] == 3'd1); // FRF w1 write
3080assign fprs_tid1_sel[2] = |fprs_w2_vld[1:0] & (fprs_w2_tid[2:0] == 3'd1); // FRF w2 write
3081assign fprs_tid1_sel[3] = ~(|fprs_tid1_sel[2:0]); // hold
3082
3083assign din_fprs_tid1[0] = // dirty lower
3084 ( fprs_tid1_sel[0] & rng_data_2f_b7_0[0] ) | // ASR FPRS write
3085 ( fprs_tid1_sel[1] & (fprs_tid1[0] | ~fprs_w1_addr[4])) | // FRF w1 write
3086 ( fprs_tid1_sel[2] & (fprs_tid1[0] | ~fprs_w2_addr[4])) | // FRF w2 write
3087 ( fprs_tid1_sel[3] & fprs_tid1[0] ) ; // hold
3088
3089assign din_fprs_tid1[1] = // dirty upper
3090 ( fprs_tid1_sel[0] & rng_data_2f_b7_0[1] ) | // ASR FPRS write
3091 ( fprs_tid1_sel[1] & (fprs_tid1[1] | fprs_w1_addr[4])) | // FRF w1 write
3092 ( fprs_tid1_sel[2] & (fprs_tid1[1] | fprs_w2_addr[4])) | // FRF w2 write
3093 ( fprs_tid1_sel[3] & fprs_tid1[1] ) ; // hold
3094
3095assign din_fprs_tid1[2] = // enable fp (POR value is 1'b1)
3096 ~(( fprs_tid1_sel[0] & rng_data_2f_b7_0[2]) | // ASR FPRS write
3097 (~fprs_tid1_sel[0] & fprs_tid1[2] ) ); // hold
3098
3099fgu_fac_ctl_msff_ctl_macro__width_3 fprstid1 ( // FS:wmr_protect
3100 .scan_in(fprstid1_wmr_scanin),
3101 .scan_out(fprstid1_wmr_scanout),
3102 .siclk(spc_aclk_wmr),
3103 .l1clk(l1clk_pm1),
3104 .din (din_fprs_tid1[2:0]),
3105 .dout({fprs_tid1_[2], fprs_tid1[1:0]}),
3106 .soclk(soclk)
3107 );
3108
3109assign fprs_tid1[2] = ~fprs_tid1_[2];
3110
3111// ----------
3112// FPRS tid2
3113// ----------
3114
3115assign fprs_tid2_sel[0] = rng_wr_fprs_3f & (rng_wr_tid_3f[2:0] == 3'd2); // ASR FPRS write
3116assign fprs_tid2_sel[1] = |fprs_w1_vld[1:0] & (fprs_w1_tid[2:0] == 3'd2); // FRF w1 write
3117assign fprs_tid2_sel[2] = |fprs_w2_vld[1:0] & (fprs_w2_tid[2:0] == 3'd2); // FRF w2 write
3118assign fprs_tid2_sel[3] = ~(|fprs_tid2_sel[2:0]); // hold
3119
3120assign din_fprs_tid2[0] = // dirty lower
3121 ( fprs_tid2_sel[0] & rng_data_2f_b7_0[0] ) | // ASR FPRS write
3122 ( fprs_tid2_sel[1] & (fprs_tid2[0] | ~fprs_w1_addr[4])) | // FRF w1 write
3123 ( fprs_tid2_sel[2] & (fprs_tid2[0] | ~fprs_w2_addr[4])) | // FRF w2 write
3124 ( fprs_tid2_sel[3] & fprs_tid2[0] ) ; // hold
3125
3126assign din_fprs_tid2[1] = // dirty upper
3127 ( fprs_tid2_sel[0] & rng_data_2f_b7_0[1] ) | // ASR FPRS write
3128 ( fprs_tid2_sel[1] & (fprs_tid2[1] | fprs_w1_addr[4])) | // FRF w1 write
3129 ( fprs_tid2_sel[2] & (fprs_tid2[1] | fprs_w2_addr[4])) | // FRF w2 write
3130 ( fprs_tid2_sel[3] & fprs_tid2[1] ) ; // hold
3131
3132assign din_fprs_tid2[2] = // enable fp (POR value is 1'b1)
3133 ~(( fprs_tid2_sel[0] & rng_data_2f_b7_0[2]) | // ASR FPRS write
3134 (~fprs_tid2_sel[0] & fprs_tid2[2] ) ); // hold
3135
3136fgu_fac_ctl_msff_ctl_macro__width_3 fprstid2 ( // FS:wmr_protect
3137 .scan_in(fprstid2_wmr_scanin),
3138 .scan_out(fprstid2_wmr_scanout),
3139 .siclk(spc_aclk_wmr),
3140 .l1clk(l1clk_pm1),
3141 .din (din_fprs_tid2[2:0]),
3142 .dout({fprs_tid2_[2], fprs_tid2[1:0]}),
3143 .soclk(soclk)
3144 );
3145
3146assign fprs_tid2[2] = ~fprs_tid2_[2];
3147
3148// ----------
3149// FPRS tid3
3150// ----------
3151
3152assign fprs_tid3_sel[0] = rng_wr_fprs_3f & (rng_wr_tid_3f[2:0] == 3'd3); // ASR FPRS write
3153assign fprs_tid3_sel[1] = |fprs_w1_vld[1:0] & (fprs_w1_tid[2:0] == 3'd3); // FRF w1 write
3154assign fprs_tid3_sel[2] = |fprs_w2_vld[1:0] & (fprs_w2_tid[2:0] == 3'd3); // FRF w2 write
3155assign fprs_tid3_sel[3] = ~(|fprs_tid3_sel[2:0]); // hold
3156
3157assign din_fprs_tid3[0] = // dirty lower
3158 ( fprs_tid3_sel[0] & rng_data_2f_b7_0[0] ) | // ASR FPRS write
3159 ( fprs_tid3_sel[1] & (fprs_tid3[0] | ~fprs_w1_addr[4])) | // FRF w1 write
3160 ( fprs_tid3_sel[2] & (fprs_tid3[0] | ~fprs_w2_addr[4])) | // FRF w2 write
3161 ( fprs_tid3_sel[3] & fprs_tid3[0] ) ; // hold
3162
3163assign din_fprs_tid3[1] = // dirty upper
3164 ( fprs_tid3_sel[0] & rng_data_2f_b7_0[1] ) | // ASR FPRS write
3165 ( fprs_tid3_sel[1] & (fprs_tid3[1] | fprs_w1_addr[4])) | // FRF w1 write
3166 ( fprs_tid3_sel[2] & (fprs_tid3[1] | fprs_w2_addr[4])) | // FRF w2 write
3167 ( fprs_tid3_sel[3] & fprs_tid3[1] ) ; // hold
3168
3169assign din_fprs_tid3[2] = // enable fp (POR value is 1'b1)
3170 ~(( fprs_tid3_sel[0] & rng_data_2f_b7_0[2]) | // ASR FPRS write
3171 (~fprs_tid3_sel[0] & fprs_tid3[2] ) ); // hold
3172
3173fgu_fac_ctl_msff_ctl_macro__width_3 fprstid3 ( // FS:wmr_protect
3174 .scan_in(fprstid3_wmr_scanin),
3175 .scan_out(fprstid3_wmr_scanout),
3176 .siclk(spc_aclk_wmr),
3177 .l1clk(l1clk_pm1),
3178 .din (din_fprs_tid3[2:0]),
3179 .dout({fprs_tid3_[2], fprs_tid3[1:0]}),
3180 .soclk(soclk)
3181 );
3182
3183assign fprs_tid3[2] = ~fprs_tid3_[2];
3184
3185// ----------
3186// FPRS tid4
3187// ----------
3188
3189assign fprs_tid4_sel[0] = rng_wr_fprs_3f & (rng_wr_tid_3f[2:0] == 3'd4); // ASR FPRS write
3190assign fprs_tid4_sel[1] = |fprs_w1_vld[1:0] & (fprs_w1_tid[2:0] == 3'd4); // FRF w1 write
3191assign fprs_tid4_sel[2] = |fprs_w2_vld[1:0] & (fprs_w2_tid[2:0] == 3'd4); // FRF w2 write
3192assign fprs_tid4_sel[3] = ~(|fprs_tid4_sel[2:0]); // hold
3193
3194assign din_fprs_tid4[0] = // dirty lower
3195 ( fprs_tid4_sel[0] & rng_data_2f_b7_0[0] ) | // ASR FPRS write
3196 ( fprs_tid4_sel[1] & (fprs_tid4[0] | ~fprs_w1_addr[4])) | // FRF w1 write
3197 ( fprs_tid4_sel[2] & (fprs_tid4[0] | ~fprs_w2_addr[4])) | // FRF w2 write
3198 ( fprs_tid4_sel[3] & fprs_tid4[0] ) ; // hold
3199
3200assign din_fprs_tid4[1] = // dirty upper
3201 ( fprs_tid4_sel[0] & rng_data_2f_b7_0[1] ) | // ASR FPRS write
3202 ( fprs_tid4_sel[1] & (fprs_tid4[1] | fprs_w1_addr[4])) | // FRF w1 write
3203 ( fprs_tid4_sel[2] & (fprs_tid4[1] | fprs_w2_addr[4])) | // FRF w2 write
3204 ( fprs_tid4_sel[3] & fprs_tid4[1] ) ; // hold
3205
3206assign din_fprs_tid4[2] = // enable fp (POR value is 1'b1)
3207 ~(( fprs_tid4_sel[0] & rng_data_2f_b7_0[2]) | // ASR FPRS write
3208 (~fprs_tid4_sel[0] & fprs_tid4[2] ) ); // hold
3209
3210fgu_fac_ctl_msff_ctl_macro__width_3 fprstid4 ( // FS:wmr_protect
3211 .scan_in(fprstid4_wmr_scanin),
3212 .scan_out(fprstid4_wmr_scanout),
3213 .siclk(spc_aclk_wmr),
3214 .l1clk(l1clk_pm1),
3215 .din (din_fprs_tid4[2:0]),
3216 .dout({fprs_tid4_[2], fprs_tid4[1:0]}),
3217 .soclk(soclk)
3218 );
3219
3220assign fprs_tid4[2] = ~fprs_tid4_[2];
3221
3222// ----------
3223// FPRS tid5
3224// ----------
3225
3226assign fprs_tid5_sel[0] = rng_wr_fprs_3f & (rng_wr_tid_3f[2:0] == 3'd5); // ASR FPRS write
3227assign fprs_tid5_sel[1] = |fprs_w1_vld[1:0] & (fprs_w1_tid[2:0] == 3'd5); // FRF w1 write
3228assign fprs_tid5_sel[2] = |fprs_w2_vld[1:0] & (fprs_w2_tid[2:0] == 3'd5); // FRF w2 write
3229assign fprs_tid5_sel[3] = ~(|fprs_tid5_sel[2:0]); // hold
3230
3231assign din_fprs_tid5[0] = // dirty lower
3232 ( fprs_tid5_sel[0] & rng_data_2f_b7_0[0] ) | // ASR FPRS write
3233 ( fprs_tid5_sel[1] & (fprs_tid5[0] | ~fprs_w1_addr[4])) | // FRF w1 write
3234 ( fprs_tid5_sel[2] & (fprs_tid5[0] | ~fprs_w2_addr[4])) | // FRF w2 write
3235 ( fprs_tid5_sel[3] & fprs_tid5[0] ) ; // hold
3236
3237assign din_fprs_tid5[1] = // dirty upper
3238 ( fprs_tid5_sel[0] & rng_data_2f_b7_0[1] ) | // ASR FPRS write
3239 ( fprs_tid5_sel[1] & (fprs_tid5[1] | fprs_w1_addr[4])) | // FRF w1 write
3240 ( fprs_tid5_sel[2] & (fprs_tid5[1] | fprs_w2_addr[4])) | // FRF w2 write
3241 ( fprs_tid5_sel[3] & fprs_tid5[1] ) ; // hold
3242
3243assign din_fprs_tid5[2] = // enable fp (POR value is 1'b1)
3244 ~(( fprs_tid5_sel[0] & rng_data_2f_b7_0[2]) | // ASR FPRS write
3245 (~fprs_tid5_sel[0] & fprs_tid5[2] ) ); // hold
3246
3247fgu_fac_ctl_msff_ctl_macro__width_3 fprstid5 ( // FS:wmr_protect
3248 .scan_in(fprstid5_wmr_scanin),
3249 .scan_out(fprstid5_wmr_scanout),
3250 .siclk(spc_aclk_wmr),
3251 .l1clk(l1clk_pm1),
3252 .din (din_fprs_tid5[2:0]),
3253 .dout({fprs_tid5_[2], fprs_tid5[1:0]}),
3254 .soclk(soclk)
3255 );
3256
3257assign fprs_tid5[2] = ~fprs_tid5_[2];
3258
3259// ----------
3260// FPRS tid6
3261// ----------
3262
3263assign fprs_tid6_sel[0] = rng_wr_fprs_3f & (rng_wr_tid_3f[2:0] == 3'd6); // ASR FPRS write
3264assign fprs_tid6_sel[1] = |fprs_w1_vld[1:0] & (fprs_w1_tid[2:0] == 3'd6); // FRF w1 write
3265assign fprs_tid6_sel[2] = |fprs_w2_vld[1:0] & (fprs_w2_tid[2:0] == 3'd6); // FRF w2 write
3266assign fprs_tid6_sel[3] = ~(|fprs_tid6_sel[2:0]); // hold
3267
3268assign din_fprs_tid6[0] = // dirty lower
3269 ( fprs_tid6_sel[0] & rng_data_2f_b7_0[0] ) | // ASR FPRS write
3270 ( fprs_tid6_sel[1] & (fprs_tid6[0] | ~fprs_w1_addr[4])) | // FRF w1 write
3271 ( fprs_tid6_sel[2] & (fprs_tid6[0] | ~fprs_w2_addr[4])) | // FRF w2 write
3272 ( fprs_tid6_sel[3] & fprs_tid6[0] ) ; // hold
3273
3274assign din_fprs_tid6[1] = // dirty upper
3275 ( fprs_tid6_sel[0] & rng_data_2f_b7_0[1] ) | // ASR FPRS write
3276 ( fprs_tid6_sel[1] & (fprs_tid6[1] | fprs_w1_addr[4])) | // FRF w1 write
3277 ( fprs_tid6_sel[2] & (fprs_tid6[1] | fprs_w2_addr[4])) | // FRF w2 write
3278 ( fprs_tid6_sel[3] & fprs_tid6[1] ) ; // hold
3279
3280assign din_fprs_tid6[2] = // enable fp (POR value is 1'b1)
3281 ~(( fprs_tid6_sel[0] & rng_data_2f_b7_0[2]) | // ASR FPRS write
3282 (~fprs_tid6_sel[0] & fprs_tid6[2] ) ); // hold
3283
3284fgu_fac_ctl_msff_ctl_macro__width_3 fprstid6 ( // FS:wmr_protect
3285 .scan_in(fprstid6_wmr_scanin),
3286 .scan_out(fprstid6_wmr_scanout),
3287 .siclk(spc_aclk_wmr),
3288 .l1clk(l1clk_pm1),
3289 .din (din_fprs_tid6[2:0]),
3290 .dout({fprs_tid6_[2], fprs_tid6[1:0]}),
3291 .soclk(soclk)
3292 );
3293
3294assign fprs_tid6[2] = ~fprs_tid6_[2];
3295
3296// ----------
3297// FPRS tid7
3298// ----------
3299
3300assign fprs_tid7_sel[0] = rng_wr_fprs_3f & (rng_wr_tid_3f[2:0] == 3'd7); // ASR FPRS write
3301assign fprs_tid7_sel[1] = |fprs_w1_vld[1:0] & (fprs_w1_tid[2:0] == 3'd7); // FRF w1 write
3302assign fprs_tid7_sel[2] = |fprs_w2_vld[1:0] & (fprs_w2_tid[2:0] == 3'd7); // FRF w2 write
3303assign fprs_tid7_sel[3] = ~(|fprs_tid7_sel[2:0]); // hold
3304
3305assign din_fprs_tid7[0] = // dirty lower
3306 ( fprs_tid7_sel[0] & rng_data_2f_b7_0[0] ) | // ASR FPRS write
3307 ( fprs_tid7_sel[1] & (fprs_tid7[0] | ~fprs_w1_addr[4])) | // FRF w1 write
3308 ( fprs_tid7_sel[2] & (fprs_tid7[0] | ~fprs_w2_addr[4])) | // FRF w2 write
3309 ( fprs_tid7_sel[3] & fprs_tid7[0] ) ; // hold
3310
3311assign din_fprs_tid7[1] = // dirty upper
3312 ( fprs_tid7_sel[0] & rng_data_2f_b7_0[1] ) | // ASR FPRS write
3313 ( fprs_tid7_sel[1] & (fprs_tid7[1] | fprs_w1_addr[4])) | // FRF w1 write
3314 ( fprs_tid7_sel[2] & (fprs_tid7[1] | fprs_w2_addr[4])) | // FRF w2 write
3315 ( fprs_tid7_sel[3] & fprs_tid7[1] ) ; // hold
3316
3317assign din_fprs_tid7[2] = // enable fp (POR value is 1'b1)
3318 ~(( fprs_tid7_sel[0] & rng_data_2f_b7_0[2]) | // ASR FPRS write
3319 (~fprs_tid7_sel[0] & fprs_tid7[2] ) ); // hold
3320
3321fgu_fac_ctl_msff_ctl_macro__width_3 fprstid7 ( // FS:wmr_protect
3322 .scan_in(fprstid7_wmr_scanin),
3323 .scan_out(fprstid7_wmr_scanout),
3324 .siclk(spc_aclk_wmr),
3325 .l1clk(l1clk_pm1),
3326 .din (din_fprs_tid7[2:0]),
3327 .dout({fprs_tid7_[2], fprs_tid7[1:0]}),
3328 .soclk(soclk)
3329 );
3330
3331assign fprs_tid7[2] = ~fprs_tid7_[2];
3332
3333assign fgu_fprs_fef[7:0] =
3334 {fprs_tid7[2],
3335 fprs_tid6[2],
3336 fprs_tid5[2],
3337 fprs_tid4[2],
3338 fprs_tid3[2],
3339 fprs_tid2[2],
3340 fprs_tid1[2],
3341 fprs_tid0[2]};
3342
3343// ----------
3344// ASR FPRS read data
3345// ----------
3346
3347assign din_rng_fprs[2:0] =
3348 ({3{(rng_wr_tid_3f[2:0] == 3'd0)}} & fprs_tid0[2:0]) |
3349 ({3{(rng_wr_tid_3f[2:0] == 3'd1)}} & fprs_tid1[2:0]) |
3350 ({3{(rng_wr_tid_3f[2:0] == 3'd2)}} & fprs_tid2[2:0]) |
3351 ({3{(rng_wr_tid_3f[2:0] == 3'd3)}} & fprs_tid3[2:0]) |
3352 ({3{(rng_wr_tid_3f[2:0] == 3'd4)}} & fprs_tid4[2:0]) |
3353 ({3{(rng_wr_tid_3f[2:0] == 3'd5)}} & fprs_tid5[2:0]) |
3354 ({3{(rng_wr_tid_3f[2:0] == 3'd6)}} & fprs_tid6[2:0]) |
3355 ({3{(rng_wr_tid_3f[2:0] == 3'd7)}} & fprs_tid7[2:0]) ;
3356
3357fgu_fac_ctl_msff_ctl_macro__width_3 fprs_rng (
3358 .scan_in(fprs_rng_scanin),
3359 .scan_out(fprs_rng_scanout),
3360 .l1clk(l1clk_pm1),
3361 .din (din_rng_fprs[2:0]),
3362 .dout(fac_rng_fprs[2:0]),
3363 .siclk(siclk),
3364 .soclk(soclk)
3365 );
3366
3367// ----------------------------------------------------------------------------
3368// FGU ASI local ring control - ASR GSR/FPRS access, ASI FRF ECC access
3369// ----------------------------------------------------------------------------
3370//
3371//
3372// ASI access should not happen for a given thread when there is a valid instr
3373// in the pipeline for that thread.
3374//
3375// A packet is transmitted on the ring over 2 cycles. First cycle
3376// carries control and address information. Second cycle carries data.
3377// -Determinate write packets go through the pipe unmodified. The write data
3378// is used by the unit.
3379// -Determinate read packets have their data portion modified
3380// by the target unit.
3381//
3382// 65-bit control/data bus output from the ring:
3383// 64 - ctl/data
3384// 63 - valid/hole
3385// 62 - ack
3386// 61:60 - 00-ASI, 01-ASR, 10-PR, 11-HPR
3387// 59 - rd/wr
3388// 58:56 - Thread ID
3389// 55:48 - ASI field
3390// 47:0 - Virtual Address
3391//
3392////////////////////////////////////////////////////////////////////////////////
3393//
3394// PIPELINE STRUCTURE
3395//
3396// rng_in_cdbus
3397// |
3398// |
3399// -------------
3400// | stage1 reg |
3401// -------------
3402// |
3403// ------------------------|---------> Store Data
3404// | v
3405// | -------------
3406// | | Decode |
3407// | | | ---------> Load request
3408// | | |
3409// | -------------
3410// | |
3411// | |
3412// v v
3413// --------------- -------------
3414// |stage2 data reg| |stage2 ctl reg|
3415// --------------- -------------
3416// load data | |
3417// ------------- | |
3418//indet load data | | |---------> Store control
3419// --------- | | |
3420// | | | |
3421// v v v |
3422// ---------------- |
3423// \ input mux / |
3424// -------------- -----------------
3425// | |
3426// | |
3427// | |
3428// v v
3429// ----------------
3430// \ data/ctl mux /
3431// --------------
3432// |
3433// v
3434// -------------
3435// | stage3 reg |
3436// -------------
3437// |
3438// |
3439// v
3440// rng_out_cdbus
3441//
3442//////////////////////////////////////////////////////////////////////
3443
3444`define FRF_ADDR 8'd73 // FRF ECC address
3445`define GSR_ADDR 8'd19 // GSR address
3446`define FPRS_ADDR 8'd6 // FPRS address
3447`define ASI 2'b00
3448`define ASR 2'b01
3449
3450// ------------------------------------
3451// STAGE 1
3452// ------------------------------------
3453
3454// First cycle of the packet holds control and address information
3455// Second cycle holds the read/write data
3456
3457// bit 64 indicates whether ctl packet or data packet
3458fgu_fac_ctl_msff_ctl_macro__width_25 rng_stg1 (
3459 .scan_in(rng_stg1_scanin),
3460 .scan_out(rng_stg1_scanout),
3461 .l1clk(l1clk_pm2),
3462 .din ({in_rngl_cdbus[64:48], in_rngl_cdbus[7:0]}), // requires free running clk or rng_data_1f[63] en
3463 .dout ({rng_ctl_1f, rng_valid_1f, rng_data_1f[62:48], rng_data_1f_b7_0[7:0]}),
3464 .siclk(siclk),
3465 .soclk(soclk)
3466 );
3467
3468// decode the packet for ASR GSR/FPRS read or ASI ECC read
3469assign rng_rd_1f =
3470 rng_ctl_1f & // ctl packet (not data)
3471 rng_valid_1f & // valid
3472 ~rng_data_1f[62] & // ~ack
3473 rng_data_1f[59] ; // read (not write)
3474
3475// decode the packet for ASR GSR/FPRS write
3476assign rng_wr_1f =
3477 rng_ctl_1f & // ctl packet (not data)
3478 rng_valid_1f & // valid
3479 ~rng_data_1f[62] & // ~ack
3480 (rng_data_1f[61:60] == `ASR) & // ASR
3481 ~rng_data_1f[59] ; // write (not read)
3482
3483assign rng_rd_gsr_1f = rng_rd_1f & (rng_data_1f[61:60] == `ASR) & (rng_data_1f[55:48] == `GSR_ADDR );
3484assign rng_wr_gsr_1f = rng_wr_1f & (rng_data_1f[55:48] == `GSR_ADDR );
3485assign rng_rd_fprs_1f = rng_rd_1f & (rng_data_1f[61:60] == `ASR) & (rng_data_1f[55:48] == `FPRS_ADDR);
3486assign rng_wr_fprs_1f = rng_wr_1f & (rng_data_1f[55:48] == `FPRS_ADDR);
3487assign rng_rd_ecc_1f = rng_rd_1f & (rng_data_1f[61:60] == `ASI) & (rng_data_1f[55:48] == `FRF_ADDR );
3488
3489assign rng_rd_or_wr_1f =
3490 rng_rd_gsr_1f | rng_wr_gsr_1f |
3491 rng_rd_fprs_1f | rng_wr_fprs_1f |
3492 rng_rd_ecc_1f;
3493
3494// 0in custom -fire ((rng_rd_or_wr_1f & div_engine_busy_e & (rng_data_1f[58:56]==div_tid_in_e[2:0])) | (rng_rd_or_wr_1f & (div_finish_fltd_fb | div_finish_flts_fb) & (rng_data_1f[58:56]==fac_fpd_tid_fb[2:0])) | (rng_rd_or_wr_1f & dec_fgu_valid_e & (rng_data_1f[58:56]==fac_tid_e[2:0])) | (rng_rd_or_wr_1f & fac_dec_valid_fx1 & (rng_data_1f[58:56]==tid_fx1[2:0])) | (rng_rd_or_wr_1f & dec_valid_fx2 & (rng_data_1f[58:56]==tid_fx2[2:0])) | (rng_rd_or_wr_1f & dec_valid_fx3 & (rng_data_1f[58:56]==tid_fx3[2:0])) | (rng_rd_or_wr_1f & (|fad_w1_vld_fw[1:0]) & (rng_data_1f[58:56]==fad_w1_tid_fw[2:0]))) -message "GSR or FPRS or FRF_ECC ASI collision with FPop"
3495
3496// ------------------------------------
3497// STAGE 2
3498// ------------------------------------
3499
3500fgu_fac_ctl_msff_ctl_macro__width_17 rng_stg2 (
3501 .scan_in(rng_stg2_scanin),
3502 .scan_out(rng_stg2_scanout),
3503 .l1clk(l1clk_pm1),
3504 .din ({rng_data_1f[58:56],
3505 rng_wr_gsr_1f,
3506 rng_rd_or_wr_1f,
3507 rng_rd_gsr_1f,
3508 rng_rd_fprs_1f,
3509 rng_wr_fprs_1f,
3510 rng_rd_ecc_1f,
3511 rng_data_1f_b7_0[7:0]}),
3512 .dout({rng_wr_tid_2f[2:0],
3513 rng_wr_gsr_2f,
3514 rng_rd_or_wr_2f,
3515 rng_rd_gsr_2f,
3516 rng_rd_fprs_2f,
3517 rng_wr_fprs_2f,
3518 rng_rd_ecc_2f,
3519 rng_data_2f_b7_0[7:0]}),
3520 .siclk(siclk),
3521 .soclk(soclk)
3522 );
3523
3524fgu_fac_ctl_msff_ctl_macro__width_6 rng_6463 (
3525 .scan_in(rng_6463_scanin),
3526 .scan_out(rng_6463_scanout),
3527 .l1clk(l1clk_pm2),
3528 .din ({rng_ctl_1f,
3529 rng_valid_1f,
3530 rng_ctl_2f,
3531 rng_valid_2f,
3532 rng_ctl_3f,
3533 rng_cdbus_3f_b63}),
3534 .dout({rng_ctl_2f, // requires free running clk
3535 rng_valid_2f, // requires free running clk
3536 rng_ctl_3f, // requires free running clk
3537 rng_valid_3f, // requires free running clk
3538 fgu_rngl_cdbus_b64, // requires free running clk
3539 fgu_rngl_cdbus_b63}),
3540 .siclk(siclk),
3541 .soclk(soclk) // requires free running clk
3542 );
3543
3544// ------------------------------------
3545// STAGE 3
3546// ------------------------------------
3547
3548fgu_fac_ctl_msff_ctl_macro__width_9 rng_stg3 (
3549 .scan_in(rng_stg3_scanin),
3550 .scan_out(rng_stg3_scanout),
3551 .l1clk(l1clk_pm1),
3552 .din ({rng_wr_tid_2f[2:0],
3553 rng_wr_gsr_2f,
3554 rng_rd_or_wr_2f,
3555 rng_rd_gsr_2f,
3556 rng_rd_fprs_2f,
3557 rng_wr_fprs_2f,
3558 rng_rd_ecc_2f}),
3559 .dout({rng_wr_tid_3f[2:0],
3560 fac_rng_wr_gsr_3f,
3561 fac_rng_rd_or_wr_3f,
3562 rng_rd_gsr_3f,
3563 rng_rd_fprs_3f,
3564 rng_wr_fprs_3f,
3565 rng_rd_ecc_3f}),
3566 .siclk(siclk),
3567 .soclk(soclk)
3568 );
3569
3570assign rng_b64_default_sel =
3571 ~fac_rng_rd_or_wr_3f &
3572 ~fac_rng_rd_gsr_4f &
3573 ~fac_rng_rd_fprs_4f &
3574 ~fac_rng_rd_ecc_4f ;
3575
3576assign rng_cdbus_3f_b63 =
3577 (fac_rng_rd_or_wr_3f & rng_valid_3f ) |
3578 (fac_rng_rd_gsr_4f & fgd_gsr_asr_mask_fx4_b31) |
3579 (rng_b64_default_sel & rng_valid_3f ) ;
3580
3581// ------------------------------------
3582// STAGE 4
3583// ------------------------------------
3584
3585fgu_fac_ctl_msff_ctl_macro__width_5 rng_stg4 (
3586 .scan_in(rng_stg4_scanin),
3587 .scan_out(rng_stg4_scanout),
3588 .l1clk(l1clk_pm1),
3589 .din ({ rng_rd_gsr_3f,
3590 rng_rd_fprs_3f,
3591 rng_rd_ecc_3f,
3592 fac_rng_rd_or_wr_3f,
3593 rng_rd_or_wr_4f}),
3594 .dout({fac_rng_rd_gsr_4f,
3595 fac_rng_rd_fprs_4f,
3596 fac_rng_rd_ecc_4f,
3597 rng_rd_or_wr_4f,
3598 rng_rd_or_wr_5f}),
3599 .siclk(siclk),
3600 .soclk(soclk)
3601 );
3602
3603
3604supply0 vss;
3605supply1 vdd;
3606// fixscan start:
3607assign spares_scanin = scan_in ;
3608assign e_00_scanin = spares_scanout ;
3609assign e_01_scanin = e_00_scanout ;
3610assign e_02_scanin = e_01_scanout ;
3611assign e_03_scanin = e_02_scanout ;
3612assign fx1_00_scanin = e_03_scanout ;
3613assign fx1_01_scanin = fx1_00_scanout ;
3614assign fx1_02_scanin = fx1_01_scanout ;
3615assign fx2_00_scanin = fx1_02_scanout ;
3616assign fx2_01_scanin = fx2_00_scanout ;
3617assign fx2_02_scanin = fx2_01_scanout ;
3618assign fx3_00_scanin = fx2_02_scanout ;
3619assign fx3_01_scanin = fx3_00_scanout ;
3620assign fx4_00_scanin = fx3_01_scanout ;
3621assign fx5_00_scanin = fx4_00_scanout ;
3622assign fb_00_scanin = fx5_00_scanout ;
3623assign fw_00_scanin = fb_00_scanout ;
3624assign fw_01_scanin = fw_00_scanout ;
3625assign fprs_frf_ctl_scanin = fw_01_scanout ;
3626assign fprs_rng_scanin = fprs_frf_ctl_scanout ;
3627assign rng_stg1_scanin = fprs_rng_scanout ;
3628assign rng_stg2_scanin = rng_stg1_scanout ;
3629assign rng_6463_scanin = rng_stg2_scanout ;
3630assign rng_stg3_scanin = rng_6463_scanout ;
3631assign rng_stg4_scanin = rng_stg3_scanout ;
3632assign scan_out = rng_stg4_scanout ;
3633
3634assign fprstid0_wmr_scanin = wmr_scan_in ;
3635assign fprstid1_wmr_scanin = fprstid0_wmr_scanout ;
3636assign fprstid2_wmr_scanin = fprstid1_wmr_scanout ;
3637assign fprstid3_wmr_scanin = fprstid2_wmr_scanout ;
3638assign fprstid4_wmr_scanin = fprstid3_wmr_scanout ;
3639assign fprstid5_wmr_scanin = fprstid4_wmr_scanout ;
3640assign fprstid6_wmr_scanin = fprstid5_wmr_scanout ;
3641assign fprstid7_wmr_scanin = fprstid6_wmr_scanout ;
3642assign wmr_scan_out = fprstid7_wmr_scanout ;
3643// fixscan end:
3644endmodule // fgu_fac_ctl
3645
3646
3647
3648
3649
3650
3651
3652
3653// any PARAMS parms go into naming of macro
3654
3655module fgu_fac_ctl_l1clkhdr_ctl_macro (
3656 l2clk,
3657 l1en,
3658 pce_ov,
3659 stop,
3660 se,
3661 l1clk);
3662
3663
3664 input l2clk;
3665 input l1en;
3666 input pce_ov;
3667 input stop;
3668 input se;
3669 output l1clk;
3670
3671
3672
3673
3674
3675cl_sc1_l1hdr_8x c_0 (
3676
3677
3678 .l2clk(l2clk),
3679 .pce(l1en),
3680 .l1clk(l1clk),
3681 .se(se),
3682 .pce_ov(pce_ov),
3683 .stop(stop)
3684);
3685
3686
3687
3688endmodule
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698// Description: Spare gate macro for control blocks
3699//
3700// Param num controls the number of times the macro is added
3701// flops=0 can be used to use only combination spare logic
3702
3703
3704module fgu_fac_ctl_spare_ctl_macro__num_5 (
3705 l1clk,
3706 scan_in,
3707 siclk,
3708 soclk,
3709 scan_out);
3710wire si_0;
3711wire so_0;
3712wire spare0_flop_unused;
3713wire spare0_buf_32x_unused;
3714wire spare0_nand3_8x_unused;
3715wire spare0_inv_8x_unused;
3716wire spare0_aoi22_4x_unused;
3717wire spare0_buf_8x_unused;
3718wire spare0_oai22_4x_unused;
3719wire spare0_inv_16x_unused;
3720wire spare0_nand2_16x_unused;
3721wire spare0_nor3_4x_unused;
3722wire spare0_nand2_8x_unused;
3723wire spare0_buf_16x_unused;
3724wire spare0_nor2_16x_unused;
3725wire spare0_inv_32x_unused;
3726wire si_1;
3727wire so_1;
3728wire spare1_flop_unused;
3729wire spare1_buf_32x_unused;
3730wire spare1_nand3_8x_unused;
3731wire spare1_inv_8x_unused;
3732wire spare1_aoi22_4x_unused;
3733wire spare1_buf_8x_unused;
3734wire spare1_oai22_4x_unused;
3735wire spare1_inv_16x_unused;
3736wire spare1_nand2_16x_unused;
3737wire spare1_nor3_4x_unused;
3738wire spare1_nand2_8x_unused;
3739wire spare1_buf_16x_unused;
3740wire spare1_nor2_16x_unused;
3741wire spare1_inv_32x_unused;
3742wire si_2;
3743wire so_2;
3744wire spare2_flop_unused;
3745wire spare2_buf_32x_unused;
3746wire spare2_nand3_8x_unused;
3747wire spare2_inv_8x_unused;
3748wire spare2_aoi22_4x_unused;
3749wire spare2_buf_8x_unused;
3750wire spare2_oai22_4x_unused;
3751wire spare2_inv_16x_unused;
3752wire spare2_nand2_16x_unused;
3753wire spare2_nor3_4x_unused;
3754wire spare2_nand2_8x_unused;
3755wire spare2_buf_16x_unused;
3756wire spare2_nor2_16x_unused;
3757wire spare2_inv_32x_unused;
3758wire si_3;
3759wire so_3;
3760wire spare3_flop_unused;
3761wire spare3_buf_32x_unused;
3762wire spare3_nand3_8x_unused;
3763wire spare3_inv_8x_unused;
3764wire spare3_aoi22_4x_unused;
3765wire spare3_buf_8x_unused;
3766wire spare3_oai22_4x_unused;
3767wire spare3_inv_16x_unused;
3768wire spare3_nand2_16x_unused;
3769wire spare3_nor3_4x_unused;
3770wire spare3_nand2_8x_unused;
3771wire spare3_buf_16x_unused;
3772wire spare3_nor2_16x_unused;
3773wire spare3_inv_32x_unused;
3774wire si_4;
3775wire so_4;
3776wire spare4_flop_unused;
3777wire spare4_buf_32x_unused;
3778wire spare4_nand3_8x_unused;
3779wire spare4_inv_8x_unused;
3780wire spare4_aoi22_4x_unused;
3781wire spare4_buf_8x_unused;
3782wire spare4_oai22_4x_unused;
3783wire spare4_inv_16x_unused;
3784wire spare4_nand2_16x_unused;
3785wire spare4_nor3_4x_unused;
3786wire spare4_nand2_8x_unused;
3787wire spare4_buf_16x_unused;
3788wire spare4_nor2_16x_unused;
3789wire spare4_inv_32x_unused;
3790
3791
3792input l1clk;
3793input scan_in;
3794input siclk;
3795input soclk;
3796output scan_out;
3797
3798cl_sc1_msff_8x spare0_flop (.l1clk(l1clk),
3799 .siclk(siclk),
3800 .soclk(soclk),
3801 .si(si_0),
3802 .so(so_0),
3803 .d(1'b0),
3804 .q(spare0_flop_unused));
3805assign si_0 = scan_in;
3806
3807cl_u1_buf_32x spare0_buf_32x (.in(1'b1),
3808 .out(spare0_buf_32x_unused));
3809cl_u1_nand3_8x spare0_nand3_8x (.in0(1'b1),
3810 .in1(1'b1),
3811 .in2(1'b1),
3812 .out(spare0_nand3_8x_unused));
3813cl_u1_inv_8x spare0_inv_8x (.in(1'b1),
3814 .out(spare0_inv_8x_unused));
3815cl_u1_aoi22_4x spare0_aoi22_4x (.in00(1'b1),
3816 .in01(1'b1),
3817 .in10(1'b1),
3818 .in11(1'b1),
3819 .out(spare0_aoi22_4x_unused));
3820cl_u1_buf_8x spare0_buf_8x (.in(1'b1),
3821 .out(spare0_buf_8x_unused));
3822cl_u1_oai22_4x spare0_oai22_4x (.in00(1'b1),
3823 .in01(1'b1),
3824 .in10(1'b1),
3825 .in11(1'b1),
3826 .out(spare0_oai22_4x_unused));
3827cl_u1_inv_16x spare0_inv_16x (.in(1'b1),
3828 .out(spare0_inv_16x_unused));
3829cl_u1_nand2_16x spare0_nand2_16x (.in0(1'b1),
3830 .in1(1'b1),
3831 .out(spare0_nand2_16x_unused));
3832cl_u1_nor3_4x spare0_nor3_4x (.in0(1'b0),
3833 .in1(1'b0),
3834 .in2(1'b0),
3835 .out(spare0_nor3_4x_unused));
3836cl_u1_nand2_8x spare0_nand2_8x (.in0(1'b1),
3837 .in1(1'b1),
3838 .out(spare0_nand2_8x_unused));
3839cl_u1_buf_16x spare0_buf_16x (.in(1'b1),
3840 .out(spare0_buf_16x_unused));
3841cl_u1_nor2_16x spare0_nor2_16x (.in0(1'b0),
3842 .in1(1'b0),
3843 .out(spare0_nor2_16x_unused));
3844cl_u1_inv_32x spare0_inv_32x (.in(1'b1),
3845 .out(spare0_inv_32x_unused));
3846
3847cl_sc1_msff_8x spare1_flop (.l1clk(l1clk),
3848 .siclk(siclk),
3849 .soclk(soclk),
3850 .si(si_1),
3851 .so(so_1),
3852 .d(1'b0),
3853 .q(spare1_flop_unused));
3854assign si_1 = so_0;
3855
3856cl_u1_buf_32x spare1_buf_32x (.in(1'b1),
3857 .out(spare1_buf_32x_unused));
3858cl_u1_nand3_8x spare1_nand3_8x (.in0(1'b1),
3859 .in1(1'b1),
3860 .in2(1'b1),
3861 .out(spare1_nand3_8x_unused));
3862cl_u1_inv_8x spare1_inv_8x (.in(1'b1),
3863 .out(spare1_inv_8x_unused));
3864cl_u1_aoi22_4x spare1_aoi22_4x (.in00(1'b1),
3865 .in01(1'b1),
3866 .in10(1'b1),
3867 .in11(1'b1),
3868 .out(spare1_aoi22_4x_unused));
3869cl_u1_buf_8x spare1_buf_8x (.in(1'b1),
3870 .out(spare1_buf_8x_unused));
3871cl_u1_oai22_4x spare1_oai22_4x (.in00(1'b1),
3872 .in01(1'b1),
3873 .in10(1'b1),
3874 .in11(1'b1),
3875 .out(spare1_oai22_4x_unused));
3876cl_u1_inv_16x spare1_inv_16x (.in(1'b1),
3877 .out(spare1_inv_16x_unused));
3878cl_u1_nand2_16x spare1_nand2_16x (.in0(1'b1),
3879 .in1(1'b1),
3880 .out(spare1_nand2_16x_unused));
3881cl_u1_nor3_4x spare1_nor3_4x (.in0(1'b0),
3882 .in1(1'b0),
3883 .in2(1'b0),
3884 .out(spare1_nor3_4x_unused));
3885cl_u1_nand2_8x spare1_nand2_8x (.in0(1'b1),
3886 .in1(1'b1),
3887 .out(spare1_nand2_8x_unused));
3888cl_u1_buf_16x spare1_buf_16x (.in(1'b1),
3889 .out(spare1_buf_16x_unused));
3890cl_u1_nor2_16x spare1_nor2_16x (.in0(1'b0),
3891 .in1(1'b0),
3892 .out(spare1_nor2_16x_unused));
3893cl_u1_inv_32x spare1_inv_32x (.in(1'b1),
3894 .out(spare1_inv_32x_unused));
3895
3896cl_sc1_msff_8x spare2_flop (.l1clk(l1clk),
3897 .siclk(siclk),
3898 .soclk(soclk),
3899 .si(si_2),
3900 .so(so_2),
3901 .d(1'b0),
3902 .q(spare2_flop_unused));
3903assign si_2 = so_1;
3904
3905cl_u1_buf_32x spare2_buf_32x (.in(1'b1),
3906 .out(spare2_buf_32x_unused));
3907cl_u1_nand3_8x spare2_nand3_8x (.in0(1'b1),
3908 .in1(1'b1),
3909 .in2(1'b1),
3910 .out(spare2_nand3_8x_unused));
3911cl_u1_inv_8x spare2_inv_8x (.in(1'b1),
3912 .out(spare2_inv_8x_unused));
3913cl_u1_aoi22_4x spare2_aoi22_4x (.in00(1'b1),
3914 .in01(1'b1),
3915 .in10(1'b1),
3916 .in11(1'b1),
3917 .out(spare2_aoi22_4x_unused));
3918cl_u1_buf_8x spare2_buf_8x (.in(1'b1),
3919 .out(spare2_buf_8x_unused));
3920cl_u1_oai22_4x spare2_oai22_4x (.in00(1'b1),
3921 .in01(1'b1),
3922 .in10(1'b1),
3923 .in11(1'b1),
3924 .out(spare2_oai22_4x_unused));
3925cl_u1_inv_16x spare2_inv_16x (.in(1'b1),
3926 .out(spare2_inv_16x_unused));
3927cl_u1_nand2_16x spare2_nand2_16x (.in0(1'b1),
3928 .in1(1'b1),
3929 .out(spare2_nand2_16x_unused));
3930cl_u1_nor3_4x spare2_nor3_4x (.in0(1'b0),
3931 .in1(1'b0),
3932 .in2(1'b0),
3933 .out(spare2_nor3_4x_unused));
3934cl_u1_nand2_8x spare2_nand2_8x (.in0(1'b1),
3935 .in1(1'b1),
3936 .out(spare2_nand2_8x_unused));
3937cl_u1_buf_16x spare2_buf_16x (.in(1'b1),
3938 .out(spare2_buf_16x_unused));
3939cl_u1_nor2_16x spare2_nor2_16x (.in0(1'b0),
3940 .in1(1'b0),
3941 .out(spare2_nor2_16x_unused));
3942cl_u1_inv_32x spare2_inv_32x (.in(1'b1),
3943 .out(spare2_inv_32x_unused));
3944
3945cl_sc1_msff_8x spare3_flop (.l1clk(l1clk),
3946 .siclk(siclk),
3947 .soclk(soclk),
3948 .si(si_3),
3949 .so(so_3),
3950 .d(1'b0),
3951 .q(spare3_flop_unused));
3952assign si_3 = so_2;
3953
3954cl_u1_buf_32x spare3_buf_32x (.in(1'b1),
3955 .out(spare3_buf_32x_unused));
3956cl_u1_nand3_8x spare3_nand3_8x (.in0(1'b1),
3957 .in1(1'b1),
3958 .in2(1'b1),
3959 .out(spare3_nand3_8x_unused));
3960cl_u1_inv_8x spare3_inv_8x (.in(1'b1),
3961 .out(spare3_inv_8x_unused));
3962cl_u1_aoi22_4x spare3_aoi22_4x (.in00(1'b1),
3963 .in01(1'b1),
3964 .in10(1'b1),
3965 .in11(1'b1),
3966 .out(spare3_aoi22_4x_unused));
3967cl_u1_buf_8x spare3_buf_8x (.in(1'b1),
3968 .out(spare3_buf_8x_unused));
3969cl_u1_oai22_4x spare3_oai22_4x (.in00(1'b1),
3970 .in01(1'b1),
3971 .in10(1'b1),
3972 .in11(1'b1),
3973 .out(spare3_oai22_4x_unused));
3974cl_u1_inv_16x spare3_inv_16x (.in(1'b1),
3975 .out(spare3_inv_16x_unused));
3976cl_u1_nand2_16x spare3_nand2_16x (.in0(1'b1),
3977 .in1(1'b1),
3978 .out(spare3_nand2_16x_unused));
3979cl_u1_nor3_4x spare3_nor3_4x (.in0(1'b0),
3980 .in1(1'b0),
3981 .in2(1'b0),
3982 .out(spare3_nor3_4x_unused));
3983cl_u1_nand2_8x spare3_nand2_8x (.in0(1'b1),
3984 .in1(1'b1),
3985 .out(spare3_nand2_8x_unused));
3986cl_u1_buf_16x spare3_buf_16x (.in(1'b1),
3987 .out(spare3_buf_16x_unused));
3988cl_u1_nor2_16x spare3_nor2_16x (.in0(1'b0),
3989 .in1(1'b0),
3990 .out(spare3_nor2_16x_unused));
3991cl_u1_inv_32x spare3_inv_32x (.in(1'b1),
3992 .out(spare3_inv_32x_unused));
3993
3994cl_sc1_msff_8x spare4_flop (.l1clk(l1clk),
3995 .siclk(siclk),
3996 .soclk(soclk),
3997 .si(si_4),
3998 .so(so_4),
3999 .d(1'b0),
4000 .q(spare4_flop_unused));
4001assign si_4 = so_3;
4002
4003cl_u1_buf_32x spare4_buf_32x (.in(1'b1),
4004 .out(spare4_buf_32x_unused));
4005cl_u1_nand3_8x spare4_nand3_8x (.in0(1'b1),
4006 .in1(1'b1),
4007 .in2(1'b1),
4008 .out(spare4_nand3_8x_unused));
4009cl_u1_inv_8x spare4_inv_8x (.in(1'b1),
4010 .out(spare4_inv_8x_unused));
4011cl_u1_aoi22_4x spare4_aoi22_4x (.in00(1'b1),
4012 .in01(1'b1),
4013 .in10(1'b1),
4014 .in11(1'b1),
4015 .out(spare4_aoi22_4x_unused));
4016cl_u1_buf_8x spare4_buf_8x (.in(1'b1),
4017 .out(spare4_buf_8x_unused));
4018cl_u1_oai22_4x spare4_oai22_4x (.in00(1'b1),
4019 .in01(1'b1),
4020 .in10(1'b1),
4021 .in11(1'b1),
4022 .out(spare4_oai22_4x_unused));
4023cl_u1_inv_16x spare4_inv_16x (.in(1'b1),
4024 .out(spare4_inv_16x_unused));
4025cl_u1_nand2_16x spare4_nand2_16x (.in0(1'b1),
4026 .in1(1'b1),
4027 .out(spare4_nand2_16x_unused));
4028cl_u1_nor3_4x spare4_nor3_4x (.in0(1'b0),
4029 .in1(1'b0),
4030 .in2(1'b0),
4031 .out(spare4_nor3_4x_unused));
4032cl_u1_nand2_8x spare4_nand2_8x (.in0(1'b1),
4033 .in1(1'b1),
4034 .out(spare4_nand2_8x_unused));
4035cl_u1_buf_16x spare4_buf_16x (.in(1'b1),
4036 .out(spare4_buf_16x_unused));
4037cl_u1_nor2_16x spare4_nor2_16x (.in0(1'b0),
4038 .in1(1'b0),
4039 .out(spare4_nor2_16x_unused));
4040cl_u1_inv_32x spare4_inv_32x (.in(1'b1),
4041 .out(spare4_inv_32x_unused));
4042assign scan_out = so_4;
4043
4044
4045
4046endmodule
4047
4048
4049
4050
4051
4052
4053// any PARAMS parms go into naming of macro
4054
4055module fgu_fac_ctl_msff_ctl_macro__width_10 (
4056 din,
4057 l1clk,
4058 scan_in,
4059 siclk,
4060 soclk,
4061 dout,
4062 scan_out);
4063wire [9:0] fdin;
4064wire [8:0] so;
4065
4066 input [9:0] din;
4067 input l1clk;
4068 input scan_in;
4069
4070
4071 input siclk;
4072 input soclk;
4073
4074 output [9:0] dout;
4075 output scan_out;
4076assign fdin[9:0] = din[9:0];
4077
4078
4079
4080
4081
4082
4083dff #(10) d0_0 (
4084.l1clk(l1clk),
4085.siclk(siclk),
4086.soclk(soclk),
4087.d(fdin[9:0]),
4088.si({scan_in,so[8:0]}),
4089.so({so[8:0],scan_out}),
4090.q(dout[9:0])
4091);
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104endmodule
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118// any PARAMS parms go into naming of macro
4119
4120module fgu_fac_ctl_msff_ctl_macro__width_37 (
4121 din,
4122 l1clk,
4123 scan_in,
4124 siclk,
4125 soclk,
4126 dout,
4127 scan_out);
4128wire [36:0] fdin;
4129wire [35:0] so;
4130
4131 input [36:0] din;
4132 input l1clk;
4133 input scan_in;
4134
4135
4136 input siclk;
4137 input soclk;
4138
4139 output [36:0] dout;
4140 output scan_out;
4141assign fdin[36:0] = din[36:0];
4142
4143
4144
4145
4146
4147
4148dff #(37) d0_0 (
4149.l1clk(l1clk),
4150.siclk(siclk),
4151.soclk(soclk),
4152.d(fdin[36:0]),
4153.si({scan_in,so[35:0]}),
4154.so({so[35:0],scan_out}),
4155.q(dout[36:0])
4156);
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169endmodule
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183// any PARAMS parms go into naming of macro
4184
4185module fgu_fac_ctl_msff_ctl_macro__width_17 (
4186 din,
4187 l1clk,
4188 scan_in,
4189 siclk,
4190 soclk,
4191 dout,
4192 scan_out);
4193wire [16:0] fdin;
4194wire [15:0] so;
4195
4196 input [16:0] din;
4197 input l1clk;
4198 input scan_in;
4199
4200
4201 input siclk;
4202 input soclk;
4203
4204 output [16:0] dout;
4205 output scan_out;
4206assign fdin[16:0] = din[16:0];
4207
4208
4209
4210
4211
4212
4213dff #(17) d0_0 (
4214.l1clk(l1clk),
4215.siclk(siclk),
4216.soclk(soclk),
4217.d(fdin[16:0]),
4218.si({scan_in,so[15:0]}),
4219.so({so[15:0],scan_out}),
4220.q(dout[16:0])
4221);
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234endmodule
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248// any PARAMS parms go into naming of macro
4249
4250module fgu_fac_ctl_msff_ctl_macro__width_9 (
4251 din,
4252 l1clk,
4253 scan_in,
4254 siclk,
4255 soclk,
4256 dout,
4257 scan_out);
4258wire [8:0] fdin;
4259wire [7:0] so;
4260
4261 input [8:0] din;
4262 input l1clk;
4263 input scan_in;
4264
4265
4266 input siclk;
4267 input soclk;
4268
4269 output [8:0] dout;
4270 output scan_out;
4271assign fdin[8:0] = din[8:0];
4272
4273
4274
4275
4276
4277
4278dff #(9) d0_0 (
4279.l1clk(l1clk),
4280.siclk(siclk),
4281.soclk(soclk),
4282.d(fdin[8:0]),
4283.si({scan_in,so[7:0]}),
4284.so({so[7:0],scan_out}),
4285.q(dout[8:0])
4286);
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299endmodule
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313// any PARAMS parms go into naming of macro
4314
4315module fgu_fac_ctl_msff_ctl_macro__width_128 (
4316 din,
4317 l1clk,
4318 scan_in,
4319 siclk,
4320 soclk,
4321 dout,
4322 scan_out);
4323wire [127:0] fdin;
4324wire [126:0] so;
4325
4326 input [127:0] din;
4327 input l1clk;
4328 input scan_in;
4329
4330
4331 input siclk;
4332 input soclk;
4333
4334 output [127:0] dout;
4335 output scan_out;
4336assign fdin[127:0] = din[127:0];
4337
4338
4339
4340
4341
4342
4343dff #(128) d0_0 (
4344.l1clk(l1clk),
4345.siclk(siclk),
4346.soclk(soclk),
4347.d(fdin[127:0]),
4348.si({scan_in,so[126:0]}),
4349.so({so[126:0],scan_out}),
4350.q(dout[127:0])
4351);
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364endmodule
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378// any PARAMS parms go into naming of macro
4379
4380module fgu_fac_ctl_msff_ctl_macro__width_21 (
4381 din,
4382 l1clk,
4383 scan_in,
4384 siclk,
4385 soclk,
4386 dout,
4387 scan_out);
4388wire [20:0] fdin;
4389wire [19:0] so;
4390
4391 input [20:0] din;
4392 input l1clk;
4393 input scan_in;
4394
4395
4396 input siclk;
4397 input soclk;
4398
4399 output [20:0] dout;
4400 output scan_out;
4401assign fdin[20:0] = din[20:0];
4402
4403
4404
4405
4406
4407
4408dff #(21) d0_0 (
4409.l1clk(l1clk),
4410.siclk(siclk),
4411.soclk(soclk),
4412.d(fdin[20:0]),
4413.si({scan_in,so[19:0]}),
4414.so({so[19:0],scan_out}),
4415.q(dout[20:0])
4416);
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429endmodule
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443// any PARAMS parms go into naming of macro
4444
4445module fgu_fac_ctl_msff_ctl_macro__width_4 (
4446 din,
4447 l1clk,
4448 scan_in,
4449 siclk,
4450 soclk,
4451 dout,
4452 scan_out);
4453wire [3:0] fdin;
4454wire [2:0] so;
4455
4456 input [3:0] din;
4457 input l1clk;
4458 input scan_in;
4459
4460
4461 input siclk;
4462 input soclk;
4463
4464 output [3:0] dout;
4465 output scan_out;
4466assign fdin[3:0] = din[3:0];
4467
4468
4469
4470
4471
4472
4473dff #(4) d0_0 (
4474.l1clk(l1clk),
4475.siclk(siclk),
4476.soclk(soclk),
4477.d(fdin[3:0]),
4478.si({scan_in,so[2:0]}),
4479.so({so[2:0],scan_out}),
4480.q(dout[3:0])
4481);
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494endmodule
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508// any PARAMS parms go into naming of macro
4509
4510module fgu_fac_ctl_msff_ctl_macro__width_16 (
4511 din,
4512 l1clk,
4513 scan_in,
4514 siclk,
4515 soclk,
4516 dout,
4517 scan_out);
4518wire [15:0] fdin;
4519wire [14:0] so;
4520
4521 input [15:0] din;
4522 input l1clk;
4523 input scan_in;
4524
4525
4526 input siclk;
4527 input soclk;
4528
4529 output [15:0] dout;
4530 output scan_out;
4531assign fdin[15:0] = din[15:0];
4532
4533
4534
4535
4536
4537
4538dff #(16) d0_0 (
4539.l1clk(l1clk),
4540.siclk(siclk),
4541.soclk(soclk),
4542.d(fdin[15:0]),
4543.si({scan_in,so[14:0]}),
4544.so({so[14:0],scan_out}),
4545.q(dout[15:0])
4546);
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559endmodule
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573// any PARAMS parms go into naming of macro
4574
4575module fgu_fac_ctl_msff_ctl_macro__width_60 (
4576 din,
4577 l1clk,
4578 scan_in,
4579 siclk,
4580 soclk,
4581 dout,
4582 scan_out);
4583wire [59:0] fdin;
4584wire [58:0] so;
4585
4586 input [59:0] din;
4587 input l1clk;
4588 input scan_in;
4589
4590
4591 input siclk;
4592 input soclk;
4593
4594 output [59:0] dout;
4595 output scan_out;
4596assign fdin[59:0] = din[59:0];
4597
4598
4599
4600
4601
4602
4603dff #(60) d0_0 (
4604.l1clk(l1clk),
4605.siclk(siclk),
4606.soclk(soclk),
4607.d(fdin[59:0]),
4608.si({scan_in,so[58:0]}),
4609.so({so[58:0],scan_out}),
4610.q(dout[59:0])
4611);
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624endmodule
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638// any PARAMS parms go into naming of macro
4639
4640module fgu_fac_ctl_msff_ctl_macro__width_3 (
4641 din,
4642 l1clk,
4643 scan_in,
4644 siclk,
4645 soclk,
4646 dout,
4647 scan_out);
4648wire [2:0] fdin;
4649wire [1:0] so;
4650
4651 input [2:0] din;
4652 input l1clk;
4653 input scan_in;
4654
4655
4656 input siclk;
4657 input soclk;
4658
4659 output [2:0] dout;
4660 output scan_out;
4661assign fdin[2:0] = din[2:0];
4662
4663
4664
4665
4666
4667
4668dff #(3) d0_0 (
4669.l1clk(l1clk),
4670.siclk(siclk),
4671.soclk(soclk),
4672.d(fdin[2:0]),
4673.si({scan_in,so[1:0]}),
4674.so({so[1:0],scan_out}),
4675.q(dout[2:0])
4676);
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689endmodule
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703// any PARAMS parms go into naming of macro
4704
4705module fgu_fac_ctl_msff_ctl_macro__width_52 (
4706 din,
4707 l1clk,
4708 scan_in,
4709 siclk,
4710 soclk,
4711 dout,
4712 scan_out);
4713wire [51:0] fdin;
4714wire [50:0] so;
4715
4716 input [51:0] din;
4717 input l1clk;
4718 input scan_in;
4719
4720
4721 input siclk;
4722 input soclk;
4723
4724 output [51:0] dout;
4725 output scan_out;
4726assign fdin[51:0] = din[51:0];
4727
4728
4729
4730
4731
4732
4733dff #(52) d0_0 (
4734.l1clk(l1clk),
4735.siclk(siclk),
4736.soclk(soclk),
4737.d(fdin[51:0]),
4738.si({scan_in,so[50:0]}),
4739.so({so[50:0],scan_out}),
4740.q(dout[51:0])
4741);
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754endmodule
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768// any PARAMS parms go into naming of macro
4769
4770module fgu_fac_ctl_msff_ctl_macro__width_31 (
4771 din,
4772 l1clk,
4773 scan_in,
4774 siclk,
4775 soclk,
4776 dout,
4777 scan_out);
4778wire [30:0] fdin;
4779wire [29:0] so;
4780
4781 input [30:0] din;
4782 input l1clk;
4783 input scan_in;
4784
4785
4786 input siclk;
4787 input soclk;
4788
4789 output [30:0] dout;
4790 output scan_out;
4791assign fdin[30:0] = din[30:0];
4792
4793
4794
4795
4796
4797
4798dff #(31) d0_0 (
4799.l1clk(l1clk),
4800.siclk(siclk),
4801.soclk(soclk),
4802.d(fdin[30:0]),
4803.si({scan_in,so[29:0]}),
4804.so({so[29:0],scan_out}),
4805.q(dout[30:0])
4806);
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819endmodule
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833// any PARAMS parms go into naming of macro
4834
4835module fgu_fac_ctl_msff_ctl_macro__width_26 (
4836 din,
4837 l1clk,
4838 scan_in,
4839 siclk,
4840 soclk,
4841 dout,
4842 scan_out);
4843wire [25:0] fdin;
4844wire [24:0] so;
4845
4846 input [25:0] din;
4847 input l1clk;
4848 input scan_in;
4849
4850
4851 input siclk;
4852 input soclk;
4853
4854 output [25:0] dout;
4855 output scan_out;
4856assign fdin[25:0] = din[25:0];
4857
4858
4859
4860
4861
4862
4863dff #(26) d0_0 (
4864.l1clk(l1clk),
4865.siclk(siclk),
4866.soclk(soclk),
4867.d(fdin[25:0]),
4868.si({scan_in,so[24:0]}),
4869.so({so[24:0],scan_out}),
4870.q(dout[25:0])
4871);
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884endmodule
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898// any PARAMS parms go into naming of macro
4899
4900module fgu_fac_ctl_msff_ctl_macro__width_25 (
4901 din,
4902 l1clk,
4903 scan_in,
4904 siclk,
4905 soclk,
4906 dout,
4907 scan_out);
4908wire [24:0] fdin;
4909wire [23:0] so;
4910
4911 input [24:0] din;
4912 input l1clk;
4913 input scan_in;
4914
4915
4916 input siclk;
4917 input soclk;
4918
4919 output [24:0] dout;
4920 output scan_out;
4921assign fdin[24:0] = din[24:0];
4922
4923
4924
4925
4926
4927
4928dff #(25) d0_0 (
4929.l1clk(l1clk),
4930.siclk(siclk),
4931.soclk(soclk),
4932.d(fdin[24:0]),
4933.si({scan_in,so[23:0]}),
4934.so({so[23:0],scan_out}),
4935.q(dout[24:0])
4936);
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949endmodule
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963// any PARAMS parms go into naming of macro
4964
4965module fgu_fac_ctl_msff_ctl_macro__width_53 (
4966 din,
4967 l1clk,
4968 scan_in,
4969 siclk,
4970 soclk,
4971 dout,
4972 scan_out);
4973wire [52:0] fdin;
4974wire [51:0] so;
4975
4976 input [52:0] din;
4977 input l1clk;
4978 input scan_in;
4979
4980
4981 input siclk;
4982 input soclk;
4983
4984 output [52:0] dout;
4985 output scan_out;
4986assign fdin[52:0] = din[52:0];
4987
4988
4989
4990
4991
4992
4993dff #(53) d0_0 (
4994.l1clk(l1clk),
4995.siclk(siclk),
4996.soclk(soclk),
4997.d(fdin[52:0]),
4998.si({scan_in,so[51:0]}),
4999.so({so[51:0],scan_out}),
5000.q(dout[52:0])
5001);
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014endmodule
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028// any PARAMS parms go into naming of macro
5029
5030module fgu_fac_ctl_msff_ctl_macro__width_12 (
5031 din,
5032 l1clk,
5033 scan_in,
5034 siclk,
5035 soclk,
5036 dout,
5037 scan_out);
5038wire [11:0] fdin;
5039wire [10:0] so;
5040
5041 input [11:0] din;
5042 input l1clk;
5043 input scan_in;
5044
5045
5046 input siclk;
5047 input soclk;
5048
5049 output [11:0] dout;
5050 output scan_out;
5051assign fdin[11:0] = din[11:0];
5052
5053
5054
5055
5056
5057
5058dff #(12) d0_0 (
5059.l1clk(l1clk),
5060.siclk(siclk),
5061.soclk(soclk),
5062.d(fdin[11:0]),
5063.si({scan_in,so[10:0]}),
5064.so({so[10:0],scan_out}),
5065.q(dout[11:0])
5066);
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079endmodule
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093// any PARAMS parms go into naming of macro
5094
5095module fgu_fac_ctl_msff_ctl_macro__width_6 (
5096 din,
5097 l1clk,
5098 scan_in,
5099 siclk,
5100 soclk,
5101 dout,
5102 scan_out);
5103wire [5:0] fdin;
5104wire [4:0] so;
5105
5106 input [5:0] din;
5107 input l1clk;
5108 input scan_in;
5109
5110
5111 input siclk;
5112 input soclk;
5113
5114 output [5:0] dout;
5115 output scan_out;
5116assign fdin[5:0] = din[5:0];
5117
5118
5119
5120
5121
5122
5123dff #(6) d0_0 (
5124.l1clk(l1clk),
5125.siclk(siclk),
5126.soclk(soclk),
5127.d(fdin[5:0]),
5128.si({scan_in,so[4:0]}),
5129.so({so[4:0],scan_out}),
5130.q(dout[5:0])
5131);
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144endmodule
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158// any PARAMS parms go into naming of macro
5159
5160module fgu_fac_ctl_msff_ctl_macro__width_5 (
5161 din,
5162 l1clk,
5163 scan_in,
5164 siclk,
5165 soclk,
5166 dout,
5167 scan_out);
5168wire [4:0] fdin;
5169wire [3:0] so;
5170
5171 input [4:0] din;
5172 input l1clk;
5173 input scan_in;
5174
5175
5176 input siclk;
5177 input soclk;
5178
5179 output [4:0] dout;
5180 output scan_out;
5181assign fdin[4:0] = din[4:0];
5182
5183
5184
5185
5186
5187
5188dff #(5) d0_0 (
5189.l1clk(l1clk),
5190.siclk(siclk),
5191.soclk(soclk),
5192.d(fdin[4:0]),
5193.si({scan_in,so[3:0]}),
5194.so({so[3:0],scan_out}),
5195.q(dout[4:0])
5196);
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209endmodule
5210
5211
5212
5213
5214
5215
5216
5217