Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / spc / fgu / rtl / fgu_fdc_ctl.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: fgu_fdc_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_fdc_ctl (
36 l2clk,
37 scan_in,
38 tcu_pce_ov,
39 spc_aclk,
40 spc_bclk,
41 tcu_scan_en,
42 scan_out,
43 fac_div_flush_fx3,
44 fpe_rs2_fmt_fx1_b0,
45 fpf_hi_bof_fx1,
46 fpf_lo_bof_fx1,
47 fpf_sa_xor_sb_fx1,
48 fac_div_valid_fx1,
49 fac_divq_valid_fx1,
50 fac_div_control_fx1,
51 fpc_rd_mode_fx3,
52 fpc_emin_fx3,
53 div_clken,
54 fdd_pe_clth,
55 fdd_cla_zero32_,
56 fdd_cla_zero64_,
57 fdd_result,
58 fdd_fdx_din0,
59 fdd_fdx_din1,
60 fdd_fdx_cin64,
61 fdd_fdq00_10_sum,
62 fdd_fdq00_10_carry,
63 fdd_fdq1p_sum,
64 fdd_fdq1p_carry,
65 fdd_fdq1n_sum,
66 fdd_fdq1n_carry,
67 fgu_fdiv_stall,
68 fgu_idiv_stall,
69 fdc_dec_exp_early,
70 fdc_icc_v_early,
71 fdc_xicc_z_early,
72 fdc_finish_int_early,
73 fdc_finish_fltd_early,
74 fdc_finish_flts_early,
75 fdc_flt_inexact,
76 fdc_asign_lth,
77 fdc_bsign_lth,
78 fdc_bsign_lth_,
79 fdc_pe_cycle3,
80 fdc_pe_cmux_sel,
81 fdc_pe_smux_sel,
82 fdc_pe_xsht_ctl,
83 fdc_ie_fsqrt_valid_even,
84 fdc_ie_fsqrt_valid_even_,
85 fdc_ie_fsqrt_valid_odd,
86 fdc_ie_fsqrt_valid_odd_,
87 fdc_ie_rmux_sel,
88 fdc_ie_dmux_sel,
89 fdc_flt_increment,
90 fdc_pte_clasel,
91 fdc_pte_csa_cin,
92 fdc_pte_cycle2,
93 fdc_emin_lth,
94 fdc_pte_qsel,
95 fdc_pte_stall_,
96 fdc_flt_round,
97 fdc_idiv_ctl,
98 fdc_fdx_cin_in,
99 fdc_qsel00,
100 fdc_qsel1,
101 fdc_q_in,
102 fdc_qm1_in);
103wire pce_ov;
104wire stop;
105wire siclk;
106wire soclk;
107wire se;
108wire l1clk_pm1;
109wire spares_scanin;
110wire spares_scanout;
111wire incoming_sign_fx1;
112wire [7:0] qcontrol_in;
113wire fsqrt_fract_all_ones;
114wire [7:0] qcontrol_fx1;
115wire qdata_lth_scanin;
116wire qdata_lth_scanout;
117wire valid_in;
118wire valid_lth;
119wire [3:0] fdc_pte_cycle;
120wire div_flush_lth;
121wire [3:1] pe_cycle_in;
122wire [3:1] fdc_pe_cycle;
123wire engine_running_in;
124wire engine_stop;
125wire engine_running_lth;
126wire engine_on;
127wire [7:0] pe_ndq;
128wire [3:0] pte_cycle_in;
129wire [4:0] control_lth;
130wire cntl_lth_scanin;
131wire cntl_lth_scanout;
132wire [2:0] pe_hmux_sel;
133wire b_neg_one;
134wire [7:0] pe_xsht_amt;
135wire a_neg_max;
136wire ovfl_64_in;
137wire b_neg_one_lth;
138wire finish_raw;
139wire ovfl_64_lth;
140wire flt_shift_sel_;
141wire ovlf_lth_scanin;
142wire ovlf_lth_scanout;
143wire cla_zero64_lth_;
144wire cla_zero32_lth_;
145wire fdiv_stall_in;
146wire stall_hold;
147wire idiv_stall_in;
148wire stall_hold_in;
149wire [3:0] stall_cnt_raw;
150wire [3:0] stall_cnt_in;
151wire finish_lth;
152wire [3:0] stall_cnt;
153wire stall_lth_scanin;
154wire stall_lth_scanout;
155wire finish_lth_in;
156wire idiv_stall_lth;
157wire [4:0] control_in;
158wire asign_in;
159wire bsign_in;
160wire ndq_odd_in;
161wire data_lth_scanin;
162wire data_lth_scanout;
163wire ndq_odd_lth;
164wire ndq_odd_2lth;
165wire [63:0] clth;
166wire b0_nor_76;
167wire b0_nor_54;
168wire b0_nor_32;
169wire b0_nor_10;
170wire b0_zeroh_;
171wire b0_zerol_;
172wire b0_zero_;
173wire [1:0] b0_cnth;
174wire [1:0] b0_cntl;
175wire [2:0] b0_cnt;
176wire b1_nor_76;
177wire b1_nor_54;
178wire b1_nor_32;
179wire b1_nor_10;
180wire b1_zeroh_;
181wire b1_zerol_;
182wire b1_zero_;
183wire [1:0] b1_cnth;
184wire [1:0] b1_cntl;
185wire [2:0] b1_cnt;
186wire b2_nor_76;
187wire b2_nor_54;
188wire b2_nor_32;
189wire b2_nor_10;
190wire b2_zeroh_;
191wire b2_zerol_;
192wire b2_zero_;
193wire [1:0] b2_cnth;
194wire [1:0] b2_cntl;
195wire [2:0] b2_cnt;
196wire b3_nor_76;
197wire b3_nor_54;
198wire b3_nor_32;
199wire b3_nor_10;
200wire b3_zeroh_;
201wire b3_zerol_;
202wire b3_zero_;
203wire [1:0] b3_cnth;
204wire [1:0] b3_cntl;
205wire [2:0] b3_cnt;
206wire b4_nor_76;
207wire b4_nor_54;
208wire b4_nor_32;
209wire b4_nor_10;
210wire b4_zeroh_;
211wire b4_zerol_;
212wire b4_zero_;
213wire [1:0] b4_cnth;
214wire [1:0] b4_cntl;
215wire [2:0] b4_cnt;
216wire b5_nor_76;
217wire b5_nor_54;
218wire b5_nor_32;
219wire b5_nor_10;
220wire b5_zeroh_;
221wire b5_zerol_;
222wire b5_zero_;
223wire [1:0] b5_cnth;
224wire [1:0] b5_cntl;
225wire [2:0] b5_cnt;
226wire b6_nor_76;
227wire b6_nor_54;
228wire b6_nor_32;
229wire b6_nor_10;
230wire b6_zeroh_;
231wire b6_zerol_;
232wire b6_zero_;
233wire [1:0] b6_cnth;
234wire [1:0] b6_cntl;
235wire [2:0] b6_cnt;
236wire b7_nor_76;
237wire b7_nor_54;
238wire b7_nor_32;
239wire b7_nor_10;
240wire b7_zeroh_;
241wire b7_zerol_;
242wire b7_zero_;
243wire [1:0] b7_cnth;
244wire [1:0] b7_cntl;
245wire [2:0] b7_cnt;
246wire b3_0sel;
247wire b2_0sel;
248wire b1_0sel;
249wire b0_0sel;
250wire [4:0] cntl0l;
251wire b7_0sel;
252wire b6_0sel;
253wire b5_0sel;
254wire b4_0sel;
255wire [4:0] cntl0h;
256wire cntl0_selh;
257wire cntl0_sell;
258wire [6:0] cntl0;
259wire b7_nand_74;
260wire b7_nand_30;
261wire b7_ones;
262wire b7_ones_;
263wire [1:0] b7_cnt1h;
264wire [1:0] b7_cnt1l;
265wire [2:0] b7_cnt1;
266wire b6_nand_74;
267wire b6_nand_30;
268wire b6_ones;
269wire b6_ones_;
270wire [1:0] b6_cnt1h;
271wire [1:0] b6_cnt1l;
272wire [2:0] b6_cnt1;
273wire b5_nand_74;
274wire b5_nand_30;
275wire b5_ones;
276wire b5_ones_;
277wire [1:0] b5_cnt1h;
278wire [1:0] b5_cnt1l;
279wire [2:0] b5_cnt1;
280wire b4_nand_74;
281wire b4_nand_30;
282wire b4_ones;
283wire b4_ones_;
284wire [1:0] b4_cnt1h;
285wire [1:0] b4_cnt1l;
286wire [2:0] b4_cnt1;
287wire b3_nand_74;
288wire b3_nand_30;
289wire b3_ones;
290wire b3_ones_;
291wire [1:0] b3_cnt1h;
292wire [1:0] b3_cnt1l;
293wire [2:0] b3_cnt1;
294wire b2_nand_74;
295wire b2_nand_30;
296wire b2_ones;
297wire b2_ones_;
298wire [1:0] b2_cnt1h;
299wire [1:0] b2_cnt1l;
300wire [2:0] b2_cnt1;
301wire b1_nand_74;
302wire b1_nand_30;
303wire b1_ones;
304wire b1_ones_;
305wire [1:0] b1_cnt1h;
306wire [1:0] b1_cnt1l;
307wire [2:0] b1_cnt1;
308wire b0_nand_74;
309wire [1:0] b0_cnt1h;
310wire [1:0] b0_cnt1l;
311wire [2:0] b0_cnt1;
312wire b3_1sel;
313wire b2_1sel;
314wire b1_1sel;
315wire b0_1sel;
316wire [4:0] cntl1l;
317wire b7_1sel;
318wire b6_1sel;
319wire b5_1sel;
320wire b4_1sel;
321wire [4:0] cntl1h;
322wire cntl1_selh;
323wire [5:0] cntl1;
324wire xsht_amt_sel10;
325wire xsht_amt_sel11;
326wire xsht_amt_sel20;
327wire xsht_amt_sel21;
328wire [7:0] xsht_amt_in;
329wire [7:0] pe_hamt_lth;
330wire [7:0] pe_hamt_in;
331wire xsht_lth_scanin;
332wire xsht_lth_scanout;
333wire hamt_lth_scanin;
334wire hamt_lth_scanout;
335wire [5:0] xsht_ctl_in;
336wire xcntl_lth_scanin;
337wire xcntl_lth_scanout;
338wire engine_valid_fx1;
339wire engine_valid_fx2;
340wire queue_valid_lth_fx2;
341wire engine_valid_lth_fx2;
342wire engine_valid_fx3;
343wire queue_valid_lth_fx3;
344wire engine_valid_lth_fx3;
345wire queue_valid_fx1;
346wire queue_valid_fx2;
347wire q2e_fx3p;
348wire xrnd_vld_lth_scanin;
349wire xrnd_vld_lth_scanout;
350wire [1:0] eround_mode_in;
351wire [1:0] qround_mode_lth;
352wire [1:0] eround_mode_lth;
353wire e_emin_in;
354wire q_emin_lth;
355wire [1:0] qround_mode_in;
356wire q_emin_in;
357wire float_sign_in;
358wire float_sign_lth;
359wire flt_sqrte_kill_dec;
360wire inexact_in;
361wire final_sticky;
362wire final_guard;
363wire xrnd_lth_scanin;
364wire xrnd_lth_scanout;
365wire sticky_pte1;
366wire sticky_pte0;
367wire final_lsb;
368wire flt_rnd00_en;
369wire flt_rnd1x_en;
370wire fsqrt_special_in;
371wire fsqrt_special_lth;
372wire spec_sqrt_lth_scanin;
373wire spec_sqrt_lth_scanout;
374wire cla_64;
375wire cin_in_raw;
376wire [3:0] fdq00_sum;
377wire [3:0] fdq00_carry;
378wire [3:0] pr00;
379wire [3:0] pr1p;
380wire [2:0] qsel1p;
381wire [3:0] fdq10_sum;
382wire [3:0] fdq10_carry;
383wire [3:0] pr10;
384wire [2:0] qsel10;
385wire [3:0] pr1n;
386wire [2:0] qsel1n;
387wire engine_start;
388
389
390// Timing constraints definition :
391// For Inputs : Required setup to the end of the cycle
392// For Outputs : Actual time the signal leaves block measured from L1CLK rise
393// For pin location : I am assuming dataflow direction is vertical
394
395
396// *** globals ***
397input l2clk;
398input scan_in;
399input tcu_pce_ov; // scan signals
400input spc_aclk;
401input spc_bclk;
402input tcu_scan_en;
403output scan_out;
404
405input fac_div_flush_fx3;
406input fpe_rs2_fmt_fx1_b0;
407input fpf_hi_bof_fx1;
408input fpf_lo_bof_fx1;
409input fpf_sa_xor_sb_fx1;
410
411input fac_div_valid_fx1; // div_valid divq_valid | action
412input fac_divq_valid_fx1; // --------- ---------- | ---------------------------------------
413 // 1 0 | start divide from FX1 RS1/RS2/control
414 // 0 1 | load queue from FX1 RS1/RS2/control
415 // 1 1 | start divide from queue RS1/RS2/control
416
417input [4:0] fac_div_control_fx1; // 0in value -var fac_div_control_fx1[3:0] -val 4'b0000 4'b0010 4'b0100 4'b0101 4'b0110 4'b0111 4'b1000 4'b1010 -active (fac_div_valid_fx1 ^ fac_divq_valid_fx1)
418 // [3:0] : [4] : Thread Group
419 // 0000 : Float Divide Single
420 // 0010 : Float Divide Double
421 // 0100 : Integer Unsigned - 32 bit
422 // 0101 : Integer Signed - 32 bit
423 // 0110 : Integer Unsigned - 64 bit
424 // 0111 : Integer Signed - 64 bit
425 // 1000 : Float SQRT Single
426 // 1010 : Float SQRT Double
427
428input [1:0] fpc_rd_mode_fx3;
429input fpc_emin_fx3;
430
431input div_clken; // div clken
432
433
434// *** locals ***
435input [63:0] fdd_pe_clth;
436input fdd_cla_zero32_;
437input fdd_cla_zero64_;
438input [63:9] fdd_result;
439
440input fdd_fdx_din0;
441input fdd_fdx_din1;
442input fdd_fdx_cin64;
443
444input [4:0] fdd_fdq00_10_sum;
445input [4:0] fdd_fdq00_10_carry;
446input [3:0] fdd_fdq1p_sum;
447input [3:0] fdd_fdq1p_carry;
448input [3:0] fdd_fdq1n_sum;
449input [3:0] fdd_fdq1n_carry;
450
451
452// *** globals ***
453output fgu_fdiv_stall;
454output [1:0] fgu_idiv_stall; // Stall by Thread Group
455output fdc_dec_exp_early;
456output fdc_icc_v_early;
457output [1:0] fdc_xicc_z_early;
458output fdc_finish_int_early;
459output fdc_finish_fltd_early;
460output fdc_finish_flts_early;
461output fdc_flt_inexact;
462
463
464// *** locals ***
465output fdc_asign_lth;
466output fdc_bsign_lth;
467output fdc_bsign_lth_;
468output fdc_pe_cycle3;
469output fdc_pe_cmux_sel;
470output [2:0] fdc_pe_smux_sel;
471output [5:0] fdc_pe_xsht_ctl;
472output fdc_ie_fsqrt_valid_even;
473output fdc_ie_fsqrt_valid_even_;
474output fdc_ie_fsqrt_valid_odd;
475output fdc_ie_fsqrt_valid_odd_;
476output [4:0] fdc_ie_rmux_sel;
477output [2:0] fdc_ie_dmux_sel;
478output fdc_flt_increment;
479output [1:0] fdc_pte_clasel;
480output fdc_pte_csa_cin;
481output fdc_pte_cycle2;
482output fdc_emin_lth;
483output [2:0] fdc_pte_qsel;
484output fdc_pte_stall_;
485
486output [1:0] fdc_flt_round;
487output [4:0] fdc_idiv_ctl; // 0in bits_on -max 1 -var fdc_idiv_ctl[3:0]
488 // 3210 [4] = integer
489 // ----
490 // 0001 : 8000 0000 0000 0000
491 // 0010 : FFFF FFFF 8000 0000
492 // 0100 : 0000 0000 7FFF FFFF
493 // 1000 : 0000 0000 FFFF FFFF
494
495output fdc_fdx_cin_in;
496output [2:0] fdc_qsel00;
497output [2:0] fdc_qsel1;
498
499output [1:0] fdc_q_in;
500output [1:0] fdc_qm1_in;
501
502// scan renames
503assign pce_ov = tcu_pce_ov;
504assign stop = 1'b0;
505assign siclk = spc_aclk;
506assign soclk = spc_bclk;
507assign se = tcu_scan_en;
508// end scan
509
510
511fgu_fdc_ctl_l1clkhdr_ctl_macro clkgen_pm1 (
512 .l2clk(l2clk),
513 .l1en (div_clken),
514 .l1clk(l1clk_pm1),
515 .pce_ov(pce_ov),
516 .stop(stop),
517 .se(se)
518 );
519
520fgu_fdc_ctl_spare_ctl_macro__num_3 spares ( // spares: 13 gates + 1 flop for each "num"
521 .scan_in(spares_scanin),
522 .scan_out(spares_scanout),
523 .l1clk(l1clk_pm1),
524 .siclk(siclk),
525 .soclk(soclk)
526 );
527
528
529assign incoming_sign_fx1= fpf_sa_xor_sb_fx1 & ~fac_div_control_fx1[3]; // Turn off for Square Root
530
531assign qcontrol_in[7:0] = ({8{ fac_divq_valid_fx1}} & {fsqrt_fract_all_ones,incoming_sign_fx1,fpe_rs2_fmt_fx1_b0,fac_div_control_fx1[4:0]}) |
532 ({8{~fac_divq_valid_fx1}} & qcontrol_fx1[7:0] );
533
534fgu_fdc_ctl_msff_ctl_macro__width_8 qdata_lth (
535 .scan_in(qdata_lth_scanin),
536 .scan_out(qdata_lth_scanout),
537 .l1clk( l1clk_pm1 ),
538 .din ({qcontrol_in[7:0] }),
539 .dout ({qcontrol_fx1[7:0]}),
540 .siclk(siclk),
541 .soclk(soclk));
542
543
544
545// * * * * * * * * * * * * Main Controller * * * * * * * * * * * *
546
547
548// *** State control ***
549
550//* * * * * * * * * * * * "pre-engine" (integer only)* * * * *
551//
552// cycle 0 : fac_div_valid_fx1 A&B are transmitted to divide hardware
553// A loaded into Slth
554// B loaded into Clth;
555//
556// cycle 1 : pe_cycle[1] B into CNTL0 and CNTL1 -> compute "lsb";
557// A loaded into Clth;
558// B loaded into Slth;
559//
560// cycle 2 : pe_cycle[2] A into CNTL0 and CNTL1 -> compute "lsa";
561// B shifts by "lsb" amount
562// A loaded into Slth;
563// Xsht loaded into Clth; (this is Bsh)
564//
565// cycle 3 : pe_cycle[3] A shifts by "lsa" amount;
566// engine_start Bsh is XORed to produce positive divisor
567// compute ndq = lsb - lsa + 1;
568// finished if ndq <= 0; (ie B > A)
569//
570//* * * * * * * * * * * * * "engine" * * * * * * * * * * * * *
571//
572// See Integer "engine" run-time below for how ndq is computed.
573//
574// if (even ndq)
575// then X = ndq / 2
576// else X = (ndq - 1) / 2
577//
578// for X cycles
579// perform loop
580//
581// cycle X+3 : engine_stop last loop
582//
583//* * * * * * * * * * * * "post-engine" * * * * * * * * * * * *
584//
585// cycle X+4 : pte_cycle[3] load "S0" and "C0" latches into adder latches
586// For an odd ndq, we actually compute the last Q and Qm1
587// and then load "C1" and "S1" into the adder latches.
588//
589// cycle X+5 : pte_cycle[2] compute Sign of Remainder
590// compute zero remainder (used as Sticky and in correction)
591// load Q and Qm1 into adder latches
592// make correction if necessary
593// turn off valid_lth (new divide will NOT affect result)
594//
595// cycle X+6 : pte_cycle[1] compute Qf = Q - Qm1 + correction;
596// 64-bit Integer - load into Result latch
597//
598// cycle X+7 pte_cycle[0] 32-bit Integer - Overflow detection and correction
599// Floating Point - Round
600//
601// cycle X+7/8 fdc_finish transmit Result
602//
603//
604//* * * * * * * * * * * * Integer "engine" run-time * * * * * * * * * *
605//
606//
607// Define : lsa : number of Leading Sign bits in A (n-1 for negative)
608// lsb : number of Leading Sign bits in B (n for negative)
609// nda : number of digits in A (nda=64-lsa)
610// ndb : number of digits in B (ndb=64-lsb)
611// ndq : number of digits in the Quotient Q (MAX)
612//
613// Then ndq = nda - (ndb - 1);
614//
615// The minus one comes from the fact that dividing by '1' does not reduce
616// the number of significant bits in the dividend (A operand).
617//
618// By substitution :
619//
620// ndq = [64 - lsa] - ([64 - lsb] - 1);
621// = lsb - lsa + 1;
622//
623//
624// Example : A = 0000 1111 (+15) lsa = 4
625// (8-bit) B = 0000 0010 (+2) lsb = 6
626// ------------------
627// R = 0000 0111 (+7) notice ndq=3
628//
629// compute ndq = lsb - lsa + 1
630// = 6 - 4 + 1
631// = 3 (this is a MAX ndq computation)
632//
633//
634// Example : A = 0000 1000 (+8) lsa = 4
635// (8-bit) B = 0000 0011 (+3) lsb = 6
636// ------------------
637// R = 0000 0010 (+2) notice ndq=2
638//
639// compute ndq = lsb - lsa + 1
640// = 6 - 4 + 1
641// = 3 (this is a MAX ndq computation)
642//
643//
644// Example : A = 1111 0000 (-16) lsa = 3 (n-1 for negative)
645// (8-bit) B = 0000 0010 (+2) lsb = 6
646// ------------------
647// R = 1111 1000 (-8) notice ndq=4
648//
649// compute ndq = lsb - lsa + 1
650// = 6 - 3 + 1
651// = 4 (this is a MAX ndq computation)
652//
653//
654//
655//
656//
657//* * * * * * * * * * * * * Total cycle count * * * * * * * * * * * *
658//
659// *** 32-bit Integer Division***
660//
661// FX1 transmit of RS1 and RS2
662// 3 "pre-engine"
663// X "engine" where X = (lsb-lsa)// 2; {0 to 32 cycles}
664// 4 "post-engine" where 4th cycle is Overflow detection and correction
665// S "engine-stall" where S = 4 - X; {0 to 4 cycles} (needed to sync up with bubble)
666// FX5 transmit to EXU
667// W
668// ---
669// 10+X+S {14 to 42 cycles}
670//
671//
672// *** 64-bit Integer Division***
673//
674// FX1 transmit of RS1 and RS2
675// 3 "pre-engine"
676// X "engine" where X = (lsb-lsa)// 2; {0 to 32 cycles}
677// 3 "post-engine"
678// S "engine-stall" where S = 4 - X; {0 to 4 cycles} (needed to sync up with bubble)
679// FX5 transmit to EXU
680// W
681// ---
682// 9+X+S {13 to 41 cycles}
683//
684//
685// *** Float Double Precision divide and square root***
686//
687// FX1 transmit of RS1 and RS2
688// 27 "engine" need 53 mantissa + 1 guard + 1 for 0.1 = 55
689// 27 cycles compute 54 quotient digits. The last bit is computed during pte_cycle[3].
690// 4 "post-engine"
691// FB
692// FW
693// FW1
694// ---
695// 35 cycles
696//
697//
698// *** Float Single Precision divide and square root ***
699//
700// FX1 transmit of RS1 and RS2
701// 13 "engine" need 24 mantissa + 1 guard + 1 for 0.1 = 26
702// 4 "post-engine"
703// FB
704// FW
705// FW1
706// ---
707// 21 cycles
708
709
710assign valid_in = (fac_div_valid_fx1 ) |
711 (valid_lth & ~fdc_pte_cycle[2] & ~div_flush_lth);
712
713assign pe_cycle_in[1] = (fac_div_valid_fx1 & fac_div_control_fx1[2] & ~fac_divq_valid_fx1) |
714 (fac_div_valid_fx1 & qcontrol_fx1[2] & fac_divq_valid_fx1);
715
716assign pe_cycle_in[3:2] = fdc_pe_cycle[2:1] & {2{~div_flush_lth}};
717
718assign engine_running_in = (fac_div_valid_fx1 & ~fac_div_control_fx1[2] & ~fac_divq_valid_fx1) | // start FLT
719 (fac_div_valid_fx1 & ~qcontrol_fx1[2] & fac_divq_valid_fx1) | // start FLT
720 (fdc_pe_cycle[3] & ~engine_stop & ~div_flush_lth ) | // start INT
721 (engine_running_lth & ~engine_stop & ~div_flush_lth );
722
723assign engine_on = fdc_pe_cycle[3] | engine_running_lth;
724
725// 0in assert_timer -var (engine_running_lth & (control_lth[2:0] == 3'b000)) -max 13 -message "FDIV/FSQRT engine running > 13 cycles for SP"
726// 0in assert_timer -var (engine_running_lth & (control_lth[2:0] == 3'b010)) -max 27 -message "FDIV/FSQRT engine running > 27 cycles for DP"
727// 0in assert_timer -var (engine_running_lth & (control_lth[3:2] == 2'b01 )) -max 32 -message "IDIV engine running > 32 cycles"
728
729assign engine_stop = ((pe_ndq[6:1] == 6'b000000) & engine_on) |
730 ( pe_ndq[7] & engine_on);
731
732assign pte_cycle_in[3:1] = {engine_stop,fdc_pte_cycle[3:2]} & {3{~div_flush_lth}};
733assign pte_cycle_in[0] = fdc_pte_cycle[1] & ~(control_lth[2] & control_lth[1]) & ~div_flush_lth;
734
735fgu_fdc_ctl_msff_ctl_macro__width_10 cntl_lth (
736 .scan_in(cntl_lth_scanin),
737 .scan_out(cntl_lth_scanout),
738 .l1clk( l1clk_pm1 ),
739 .din ({valid_in , pe_cycle_in[3:1] , engine_running_in , pte_cycle_in[3:0] , fac_div_flush_fx3}),
740 .dout ({valid_lth , fdc_pe_cycle[3:1] , engine_running_lth , fdc_pte_cycle[3:0] , div_flush_lth }),
741 .siclk(siclk),
742 .soclk(soclk));
743
744// 0in bits_on -max 1 -var {fdc_pe_cycle[3:1], engine_running_lth, fdc_pte_cycle[3:0], finish_lth}
745
746// 0in state_transition -var {fac_div_valid_fx1, pe_cycle_in[3:1], engine_running_in} -val {1'b1, 3'b000, 1'b0} -next {1'b0, 3'b001, 1'b0} {1'b0, 3'b000, 1'b1} {1'b0, 3'b000, 1'b0} -match_by_cycle
747// 0in state_transition -var pe_cycle_in[3:1] -val 3'b000 -next 3'b001 3'b000
748// 0in state_transition -var pe_cycle_in[3:1] -val 3'b001 -next 3'b010 3'b000 -match_by_cycle
749// 0in state_transition -var pe_cycle_in[3:1] -val 3'b010 -next 3'b100 3'b000 -match_by_cycle
750// 0in state_transition -var {engine_running_in, pe_cycle_in[3:1]} -val {1'b0, 3'b100} -next {1'b1, 3'b000} {1'b0, 3'b000} -match_by_cycle
751// 0in state_transition -var {pte_cycle_in[3:0], engine_running_in} -val {4'b0000, 1'b1} -next {4'b1000, 1'b0} {4'b0000, 1'b0}
752// 0in state_transition -var pte_cycle_in[3:0] -val 4'b0000 -next 4'b1000
753// 0in state_transition -var pte_cycle_in[3:0] -val 4'b1000 -next 4'b0100 -match_by_cycle
754// 0in state_transition -var pte_cycle_in[3:0] -val 4'b0100 -next 4'b0010 -match_by_cycle
755// 0in state_transition -var {pte_cycle_in[3:0], finish_lth_in} -val {4'b0010, 1'b0} -next {4'b0001, 1'b0} {4'b0000, 1'b1}
756// 0in state_transition -var {pte_cycle_in[3:0], finish_lth_in} -val {4'b0001, 1'b0} -next {4'b0000, 1'b1}
757
758assign fdc_pe_cycle3 = fdc_pe_cycle[3]; // Tools issues with single bit buses downstream
759assign fdc_pte_cycle2 = fdc_pte_cycle[2]; // Tools issues with single bit buses downstream
760
761assign fdc_pe_cmux_sel = fdc_pe_cycle[1] | fdc_pe_cycle[2];
762
763// For neg B, left shift by 1 to compensate for 'n-1' shift amount
764assign fdc_pe_smux_sel[0] = fdc_pe_cycle[1] & fdd_pe_clth[63] & control_lth[0];
765assign fdc_pe_smux_sel[1] = fdc_pe_cycle[1] | fdc_pe_cycle[2];
766assign fdc_pe_smux_sel[2] = fac_div_valid_fx1 & ~fac_divq_valid_fx1;
767
768assign pe_hmux_sel[0] = ( fac_div_valid_fx1 & ~fac_div_control_fx1[2] & fac_div_control_fx1[1] & ~fac_divq_valid_fx1) |
769 ( fac_div_valid_fx1 & ~qcontrol_fx1[2] & qcontrol_fx1[1] & fac_divq_valid_fx1);
770assign pe_hmux_sel[1] = ( fac_div_valid_fx1 & ~fac_div_control_fx1[2] & ~fac_div_control_fx1[1] & ~fac_divq_valid_fx1) |
771 ( fac_div_valid_fx1 & ~qcontrol_fx1[2] & ~qcontrol_fx1[1] & fac_divq_valid_fx1);
772assign pe_hmux_sel[2] = ~fdc_pe_cycle[1] & valid_lth;
773
774
775// *** Integer Overflow Detection ***
776
777// fdc_idiv_ctl
778 // 3210
779 // ----
780 // 0001 : 8000 0000 0000 0000 ovfl_64x
781 // 0010 : FFFF FFFF 8000 0000 ovfl_32n
782 // 0100 : 0000 0000 7FFF FFFF ovfl_32p
783 // 1000 : 0000 0000 FFFF FFFF ovfl_32u
784
785
786// For 64-bit divide, the only OVFL condition exits is : neg max / -1
787// This results in a constant of "8000 0000 0000 0000" defined on pg 196.
788
789assign b_neg_one = fdc_pe_cycle[2] & fdc_bsign_lth &
790 (pe_xsht_amt[6:0] == 7'b0111111);
791
792assign a_neg_max = fdc_pe_cycle[3] & fdc_asign_lth &
793 (pe_xsht_amt[6:0] == 7'b1111111); // xsht_amt is inverted by cycle[3]
794
795assign ovfl_64_in = ( a_neg_max & b_neg_one_lth & ~div_flush_lth) | // 64-bit divide
796 (~finish_raw & ovfl_64_lth & ~div_flush_lth);
797
798assign fdc_idiv_ctl[0] = fdc_pte_cycle[0] & ovfl_64_lth & control_lth[1];
799
800// For 64-bit/32-bit, three OVFL constants are possible. (see pages 152-154)
801// For - signed : if quotient <= (-2^31 - 1) then result = FFFF FFFF 8000 0000 (-2^31 )
802// For + signed : if quotient >= ( 2^31 ) then result = 0000 0000 7FFF FFFF ( 2^31 - 1)
803// For unsigned : if quotient >= ( 2^32 ) then result = 0000 0000 FFFF FFFF ( 2^32 - 1)
804
805assign fdc_idiv_ctl[1] = fdc_pte_cycle[0] & (control_lth[2:0] == 3'b101) &
806 fdd_result[63] & (fdd_result[62:31] != 32'hFFFFFFFF) & ~ovfl_64_lth;
807
808assign fdc_idiv_ctl[2] = fdc_pte_cycle[0] & (control_lth[2:0] == 3'b101) &
809 ((~fdd_result[63] & (fdd_result[62:31] != 32'h00000000)) | ovfl_64_lth);
810
811assign fdc_idiv_ctl[3] = fdc_pte_cycle[0] & (control_lth[2:0] == 3'b100) &
812 (fdd_result[63:32] != 32'h00000000);
813
814assign fdc_idiv_ctl[4] = fdc_pte_cycle[0] & ~control_lth[2] & ~flt_shift_sel_ & ~fdc_flt_increment;
815
816assign fdc_icc_v_early = | fdc_idiv_ctl[3:0];
817
818
819fgu_fdc_ctl_msff_ctl_macro__width_4 ovlf_lth (
820 .scan_in(ovlf_lth_scanin),
821 .scan_out(ovlf_lth_scanout),
822 .l1clk( l1clk_pm1 ),
823 .din ({ovfl_64_in , b_neg_one , fdd_cla_zero64_ , fdd_cla_zero32_}),
824 .dout ({ovfl_64_lth , b_neg_one_lth , cla_zero64_lth_ , cla_zero32_lth_}),
825 .siclk(siclk),
826 .soclk(soclk));
827
828
829assign fdc_xicc_z_early[1] = ~cla_zero64_lth_;
830assign fdc_xicc_z_early[0] = ~cla_zero32_lth_ & ~fdc_icc_v_early;
831
832
833// *** Engine stall ***
834
835// The INTEGER divide has a variable timing dependent on the operand data.
836// The divide must provide a STALL signal to the issue logic to ensure no
837// collision on the shared FGU to EXU bus. The timing of the IDIV_STALL
838// is given below.
839//
840// t-1 t t+1 t+2 t+3 t+4 t+5 t+6 t+7
841// -----|------|------|------|------|------|------|------|------|
842// idiv | idiv | D | E | fx1 | fx2 | fx3 | fx4 | fx5 |
843// stall | stall| | | | | | | |
844// in | | | |engine|pte[3]|pte[2]|pte[1]|finish|
845// | | | | stop | | | | |
846// | | | | | | | | |
847// 8/9 | 6/7 | 4/5 | 2/3 | 0/1 | | | | |
848// | | | | | | | | |
849// +0 | +1 | +2 | +3 | +4 | | | | |
850//
851//
852// The Floating Point Divide and Square Root has a fixed latency.
853// The divide must provide a STALL signal to the issue logic to ensure no
854// collision at the W2 port to the FRF.
855//
856// t-1 t t+1 t+2 t+3 t+4
857// -----|------|------|------|------|------|
858// fdiv | fdiv | D | E | M | fb/B |
859// stall | stall| | | | |
860// in | | | | | |
861// | | | | | |
862// |pte[3]|pte[2]|pte[1]|pte[0]|finish|
863// | | | | | |
864// | | | | | |
865// 8/9 | 6/7 | | | | |
866// | | | | | |
867// +0 | +1 | | | | |
868//
869//
870// at engine_start :
871// stall_cnt
872// 3 2 1 0
873// -------
874// ndq = neg -> 1 1 1 1
875// ndq = 0/1 -> 1 1 1 1 [6:1] = 000 000
876// ndq = 2/3 -> 0 1 1 1 = 000 001
877// ndq = 4/5 -> 0 0 1 1 = 000 010
878// ndq = 6/7 -> 0 0 0 1 = 000 011
879// ndq >=8/9 -> 0 0 0 0 = 000 100 idiv_stall_in
880
881
882assign fdiv_stall_in = ((pe_ndq[6:1] == 6'b000000) & engine_on & ~control_lth[2] & ~stall_hold);
883
884assign idiv_stall_in = ((pe_ndq[6:1] == 6'b000100) & engine_on & control_lth[2] & control_lth[1] & ~stall_hold & ~div_flush_lth) |
885 ((pe_ndq[6:3] == 4'b0000 ) & engine_on & control_lth[2] & ~stall_hold & ~div_flush_lth) |
886 ( pe_ndq[7] & engine_on & control_lth[2] & ~stall_hold & ~div_flush_lth);
887
888
889assign stall_hold_in = (fdiv_stall_in & ~div_flush_lth ) |
890 (idiv_stall_in & ~div_flush_lth ) |
891 (stall_hold & ~div_flush_lth & ~finish_raw);
892
893
894assign stall_cnt_raw[3] = (pe_ndq[6:1] == 6'b000000) |
895 (pe_ndq[7] );
896
897assign stall_cnt_raw[2] = (pe_ndq[6:2] == 5'b00000 ) |
898 (pe_ndq[7] );
899
900assign stall_cnt_raw[1] = (pe_ndq[6:1] == 6'b000010) |
901 (pe_ndq[6:2] == 5'b00000 ) |
902 (pe_ndq[7] );
903
904assign stall_cnt_raw[0] = (pe_ndq[6:3] == 4'b0000 ) |
905 (pe_ndq[7] );
906
907assign stall_cnt_in[3:0] = ({4{ fdc_pe_cycle[3] & control_lth[1] & ~div_flush_lth}} & stall_cnt_raw[3:0] ) | // INT64 engine_start
908 ({4{ fdc_pe_cycle[3] & ~control_lth[1] & ~div_flush_lth}} & {1'b0,stall_cnt_raw[3:1]}) | // INT32 engine_start
909 ({4{~fdc_pe_cycle[3] & ~finish_lth & ~div_flush_lth}} & stall_cnt[3:0] ) |
910 ({4{ finish_lth & ~div_flush_lth}} & {1'b0,stall_cnt[3:1] });
911
912fgu_fdc_ctl_msff_ctl_macro__width_8 stall_lth (
913 .scan_in(stall_lth_scanin),
914 .scan_out(stall_lth_scanout),
915 .l1clk( l1clk_pm1 ),
916 .din ({finish_lth_in , fdiv_stall_in , idiv_stall_in , stall_hold_in , stall_cnt_in[3:0]}),
917 .dout ({finish_lth , fgu_fdiv_stall , idiv_stall_lth , stall_hold , stall_cnt[3:0] }),
918 .siclk(siclk),
919 .soclk(soclk));
920
921
922assign fgu_idiv_stall[1] = control_lth[4] & idiv_stall_lth; // Threads 4-7
923assign fgu_idiv_stall[0] = ~control_lth[4] & idiv_stall_lth; // Threads 0-3
924
925
926assign finish_lth_in = (fdc_pte_cycle[0] & ~div_flush_lth) |
927 (fdc_pte_cycle[1] & control_lth[2] & control_lth[1] & ~div_flush_lth) |
928 (finish_lth & stall_cnt[0] & ~div_flush_lth);
929
930
931assign finish_raw = finish_lth & ~stall_cnt[0];
932
933assign fdc_finish_int_early = (fdc_pte_cycle[0] & ~stall_cnt[0] & control_lth[2] ) |
934 (fdc_pte_cycle[1] & ~stall_cnt[0] & control_lth[2] & control_lth[1]) |
935 (finish_lth & stall_cnt[0] & ~stall_cnt[1] & control_lth[2] );
936
937assign fdc_finish_fltd_early = fdc_pte_cycle[0] & ~control_lth[2] & control_lth[1];
938assign fdc_finish_flts_early = fdc_pte_cycle[0] & ~control_lth[2] & ~control_lth[1];
939
940
941
942assign fdc_pte_stall_ = fdc_pte_cycle[1] |
943 fdc_idiv_ctl[0] | fdc_idiv_ctl[1] | fdc_idiv_ctl[2] | fdc_idiv_ctl[3] |
944 (fdc_pte_cycle[0] & ~flt_shift_sel_ & ~control_lth[2]) |
945 (fdc_pte_cycle[0] & fdc_flt_increment );
946
947
948
949// *** State data ***
950
951assign control_in[4:0] = ({5{ fac_div_valid_fx1 & ~fac_divq_valid_fx1}} & fac_div_control_fx1[4:0]) |
952 ({5{ fac_div_valid_fx1 & fac_divq_valid_fx1}} & qcontrol_fx1[4:0]) |
953 ({5{~fac_div_valid_fx1 }} & control_lth[4:0]);
954
955assign asign_in = ( fdc_pe_cycle[2] & fdd_pe_clth[63] & control_lth[0] ) |
956 (~fdc_pe_cycle[2] & fdc_asign_lth & ~fac_div_valid_fx1);
957
958assign bsign_in = ( fdc_pe_cycle[1] & fdd_pe_clth[63] & control_lth[0] ) |
959 (~fdc_pe_cycle[1] & fdc_bsign_lth & ~fac_div_valid_fx1);
960
961assign ndq_odd_in = ~pe_ndq[7] & pe_ndq[0];
962
963fgu_fdc_ctl_msff_ctl_macro__width_9 data_lth (
964 .scan_in(data_lth_scanin),
965 .scan_out(data_lth_scanout),
966 .l1clk( l1clk_pm1 ),
967 .din ({control_in[4:0] ,asign_in ,bsign_in ,ndq_odd_in ,ndq_odd_lth }),
968 .dout ({control_lth[4:0],fdc_asign_lth,fdc_bsign_lth,ndq_odd_lth,ndq_odd_2lth }),
969 .siclk(siclk),
970 .soclk(soclk));
971
972assign fdc_pte_clasel[0] = fdc_pte_cycle[3] & ~ndq_odd_lth;
973assign fdc_pte_clasel[1] = fdc_pte_cycle[3] & ndq_odd_lth;
974
975assign fdc_pte_qsel[0] = control_lth[2] & ~ndq_odd_2lth; // INT even
976assign fdc_pte_qsel[1] = control_lth[2] & ndq_odd_2lth; // INT odd
977assign fdc_pte_qsel[2] = ~control_lth[2] & control_lth[1]; // FLT DP
978
979
980assign fdc_bsign_lth_ = ~fdc_bsign_lth;
981assign fdc_pte_csa_cin = fdc_asign_lth ^ fdc_bsign_lth;
982
983
984
985// * * * * * * * * * * * Interface to engine * * * * * * * * * * *
986
987// integer select by "fdc_pe_cycle[3]"
988
989// fac_div_control_fx1[3:0] ==
990// [3:0] :
991// 0000 : Float Divide Single
992// 0010 : Float Divide Double
993// 0100 : Integer Unsigned - 32 bit
994// 0101 : Integer Signed - 32 bit
995// 0110 : Integer Unsigned - 64 bit
996// 0111 : Integer Signed - 64 bit
997// 1000 : Float SQRT Single
998// 1010 : Float SQRT Double
999
1000
1001assign fdc_ie_rmux_sel[0] = ~fac_div_valid_fx1; // integer
1002assign fdc_ie_rmux_sel[1] = fac_div_valid_fx1 & fac_div_control_fx1[3] & ~fac_divq_valid_fx1; // float sqrt
1003assign fdc_ie_rmux_sel[2] = fac_div_valid_fx1 & ~fac_div_control_fx1[3] & ~fac_divq_valid_fx1; // float div
1004assign fdc_ie_rmux_sel[3] = fac_div_valid_fx1 & qcontrol_fx1[3] & fac_divq_valid_fx1; // float sqrt
1005assign fdc_ie_rmux_sel[4] = fac_div_valid_fx1 & ~qcontrol_fx1[3] & fac_divq_valid_fx1; // float div
1006
1007assign fdc_ie_dmux_sel[0] = ~fac_div_valid_fx1; // integer
1008assign fdc_ie_dmux_sel[1] = fac_div_valid_fx1 & ~fac_div_control_fx1[3] & ~fac_divq_valid_fx1; // float div
1009assign fdc_ie_dmux_sel[2] = fac_div_valid_fx1 & ~qcontrol_fx1[3] & fac_divq_valid_fx1; // float div
1010
1011
1012// must be qualified w/ valid so INT is not corrupted by garbage on bus during pe_cycle[3]
1013assign fdc_ie_fsqrt_valid_even = (fac_div_valid_fx1 & fac_div_control_fx1[3] & fpe_rs2_fmt_fx1_b0 & ~fac_divq_valid_fx1) |
1014 (fac_div_valid_fx1 & qcontrol_fx1[3] & qcontrol_fx1[5] & fac_divq_valid_fx1);
1015
1016assign fdc_ie_fsqrt_valid_odd = (fac_div_valid_fx1 & fac_div_control_fx1[3] & ~fpe_rs2_fmt_fx1_b0 & ~fac_divq_valid_fx1) |
1017 (fac_div_valid_fx1 & qcontrol_fx1[3] & ~qcontrol_fx1[5] & fac_divq_valid_fx1);
1018
1019assign fdc_ie_fsqrt_valid_even_ = ~fdc_ie_fsqrt_valid_even;
1020assign fdc_ie_fsqrt_valid_odd_ = ~fdc_ie_fsqrt_valid_odd;
1021
1022
1023// * * * * * * * * * * * * start : Integer CNTL0 * * * * * * * * * * * * *
1024
1025//reg [6:0] cntl0;
1026//
1027//always @ (fdd_pe_clth[63:0])
1028//
1029// begin
1030//
1031// casex (fdd_pe_clth[63:0])
1032// 64'b1???????????????????????????????????????????????????????????????: cntl0[6:0] = 7'b0000000;
1033// 64'b01??????????????????????????????????????????????????????????????: cntl0[6:0] = 7'b0000001;
1034// 64'b001?????????????????????????????????????????????????????????????: cntl0[6:0] = 7'b0000010;
1035// 64'b0001????????????????????????????????????????????????????????????: cntl0[6:0] = 7'b0000011;
1036// 64'b00001???????????????????????????????????????????????????????????: cntl0[6:0] = 7'b0000100;
1037// 64'b000001??????????????????????????????????????????????????????????: cntl0[6:0] = 7'b0000101;
1038// 64'b0000001?????????????????????????????????????????????????????????: cntl0[6:0] = 7'b0000110;
1039// 64'b00000001????????????????????????????????????????????????????????: cntl0[6:0] = 7'b0000111;
1040//
1041// 64'b000000001???????????????????????????????????????????????????????: cntl0[6:0] = 7'b0001000;
1042// 64'b0000000001??????????????????????????????????????????????????????: cntl0[6:0] = 7'b0001001;
1043// 64'b00000000001?????????????????????????????????????????????????????: cntl0[6:0] = 7'b0001010;
1044// 64'b000000000001????????????????????????????????????????????????????: cntl0[6:0] = 7'b0001011;
1045// 64'b0000000000001???????????????????????????????????????????????????: cntl0[6:0] = 7'b0001100;
1046// 64'b00000000000001??????????????????????????????????????????????????: cntl0[6:0] = 7'b0001101;
1047// 64'b000000000000001?????????????????????????????????????????????????: cntl0[6:0] = 7'b0001110;
1048// 64'b0000000000000001????????????????????????????????????????????????: cntl0[6:0] = 7'b0001111;
1049//
1050// 64'b00000000000000001???????????????????????????????????????????????: cntl0[6:0] = 7'b0010000;
1051// 64'b000000000000000001??????????????????????????????????????????????: cntl0[6:0] = 7'b0010001;
1052// 64'b0000000000000000001?????????????????????????????????????????????: cntl0[6:0] = 7'b0010010;
1053// 64'b00000000000000000001????????????????????????????????????????????: cntl0[6:0] = 7'b0010011;
1054// 64'b000000000000000000001???????????????????????????????????????????: cntl0[6:0] = 7'b0010100;
1055// 64'b0000000000000000000001??????????????????????????????????????????: cntl0[6:0] = 7'b0010101;
1056// 64'b00000000000000000000001?????????????????????????????????????????: cntl0[6:0] = 7'b0010110;
1057// 64'b000000000000000000000001????????????????????????????????????????: cntl0[6:0] = 7'b0010111;
1058//
1059// 64'b0000000000000000000000001???????????????????????????????????????: cntl0[6:0] = 7'b0011000;
1060// 64'b00000000000000000000000001??????????????????????????????????????: cntl0[6:0] = 7'b0011001;
1061// 64'b000000000000000000000000001?????????????????????????????????????: cntl0[6:0] = 7'b0011010;
1062// 64'b0000000000000000000000000001????????????????????????????????????: cntl0[6:0] = 7'b0011011;
1063// 64'b00000000000000000000000000001???????????????????????????????????: cntl0[6:0] = 7'b0011100;
1064// 64'b000000000000000000000000000001??????????????????????????????????: cntl0[6:0] = 7'b0011101;
1065// 64'b0000000000000000000000000000001?????????????????????????????????: cntl0[6:0] = 7'b0011110;
1066// 64'b00000000000000000000000000000001????????????????????????????????: cntl0[6:0] = 7'b0011111;
1067//
1068// 64'b000000000000000000000000000000001???????????????????????????????: cntl0[6:0] = 7'b0100000;
1069// 64'b0000000000000000000000000000000001??????????????????????????????: cntl0[6:0] = 7'b0100001;
1070// 64'b00000000000000000000000000000000001?????????????????????????????: cntl0[6:0] = 7'b0100010;
1071// 64'b000000000000000000000000000000000001????????????????????????????: cntl0[6:0] = 7'b0100011;
1072// 64'b0000000000000000000000000000000000001???????????????????????????: cntl0[6:0] = 7'b0100100;
1073// 64'b00000000000000000000000000000000000001??????????????????????????: cntl0[6:0] = 7'b0100101;
1074// 64'b000000000000000000000000000000000000001?????????????????????????: cntl0[6:0] = 7'b0100110;
1075// 64'b0000000000000000000000000000000000000001????????????????????????: cntl0[6:0] = 7'b0100111;
1076//
1077// 64'b00000000000000000000000000000000000000001???????????????????????: cntl0[6:0] = 7'b0101000;
1078// 64'b000000000000000000000000000000000000000001??????????????????????: cntl0[6:0] = 7'b0101001;
1079// 64'b0000000000000000000000000000000000000000001?????????????????????: cntl0[6:0] = 7'b0101010;
1080// 64'b00000000000000000000000000000000000000000001????????????????????: cntl0[6:0] = 7'b0101011;
1081// 64'b000000000000000000000000000000000000000000001???????????????????: cntl0[6:0] = 7'b0101100;
1082// 64'b0000000000000000000000000000000000000000000001??????????????????: cntl0[6:0] = 7'b0101101;
1083// 64'b00000000000000000000000000000000000000000000001?????????????????: cntl0[6:0] = 7'b0101110;
1084// 64'b000000000000000000000000000000000000000000000001????????????????: cntl0[6:0] = 7'b0101111;
1085//
1086// 64'b0000000000000000000000000000000000000000000000001???????????????: cntl0[6:0] = 7'b0110000;
1087// 64'b00000000000000000000000000000000000000000000000001??????????????: cntl0[6:0] = 7'b0110001;
1088// 64'b000000000000000000000000000000000000000000000000001?????????????: cntl0[6:0] = 7'b0110010;
1089// 64'b0000000000000000000000000000000000000000000000000001????????????: cntl0[6:0] = 7'b0110011;
1090// 64'b00000000000000000000000000000000000000000000000000001???????????: cntl0[6:0] = 7'b0110100;
1091// 64'b000000000000000000000000000000000000000000000000000001??????????: cntl0[6:0] = 7'b0110101;
1092// 64'b0000000000000000000000000000000000000000000000000000001?????????: cntl0[6:0] = 7'b0110110;
1093// 64'b00000000000000000000000000000000000000000000000000000001????????: cntl0[6:0] = 7'b0110111;
1094//
1095// 64'b000000000000000000000000000000000000000000000000000000001???????: cntl0[6:0] = 7'b0111000;
1096// 64'b0000000000000000000000000000000000000000000000000000000001??????: cntl0[6:0] = 7'b0111001;
1097// 64'b00000000000000000000000000000000000000000000000000000000001?????: cntl0[6:0] = 7'b0111010;
1098// 64'b000000000000000000000000000000000000000000000000000000000001????: cntl0[6:0] = 7'b0111011;
1099// 64'b0000000000000000000000000000000000000000000000000000000000001???: cntl0[6:0] = 7'b0111100;
1100// 64'b00000000000000000000000000000000000000000000000000000000000001??: cntl0[6:0] = 7'b0111101;
1101// 64'b000000000000000000000000000000000000000000000000000000000000001?: cntl0[6:0] = 7'b0111110;
1102// 64'b0000000000000000000000000000000000000000000000000000000000000001: cntl0[6:0] = 7'b0111111;
1103//
1104// 64'b0000000000000000000000000000000000000000000000000000000000000000: cntl0[6:0] = 7'b1000000;
1105//
1106// default: cntl0[6:0] = 7'bxxxxxxx;
1107//
1108// endcase
1109//
1110//end
1111
1112
1113// The real count leading zero (CNTL0) circuit must be coded at the gate level.
1114// For each 8-bit byte, a 3-bit count and an "all zero" will be computed. The
1115// "all zero" will then be used to find which byte contains the leading 1.
1116// The 3-bit count from each byte will be muxed using those "all zero" controls
1117// to form the 3 LSB's of the CNTL0. The upper 4 bits of the CNTL0 are
1118// computed directly from the byte "all zero" controls. See the truth tables
1119// below for more details.
1120//
1121// byte
1122// clth[7:0] | cnt[2:0] zero
1123// -----------------|-----------------
1124// 1 x x x x x x x | 0 0 0 0
1125// 0 1 x x x x x x | 0 0 1 0
1126// 0 0 1 x x x x x | 0 1 0 0
1127// 0 0 0 1 x x x x | 0 1 1 0
1128// 0 0 0 0 1 x x x | 1 0 0 0
1129// 0 0 0 0 0 1 x x | 1 0 1 0
1130// 0 0 0 0 0 0 1 x | 1 1 0 0
1131// 0 0 0 0 0 0 0 1 | 1 1 1 0
1132// 0 0 0 0 0 0 0 0 | 0 0 0 1
1133//
1134//
1135// Byte Zero_
1136// z7 z6 z5 z4 z3 z2 z1 z0 | cnt[6:3]
1137// -------------------------|-------------
1138// 1 x x x x x x x | 0 0 0 0
1139// 0 1 x x x x x x | 0 0 0 1
1140// 0 0 1 x x x x x | 0 0 1 0
1141// 0 0 0 1 x x x x | 0 0 1 1
1142// 0 0 0 0 1 x x x | 0 1 0 0
1143// 0 0 0 0 0 1 x x | 0 1 0 1
1144// 0 0 0 0 0 0 1 x | 0 1 1 0
1145// 0 0 0 0 0 0 0 1 | 0 1 1 1
1146// 0 0 0 0 0 0 0 0 | 1 x x x (divide ENDS!)
1147//
1148//
1149// Byte Zero_ is an 8-way OR of all bits in that byte.
1150// This can be accomplished by 4 * Nor2 + Nand4
1151//
1152// In order to compute the 3-bit count, we must further
1153// divide the byte down into an upper and lower half.
1154//
1155// Estimated critical path :
1156// NOR2 + NAND4 + PE(3->4) + MUX4 + MUX2 + MUX3(merge CNTL0 + CNTL1)
1157
1158
1159assign clth[63:0] = fdd_pe_clth[63:0];
1160
1161
1162// ************************ BYTE 0 => 07:00 **************************
1163
1164assign b0_nor_76 = ~(clth[7] | clth[6]);
1165assign b0_nor_54 = ~(clth[5] | clth[4]);
1166assign b0_nor_32 = ~(clth[3] | clth[2]);
1167assign b0_nor_10 = ~(clth[1] | clth[0]);
1168
1169assign b0_zeroh_ = ~(b0_nor_76 & b0_nor_54);
1170assign b0_zerol_ = ~(b0_nor_32 & b0_nor_10);
1171assign b0_zero_ = ~(b0_nor_76 & b0_nor_54 & b0_nor_32 & b0_nor_10);
1172
1173assign b0_cnth[0] = (~clth[7] & clth[6] ) |
1174 (~clth[7] & ~clth[5] & clth[4]);
1175
1176assign b0_cnth[1] = (~clth[7] & ~clth[6] & clth[5] ) |
1177 (~clth[7] & ~clth[6] & clth[4]);
1178
1179assign b0_cntl[0] = (~clth[3] & clth[2] ) |
1180 (~clth[3] & ~clth[1] & clth[0]);
1181
1182assign b0_cntl[1] = (~clth[3] & ~clth[2] & clth[1] ) |
1183 (~clth[3] & ~clth[2] & clth[0]);
1184
1185assign b0_cnt[0] = ( b0_zeroh_ & b0_cnth[0]) |
1186 (~b0_zeroh_ & b0_cntl[0]);
1187
1188assign b0_cnt[1] = ( b0_zeroh_ & b0_cnth[1]) |
1189 (~b0_zeroh_ & b0_cntl[1]);
1190
1191assign b0_cnt[2] = (~b0_zeroh_ & b0_zerol_);
1192
1193
1194// ************************ BYTE 1 => 15:08 **************************
1195
1196assign b1_nor_76 = ~(clth[15] | clth[14]);
1197assign b1_nor_54 = ~(clth[13] | clth[12]);
1198assign b1_nor_32 = ~(clth[11] | clth[10]);
1199assign b1_nor_10 = ~(clth[9] | clth[8]);
1200
1201assign b1_zeroh_ = ~(b1_nor_76 & b1_nor_54);
1202assign b1_zerol_ = ~(b1_nor_32 & b1_nor_10);
1203assign b1_zero_ = ~(b1_nor_76 & b1_nor_54 & b1_nor_32 & b1_nor_10);
1204
1205assign b1_cnth[0] = (~clth[15] & clth[14] ) |
1206 (~clth[15] & ~clth[13] & clth[12]);
1207
1208assign b1_cnth[1] = (~clth[15] & ~clth[14] & clth[13] ) |
1209 (~clth[15] & ~clth[14] & clth[12]);
1210
1211assign b1_cntl[0] = (~clth[11] & clth[10] ) |
1212 (~clth[11] & ~clth[9] & clth[8]);
1213
1214assign b1_cntl[1] = (~clth[11] & ~clth[10] & clth[9] ) |
1215 (~clth[11] & ~clth[10] & clth[8]);
1216
1217assign b1_cnt[0] = ( b1_zeroh_ & b1_cnth[0]) |
1218 (~b1_zeroh_ & b1_cntl[0]);
1219
1220assign b1_cnt[1] = ( b1_zeroh_ & b1_cnth[1]) |
1221 (~b1_zeroh_ & b1_cntl[1]);
1222
1223assign b1_cnt[2] = (~b1_zeroh_ & b1_zerol_);
1224
1225
1226// ************************ BYTE 2 => 23:16 **************************
1227
1228assign b2_nor_76 = ~(clth[23] | clth[22]);
1229assign b2_nor_54 = ~(clth[21] | clth[20]);
1230assign b2_nor_32 = ~(clth[19] | clth[18]);
1231assign b2_nor_10 = ~(clth[17] | clth[16]);
1232
1233assign b2_zeroh_ = ~(b2_nor_76 & b2_nor_54);
1234assign b2_zerol_ = ~(b2_nor_32 & b2_nor_10);
1235assign b2_zero_ = ~(b2_nor_76 & b2_nor_54 & b2_nor_32 & b2_nor_10);
1236
1237assign b2_cnth[0] = (~clth[23] & clth[22] ) |
1238 (~clth[23] & ~clth[21] & clth[20]);
1239
1240assign b2_cnth[1] = (~clth[23] & ~clth[22] & clth[21] ) |
1241 (~clth[23] & ~clth[22] & clth[20]);
1242
1243assign b2_cntl[0] = (~clth[19] & clth[18] ) |
1244 (~clth[19] & ~clth[17] & clth[16]);
1245
1246assign b2_cntl[1] = (~clth[19] & ~clth[18] & clth[17] ) |
1247 (~clth[19] & ~clth[18] & clth[16]);
1248
1249assign b2_cnt[0] = ( b2_zeroh_ & b2_cnth[0]) |
1250 (~b2_zeroh_ & b2_cntl[0]);
1251
1252assign b2_cnt[1] = ( b2_zeroh_ & b2_cnth[1]) |
1253 (~b2_zeroh_ & b2_cntl[1]);
1254
1255assign b2_cnt[2] = (~b2_zeroh_ & b2_zerol_);
1256
1257
1258// ************************ BYTE 3 => 31:24 **************************
1259
1260assign b3_nor_76 = ~(clth[31] | clth[30]);
1261assign b3_nor_54 = ~(clth[29] | clth[28]);
1262assign b3_nor_32 = ~(clth[27] | clth[26]);
1263assign b3_nor_10 = ~(clth[25] | clth[24]);
1264
1265assign b3_zeroh_ = ~(b3_nor_76 & b3_nor_54);
1266assign b3_zerol_ = ~(b3_nor_32 & b3_nor_10);
1267assign b3_zero_ = ~(b3_nor_76 & b3_nor_54 & b3_nor_32 & b3_nor_10);
1268
1269assign b3_cnth[0] = (~clth[31] & clth[30] ) |
1270 (~clth[31] & ~clth[29] & clth[28]);
1271
1272assign b3_cnth[1] = (~clth[31] & ~clth[30] & clth[29] ) |
1273 (~clth[31] & ~clth[30] & clth[28]);
1274
1275assign b3_cntl[0] = (~clth[27] & clth[26] ) |
1276 (~clth[27] & ~clth[25] & clth[24]);
1277
1278assign b3_cntl[1] = (~clth[27] & ~clth[26] & clth[25] ) |
1279 (~clth[27] & ~clth[26] & clth[24]);
1280
1281assign b3_cnt[0] = ( b3_zeroh_ & b3_cnth[0]) |
1282 (~b3_zeroh_ & b3_cntl[0]);
1283
1284assign b3_cnt[1] = ( b3_zeroh_ & b3_cnth[1]) |
1285 (~b3_zeroh_ & b3_cntl[1]);
1286
1287assign b3_cnt[2] = (~b3_zeroh_ & b3_zerol_);
1288
1289
1290// ************************ BYTE 4 => 39:32 **************************
1291
1292assign b4_nor_76 = ~(clth[39] | clth[38]);
1293assign b4_nor_54 = ~(clth[37] | clth[36]);
1294assign b4_nor_32 = ~(clth[35] | clth[34]);
1295assign b4_nor_10 = ~(clth[33] | clth[32]);
1296
1297assign b4_zeroh_ = ~(b4_nor_76 & b4_nor_54);
1298assign b4_zerol_ = ~(b4_nor_32 & b4_nor_10);
1299assign b4_zero_ = ~(b4_nor_76 & b4_nor_54 & b4_nor_32 & b4_nor_10);
1300
1301assign b4_cnth[0] = (~clth[39] & clth[38] ) |
1302 (~clth[39] & ~clth[37] & clth[36]);
1303
1304assign b4_cnth[1] = (~clth[39] & ~clth[38] & clth[37] ) |
1305 (~clth[39] & ~clth[38] & clth[36]);
1306
1307assign b4_cntl[0] = (~clth[35] & clth[34] ) |
1308 (~clth[35] & ~clth[33] & clth[32]);
1309
1310assign b4_cntl[1] = (~clth[35] & ~clth[34] & clth[33] ) |
1311 (~clth[35] & ~clth[34] & clth[32]);
1312
1313assign b4_cnt[0] = ( b4_zeroh_ & b4_cnth[0]) |
1314 (~b4_zeroh_ & b4_cntl[0]);
1315
1316assign b4_cnt[1] = ( b4_zeroh_ & b4_cnth[1]) |
1317 (~b4_zeroh_ & b4_cntl[1]);
1318
1319assign b4_cnt[2] = (~b4_zeroh_ & b4_zerol_);
1320
1321
1322// ************************ BYTE 5 => 47:40 **************************
1323
1324assign b5_nor_76 = ~(clth[47] | clth[46]);
1325assign b5_nor_54 = ~(clth[45] | clth[44]);
1326assign b5_nor_32 = ~(clth[43] | clth[42]);
1327assign b5_nor_10 = ~(clth[41] | clth[40]);
1328
1329assign b5_zeroh_ = ~(b5_nor_76 & b5_nor_54);
1330assign b5_zerol_ = ~(b5_nor_32 & b5_nor_10);
1331assign b5_zero_ = ~(b5_nor_76 & b5_nor_54 & b5_nor_32 & b5_nor_10);
1332
1333assign b5_cnth[0] = (~clth[47] & clth[46] ) |
1334 (~clth[47] & ~clth[45] & clth[44]);
1335
1336assign b5_cnth[1] = (~clth[47] & ~clth[46] & clth[45] ) |
1337 (~clth[47] & ~clth[46] & clth[44]);
1338
1339assign b5_cntl[0] = (~clth[43] & clth[42] ) |
1340 (~clth[43] & ~clth[41] & clth[40]);
1341
1342assign b5_cntl[1] = (~clth[43] & ~clth[42] & clth[41] ) |
1343 (~clth[43] & ~clth[42] & clth[40]);
1344
1345assign b5_cnt[0] = ( b5_zeroh_ & b5_cnth[0]) |
1346 (~b5_zeroh_ & b5_cntl[0]);
1347
1348assign b5_cnt[1] = ( b5_zeroh_ & b5_cnth[1]) |
1349 (~b5_zeroh_ & b5_cntl[1]);
1350
1351assign b5_cnt[2] = (~b5_zeroh_ & b5_zerol_);
1352
1353
1354// ************************ BYTE 6 => 55:48 **************************
1355
1356assign b6_nor_76 = ~(clth[55] | clth[54]);
1357assign b6_nor_54 = ~(clth[53] | clth[52]);
1358assign b6_nor_32 = ~(clth[51] | clth[50]);
1359assign b6_nor_10 = ~(clth[49] | clth[48]);
1360
1361assign b6_zeroh_ = ~(b6_nor_76 & b6_nor_54);
1362assign b6_zerol_ = ~(b6_nor_32 & b6_nor_10);
1363assign b6_zero_ = ~(b6_nor_76 & b6_nor_54 & b6_nor_32 & b6_nor_10);
1364
1365assign b6_cnth[0] = (~clth[55] & clth[54] ) |
1366 (~clth[55] & ~clth[53] & clth[52]);
1367
1368assign b6_cnth[1] = (~clth[55] & ~clth[54] & clth[53] ) |
1369 (~clth[55] & ~clth[54] & clth[52]);
1370
1371assign b6_cntl[0] = (~clth[51] & clth[50] ) |
1372 (~clth[51] & ~clth[49] & clth[48]);
1373
1374assign b6_cntl[1] = (~clth[51] & ~clth[50] & clth[49] ) |
1375 (~clth[51] & ~clth[50] & clth[48]);
1376
1377assign b6_cnt[0] = ( b6_zeroh_ & b6_cnth[0]) |
1378 (~b6_zeroh_ & b6_cntl[0]);
1379
1380assign b6_cnt[1] = ( b6_zeroh_ & b6_cnth[1]) |
1381 (~b6_zeroh_ & b6_cntl[1]);
1382
1383assign b6_cnt[2] = (~b6_zeroh_ & b6_zerol_);
1384
1385
1386// ************************ BYTE 7 => 63:56 **************************
1387
1388assign b7_nor_76 = ~(clth[63] | clth[62]);
1389assign b7_nor_54 = ~(clth[61] | clth[60]);
1390assign b7_nor_32 = ~(clth[59] | clth[58]);
1391assign b7_nor_10 = ~(clth[57] | clth[56]);
1392
1393assign b7_zeroh_ = ~(b7_nor_76 & b7_nor_54);
1394assign b7_zerol_ = ~(b7_nor_32 & b7_nor_10);
1395assign b7_zero_ = ~(b7_nor_76 & b7_nor_54 & b7_nor_32 & b7_nor_10);
1396
1397assign b7_cnth[0] = (~clth[63] & clth[62] ) |
1398 (~clth[63] & ~clth[61] & clth[60]);
1399
1400assign b7_cnth[1] = (~clth[63] & ~clth[62] & clth[61] ) |
1401 (~clth[63] & ~clth[62] & clth[60]);
1402
1403assign b7_cntl[0] = (~clth[59] & clth[58] ) |
1404 (~clth[59] & ~clth[57] & clth[56]);
1405
1406assign b7_cntl[1] = (~clth[59] & ~clth[58] & clth[57] ) |
1407 (~clth[59] & ~clth[58] & clth[56]);
1408
1409assign b7_cnt[0] = ( b7_zeroh_ & b7_cnth[0]) |
1410 (~b7_zeroh_ & b7_cntl[0]);
1411
1412assign b7_cnt[1] = ( b7_zeroh_ & b7_cnth[1]) |
1413 (~b7_zeroh_ & b7_cntl[1]);
1414
1415assign b7_cnt[2] = (~b7_zeroh_ & b7_zerol_);
1416
1417
1418
1419// ************************ Global CNTL0 **************************
1420
1421// When CNTL0[6] = 1 all other bits become a DON'T CARE
1422
1423assign b3_0sel = b3_zero_ ;
1424assign b2_0sel = ~b3_zero_ & b2_zero_ ;
1425assign b1_0sel = ~b3_zero_ & ~b2_zero_ & b1_zero_;
1426assign b0_0sel = ~b3_zero_ & ~b2_zero_ & ~b1_zero_;
1427
1428assign cntl0l[4:0] = ({5{b3_0sel}} & {2'b00,b3_cnt[2:0]}) |
1429 ({5{b2_0sel}} & {2'b01,b2_cnt[2:0]}) |
1430 ({5{b1_0sel}} & {2'b10,b1_cnt[2:0]}) |
1431 ({5{b0_0sel}} & {2'b11,b0_cnt[2:0]});
1432
1433
1434assign b7_0sel = b7_zero_ ;
1435assign b6_0sel = ~b7_zero_ & b6_zero_ ;
1436assign b5_0sel = ~b7_zero_ & ~b6_zero_ & b5_zero_;
1437assign b4_0sel = ~b7_zero_ & ~b6_zero_ & ~b5_zero_;
1438
1439assign cntl0h[4:0] = ({5{b7_0sel}} & {2'b00,b7_cnt[2:0]}) |
1440 ({5{b6_0sel}} & {2'b01,b6_cnt[2:0]}) |
1441 ({5{b5_0sel}} & {2'b10,b5_cnt[2:0]}) |
1442 ({5{b4_0sel}} & {2'b11,b4_cnt[2:0]});
1443
1444assign cntl0_selh = b7_zero_ | b6_zero_ | b5_zero_ | b4_zero_;
1445assign cntl0_sell = b3_zero_ | b2_zero_ | b1_zero_ | b0_zero_;
1446assign cntl0[6] = ~(cntl0_selh | cntl0_sell);
1447
1448assign cntl0[5:0] = ({6{ cntl0_selh}} & {1'b0, cntl0h[4:0]}) |
1449 ({6{~cntl0_selh}} & {1'b1, cntl0l[4:0]});
1450
1451
1452// * * * * * * * * * * * * End : Integer CNTL0 * * * * * * * * * * * * *
1453
1454
1455// * * * * * * * * * * * * Start : Integer CNTL1 * * * * * * * * * * * * *
1456
1457//reg [6:0] cntl1;
1458//
1459//always @ (fdd_pe_clth[63:0])
1460//
1461// begin
1462//
1463//
1464// casex (fdd_pe_clth[63:0])
1465// 64'b0???????????????????????????????????????????????????????????????: cntl1[6:0] = 7'b0000000;
1466//
1467// 64'b10??????????????????????????????????????????????????????????????: cntl1[6:0] = 7'b0000000;
1468// 64'b110?????????????????????????????????????????????????????????????: cntl1[6:0] = 7'b0000001;
1469// 64'b1110????????????????????????????????????????????????????????????: cntl1[6:0] = 7'b0000010;
1470// 64'b11110???????????????????????????????????????????????????????????: cntl1[6:0] = 7'b0000011;
1471// 64'b111110??????????????????????????????????????????????????????????: cntl1[6:0] = 7'b0000100;
1472// 64'b1111110?????????????????????????????????????????????????????????: cntl1[6:0] = 7'b0000101;
1473// 64'b11111110????????????????????????????????????????????????????????: cntl1[6:0] = 7'b0000110;
1474// 64'b111111110???????????????????????????????????????????????????????: cntl1[6:0] = 7'b0000111;
1475//
1476// 64'b1111111110??????????????????????????????????????????????????????: cntl1[6:0] = 7'b0001000;
1477// 64'b11111111110?????????????????????????????????????????????????????: cntl1[6:0] = 7'b0001001;
1478// 64'b111111111110????????????????????????????????????????????????????: cntl1[6:0] = 7'b0001010;
1479// 64'b1111111111110???????????????????????????????????????????????????: cntl1[6:0] = 7'b0001011;
1480// 64'b11111111111110??????????????????????????????????????????????????: cntl1[6:0] = 7'b0001100;
1481// 64'b111111111111110?????????????????????????????????????????????????: cntl1[6:0] = 7'b0001101;
1482// 64'b1111111111111110????????????????????????????????????????????????: cntl1[6:0] = 7'b0001110;
1483// 64'b11111111111111110???????????????????????????????????????????????: cntl1[6:0] = 7'b0001111;
1484//
1485// 64'b111111111111111110??????????????????????????????????????????????: cntl1[6:0] = 7'b0010000;
1486// 64'b1111111111111111110?????????????????????????????????????????????: cntl1[6:0] = 7'b0010001;
1487// 64'b11111111111111111110????????????????????????????????????????????: cntl1[6:0] = 7'b0010010;
1488// 64'b111111111111111111110???????????????????????????????????????????: cntl1[6:0] = 7'b0010011;
1489// 64'b1111111111111111111110??????????????????????????????????????????: cntl1[6:0] = 7'b0010100;
1490// 64'b11111111111111111111110?????????????????????????????????????????: cntl1[6:0] = 7'b0010101;
1491// 64'b111111111111111111111110????????????????????????????????????????: cntl1[6:0] = 7'b0010110;
1492// 64'b1111111111111111111111110???????????????????????????????????????: cntl1[6:0] = 7'b0010111;
1493//
1494// 64'b11111111111111111111111110??????????????????????????????????????: cntl1[6:0] = 7'b0011000;
1495// 64'b111111111111111111111111110?????????????????????????????????????: cntl1[6:0] = 7'b0011001;
1496// 64'b1111111111111111111111111110????????????????????????????????????: cntl1[6:0] = 7'b0011010;
1497// 64'b11111111111111111111111111110???????????????????????????????????: cntl1[6:0] = 7'b0011011;
1498// 64'b111111111111111111111111111110??????????????????????????????????: cntl1[6:0] = 7'b0011100;
1499// 64'b1111111111111111111111111111110?????????????????????????????????: cntl1[6:0] = 7'b0011101;
1500// 64'b11111111111111111111111111111110????????????????????????????????: cntl1[6:0] = 7'b0011110;
1501// 64'b111111111111111111111111111111110???????????????????????????????: cntl1[6:0] = 7'b0011111;
1502//
1503// 64'b1111111111111111111111111111111110??????????????????????????????: cntl1[6:0] = 7'b0100000;
1504// 64'b11111111111111111111111111111111110?????????????????????????????: cntl1[6:0] = 7'b0100001;
1505// 64'b111111111111111111111111111111111110????????????????????????????: cntl1[6:0] = 7'b0100010;
1506// 64'b1111111111111111111111111111111111110???????????????????????????: cntl1[6:0] = 7'b0100011;
1507// 64'b11111111111111111111111111111111111110??????????????????????????: cntl1[6:0] = 7'b0100100;
1508// 64'b111111111111111111111111111111111111110?????????????????????????: cntl1[6:0] = 7'b0100101;
1509// 64'b1111111111111111111111111111111111111110????????????????????????: cntl1[6:0] = 7'b0100110;
1510// 64'b11111111111111111111111111111111111111110???????????????????????: cntl1[6:0] = 7'b0100111;
1511//
1512// 64'b111111111111111111111111111111111111111110??????????????????????: cntl1[6:0] = 7'b0101000;
1513// 64'b1111111111111111111111111111111111111111110?????????????????????: cntl1[6:0] = 7'b0101001;
1514// 64'b11111111111111111111111111111111111111111110????????????????????: cntl1[6:0] = 7'b0101010;
1515// 64'b111111111111111111111111111111111111111111110???????????????????: cntl1[6:0] = 7'b0101011;
1516// 64'b1111111111111111111111111111111111111111111110??????????????????: cntl1[6:0] = 7'b0101100;
1517// 64'b11111111111111111111111111111111111111111111110?????????????????: cntl1[6:0] = 7'b0101101;
1518// 64'b111111111111111111111111111111111111111111111110????????????????: cntl1[6:0] = 7'b0101110;
1519// 64'b1111111111111111111111111111111111111111111111110???????????????: cntl1[6:0] = 7'b0101111;
1520//
1521// 64'b11111111111111111111111111111111111111111111111110??????????????: cntl1[6:0] = 7'b0110000;
1522// 64'b111111111111111111111111111111111111111111111111110?????????????: cntl1[6:0] = 7'b0110001;
1523// 64'b1111111111111111111111111111111111111111111111111110????????????: cntl1[6:0] = 7'b0110010;
1524// 64'b11111111111111111111111111111111111111111111111111110???????????: cntl1[6:0] = 7'b0110011;
1525// 64'b111111111111111111111111111111111111111111111111111110??????????: cntl1[6:0] = 7'b0110100;
1526// 64'b1111111111111111111111111111111111111111111111111111110?????????: cntl1[6:0] = 7'b0110101;
1527// 64'b11111111111111111111111111111111111111111111111111111110????????: cntl1[6:0] = 7'b0110110;
1528// 64'b111111111111111111111111111111111111111111111111111111110???????: cntl1[6:0] = 7'b0110111;
1529//
1530// 64'b1111111111111111111111111111111111111111111111111111111110??????: cntl1[6:0] = 7'b0111000;
1531// 64'b11111111111111111111111111111111111111111111111111111111110?????: cntl1[6:0] = 7'b0111001;
1532// 64'b111111111111111111111111111111111111111111111111111111111110????: cntl1[6:0] = 7'b0111010;
1533// 64'b1111111111111111111111111111111111111111111111111111111111110???: cntl1[6:0] = 7'b0111011;
1534// 64'b11111111111111111111111111111111111111111111111111111111111110??: cntl1[6:0] = 7'b0111100;
1535// 64'b111111111111111111111111111111111111111111111111111111111111110?: cntl1[6:0] = 7'b0111101;
1536// 64'b1111111111111111111111111111111111111111111111111111111111111110: cntl1[6:0] = 7'b0111110;
1537// 64'b1111111111111111111111111111111111111111111111111111111111111111: cntl1[6:0] = 7'b0111111;
1538//
1539// default: cntl1[6:0] = 7'b0000000;
1540//
1541// endcase
1542//
1543//end
1544
1545
1546// The count leading one (CNTL1) here must compute "n-1"
1547// leading 1's. To do this, each local byte will receive
1548// an offset input.
1549// Note : If clth[63] = 0 then CNTL1 is a DON'T CARE
1550
1551// byte
1552// clth[7:0] | cnt[2:0] ones
1553// -----------------|-----------------
1554// 0 x x x x x x x | 0 0 0 0
1555// 1 0 x x x x x x | 0 0 1 0
1556// 1 1 0 x x x x x | 0 1 0 0
1557// 1 1 1 0 x x x x | 0 1 1 0
1558// 1 1 1 1 0 x x x | 1 0 0 0
1559// 1 1 1 1 1 0 x x | 1 0 1 0
1560// 1 1 1 1 1 1 0 x | 1 1 0 0
1561// 1 1 1 1 1 1 1 0 | 1 1 1 0
1562// 1 1 1 1 1 1 1 1 | 0 0 0 1 (byte 0 is '111' here)
1563//
1564//
1565// Byte Ones_
1566// z7 z6 z5 z4 z3 z2 z1 z0 | cnt[6:3]
1567// -------------------------|-------------
1568// 1 x x x x x x x | 0 0 0 0
1569// 0 1 x x x x x x | 0 0 0 1
1570// 0 0 1 x x x x x | 0 0 1 0
1571// 0 0 0 1 x x x x | 0 0 1 1
1572// 0 0 0 0 1 x x x | 0 1 0 0
1573// 0 0 0 0 0 1 x x | 0 1 0 1
1574// 0 0 0 0 0 0 1 x | 0 1 1 0
1575// 0 0 0 0 0 0 0 1 | 0 1 1 1
1576// 0 0 0 0 0 0 0 0 | 1 x x x (divide ENDS!)
1577//
1578//
1579// Estimated critical path :
1580// NAND4 + NOR2 + INV + PE(3->4) + MUX4 + MUX2 + MUX3(merge CNTL0 + CNTL1)
1581
1582
1583
1584// ************************ BYTE 7 => 62:55 **************************
1585
1586assign b7_nand_74 = ~(clth[62] & clth[61] & clth[60] & clth[59]);
1587assign b7_nand_30 = ~(clth[58] & clth[57] & clth[56] & clth[55]);
1588
1589assign b7_ones = ~(b7_nand_74 | b7_nand_30);
1590assign b7_ones_ = ~b7_ones;
1591
1592assign b7_cnt1h[0] = ( clth[62] & ~clth[61] ) |
1593 ( clth[62] & clth[60] & ~clth[59]);
1594
1595assign b7_cnt1h[1] = ( clth[62] & clth[61] & ~clth[60] ) |
1596 ( clth[62] & clth[61] & ~clth[59]);
1597
1598assign b7_cnt1l[0] = ( clth[58] & ~clth[57] ) |
1599 ( clth[58] & clth[56] & ~clth[55]);
1600
1601assign b7_cnt1l[1] = ( clth[58] & clth[57] & ~clth[56] ) |
1602 ( clth[58] & clth[57] & ~clth[55]);
1603
1604assign b7_cnt1[0] = ( b7_nand_74 & b7_cnt1h[0]) |
1605 (~b7_nand_74 & b7_cnt1l[0]);
1606
1607assign b7_cnt1[1] = ( b7_nand_74 & b7_cnt1h[1]) |
1608 (~b7_nand_74 & b7_cnt1l[1]);
1609
1610assign b7_cnt1[2] = (~b7_nand_74 & b7_nand_30);
1611
1612
1613// ************************ BYTE 6 => 54:47 **************************
1614
1615assign b6_nand_74 = ~(clth[54] & clth[53] & clth[52] & clth[51]);
1616assign b6_nand_30 = ~(clth[50] & clth[49] & clth[48] & clth[47]);
1617
1618assign b6_ones = ~(b6_nand_74 | b6_nand_30);
1619assign b6_ones_ = ~b6_ones;
1620
1621assign b6_cnt1h[0] = ( clth[54] & ~clth[53] ) |
1622 ( clth[54] & clth[52] & ~clth[51]);
1623
1624assign b6_cnt1h[1] = ( clth[54] & clth[53] & ~clth[52] ) |
1625 ( clth[54] & clth[53] & ~clth[51]);
1626
1627assign b6_cnt1l[0] = ( clth[50] & ~clth[49] ) |
1628 ( clth[50] & clth[48] & ~clth[47]);
1629
1630assign b6_cnt1l[1] = ( clth[50] & clth[49] & ~clth[48] ) |
1631 ( clth[50] & clth[49] & ~clth[47]);
1632
1633assign b6_cnt1[0] = ( b6_nand_74 & b6_cnt1h[0]) |
1634 (~b6_nand_74 & b6_cnt1l[0]);
1635
1636assign b6_cnt1[1] = ( b6_nand_74 & b6_cnt1h[1]) |
1637 (~b6_nand_74 & b6_cnt1l[1]);
1638
1639assign b6_cnt1[2] = (~b6_nand_74 & b6_nand_30);
1640
1641
1642// ************************ BYTE 5 => 46:39 **************************
1643
1644assign b5_nand_74 = ~(clth[46] & clth[45] & clth[44] & clth[43]);
1645assign b5_nand_30 = ~(clth[42] & clth[41] & clth[40] & clth[39]);
1646
1647assign b5_ones = ~(b5_nand_74 | b5_nand_30);
1648assign b5_ones_ = ~b5_ones;
1649
1650assign b5_cnt1h[0] = ( clth[46] & ~clth[45] ) |
1651 ( clth[46] & clth[44] & ~clth[43]);
1652
1653assign b5_cnt1h[1] = ( clth[46] & clth[45] & ~clth[44] ) |
1654 ( clth[46] & clth[45] & ~clth[43]);
1655
1656assign b5_cnt1l[0] = ( clth[42] & ~clth[41] ) |
1657 ( clth[42] & clth[40] & ~clth[39]);
1658
1659assign b5_cnt1l[1] = ( clth[42] & clth[41] & ~clth[40] ) |
1660 ( clth[42] & clth[41] & ~clth[39]);
1661
1662assign b5_cnt1[0] = ( b5_nand_74 & b5_cnt1h[0]) |
1663 (~b5_nand_74 & b5_cnt1l[0]);
1664
1665assign b5_cnt1[1] = ( b5_nand_74 & b5_cnt1h[1]) |
1666 (~b5_nand_74 & b5_cnt1l[1]);
1667
1668assign b5_cnt1[2] = (~b5_nand_74 & b5_nand_30);
1669
1670
1671// ************************ BYTE 4 => 38:31 **************************
1672
1673assign b4_nand_74 = ~(clth[38] & clth[37] & clth[36] & clth[35]);
1674assign b4_nand_30 = ~(clth[34] & clth[33] & clth[32] & clth[31]);
1675
1676assign b4_ones = ~(b4_nand_74 | b4_nand_30);
1677assign b4_ones_ = ~b4_ones;
1678
1679assign b4_cnt1h[0] = ( clth[38] & ~clth[37] ) |
1680 ( clth[38] & clth[36] & ~clth[35]);
1681
1682assign b4_cnt1h[1] = ( clth[38] & clth[37] & ~clth[36] ) |
1683 ( clth[38] & clth[37] & ~clth[35]);
1684
1685assign b4_cnt1l[0] = ( clth[34] & ~clth[33] ) |
1686 ( clth[34] & clth[32] & ~clth[31]);
1687
1688assign b4_cnt1l[1] = ( clth[34] & clth[33] & ~clth[32] ) |
1689 ( clth[34] & clth[33] & ~clth[31]);
1690
1691assign b4_cnt1[0] = ( b4_nand_74 & b4_cnt1h[0]) |
1692 (~b4_nand_74 & b4_cnt1l[0]);
1693
1694assign b4_cnt1[1] = ( b4_nand_74 & b4_cnt1h[1]) |
1695 (~b4_nand_74 & b4_cnt1l[1]);
1696
1697assign b4_cnt1[2] = (~b4_nand_74 & b4_nand_30);
1698
1699
1700// ************************ BYTE 3 => 30:23 **************************
1701
1702assign b3_nand_74 = ~(clth[30] & clth[29] & clth[28] & clth[27]);
1703assign b3_nand_30 = ~(clth[26] & clth[25] & clth[24] & clth[23]);
1704
1705assign b3_ones = ~(b3_nand_74 | b3_nand_30);
1706assign b3_ones_ = ~b3_ones;
1707
1708assign b3_cnt1h[0] = ( clth[30] & ~clth[29] ) |
1709 ( clth[30] & clth[28] & ~clth[27]);
1710
1711assign b3_cnt1h[1] = ( clth[30] & clth[29] & ~clth[28] ) |
1712 ( clth[30] & clth[29] & ~clth[27]);
1713
1714assign b3_cnt1l[0] = ( clth[26] & ~clth[25] ) |
1715 ( clth[26] & clth[24] & ~clth[23]);
1716
1717assign b3_cnt1l[1] = ( clth[26] & clth[25] & ~clth[24] ) |
1718 ( clth[26] & clth[25] & ~clth[23]);
1719
1720assign b3_cnt1[0] = ( b3_nand_74 & b3_cnt1h[0]) |
1721 (~b3_nand_74 & b3_cnt1l[0]);
1722
1723assign b3_cnt1[1] = ( b3_nand_74 & b3_cnt1h[1]) |
1724 (~b3_nand_74 & b3_cnt1l[1]);
1725
1726assign b3_cnt1[2] = (~b3_nand_74 & b3_nand_30);
1727
1728
1729// ************************ BYTE 2 => 22:15 **************************
1730
1731assign b2_nand_74 = ~(clth[22] & clth[21] & clth[20] & clth[19]);
1732assign b2_nand_30 = ~(clth[18] & clth[17] & clth[16] & clth[15]);
1733
1734assign b2_ones = ~(b2_nand_74 | b2_nand_30);
1735assign b2_ones_ = ~b2_ones;
1736
1737assign b2_cnt1h[0] = ( clth[22] & ~clth[21] ) |
1738 ( clth[22] & clth[20] & ~clth[19]);
1739
1740assign b2_cnt1h[1] = ( clth[22] & clth[21] & ~clth[20] ) |
1741 ( clth[22] & clth[21] & ~clth[19]);
1742
1743assign b2_cnt1l[0] = ( clth[18] & ~clth[17] ) |
1744 ( clth[18] & clth[16] & ~clth[15]);
1745
1746assign b2_cnt1l[1] = ( clth[18] & clth[17] & ~clth[16] ) |
1747 ( clth[18] & clth[17] & ~clth[15]);
1748
1749assign b2_cnt1[0] = ( b2_nand_74 & b2_cnt1h[0]) |
1750 (~b2_nand_74 & b2_cnt1l[0]);
1751
1752assign b2_cnt1[1] = ( b2_nand_74 & b2_cnt1h[1]) |
1753 (~b2_nand_74 & b2_cnt1l[1]);
1754
1755assign b2_cnt1[2] = (~b2_nand_74 & b2_nand_30);
1756
1757
1758// ************************ BYTE 1 => 14:07 **************************
1759
1760assign b1_nand_74 = ~(clth[14] & clth[13] & clth[12] & clth[11]);
1761assign b1_nand_30 = ~(clth[10] & clth[9] & clth[8] & clth[7]);
1762
1763assign b1_ones = ~(b1_nand_74 | b1_nand_30);
1764assign b1_ones_ = ~b1_ones;
1765
1766assign b1_cnt1h[0] = ( clth[14] & ~clth[13] ) |
1767 ( clth[14] & clth[12] & ~clth[11]);
1768
1769assign b1_cnt1h[1] = ( clth[14] & clth[13] & ~clth[12] ) |
1770 ( clth[14] & clth[13] & ~clth[11]);
1771
1772assign b1_cnt1l[0] = ( clth[10] & ~clth[9] ) |
1773 ( clth[10] & clth[8] & ~clth[7]);
1774
1775assign b1_cnt1l[1] = ( clth[10] & clth[9] & ~clth[8] ) |
1776 ( clth[10] & clth[9] & ~clth[7]);
1777
1778assign b1_cnt1[0] = ( b1_nand_74 & b1_cnt1h[0]) |
1779 (~b1_nand_74 & b1_cnt1l[0]);
1780
1781assign b1_cnt1[1] = ( b1_nand_74 & b1_cnt1h[1]) |
1782 (~b1_nand_74 & b1_cnt1l[1]);
1783
1784assign b1_cnt1[2] = (~b1_nand_74 & b1_nand_30);
1785
1786
1787// ************************ BYTE 0 => 06:00 **************************
1788
1789// Note : Byte 0 is unique since cnt1[2:0] must be 3'b111 for byte 'all ones' case!
1790// 64'b1111111111111111111111111111111111111111111111111111111110??????: cntl1[6:0] = 7'b0111000;
1791// 64'b11111111111111111111111111111111111111111111111111111111110?????: cntl1[6:0] = 7'b0111001;
1792// 64'b111111111111111111111111111111111111111111111111111111111110????: cntl1[6:0] = 7'b0111010;
1793// 64'b1111111111111111111111111111111111111111111111111111111111110???: cntl1[6:0] = 7'b0111011;
1794// 64'b11111111111111111111111111111111111111111111111111111111111110??: cntl1[6:0] = 7'b0111100;
1795// 64'b111111111111111111111111111111111111111111111111111111111111110?: cntl1[6:0] = 7'b0111101;
1796// 64'b1111111111111111111111111111111111111111111111111111111111111110: cntl1[6:0] = 7'b0111110;
1797// 64'b1111111111111111111111111111111111111111111111111111111111111111: cntl1[6:0] = 7'b0111111;
1798
1799
1800assign b0_nand_74 = ~(clth[6] & clth[5] & clth[4] & clth[3]);
1801
1802assign b0_cnt1h[0] = ( clth[6] & ~clth[5] ) |
1803 ( clth[6] & clth[4] & ~clth[3]);
1804
1805assign b0_cnt1h[1] = ( clth[6] & clth[5] & ~clth[4] ) |
1806 ( clth[6] & clth[5] & ~clth[3]);
1807
1808assign b0_cnt1l[0] = ( clth[2] & ~clth[1] ) |
1809 ( clth[2] & clth[0] );
1810
1811assign b0_cnt1l[1] = ( clth[2] & clth[1] );
1812
1813assign b0_cnt1[0] = ( b0_nand_74 & b0_cnt1h[0]) |
1814 (~b0_nand_74 & b0_cnt1l[0]);
1815
1816assign b0_cnt1[1] = ( b0_nand_74 & b0_cnt1h[1]) |
1817 (~b0_nand_74 & b0_cnt1l[1]);
1818
1819assign b0_cnt1[2] = (~b0_nand_74 );
1820
1821
1822
1823// ************************ Global CNTL1 **************************
1824
1825assign b3_1sel = b3_ones_ ;
1826assign b2_1sel = ~b3_ones_ & b2_ones_ ;
1827assign b1_1sel = ~b3_ones_ & ~b2_ones_ & b1_ones_;
1828assign b0_1sel = ~b3_ones_ & ~b2_ones_ & ~b1_ones_;
1829
1830assign cntl1l[4:0] = ({5{b3_1sel}} & {2'b00,b3_cnt1[2:0]}) |
1831 ({5{b2_1sel}} & {2'b01,b2_cnt1[2:0]}) |
1832 ({5{b1_1sel}} & {2'b10,b1_cnt1[2:0]}) |
1833 ({5{b0_1sel}} & {2'b11,b0_cnt1[2:0]});
1834
1835
1836assign b7_1sel = b7_ones_ ;
1837assign b6_1sel = ~b7_ones_ & b6_ones_ ;
1838assign b5_1sel = ~b7_ones_ & ~b6_ones_ & b5_ones_;
1839assign b4_1sel = ~b7_ones_ & ~b6_ones_ & ~b5_ones_;
1840
1841assign cntl1h[4:0] = ({5{b7_1sel}} & {2'b00,b7_cnt1[2:0]}) |
1842 ({5{b6_1sel}} & {2'b01,b6_cnt1[2:0]}) |
1843 ({5{b5_1sel}} & {2'b10,b5_cnt1[2:0]}) |
1844 ({5{b4_1sel}} & {2'b11,b4_cnt1[2:0]});
1845
1846
1847
1848assign cntl1_selh = b7_ones_ | b6_ones_ | b5_ones_ | b4_ones_;
1849
1850assign cntl1[5:0] = ({6{ cntl1_selh}} & {1'b0, cntl1h[4:0]}) |
1851 ({6{~cntl1_selh}} & {1'b1, cntl1l[4:0]});
1852
1853
1854// * * * * * * * * * * * * End : Integer CNTL1 * * * * * * * * * * * * *
1855
1856
1857assign xsht_amt_sel10 = ~(fdd_pe_clth[63] & control_lth[0]) & fdc_pe_cycle[1];
1858assign xsht_amt_sel11 = (fdd_pe_clth[63] & control_lth[0]) & fdc_pe_cycle[1];
1859assign xsht_amt_sel20 = ~(fdd_pe_clth[63] & control_lth[0]) & fdc_pe_cycle[2];
1860assign xsht_amt_sel21 = (fdd_pe_clth[63] & control_lth[0]) & fdc_pe_cycle[2];
1861
1862assign xsht_amt_in[7:0] = ({8{engine_on }} & 8'b11111101 ) |
1863 ({8{xsht_amt_sel10}} & {1'b0 , cntl0[6:0]}) |
1864 ({8{xsht_amt_sel11}} & {2'b00, cntl1[5:0]}) |
1865 ({8{xsht_amt_sel20}} & {1'b1 ,~cntl0[6:0]}) |
1866 ({8{xsht_amt_sel21}} & {2'b11,~cntl1[5:0]});
1867
1868
1869assign pe_ndq[7:0] = pe_hamt_lth[7:0] + pe_xsht_amt[7:0] + 8'b0000_0001;
1870
1871assign pe_hamt_in[7:0] = ({8{ pe_hmux_sel[0]}} & 8'b00110100) | // FLT DP
1872 ({8{ pe_hmux_sel[1]}} & 8'b00010111) | // FLT SP
1873 ({8{fdc_pe_smux_sel[0]}} & 8'b00000001) | // INT neg B correction
1874 ({8{ pe_hmux_sel[2]}} & pe_ndq[7:0]); // SRT loop counter
1875
1876
1877
1878fgu_fdc_ctl_msff_ctl_macro__width_8 xsht_lth (
1879 .scan_in(xsht_lth_scanin),
1880 .scan_out(xsht_lth_scanout),
1881 .l1clk( l1clk_pm1 ),
1882 .din ( xsht_amt_in[7:0] ),
1883 .dout ( pe_xsht_amt[7:0] ),
1884 .siclk(siclk),
1885 .soclk(soclk));
1886
1887
1888fgu_fdc_ctl_msff_ctl_macro__width_8 hamt_lth (
1889 .scan_in(hamt_lth_scanin),
1890 .scan_out(hamt_lth_scanout),
1891 .l1clk( l1clk_pm1 ),
1892 .din ( pe_hamt_in[7:0] ),
1893 .dout ( pe_hamt_lth[7:0] ),
1894 .siclk(siclk),
1895 .soclk(soclk));
1896
1897
1898assign xsht_ctl_in[5:0] = ({6{xsht_amt_sel10}} & cntl0[5:0]) |
1899 ({6{xsht_amt_sel11}} & cntl1[5:0]) |
1900 ({6{xsht_amt_sel20}} & cntl0[5:0]) |
1901 ({6{xsht_amt_sel21}} & cntl1[5:0]);
1902
1903fgu_fdc_ctl_msff_ctl_macro__width_6 xcntl_lth (
1904 .scan_in(xcntl_lth_scanin),
1905 .scan_out(xcntl_lth_scanout),
1906 .l1clk( l1clk_pm1 ),
1907 .din ( xsht_ctl_in[5:0] ),
1908 .dout ( fdc_pe_xsht_ctl[5:0] ),
1909 .siclk(siclk),
1910 .soclk(soclk));
1911
1912
1913
1914
1915// *** Floating Point Rounding ***
1916
1917
1918assign engine_valid_fx1 = fac_div_valid_fx1 & ~fac_divq_valid_fx1;
1919assign engine_valid_fx2 = (queue_valid_lth_fx2 & (fac_div_valid_fx1 & fac_divq_valid_fx1)) | engine_valid_lth_fx2;
1920assign engine_valid_fx3 = (queue_valid_lth_fx3 & (fac_div_valid_fx1 & fac_divq_valid_fx1)) | engine_valid_lth_fx3;
1921
1922assign queue_valid_fx1 = ~fac_div_valid_fx1 & fac_divq_valid_fx1;
1923assign queue_valid_fx2 = queue_valid_lth_fx2 & ~(fac_div_valid_fx1 & fac_divq_valid_fx1);
1924//sign queue_valid_fx3 = queue_valid_lth_fx3 & ~(fac_div_valid_fx1 & fac_divq_valid_fx1);
1925
1926assign q2e_fx3p = (fac_div_valid_fx1 & fac_divq_valid_fx1) & ~queue_valid_lth_fx2 & ~queue_valid_lth_fx3;
1927
1928
1929fgu_fdc_ctl_msff_ctl_macro__width_4 xrnd_vld_lth (
1930 .scan_in(xrnd_vld_lth_scanin),
1931 .scan_out(xrnd_vld_lth_scanout),
1932 .l1clk( l1clk_pm1 ),
1933 .din ({engine_valid_fx1 ,engine_valid_fx2 ,queue_valid_fx1 ,queue_valid_fx2} ),
1934 .dout ({engine_valid_lth_fx2,engine_valid_lth_fx3,queue_valid_lth_fx2,queue_valid_lth_fx3}),
1935 .siclk(siclk),
1936 .soclk(soclk));
1937
1938
1939// SPARC v9 : pg 44
1940//
1941// RD | Round toward
1942// --- | ------------
1943// 00 | Nearest (even if tie)
1944// 01 | 0
1945// 10 | +INF
1946// 11 | -INF
1947
1948
1949assign eround_mode_in[1:0]= ({2{ engine_valid_fx3 }} & fpc_rd_mode_fx3[1:0]) |
1950 ({2{ q2e_fx3p}} & qround_mode_lth[1:0]) |
1951 ({2{~engine_valid_fx3 & ~q2e_fx3p}} & eround_mode_lth[1:0]);
1952
1953assign e_emin_in = ( engine_valid_fx3 & fpc_emin_fx3 ) |
1954 ( q2e_fx3p & q_emin_lth ) |
1955 ( ~engine_valid_fx3 & ~q2e_fx3p & fdc_emin_lth );
1956
1957
1958assign qround_mode_in[1:0]= ({2{ queue_valid_lth_fx3}} & fpc_rd_mode_fx3[1:0]) |
1959 ({2{~queue_valid_lth_fx3}} & qround_mode_lth[1:0]);
1960
1961assign q_emin_in = ( queue_valid_lth_fx3 & fpc_emin_fx3 ) |
1962 ( ~queue_valid_lth_fx3 & q_emin_lth );
1963
1964
1965assign float_sign_in = ( fac_div_valid_fx1 & ~fac_divq_valid_fx1 & incoming_sign_fx1 ) |
1966 ( fac_div_valid_fx1 & fac_divq_valid_fx1 & qcontrol_fx1[6] ) |
1967 ( ~fac_div_valid_fx1 & float_sign_lth );
1968
1969assign fdc_dec_exp_early = fdc_pte_cycle[0] & ~control_lth[2] & ~fdd_result[63] & ~flt_sqrte_kill_dec;
1970
1971assign inexact_in = fdc_pte_cycle[0] & ~control_lth[2] & (final_sticky | final_guard);
1972
1973
1974fgu_fdc_ctl_msff_ctl_macro__width_10 xrnd_lth (
1975 .scan_in(xrnd_lth_scanin),
1976 .scan_out(xrnd_lth_scanout),
1977 .l1clk( l1clk_pm1 ),
1978 .din ({float_sign_in , eround_mode_in[1:0] , qround_mode_in[1:0] , fdd_cla_zero64_ , sticky_pte1 , inexact_in , e_emin_in , q_emin_in }),
1979 .dout ({float_sign_lth , eround_mode_lth[1:0] , qround_mode_lth[1:0] , sticky_pte1 , sticky_pte0 , fdc_flt_inexact , fdc_emin_lth , q_emin_lth}),
1980 .siclk(siclk),
1981 .soclk(soclk));
1982
1983
1984assign fdc_flt_round[1] = ~control_lth[2] & ~control_lth[1]; // SP
1985assign fdc_flt_round[0] = ~control_lth[2] & control_lth[1]; // DP
1986
1987
1988assign flt_shift_sel_ = fdd_result[63] | fdc_emin_lth;
1989
1990
1991assign final_sticky = ( control_lth[1] & flt_shift_sel_ & (fdd_result[9] | sticky_pte0)) | // DP "1."
1992 ( control_lth[1] & ~flt_shift_sel_ & ( sticky_pte0)) | // DP "0."
1993 (~control_lth[1] & flt_shift_sel_ & (fdd_result[38] | sticky_pte0)) | // SP "1."
1994 (~control_lth[1] & ~flt_shift_sel_ & ( sticky_pte0)); // SP "0."
1995
1996assign final_guard = ( control_lth[1] & flt_shift_sel_ & fdd_result[10] ) | // DP "1."
1997 ( control_lth[1] & ~flt_shift_sel_ & fdd_result[9] ) | // DP "0."
1998 (~control_lth[1] & flt_shift_sel_ & fdd_result[39] ) | // SP "1."
1999 (~control_lth[1] & ~flt_shift_sel_ & fdd_result[38] ); // SP "0."
2000
2001assign final_lsb = ( control_lth[1] & flt_shift_sel_ & fdd_result[11] ) | // DP "1."
2002 ( control_lth[1] & ~flt_shift_sel_ & fdd_result[10] ) | // DP "0."
2003 (~control_lth[1] & flt_shift_sel_ & fdd_result[40] ) | // SP "1."
2004 (~control_lth[1] & ~flt_shift_sel_ & fdd_result[39] ); // SP "0."
2005
2006
2007assign flt_rnd00_en = ~control_lth[2] & (eround_mode_lth[1:0] == 2'b00);
2008assign flt_rnd1x_en = (~control_lth[2] & (eround_mode_lth[1:0] == 2'b10) & ~float_sign_lth) |
2009 (~control_lth[2] & (eround_mode_lth[1:0] == 2'b11) & float_sign_lth);
2010
2011assign fdc_flt_increment = ( flt_rnd00_en & final_guard & final_sticky ) |
2012 ( flt_rnd00_en & final_guard & final_lsb) |
2013 ( flt_rnd1x_en & final_guard ) |
2014 ( flt_rnd1x_en & final_sticky );
2015
2016
2017
2018
2019// *** Floating Point Square Root Special Case ***
2020
2021// For an odd exponent Square Root, the mantissa is shifted one bit position right.
2022// In most cases, the final result will end up in the form of "0.1". We then normalize
2023// this result and decrement the result exponent. However, if the mantissa is all ONES,
2024// this does not hold. If you take the square root of 0.1111111...1 (after the 1-bit shift),
2025// the result will move closer to 1.00000000. In the Round to +INF only,
2026// the rounded result will be 1.000000 and no decrementing of the exponent will occur.
2027
2028// 1=DP , 0=SP SQRTE
2029assign fsqrt_fract_all_ones = (~fac_div_control_fx1[1] & fac_div_control_fx1[3] & fpf_hi_bof_fx1 ) |
2030 ( fac_div_control_fx1[1] & fac_div_control_fx1[3] & fpf_hi_bof_fx1 & fpf_lo_bof_fx1);
2031
2032assign fsqrt_special_in = ( fac_div_valid_fx1 & ~fac_divq_valid_fx1 & fsqrt_fract_all_ones) |
2033 ( fac_div_valid_fx1 & fac_divq_valid_fx1 & qcontrol_fx1[7] ) |
2034 (~fac_div_valid_fx1 & fsqrt_special_lth );
2035
2036fgu_fdc_ctl_msff_ctl_macro__width_1 spec_sqrt_lth (
2037 .scan_in(spec_sqrt_lth_scanin),
2038 .scan_out(spec_sqrt_lth_scanout),
2039 .l1clk( l1clk_pm1 ),
2040 .din ( fsqrt_special_in ),
2041 .dout ( fsqrt_special_lth ),
2042 .siclk(siclk),
2043 .soclk(soclk));
2044
2045assign flt_sqrte_kill_dec = fsqrt_special_lth & (eround_mode_lth[1:0] == 2'b10); // +inf
2046
2047
2048
2049
2050// *** FDX Custom ***
2051
2052
2053assign cla_64 = fdd_fdx_din0 ^ fdd_fdx_din1 ^ fdd_fdx_cin64;
2054
2055assign cin_in_raw = (~fdc_asign_lth & ~fdc_bsign_lth & ~cla_64 ) |
2056 (~fdc_asign_lth & fdc_bsign_lth & cla_64 ) |
2057 ( fdc_asign_lth & ~fdc_bsign_lth & ~cla_64 & fdd_cla_zero64_) |
2058 ( fdc_asign_lth & fdc_bsign_lth & ~fdd_cla_zero64_) |
2059 ( fdc_asign_lth & fdc_bsign_lth & cla_64 );
2060
2061assign fdc_fdx_cin_in = fdc_pte_cycle2 & cin_in_raw;
2062
2063
2064
2065// *** FDQ00 Custom ***
2066
2067assign fdq00_sum[3:0] = fdd_fdq00_10_sum[4:1]; // s0[65:62]
2068assign fdq00_carry[3:0] = fdd_fdq00_10_carry[4:1]; // c0[65:62]
2069
2070assign pr00[0] = fdq00_sum[0] | fdq00_carry[0];
2071assign pr00[3:1] = fdq00_sum[3:1] + fdq00_carry[3:1];
2072
2073assign fdc_qsel00[0] = ( pr00[3] & ~pr00[2]) | // 10.0x ; 10.1x
2074 ( pr00[3] & ~pr00[1]) | // 10.0x ; 11.0x
2075 ( pr00[3] & ~pr00[0]); // 11.10
2076
2077assign fdc_qsel00[1] = ( pr00[3] & pr00[2] & pr00[1] & pr00[0]) | // 11.11
2078 (~pr00[3] & ~pr00[2] & ~pr00[1] & ~pr00[0]); // 00.00
2079
2080
2081assign fdc_qsel00[2] = (~pr00[3] & pr00[2]) | // 01.1x ; 01.0x
2082 (~pr00[3] & pr00[1]) | // 01.1x ; 00.1x
2083 (~pr00[3] & pr00[0]); // 00.01
2084
2085
2086// *** FDQ1p Custom ***
2087
2088assign pr1p[0] = fdd_fdq1p_sum[0] | fdd_fdq1p_carry[0];
2089assign pr1p[3:1] = fdd_fdq1p_sum[3:1] + fdd_fdq1p_carry[3:1];
2090
2091assign qsel1p[0] = ( pr1p[3] & ~pr1p[2]) | // 10.0x ; 10.1x
2092 ( pr1p[3] & ~pr1p[1]) | // 10.0x ; 11.0x
2093 ( pr1p[3] & ~pr1p[0]); // 11.10
2094
2095assign qsel1p[1] = ( pr1p[3] & pr1p[2] & pr1p[1] & pr1p[0]) | // 11.11
2096 (~pr1p[3] & ~pr1p[2] & ~pr1p[1] & ~pr1p[0]); // 00.00
2097
2098
2099assign qsel1p[2] = (~pr1p[3] & pr1p[2]) | // 01.1x ; 01.0x
2100 (~pr1p[3] & pr1p[1]) | // 01.1x ; 00.1x
2101 (~pr1p[3] & pr1p[0]); // 00.01
2102
2103
2104// *** FDQ10 Custom ***
2105
2106assign fdq10_sum[3:0] = fdd_fdq00_10_sum[3:0]; // s0[64:61]
2107assign fdq10_carry[3:0] = fdd_fdq00_10_carry[3:0]; // c0[64:61]
2108
2109assign pr10[0] = fdq10_sum[0] | fdq10_carry[0];
2110assign pr10[3:1] = fdq10_sum[3:1] + fdq10_carry[3:1];
2111
2112assign qsel10[0] = ( pr10[3] & ~pr10[2]) | // 10.0x ; 10.1x
2113 ( pr10[3] & ~pr10[1]) | // 10.0x ; 11.0x
2114 ( pr10[3] & ~pr10[0]); // 11.10
2115
2116assign qsel10[1] = ( pr10[3] & pr10[2] & pr10[1] & pr10[0]) | // 11.11
2117 (~pr10[3] & ~pr10[2] & ~pr10[1] & ~pr10[0]); // 00.00
2118
2119
2120assign qsel10[2] = (~pr10[3] & pr10[2]) | // 01.1x ; 01.0x
2121 (~pr10[3] & pr10[1]) | // 01.1x ; 00.1x
2122 (~pr10[3] & pr10[0]); // 00.01
2123
2124
2125// *** FDQ1n Custom ***
2126
2127assign pr1n[0] = fdd_fdq1n_sum[0] | fdd_fdq1n_carry[0];
2128assign pr1n[3:1] = fdd_fdq1n_sum[3:1] + fdd_fdq1n_carry[3:1];
2129
2130assign qsel1n[0] = ( pr1n[3] & ~pr1n[2]) | // 10.0x ; 10.1x
2131 ( pr1n[3] & ~pr1n[1]) | // 10.0x ; 11.0x
2132 ( pr1n[3] & ~pr1n[0]); // 11.10
2133
2134assign qsel1n[1] = ( pr1n[3] & pr1n[2] & pr1n[1] & pr1n[0]) | // 11.11
2135 (~pr1n[3] & ~pr1n[2] & ~pr1n[1] & ~pr1n[0]); // 00.00
2136
2137
2138assign qsel1n[2] = (~pr1n[3] & pr1n[2]) | // 01.1x ; 01.0x
2139 (~pr1n[3] & pr1n[1]) | // 01.1x ; 00.1x
2140 (~pr1n[3] & pr1n[0]); // 00.01
2141
2142
2143
2144assign engine_start = fac_div_valid_fx1 | fdc_pe_cycle3;
2145
2146assign fdc_qsel1[2:0] = ({3{~engine_start & fdc_qsel00[0]}} & qsel1p[2:0]) |
2147 ({3{~engine_start & fdc_qsel00[1]}} & qsel10[2:0]) |
2148 ({3{~engine_start & fdc_qsel00[2]}} & qsel1n[2:0]);
2149
2150
2151// *** Misc Logic from FDD ***
2152
2153assign fdc_q_in[1] = ( ~engine_start & fdc_qsel00[0] & fdc_bsign_lth ) |
2154 ( ~engine_start & fdc_qsel00[2] & fdc_bsign_lth_);
2155
2156assign fdc_qm1_in[1] = ( ~engine_start & fdc_qsel00[0] & fdc_bsign_lth_) |
2157 ( ~engine_start & fdc_qsel00[2] & fdc_bsign_lth );
2158
2159assign fdc_q_in[0] = ( fdc_qsel1[0] & fdc_bsign_lth ) |
2160 ( fdc_qsel1[2] & fdc_bsign_lth_);
2161
2162assign fdc_qm1_in[0] = ( fdc_qsel1[0] & fdc_bsign_lth_) |
2163 ( fdc_qsel1[2] & fdc_bsign_lth );
2164
2165
2166supply0 vss;
2167supply1 vdd;
2168
2169
2170// fixscan start:
2171assign spares_scanin = scan_in ;
2172assign qdata_lth_scanin = spares_scanout ;
2173assign cntl_lth_scanin = qdata_lth_scanout ;
2174assign ovlf_lth_scanin = cntl_lth_scanout ;
2175assign stall_lth_scanin = ovlf_lth_scanout ;
2176assign data_lth_scanin = stall_lth_scanout ;
2177assign xsht_lth_scanin = data_lth_scanout ;
2178assign hamt_lth_scanin = xsht_lth_scanout ;
2179assign xcntl_lth_scanin = hamt_lth_scanout ;
2180assign xrnd_vld_lth_scanin = xcntl_lth_scanout ;
2181assign xrnd_lth_scanin = xrnd_vld_lth_scanout ;
2182assign spec_sqrt_lth_scanin = xrnd_lth_scanout ;
2183assign scan_out = spec_sqrt_lth_scanout ;
2184// fixscan end:
2185endmodule
2186
2187
2188
2189
2190
2191
2192// any PARAMS parms go into naming of macro
2193
2194module fgu_fdc_ctl_l1clkhdr_ctl_macro (
2195 l2clk,
2196 l1en,
2197 pce_ov,
2198 stop,
2199 se,
2200 l1clk);
2201
2202
2203 input l2clk;
2204 input l1en;
2205 input pce_ov;
2206 input stop;
2207 input se;
2208 output l1clk;
2209
2210
2211
2212
2213
2214cl_sc1_l1hdr_8x c_0 (
2215
2216
2217 .l2clk(l2clk),
2218 .pce(l1en),
2219 .l1clk(l1clk),
2220 .se(se),
2221 .pce_ov(pce_ov),
2222 .stop(stop)
2223);
2224
2225
2226
2227endmodule
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237// Description: Spare gate macro for control blocks
2238//
2239// Param num controls the number of times the macro is added
2240// flops=0 can be used to use only combination spare logic
2241
2242
2243module fgu_fdc_ctl_spare_ctl_macro__num_3 (
2244 l1clk,
2245 scan_in,
2246 siclk,
2247 soclk,
2248 scan_out);
2249wire si_0;
2250wire so_0;
2251wire spare0_flop_unused;
2252wire spare0_buf_32x_unused;
2253wire spare0_nand3_8x_unused;
2254wire spare0_inv_8x_unused;
2255wire spare0_aoi22_4x_unused;
2256wire spare0_buf_8x_unused;
2257wire spare0_oai22_4x_unused;
2258wire spare0_inv_16x_unused;
2259wire spare0_nand2_16x_unused;
2260wire spare0_nor3_4x_unused;
2261wire spare0_nand2_8x_unused;
2262wire spare0_buf_16x_unused;
2263wire spare0_nor2_16x_unused;
2264wire spare0_inv_32x_unused;
2265wire si_1;
2266wire so_1;
2267wire spare1_flop_unused;
2268wire spare1_buf_32x_unused;
2269wire spare1_nand3_8x_unused;
2270wire spare1_inv_8x_unused;
2271wire spare1_aoi22_4x_unused;
2272wire spare1_buf_8x_unused;
2273wire spare1_oai22_4x_unused;
2274wire spare1_inv_16x_unused;
2275wire spare1_nand2_16x_unused;
2276wire spare1_nor3_4x_unused;
2277wire spare1_nand2_8x_unused;
2278wire spare1_buf_16x_unused;
2279wire spare1_nor2_16x_unused;
2280wire spare1_inv_32x_unused;
2281wire si_2;
2282wire so_2;
2283wire spare2_flop_unused;
2284wire spare2_buf_32x_unused;
2285wire spare2_nand3_8x_unused;
2286wire spare2_inv_8x_unused;
2287wire spare2_aoi22_4x_unused;
2288wire spare2_buf_8x_unused;
2289wire spare2_oai22_4x_unused;
2290wire spare2_inv_16x_unused;
2291wire spare2_nand2_16x_unused;
2292wire spare2_nor3_4x_unused;
2293wire spare2_nand2_8x_unused;
2294wire spare2_buf_16x_unused;
2295wire spare2_nor2_16x_unused;
2296wire spare2_inv_32x_unused;
2297
2298
2299input l1clk;
2300input scan_in;
2301input siclk;
2302input soclk;
2303output scan_out;
2304
2305cl_sc1_msff_8x spare0_flop (.l1clk(l1clk),
2306 .siclk(siclk),
2307 .soclk(soclk),
2308 .si(si_0),
2309 .so(so_0),
2310 .d(1'b0),
2311 .q(spare0_flop_unused));
2312assign si_0 = scan_in;
2313
2314cl_u1_buf_32x spare0_buf_32x (.in(1'b1),
2315 .out(spare0_buf_32x_unused));
2316cl_u1_nand3_8x spare0_nand3_8x (.in0(1'b1),
2317 .in1(1'b1),
2318 .in2(1'b1),
2319 .out(spare0_nand3_8x_unused));
2320cl_u1_inv_8x spare0_inv_8x (.in(1'b1),
2321 .out(spare0_inv_8x_unused));
2322cl_u1_aoi22_4x spare0_aoi22_4x (.in00(1'b1),
2323 .in01(1'b1),
2324 .in10(1'b1),
2325 .in11(1'b1),
2326 .out(spare0_aoi22_4x_unused));
2327cl_u1_buf_8x spare0_buf_8x (.in(1'b1),
2328 .out(spare0_buf_8x_unused));
2329cl_u1_oai22_4x spare0_oai22_4x (.in00(1'b1),
2330 .in01(1'b1),
2331 .in10(1'b1),
2332 .in11(1'b1),
2333 .out(spare0_oai22_4x_unused));
2334cl_u1_inv_16x spare0_inv_16x (.in(1'b1),
2335 .out(spare0_inv_16x_unused));
2336cl_u1_nand2_16x spare0_nand2_16x (.in0(1'b1),
2337 .in1(1'b1),
2338 .out(spare0_nand2_16x_unused));
2339cl_u1_nor3_4x spare0_nor3_4x (.in0(1'b0),
2340 .in1(1'b0),
2341 .in2(1'b0),
2342 .out(spare0_nor3_4x_unused));
2343cl_u1_nand2_8x spare0_nand2_8x (.in0(1'b1),
2344 .in1(1'b1),
2345 .out(spare0_nand2_8x_unused));
2346cl_u1_buf_16x spare0_buf_16x (.in(1'b1),
2347 .out(spare0_buf_16x_unused));
2348cl_u1_nor2_16x spare0_nor2_16x (.in0(1'b0),
2349 .in1(1'b0),
2350 .out(spare0_nor2_16x_unused));
2351cl_u1_inv_32x spare0_inv_32x (.in(1'b1),
2352 .out(spare0_inv_32x_unused));
2353
2354cl_sc1_msff_8x spare1_flop (.l1clk(l1clk),
2355 .siclk(siclk),
2356 .soclk(soclk),
2357 .si(si_1),
2358 .so(so_1),
2359 .d(1'b0),
2360 .q(spare1_flop_unused));
2361assign si_1 = so_0;
2362
2363cl_u1_buf_32x spare1_buf_32x (.in(1'b1),
2364 .out(spare1_buf_32x_unused));
2365cl_u1_nand3_8x spare1_nand3_8x (.in0(1'b1),
2366 .in1(1'b1),
2367 .in2(1'b1),
2368 .out(spare1_nand3_8x_unused));
2369cl_u1_inv_8x spare1_inv_8x (.in(1'b1),
2370 .out(spare1_inv_8x_unused));
2371cl_u1_aoi22_4x spare1_aoi22_4x (.in00(1'b1),
2372 .in01(1'b1),
2373 .in10(1'b1),
2374 .in11(1'b1),
2375 .out(spare1_aoi22_4x_unused));
2376cl_u1_buf_8x spare1_buf_8x (.in(1'b1),
2377 .out(spare1_buf_8x_unused));
2378cl_u1_oai22_4x spare1_oai22_4x (.in00(1'b1),
2379 .in01(1'b1),
2380 .in10(1'b1),
2381 .in11(1'b1),
2382 .out(spare1_oai22_4x_unused));
2383cl_u1_inv_16x spare1_inv_16x (.in(1'b1),
2384 .out(spare1_inv_16x_unused));
2385cl_u1_nand2_16x spare1_nand2_16x (.in0(1'b1),
2386 .in1(1'b1),
2387 .out(spare1_nand2_16x_unused));
2388cl_u1_nor3_4x spare1_nor3_4x (.in0(1'b0),
2389 .in1(1'b0),
2390 .in2(1'b0),
2391 .out(spare1_nor3_4x_unused));
2392cl_u1_nand2_8x spare1_nand2_8x (.in0(1'b1),
2393 .in1(1'b1),
2394 .out(spare1_nand2_8x_unused));
2395cl_u1_buf_16x spare1_buf_16x (.in(1'b1),
2396 .out(spare1_buf_16x_unused));
2397cl_u1_nor2_16x spare1_nor2_16x (.in0(1'b0),
2398 .in1(1'b0),
2399 .out(spare1_nor2_16x_unused));
2400cl_u1_inv_32x spare1_inv_32x (.in(1'b1),
2401 .out(spare1_inv_32x_unused));
2402
2403cl_sc1_msff_8x spare2_flop (.l1clk(l1clk),
2404 .siclk(siclk),
2405 .soclk(soclk),
2406 .si(si_2),
2407 .so(so_2),
2408 .d(1'b0),
2409 .q(spare2_flop_unused));
2410assign si_2 = so_1;
2411
2412cl_u1_buf_32x spare2_buf_32x (.in(1'b1),
2413 .out(spare2_buf_32x_unused));
2414cl_u1_nand3_8x spare2_nand3_8x (.in0(1'b1),
2415 .in1(1'b1),
2416 .in2(1'b1),
2417 .out(spare2_nand3_8x_unused));
2418cl_u1_inv_8x spare2_inv_8x (.in(1'b1),
2419 .out(spare2_inv_8x_unused));
2420cl_u1_aoi22_4x spare2_aoi22_4x (.in00(1'b1),
2421 .in01(1'b1),
2422 .in10(1'b1),
2423 .in11(1'b1),
2424 .out(spare2_aoi22_4x_unused));
2425cl_u1_buf_8x spare2_buf_8x (.in(1'b1),
2426 .out(spare2_buf_8x_unused));
2427cl_u1_oai22_4x spare2_oai22_4x (.in00(1'b1),
2428 .in01(1'b1),
2429 .in10(1'b1),
2430 .in11(1'b1),
2431 .out(spare2_oai22_4x_unused));
2432cl_u1_inv_16x spare2_inv_16x (.in(1'b1),
2433 .out(spare2_inv_16x_unused));
2434cl_u1_nand2_16x spare2_nand2_16x (.in0(1'b1),
2435 .in1(1'b1),
2436 .out(spare2_nand2_16x_unused));
2437cl_u1_nor3_4x spare2_nor3_4x (.in0(1'b0),
2438 .in1(1'b0),
2439 .in2(1'b0),
2440 .out(spare2_nor3_4x_unused));
2441cl_u1_nand2_8x spare2_nand2_8x (.in0(1'b1),
2442 .in1(1'b1),
2443 .out(spare2_nand2_8x_unused));
2444cl_u1_buf_16x spare2_buf_16x (.in(1'b1),
2445 .out(spare2_buf_16x_unused));
2446cl_u1_nor2_16x spare2_nor2_16x (.in0(1'b0),
2447 .in1(1'b0),
2448 .out(spare2_nor2_16x_unused));
2449cl_u1_inv_32x spare2_inv_32x (.in(1'b1),
2450 .out(spare2_inv_32x_unused));
2451assign scan_out = so_2;
2452
2453
2454
2455endmodule
2456
2457
2458
2459
2460
2461
2462// any PARAMS parms go into naming of macro
2463
2464module fgu_fdc_ctl_msff_ctl_macro__width_8 (
2465 din,
2466 l1clk,
2467 scan_in,
2468 siclk,
2469 soclk,
2470 dout,
2471 scan_out);
2472wire [7:0] fdin;
2473wire [6:0] so;
2474
2475 input [7:0] din;
2476 input l1clk;
2477 input scan_in;
2478
2479
2480 input siclk;
2481 input soclk;
2482
2483 output [7:0] dout;
2484 output scan_out;
2485assign fdin[7:0] = din[7:0];
2486
2487
2488
2489
2490
2491
2492dff #(8) d0_0 (
2493.l1clk(l1clk),
2494.siclk(siclk),
2495.soclk(soclk),
2496.d(fdin[7:0]),
2497.si({scan_in,so[6:0]}),
2498.so({so[6:0],scan_out}),
2499.q(dout[7:0])
2500);
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513endmodule
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527// any PARAMS parms go into naming of macro
2528
2529module fgu_fdc_ctl_msff_ctl_macro__width_10 (
2530 din,
2531 l1clk,
2532 scan_in,
2533 siclk,
2534 soclk,
2535 dout,
2536 scan_out);
2537wire [9:0] fdin;
2538wire [8:0] so;
2539
2540 input [9:0] din;
2541 input l1clk;
2542 input scan_in;
2543
2544
2545 input siclk;
2546 input soclk;
2547
2548 output [9:0] dout;
2549 output scan_out;
2550assign fdin[9:0] = din[9:0];
2551
2552
2553
2554
2555
2556
2557dff #(10) d0_0 (
2558.l1clk(l1clk),
2559.siclk(siclk),
2560.soclk(soclk),
2561.d(fdin[9:0]),
2562.si({scan_in,so[8:0]}),
2563.so({so[8:0],scan_out}),
2564.q(dout[9:0])
2565);
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578endmodule
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592// any PARAMS parms go into naming of macro
2593
2594module fgu_fdc_ctl_msff_ctl_macro__width_4 (
2595 din,
2596 l1clk,
2597 scan_in,
2598 siclk,
2599 soclk,
2600 dout,
2601 scan_out);
2602wire [3:0] fdin;
2603wire [2:0] so;
2604
2605 input [3:0] din;
2606 input l1clk;
2607 input scan_in;
2608
2609
2610 input siclk;
2611 input soclk;
2612
2613 output [3:0] dout;
2614 output scan_out;
2615assign fdin[3:0] = din[3:0];
2616
2617
2618
2619
2620
2621
2622dff #(4) d0_0 (
2623.l1clk(l1clk),
2624.siclk(siclk),
2625.soclk(soclk),
2626.d(fdin[3:0]),
2627.si({scan_in,so[2:0]}),
2628.so({so[2:0],scan_out}),
2629.q(dout[3:0])
2630);
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643endmodule
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657// any PARAMS parms go into naming of macro
2658
2659module fgu_fdc_ctl_msff_ctl_macro__width_9 (
2660 din,
2661 l1clk,
2662 scan_in,
2663 siclk,
2664 soclk,
2665 dout,
2666 scan_out);
2667wire [8:0] fdin;
2668wire [7:0] so;
2669
2670 input [8:0] din;
2671 input l1clk;
2672 input scan_in;
2673
2674
2675 input siclk;
2676 input soclk;
2677
2678 output [8:0] dout;
2679 output scan_out;
2680assign fdin[8:0] = din[8:0];
2681
2682
2683
2684
2685
2686
2687dff #(9) d0_0 (
2688.l1clk(l1clk),
2689.siclk(siclk),
2690.soclk(soclk),
2691.d(fdin[8:0]),
2692.si({scan_in,so[7:0]}),
2693.so({so[7:0],scan_out}),
2694.q(dout[8:0])
2695);
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708endmodule
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722// any PARAMS parms go into naming of macro
2723
2724module fgu_fdc_ctl_msff_ctl_macro__width_6 (
2725 din,
2726 l1clk,
2727 scan_in,
2728 siclk,
2729 soclk,
2730 dout,
2731 scan_out);
2732wire [5:0] fdin;
2733wire [4:0] so;
2734
2735 input [5:0] din;
2736 input l1clk;
2737 input scan_in;
2738
2739
2740 input siclk;
2741 input soclk;
2742
2743 output [5:0] dout;
2744 output scan_out;
2745assign fdin[5:0] = din[5:0];
2746
2747
2748
2749
2750
2751
2752dff #(6) d0_0 (
2753.l1clk(l1clk),
2754.siclk(siclk),
2755.soclk(soclk),
2756.d(fdin[5:0]),
2757.si({scan_in,so[4:0]}),
2758.so({so[4:0],scan_out}),
2759.q(dout[5:0])
2760);
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773endmodule
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787// any PARAMS parms go into naming of macro
2788
2789module fgu_fdc_ctl_msff_ctl_macro__width_1 (
2790 din,
2791 l1clk,
2792 scan_in,
2793 siclk,
2794 soclk,
2795 dout,
2796 scan_out);
2797wire [0:0] fdin;
2798
2799 input [0:0] din;
2800 input l1clk;
2801 input scan_in;
2802
2803
2804 input siclk;
2805 input soclk;
2806
2807 output [0:0] dout;
2808 output scan_out;
2809assign fdin[0:0] = din[0:0];
2810
2811
2812
2813
2814
2815
2816dff #(1) d0_0 (
2817.l1clk(l1clk),
2818.siclk(siclk),
2819.soclk(soclk),
2820.d(fdin[0:0]),
2821.si(scan_in),
2822.so(scan_out),
2823.q(dout[0:0])
2824);
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837endmodule
2838
2839
2840
2841
2842
2843
2844
2845