OpenCores
URL https://opencores.org/ocsvn/sparc64soc/sparc64soc/trunk

Subversion Repositories sparc64soc

[/] [sparc64soc/] [trunk/] [T1-FPU/] [fpu_add_exp_dp.v] - Blame information for rev 5

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dmitryr
// ========== Copyright Header Begin ==========================================
2
// 
3
// OpenSPARC T1 Processor File: fpu_add_exp_dp.v
4
// Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
5
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
6
// 
7
// The above named program is free software; you can redistribute it and/or
8
// modify it under the terms of the GNU General Public
9
// License version 2 as published by the Free Software Foundation.
10
// 
11
// The above named program is distributed in the hope that it will be 
12
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
// General Public License for more details.
15
// 
16
// You should have received a copy of the GNU General Public
17
// License along with this work; if not, write to the Free Software
18
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19
// 
20
// ========== Copyright Header End ============================================
21
///////////////////////////////////////////////////////////////////////////////
22
//
23
//      Add pipeline exponent datapath.
24
//
25
///////////////////////////////////////////////////////////////////////////////
26
 
27
 
28
module fpu_add_exp_dp (
29
        inq_in1,
30
        inq_in2,
31
        inq_op,
32
        inq_op_7,
33
        a1stg_step,
34
        a1stg_faddsubd,
35
        a1stg_faddsubs,
36
        a1stg_fsdtoix,
37
        a6stg_step,
38
        a1stg_fstod,
39
        a1stg_fdtos,
40
        a1stg_fstoi,
41
        a1stg_fstox,
42
        a1stg_fdtoi,
43
        a1stg_fdtox,
44
        a2stg_fsdtoix_fdtos,
45
        a2stg_faddsubop,
46
        a2stg_fitos,
47
        a2stg_fitod,
48
        a2stg_fxtos,
49
        a2stg_fxtod,
50
        a3stg_exp_7ff,
51
        a3stg_exp_ff,
52
        a3stg_exp_add,
53
        a3stg_inc_exp_inv,
54
        a3stg_same_exp_inv,
55
        a3stg_dec_exp_inv,
56
        a3stg_faddsubop,
57
        a3stg_fdtos_inv,
58
        a4stg_fixtos_fxtod_inv,
59
        a4stg_shl_cnt,
60
        a4stg_denorm_inv,
61
        a4stg_rndadd_cout,
62
        add_exp_out_expinc,
63
        add_exp_out_exp,
64
        add_exp_out_exp1,
65
        a4stg_in_of,
66
        add_exp_out_expadd,
67
        a4stg_dblop,
68
        a4stg_to_0_inv,
69
        fadd_clken_l,
70
        rclk,
71
 
72
        a1stg_expadd3_11,
73
        a1stg_expadd1_11_0,
74
        a1stg_expadd4_inv,
75
        a1stg_expadd2_5_0,
76
        a2stg_exp,
77
        a2stg_expadd,
78
        a3stg_exp_10_0,
79
        a4stg_exp_11_0,
80
        add_exp_out,
81
 
82
        se,
83
        si,
84
        so
85
);
86
 
87
 
88
input [62:52]   inq_in1;                // request operand 1 to op pipes
89
input [62:52]   inq_in2;                // request operand 2 to op pipes
90
input [1:0]      inq_op;                 // request opcode[1:0]
91
input           inq_op_7;               // request opcode[7]
92
input           a1stg_step;             // add pipe load
93
input           a1stg_faddsubd;         // add/subtract double- add 1 stg
94
input           a1stg_faddsubs;         // add/subtract single- add 1 stg
95
input           a1stg_fsdtoix;          // float to integer convert- add 1 stg
96
input           a6stg_step;             // advance the add pipe
97
input           a1stg_fstod;            // fstod- add 1 stage
98
input           a1stg_fdtos;            // fdtos- add 1 stage
99
input           a1stg_fstoi;            // fstoi- add 1 stage
100
input           a1stg_fstox;            // fstox- add 1 stage
101
input           a1stg_fdtoi;            // fdtoi- add 1 stage
102
input           a1stg_fdtox;            // fdtox- add 1 stage
103
input           a2stg_fsdtoix_fdtos;    // float to integer convert- add 2 stg
104
input           a2stg_faddsubop;        // float add or subtract- add 2 stage
105
input           a2stg_fitos;            // fitos- add 2 stage
106
input           a2stg_fitod;            // fitod- add 2 stage
107
input           a2stg_fxtos;            // fxtos- add 2 stage
108
input           a2stg_fxtod;            // fxtod- add 2 stage
109
input           a3stg_exp_7ff;          // select line to a3stg_exp
110
input           a3stg_exp_ff;           // select line to a3stg_exp
111
input           a3stg_exp_add;          // select line to a3stg_exp
112
input           a3stg_inc_exp_inv;      // increment the exponent- add 3 stg
113
input           a3stg_same_exp_inv;     // keep the exponent- add 3 stg
114
input           a3stg_dec_exp_inv;      // decrement the exponent- add 3 stg
115
input           a3stg_faddsubop;        // add/subtract- add 3 stage
116
input           a3stg_fdtos_inv;        // double to single convert- add 3 stg
117
input           a4stg_fixtos_fxtod_inv; // int to single/double cvt- add 4 stg
118
input [5:0]      a4stg_shl_cnt;          // postnorm shift left count- add 4 stg
119
input           a4stg_denorm_inv;       // 0 the exponent
120
input           a4stg_rndadd_cout;      // fraction rounding adder carry out
121
input           add_exp_out_expinc;     // select line to add_exp_out
122
input           add_exp_out_exp;        // select line to add_exp_out
123
input           add_exp_out_exp1;       // select line to add_exp_out
124
input           a4stg_in_of;            // add overflow- select exp out
125
input           add_exp_out_expadd;     // select line to add_exp_out
126
input           a4stg_dblop;            // double precision operation- add 4 stg
127
input           a4stg_to_0_inv;         // result to infinity on overflow
128
input           fadd_clken_l;           // add pipe clk enable - asserted low
129
input           rclk;           // global clock
130
 
131
output          a1stg_expadd3_11;       // exponent adder 3 output- add 1 stage
132
output [11:0]    a1stg_expadd1_11_0;     // exponent adder 1 output- add 1 stage
133
output [10:0]    a1stg_expadd4_inv;      // exponent adder 4 output- add 1 stage
134
output [5:0]     a1stg_expadd2_5_0;      // exponent adder 2 output- add 1 stage
135
output [11:0]    a2stg_exp;              // exponent- add 2 stage
136
output [12:0]    a2stg_expadd;           // exponent adder- add 2 stage
137
output [10:0]    a3stg_exp_10_0;         // exponent adder- add 3 stage
138
output [11:0]    a4stg_exp_11_0;         // exponent adder- add 4 stage
139
output [10:0]    add_exp_out;            // add exponent output
140
 
141
input           se;                     // scan_enable
142
input           si;                     // scan in
143
output          so;                     // scan out
144
 
145
 
146
wire [62:52]    a1stg_in1;
147
wire [62:52]    a1stg_in1a;
148
wire [62:52]    a1stg_in2;
149
wire [62:52]    a1stg_in2a;
150
wire [12:0]      a1stg_dp_sngop;
151
wire [12:0]      a1stg_dp_sngopa;
152
wire [12:0]      a1stg_dp_dblop;
153
wire [12:0]      a1stg_dp_dblopa;
154
wire [9:7]      a1stg_op_7;
155
wire            a1stg_op_7_0;
156
wire [10:0]      a1stg_expadd3_in1;
157
wire [10:0]      a1stg_expadd3_in2_in;
158
wire [10:0]      a1stg_expadd3_in2;
159
wire [12:0]      a1stg_expadd3;
160
wire            a1stg_expadd3_11;
161
wire [12:0]      a1stg_expadd1_in1;
162
wire [12:0]      a1stg_expadd1_in2;
163
wire [12:0]      a1stg_expadd1;
164
wire [11:0]     a1stg_expadd1_11_0;
165
wire [12:0]      a1stg_expadd4_in1;
166
wire [12:0]      a1stg_expadd4_in2;
167
wire [12:0]      a1stg_expadd4;
168
wire [10:0]      a1stg_expadd4_inv;
169
wire [12:0]      a1stg_expadd2_in1;
170
wire [12:0]      a1stg_expadd2;
171
wire [5:0]      a1stg_expadd2_5_0;
172
wire [12:0]      a2stg_exp_in;
173
wire [11:0]      a2stg_exp;
174
wire [12:0]      a2stg_expa;
175
wire [12:0]      a2stg_expadd_in2_in;
176
wire [12:0]      a2stg_expadd_in2;
177
wire [12:0]      a2stg_expadd;
178
wire [12:0]      a3stg_exp_in;
179
wire [12:0]      a3stg_exp;
180
wire [10:0]     a3stg_exp_10_0;
181
wire [12:0]      a3stg_exp_plus1;
182
wire [12:0]      a3stg_exp_minus1;
183
wire [12:0]      a4stg_exp_pre1_in;
184
wire [12:0]      a4stg_exp_pre1;
185
wire [12:0]      a4stg_exp_pre3_in;
186
wire [12:0]      a4stg_exp_pre3;
187
wire [12:0]      a4stg_exp_pre2_in;
188
wire [12:0]      a4stg_exp_pre2;
189
wire [12:0]      a4stg_exp_pre4_in;
190
wire [12:0]      a4stg_exp_pre4;
191
wire [12:0]      a4stg_exp;
192
wire [11:0]      a4stg_exp_11_0;
193
wire [12:0]      a4stg_exp2;
194
wire [12:0]      a4stg_expinc;
195
wire [12:0]      a4stg_expadd_in2;
196
wire [12:0]      a4stg_expadd;
197
wire [12:0]      a4stg_expshl;
198
wire [10:0]      add_exp_out_in1;
199
wire [10:0]      add_exp_out1;
200
wire [10:0]      add_exp_out_in2;
201
wire [10:0]      add_exp_out2;
202
wire [10:0]      add_exp_out_in3;
203
wire [10:0]      add_exp_out3;
204
wire [10:0]      add_exp_out4;
205
wire [10:0]      add_exp_out;
206
 
207
 
208
// 6/23/03: Removed tm_l input port. Using locally generated se_l instead for cken_buf 
209
wire se_l;
210
 
211
assign se_l = ~se;
212
 
213
clken_buf  ckbuf_add_exp_dp (
214
  .clk(clk),
215
  .rclk(rclk),
216
  .enb_l(fadd_clken_l),
217
  .tmb_l(se_l)
218
  );
219
 
220
///////////////////////////////////////////////////////////////////////////////
221
//
222
//      Add exponent inputs.
223
//
224
//      Add input stage.
225
//
226
///////////////////////////////////////////////////////////////////////////////
227
 
228
dffe_s #(11) i_a1stg_in1 (
229
        .din    (inq_in1[62:52]),
230
        .en     (a1stg_step),
231
        .clk    (clk),
232
 
233
        .q      (a1stg_in1[62:52]),
234
 
235
        .se     (se),
236
        .si     (),
237
        .so     ()
238
);
239
 
240
dffe_s #(11) i_a1stg_in1a (
241
        .din    (inq_in1[62:52]),
242
        .en     (a1stg_step),
243
        .clk    (clk),
244
 
245
        .q      (a1stg_in1a[62:52]),
246
 
247
        .se     (se),
248
        .si     (),
249
        .so     ()
250
);
251
 
252
dffe_s #(11) i_a1stg_in2 (
253
        .din    (inq_in2[62:52]),
254
        .en     (a1stg_step),
255
        .clk    (clk),
256
 
257
        .q      (a1stg_in2[62:52]),
258
 
259
        .se     (se),
260
        .si     (),
261
        .so     ()
262
);
263
 
264
dffe_s #(11) i_a1stg_in2a (
265
        .din    (inq_in2[62:52]),
266
        .en     (a1stg_step),
267
        .clk    (clk),
268
 
269
        .q      (a1stg_in2a[62:52]),
270
 
271
        .se     (se),
272
        .si     (),
273
        .so     ()
274
);
275
 
276
dffe_s #(13) i_a1stg_dp_sngop (
277
        .din    ({13{inq_op[0]}}),
278
        .en     (a1stg_step),
279
        .clk    (clk),
280
 
281
        .q      (a1stg_dp_sngop[12:0]),
282
 
283
        .se     (se),
284
        .si     (),
285
        .so     ()
286
);
287
 
288
dffe_s #(13) i_a1stg_dp_sngopa (
289
        .din    ({13{inq_op[0]}}),
290
        .en     (a1stg_step),
291
        .clk    (clk),
292
 
293
        .q      (a1stg_dp_sngopa[12:0]),
294
 
295
        .se     (se),
296
        .si     (),
297
        .so     ()
298
);
299
 
300
dffe_s #(13) i_a1stg_dp_dblop (
301
        .din    ({13{inq_op[1]}}),
302
        .en     (a1stg_step),
303
        .clk    (clk),
304
 
305
        .q      (a1stg_dp_dblop[12:0]),
306
 
307
        .se     (se),
308
        .si     (),
309
        .so     ()
310
);
311
 
312
dffe_s #(13) i_a1stg_dp_dblopa (
313
        .din    ({13{inq_op[1]}}),
314
        .en     (a1stg_step),
315
        .clk    (clk),
316
 
317
        .q      (a1stg_dp_dblopa[12:0]),
318
 
319
        .se     (se),
320
        .si     (),
321
        .so     ()
322
);
323
 
324
dffe_s #(4) i_a1stg_op_7 (
325
        .din    ({4{inq_op_7}}),
326
        .en     (a1stg_step),
327
        .clk    (clk),
328
 
329
        .q      ({a1stg_op_7[9:7], a1stg_op_7_0}),
330
 
331
        .se     (se),
332
        .si     (),
333
        .so     ()
334
);
335
 
336
dffe_s #(11) i_a1stg_expadd3_in1 (
337
        .din    (inq_in1[62:52]),
338
        .en     (a1stg_step),
339
        .clk    (clk),
340
 
341
        .q      (a1stg_expadd3_in1[10:0]),
342
 
343
        .se     (se),
344
        .si     (),
345
        .so     ()
346
);
347
 
348
assign a1stg_expadd3_in2_in[10:0]= (~(inq_in2[62:52]
349
                & {8'hff, {3{inq_op[1]}}}));
350
 
351
dffe_s #(11) i_a1stg_expadd3_in2 (
352
        .din    (a1stg_expadd3_in2_in[10:0]),
353
        .en     (a1stg_step),
354
        .clk    (clk),
355
 
356
        .q      (a1stg_expadd3_in2[10:0]),
357
 
358
        .se     (se),
359
        .si     (),
360
        .so     ()
361
);
362
 
363
 
364
///////////////////////////////////////////////////////////////////////////////
365
//
366
//      Add pipe exponent comparison.
367
//
368
//      Add stage 1.
369
//
370
///////////////////////////////////////////////////////////////////////////////
371
 
372
assign a1stg_expadd3[12:0]= ({2'b00, a1stg_expadd3_in1[10:0]}
373
                        + {2'b11, a1stg_expadd3_in2[10:0]}
374
                        + 13'h0001);
375
assign a1stg_expadd3_11 = a1stg_expadd3[11];
376
 
377
 
378
assign a1stg_expadd1_in1[12:0]= (a1stg_dp_dblopa
379
                            & {2'b0, a1stg_in1[62:52]})
380
                | (a1stg_dp_sngopa
381
                            & {5'b0, a1stg_in1[62:55]})
382
                | {3'b0, a1stg_op_7[9:7], 6'b0, a1stg_op_7_0};
383
 
384
assign a1stg_expadd1_in2[12:0]= (~((a1stg_dp_dblop
385
                            & {2'b0, a1stg_in2[62:52]})
386
                | (a1stg_dp_sngop
387
                            & {5'b0, a1stg_in2[62:55]})));
388
 
389
assign a1stg_expadd1[12:0]= (a1stg_expadd1_in1[12:0]
390
                        + a1stg_expadd1_in2[12:0]
391
                        + 13'h0001);
392
assign a1stg_expadd1_11_0[11:0] = a1stg_expadd1[11:0];
393
 
394
assign a1stg_expadd4_in1[12:0]= (a1stg_dp_dblopa
395
                            & {2'b0, a1stg_in2a[62:52]})
396
                | (a1stg_dp_sngopa
397
                            & {5'b0, a1stg_in2a[62:55]});
398
 
399
assign a1stg_expadd4_in2[12:0]= (~((a1stg_dp_dblop
400
                            & {2'b0, a1stg_in1a[62:52]})
401
                | (a1stg_dp_sngop
402
                            & {5'b0, a1stg_in1a[62:55]})));
403
 
404
assign a1stg_expadd4[12:0]= (a1stg_expadd4_in1[12:0]
405
                        + a1stg_expadd4_in2[12:0]
406
                        + 13'h0001);
407
assign a1stg_expadd4_inv[10:0]= (~a1stg_expadd4[10:0]);
408
 
409
assign a1stg_expadd2_in1[12:0]= (a1stg_dp_dblopa
410
                            & {2'b0, a1stg_in2a[62:52]})
411
                | (a1stg_dp_sngopa
412
                            & {5'b0, a1stg_in2a[62:55]});
413
 
414
assign a1stg_expadd2[12:0]= (a1stg_expadd2_in1[12:0]
415
                        + 13'h0001);
416
assign a1stg_expadd2_5_0[5:0] = a1stg_expadd2[5:0];
417
 
418
assign a2stg_exp_in[12:0]= ({13{(a1stg_faddsubd && (!a1stg_expadd1[12]))}}
419
                            & {2'b0, a1stg_in1a[62:52]})
420
                | ({13{(a1stg_faddsubs && (!a1stg_expadd1[12]))}}
421
                            & {5'b0, a1stg_in1a[62:55]})
422
                | ({13{(a1stg_faddsubd && a1stg_expadd1[12])}}
423
                            & {2'b0, a1stg_in2[62:52]})
424
                | ({13{a1stg_fdtos}}
425
                            & {2'b0, a1stg_in2[62:52]})
426
                | ({13{(a1stg_faddsubs && a1stg_expadd1[12])}}
427
                            & {5'b0, a1stg_in2[62:55]})
428
                | ({13{a1stg_fstod}}
429
                            & {5'b0, a1stg_in2[62:55]})
430
                | ({13{a1stg_fsdtoix}}
431
                            & a1stg_expadd2[12:0]);
432
 
433
dffe_s #(12) i_a2stg_exp (
434
        .din    (a2stg_exp_in[11:0]),
435
        .en     (a6stg_step),
436
        .clk    (clk),
437
 
438
        .q      (a2stg_exp[11:0]),
439
 
440
        .se     (se),
441
        .si     (),
442
        .so     ()
443
);
444
 
445
dffe_s #(13) i_a2stg_expa (
446
        .din    (a2stg_exp_in[12:0]),
447
        .en     (a6stg_step),
448
        .clk    (clk),
449
 
450
        .q      (a2stg_expa[12:0]),
451
 
452
        .se     (se),
453
        .si     (),
454
        .so     ()
455
);
456
 
457
 
458
///////////////////////////////////////////////////////////////////////////////
459
//
460
//      Add pipe exponent adjustment.
461
//
462
//      Add stage 1.
463
//
464
///////////////////////////////////////////////////////////////////////////////
465
 
466
assign a2stg_expadd_in2_in[12:0]= ({13{a1stg_fstod}}
467
                            & 13'h0380)
468
                | ({13{a1stg_fdtos}}
469
                            & (~13'h0380))
470
                | ({13{a1stg_fstoi}}
471
                            & (~13'h009f))
472
                | ({13{a1stg_fstox}}
473
                            & (~13'h00bf))
474
                | ({13{a1stg_fdtoi}}
475
                            & (~13'h041f))
476
                | ({13{a1stg_fdtox}}
477
                            & (~13'h043f));
478
 
479
dffe_s #(13) i_a2stg_expadd2_in2 (
480
        .din    (a2stg_expadd_in2_in[12:0]),
481
        .en     (a6stg_step),
482
        .clk    (clk),
483
 
484
        .q      (a2stg_expadd_in2[12:0]),
485
 
486
        .se     (se),
487
        .si     (),
488
        .so     ()
489
);
490
 
491
 
492
///////////////////////////////////////////////////////////////////////////////
493
//
494
//      Add pipe exponent adjustment.
495
//
496
//      Add stage 2.
497
//
498
///////////////////////////////////////////////////////////////////////////////
499
 
500
assign a2stg_expadd[12:0]= (a2stg_expa[12:0]
501
                        + a2stg_expadd_in2[12:0]
502
                        + {12'b0, a2stg_fsdtoix_fdtos});
503
 
504
assign a3stg_exp_in[12:0]= ({13{a2stg_faddsubop}}
505
                            & a2stg_expa[12:0])
506
                | ({13{a2stg_fitos}}
507
                            & 13'h009e)
508
                | ({13{a2stg_fitod}}
509
                            & 13'h041e)
510
                | ({13{a2stg_fxtos}}
511
                            & 13'h00be)
512
                | ({13{a2stg_fxtod}}
513
                            & 13'h043e)
514
                | ({13{a3stg_exp_7ff}}
515
                            & 13'h07ff)
516
                | ({13{a3stg_exp_ff}}
517
                            & 13'h00ff)
518
                | ({13{a3stg_exp_add}}
519
                            & (a2stg_expadd[12:0] & {13{(!a2stg_expadd[11])}}));
520
 
521
dffe_s #(13) i_a3stg_exp (
522
        .din    (a3stg_exp_in[12:0]),
523
        .en     (a6stg_step),
524
        .clk    (clk),
525
 
526
        .q      (a3stg_exp[12:0]),
527
 
528
        .se     (se),
529
        .si     (),
530
        .so     ()
531
);
532
 
533
assign a3stg_exp_10_0[10:0] = a3stg_exp[10:0];
534
 
535
 
536
 
537
///////////////////////////////////////////////////////////////////////////////
538
//
539
//      Add pipe exponent increment/decrement adjustment.
540
//
541
//      Add stage 3.
542
//
543
///////////////////////////////////////////////////////////////////////////////
544
 
545
assign a3stg_exp_plus1[12:0]= a3stg_exp[12:0] + 13'h0001;
546
 
547
assign a3stg_exp_minus1[12:0]= a3stg_exp[12:0] - 13'h0001;
548
 
549
assign a4stg_exp_pre1_in[12:0]= ({13{(a3stg_faddsubop && a6stg_step
550
                                        && (!a3stg_inc_exp_inv))}}
551
                            & a3stg_exp_plus1[12:0]);
552
 
553
dff_s #(13) i_a4stg_exp_pre1 (
554
        .din    (a4stg_exp_pre1_in[12:0]),
555
        .clk    (clk),
556
 
557
        .q      (a4stg_exp_pre1[12:0]),
558
 
559
        .se     (se),
560
        .si     (),
561
        .so     ()
562
);
563
 
564
assign a4stg_exp_pre3_in[12:0]= ({13{(a3stg_faddsubop && a6stg_step
565
                                        && (!a3stg_dec_exp_inv))}}
566
                            & a3stg_exp_minus1[12:0]);
567
 
568
dff_s #(13) i_a4stg_exp_pre3 (
569
        .din    (a4stg_exp_pre3_in[12:0]),
570
        .clk    (clk),
571
 
572
        .q      (a4stg_exp_pre3[12:0]),
573
 
574
        .se     (se),
575
        .si     (),
576
        .so     ()
577
);
578
 
579
assign a4stg_exp_pre2_in[12:0]= ({13{((!a3stg_fdtos_inv) && a6stg_step)}}
580
                            & a3stg_exp[12:0])
581
                | ({13{((!a4stg_fixtos_fxtod_inv) && a6stg_step)}}
582
                            & a4stg_expshl[12:0])
583
                | ({13{(!a6stg_step)}}
584
                            & a4stg_exp[12:0]);
585
 
586
dff_s #(13) i_a4stg_exp_pre2 (
587
        .din    (a4stg_exp_pre2_in[12:0]),
588
        .clk    (clk),
589
 
590
        .q      (a4stg_exp_pre2[12:0]),
591
 
592
        .se     (se),
593
        .si     (),
594
        .so     ()
595
);
596
 
597
assign a4stg_exp_pre4_in[12:0]= ({13{(a3stg_faddsubop && a6stg_step
598
                                        && (!a3stg_same_exp_inv))}}
599
                            & a3stg_exp[12:0]);
600
 
601
dff_s #(13) i_a4stg_exp_pre4 (
602
        .din    (a4stg_exp_pre4_in[12:0]),
603
        .clk    (clk),
604
 
605
        .q      (a4stg_exp_pre4[12:0]),
606
 
607
        .se     (se),
608
        .si     (),
609
        .so     ()
610
);
611
 
612
dffe_s #(13) i_a4stg_exp2 (
613
        .din    (a3stg_exp[12:0]),
614
        .en     (a6stg_step),
615
        .clk    (clk),
616
 
617
        .q      (a4stg_exp2[12:0]),
618
 
619
        .se     (se),
620
        .si     (),
621
        .so     ()
622
);
623
 
624
 
625
///////////////////////////////////////////////////////////////////////////////
626
//
627
//      Add pipe exponent rounding increment.
628
//
629
//      Add stage 4.
630
//
631
///////////////////////////////////////////////////////////////////////////////
632
 
633
assign a4stg_exp[12:0]= (a4stg_exp_pre1[12:0]
634
                | a4stg_exp_pre2[12:0]
635
                | a4stg_exp_pre3[12:0]
636
                | a4stg_exp_pre4[12:0]);
637
 
638
assign a4stg_exp_11_0[11:0] = a4stg_exp[11:0];
639
 
640
assign a4stg_expinc[12:0]= a4stg_exp[12:0] + 13'h0001;
641
 
642
 
643
///////////////////////////////////////////////////////////////////////////////
644
//
645
//      Add pipe exponent adjustment for post normalization left shift.
646
//
647
//      Add stage 4.
648
//
649
///////////////////////////////////////////////////////////////////////////////
650
 
651
assign a4stg_expadd_in2[12:0]= (~{7'b0, a4stg_shl_cnt[5:0]});
652
 
653
assign a4stg_expadd[12:0]= (a4stg_exp2[12:0]
654
                        + a4stg_expadd_in2[12:0]
655
                        + 13'h0001);
656
 
657
 
658
///////////////////////////////////////////////////////////////////////////////
659
//
660
//      Add pipe exponent output.
661
//
662
//      Add stage 4.
663
//
664
///////////////////////////////////////////////////////////////////////////////
665
 
666
assign a4stg_expshl[12:0]= (a4stg_expadd[12:0] & {13{a4stg_denorm_inv}});
667
 
668
assign add_exp_out_in1[10:0]= (~(({11{add_exp_out_exp1}}
669
                            & a4stg_exp[10:0])
670
                | ({11{a4stg_in_of}}
671
                            & {{3{a4stg_dblop}}, 7'h7f, a4stg_to_0_inv})
672
                | ({11{add_exp_out_expadd}}
673
                            & a4stg_expshl[10:0])));
674
 
675
dffe_s #(11) i_add_exp_out1 (
676
        .din    (add_exp_out_in1[10:0]),
677
        .en     (a6stg_step),
678
        .clk    (clk),
679
 
680
        .q      (add_exp_out1[10:0]),
681
 
682
        .se     (se),
683
        .si     (),
684
        .so     ()
685
);
686
 
687
assign add_exp_out_in2[10:0]= (~({11{(add_exp_out_expinc
688
                                        && a4stg_rndadd_cout)}}
689
                            & a4stg_expinc[10:0]));
690
 
691
dffe_s #(11) i_add_exp_out2 (
692
        .din    (add_exp_out_in2[10:0]),
693
        .en     (a6stg_step),
694
        .clk    (clk),
695
 
696
        .q      (add_exp_out2[10:0]),
697
 
698
        .se     (se),
699
        .si     (),
700
        .so     ()
701
);
702
 
703
assign add_exp_out_in3[10:0]= (~({11{add_exp_out_exp}}
704
                            & a4stg_exp[10:0]));
705
 
706
dffe_s #(11) i_add_exp_out3 (
707
        .din    (add_exp_out_in3[10:0]),
708
        .en     (a6stg_step),
709
        .clk    (clk),
710
 
711
        .q      (add_exp_out3[10:0]),
712
 
713
        .se     (se),
714
        .si     (),
715
        .so     ()
716
);
717
 
718
dffe_s #(11) i_add_exp_out4 (
719
        .din    ({11{a4stg_rndadd_cout}}),
720
        .en     (a6stg_step),
721
        .clk    (clk),
722
 
723
        .q      (add_exp_out4[10:0]),
724
 
725
        .se     (se),
726
        .si     (),
727
        .so     ()
728
);
729
 
730
assign add_exp_out[10:0]= (~(add_exp_out1[10:0]
731
                & add_exp_out2[10:0]
732
                & (add_exp_out3[10:0] | add_exp_out4[10:0])));
733
 
734
 
735
endmodule
736
 
737
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.