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

Subversion Repositories sparc64soc

[/] [sparc64soc/] [trunk/] [T1-FPU/] [fpu_out_dp.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dmitryr
// ========== Copyright Header Begin ==========================================
2
// 
3
// OpenSPARC T1 Processor File: fpu_out_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
//      FPU output datapath.
24
//
25
///////////////////////////////////////////////////////////////////////////////
26
 
27
 
28
module fpu_out_dp (
29
        dest_rdy,
30
        req_thread,
31
        div_exc_out,
32
        d8stg_fdivd,
33
        d8stg_fdivs,
34
        div_sign_out,
35
        div_exp_out,
36
        div_frac_out,
37
        mul_exc_out,
38
        m6stg_fmul_dbl_dst,
39
        m6stg_fmuls,
40
        mul_sign_out,
41
        mul_exp_out,
42
        mul_frac_out,
43
        add_exc_out,
44
        a6stg_fcmpop,
45
        add_cc_out,
46
        add_fcc_out,
47
        a6stg_dbl_dst,
48
        a6stg_sng_dst,
49
        a6stg_long_dst,
50
        a6stg_int_dst,
51
        add_sign_out,
52
        add_exp_out,
53
        add_frac_out,
54
        rclk,
55
 
56
        fp_cpx_data_ca,
57
 
58
        se,
59
        si,
60
        so
61
);
62
 
63
 
64
input [2:0]      dest_rdy;               // pipe with result request this cycle
65
input [1:0]      req_thread;             // thread ID of result req this cycle
66
input [4:0]      div_exc_out;            // divide pipe result- exception flags
67
input           d8stg_fdivd;            // divide double- divide stage 8
68
input           d8stg_fdivs;            // divide single- divide stage 8
69
input           div_sign_out;           // divide sign output
70
input [10:0]     div_exp_out;            // divide exponent output
71
input [51:0]     div_frac_out;           // divide fraction output
72
input [4:0]      mul_exc_out;            // multiply pipe result- exception flags
73
input           m6stg_fmul_dbl_dst;     // double precision multiply result
74
input           m6stg_fmuls;            // fmuls- multiply 6 stage
75
input           mul_sign_out;           // multiply sign output
76
input [10:0]     mul_exp_out;            // multiply exponent output
77
input [51:0]     mul_frac_out;           // multiply fraction output
78
input [4:0]      add_exc_out;            // add pipe result- exception flags
79
input           a6stg_fcmpop;           // compare- add 6 stage
80
input [1:0]      add_cc_out;             // add pipe result- condition
81
input [1:0]      add_fcc_out;            // add pipe input fcc passed through
82
input           a6stg_dbl_dst;          // float double result- add 6 stage
83
input           a6stg_sng_dst;          // float single result- add 6 stage
84
input           a6stg_long_dst;         // 64bit integer result- add 6 stage
85
input           a6stg_int_dst;          // 32bit integer result- add 6 stage
86
input           add_sign_out;           // add sign output
87
input [10:0]     add_exp_out;            // add exponent output
88
input [63:0]     add_frac_out;           // add fraction output
89
input           rclk;           // global clock
90
 
91
output [144:0]   fp_cpx_data_ca;         // FPU result to CPX
92
 
93
input           se;                     // scan_enable
94
input           si;                     // scan in
95
output          so;                     // scan out
96
 
97
 
98
wire [63:0]      add_out;
99
wire [63:0]      mul_out;
100
wire [63:0]      div_out;
101
wire [7:0]       fp_cpx_data_ca_84_77_in;
102
wire [76:0]      fp_cpx_data_ca_76_0_in;
103
wire [7:0]       fp_cpx_data_ca_84_77;
104
wire [76:0]      fp_cpx_data_ca_76_0;
105
wire [144:0]     fp_cpx_data_ca;
106
 
107
 
108
wire se_l;
109
 
110
assign se_l = ~se;
111
 
112
clken_buf  ckbuf_out_dp (
113
  .clk(clk),
114
  .rclk(rclk),
115
  .enb_l(1'b0),
116
  .tmb_l(se_l)
117
  );
118
 
119
///////////////////////////////////////////////////////////////////////////////
120
//
121
//      Add pipe output.
122
//
123
///////////////////////////////////////////////////////////////////////////////
124
 
125
assign add_out[63:0]= ({64{a6stg_dbl_dst}}
126
                            & {add_sign_out, add_exp_out[10:0],
127
                                add_frac_out[62:11]})
128
                | ({64{a6stg_sng_dst}}
129
                            & {add_sign_out, add_exp_out[7:0],
130
                                add_frac_out[62:40], 32'b0})
131
                | ({64{a6stg_long_dst}}
132
                            & add_frac_out[63:0])
133
                | ({64{a6stg_int_dst}}
134
                            & {add_frac_out[63:32], 32'b0});
135
 
136
 
137
///////////////////////////////////////////////////////////////////////////////
138
//
139
//      Multiply output.
140
//
141
///////////////////////////////////////////////////////////////////////////////
142
 
143
assign mul_out[63:0]= ({64{m6stg_fmul_dbl_dst}}
144
                            & {mul_sign_out, mul_exp_out[10:0],
145
                                mul_frac_out[51:0]})
146
                | ({64{m6stg_fmuls}}
147
                            & {mul_sign_out, mul_exp_out[7:0],
148
                                mul_frac_out[51:29], 32'b0});
149
 
150
 
151
///////////////////////////////////////////////////////////////////////////////
152
//
153
//      Divide output.
154
//
155
///////////////////////////////////////////////////////////////////////////////
156
 
157
assign div_out[63:0]= ({64{d8stg_fdivd}}
158
                            & {div_sign_out, div_exp_out[10:0],
159
                                div_frac_out[51:0]})
160
                | ({64{d8stg_fdivs}}
161
                            & {div_sign_out, div_exp_out[7:0],
162
                                div_frac_out[51:29], 32'b0});
163
 
164
 
165
///////////////////////////////////////////////////////////////////////////////
166
//
167
//      Choose the output data.
168
//
169
//      Input to the CPX data (CA) stage.
170
//
171
///////////////////////////////////////////////////////////////////////////////
172
 
173
assign fp_cpx_data_ca_84_77_in[7:0]= ({8{(|dest_rdy)}}
174
                            & {1'b1, 4'b1000, 1'b0, req_thread[1:0]});
175
 
176
assign fp_cpx_data_ca_76_0_in[76:0]= ({77{dest_rdy[2]}}
177
                            & {div_exc_out[4:0], 8'b0, div_out[63:0]})
178
                | ({77{dest_rdy[1]}}
179
                            & {mul_exc_out[4:0], 8'b0, mul_out[63:0]})
180
                | ({77{dest_rdy[0]}}
181
                            & {add_exc_out[4:0], 2'b0, a6stg_fcmpop,
182
                                add_cc_out[1:0], add_fcc_out[1:0], 1'b0,
183
                                add_out[63:0]});
184
 
185
dff_s #(8) i_fp_cpx_data_ca_84_77 (
186
        .din    (fp_cpx_data_ca_84_77_in[7:0]),
187
        .clk    (clk),
188
 
189
        .q      (fp_cpx_data_ca_84_77[7:0]),
190
 
191
        .se     (se),
192
        .si     (),
193
        .so     ()
194
);
195
 
196
dff_s #(77) i_fp_cpx_data_ca_76_0 (
197
        .din    (fp_cpx_data_ca_76_0_in[76:0]),
198
        .clk    (clk),
199
 
200
        .q      (fp_cpx_data_ca_76_0[76:0]),
201
 
202
        .se     (se),
203
        .si     (),
204
        .so     ()
205
);
206
 
207
assign fp_cpx_data_ca[144:0]= {fp_cpx_data_ca_84_77[7:3],
208
                                3'b0,
209
                                fp_cpx_data_ca_84_77[2:0],
210
                                57'b0,
211
                                fp_cpx_data_ca_76_0[76:0]};
212
 
213
 
214
endmodule
215
 
216
 

powered by: WebSVN 2.1.0

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