1 | // ========== Copyright Header Begin ========================================== |
---|
2 | // |
---|
3 | // OpenSPARC T1 Processor File: fpu_in_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 input datapath. |
---|
24 | // |
---|
25 | /////////////////////////////////////////////////////////////////////////////// |
---|
26 | |
---|
27 | module fpu_in_dp ( |
---|
28 | fp_data_rdy, |
---|
29 | fpio_data_px2_116_112, |
---|
30 | fpio_data_px2_79_72, |
---|
31 | fpio_data_px2_67_0, |
---|
32 | inq_fwrd, |
---|
33 | inq_fwrd_inv, |
---|
34 | inq_bp, |
---|
35 | inq_bp_inv, |
---|
36 | inq_dout, |
---|
37 | rclk, |
---|
38 | |
---|
39 | fp_op_in_7in, |
---|
40 | inq_id, |
---|
41 | inq_rnd_mode, |
---|
42 | inq_fcc, |
---|
43 | inq_op, |
---|
44 | inq_in1_exp_neq_ffs, |
---|
45 | inq_in1_exp_eq_0, |
---|
46 | inq_in1_53_0_neq_0, |
---|
47 | inq_in1_50_0_neq_0, |
---|
48 | inq_in1_53_32_neq_0, |
---|
49 | inq_in1, |
---|
50 | inq_in2_exp_neq_ffs, |
---|
51 | inq_in2_exp_eq_0, |
---|
52 | inq_in2_53_0_neq_0, |
---|
53 | inq_in2_50_0_neq_0, |
---|
54 | inq_in2_53_32_neq_0, |
---|
55 | inq_in2, |
---|
56 | |
---|
57 | fp_id_in, |
---|
58 | fp_rnd_mode_in, |
---|
59 | fp_fcc_in, |
---|
60 | fp_op_in, |
---|
61 | fp_src1_in, |
---|
62 | fp_src2_in, |
---|
63 | |
---|
64 | se, |
---|
65 | si, |
---|
66 | so |
---|
67 | ); |
---|
68 | |
---|
69 | |
---|
70 | input fp_data_rdy; |
---|
71 | input [116:112] fpio_data_px2_116_112; // FPU request data from PCX |
---|
72 | input [79:72] fpio_data_px2_79_72; // FPU request data from PCX |
---|
73 | input [67:0] fpio_data_px2_67_0; // FPU request data from PCX |
---|
74 | input inq_fwrd; // input Q is empty |
---|
75 | input inq_fwrd_inv; // input Q is not empty |
---|
76 | input inq_bp; // bypass the input Q SRAM |
---|
77 | input inq_bp_inv; // don't bypass the input Q SRAM |
---|
78 | input [154:0] inq_dout; // data read out from input Q SRAM |
---|
79 | input rclk; // global clock |
---|
80 | |
---|
81 | output fp_op_in_7in; // request opcode |
---|
82 | output [4:0] inq_id; // request ID to the operation pipes |
---|
83 | output [1:0] inq_rnd_mode; // request rounding mode to op pipes |
---|
84 | output [1:0] inq_fcc; // request cc ID to op pipes |
---|
85 | output [7:0] inq_op; // request opcode to op pipes |
---|
86 | output inq_in1_exp_neq_ffs; // request operand 1 exp!=ff's |
---|
87 | output inq_in1_exp_eq_0; // request operand 1 exp==0 |
---|
88 | output inq_in1_53_0_neq_0; // request operand 1[53:0]!=0 |
---|
89 | output inq_in1_50_0_neq_0; // request operand 1[50:0]!=0 |
---|
90 | output inq_in1_53_32_neq_0; // request operand 1[53:32]!=0 |
---|
91 | output [63:0] inq_in1; // request operand 1 to op pipes |
---|
92 | output inq_in2_exp_neq_ffs; // request operand 2 exp!=ff's |
---|
93 | output inq_in2_exp_eq_0; // request operand 2 exp==0 |
---|
94 | output inq_in2_53_0_neq_0; // request operand 2[53:0]!=0 |
---|
95 | output inq_in2_50_0_neq_0; // request operand 2[50:0]!=0 |
---|
96 | output inq_in2_53_32_neq_0; // request operand 2[53:32]!=0 |
---|
97 | output [63:0] inq_in2; // request operand 2 to op pipes |
---|
98 | |
---|
99 | // 6/20/03: New outputs to drive fpu-level i_fpu_inq_sram inputs |
---|
100 | output [4:0] fp_id_in; // id to be written into inq_sram |
---|
101 | output [1:0] fp_rnd_mode_in; // rnd_mode to be written into inq_sram |
---|
102 | output [1:0] fp_fcc_in; // fcc to be written into inq_sram |
---|
103 | output [7:0] fp_op_in; // request opcode |
---|
104 | output [68:0] fp_src1_in; // operand1 and its pre-computed bits portion |
---|
105 | output [68:0] fp_src2_in; // operand2, includes pre-computed bits |
---|
106 | |
---|
107 | input se; // scan_enable |
---|
108 | input si; // scan in |
---|
109 | output so; // scan out |
---|
110 | |
---|
111 | |
---|
112 | wire [154:0] inq_dout; |
---|
113 | wire [4:0] fp_id_in; |
---|
114 | wire [7:0] fp_op_in; |
---|
115 | wire fp_op_in_7; // request opcode bit[7] |
---|
116 | wire fp_op_in_7_inv; // inverted request opcode bit[7] |
---|
117 | wire fp_op_in_7in; |
---|
118 | wire [1:0] fp_fcc_in; |
---|
119 | wire [1:0] fp_rnd_mode_in; |
---|
120 | wire [63:0] fp_srca_in; |
---|
121 | wire fp_srca_53_0_neq_0; |
---|
122 | wire fp_srca_50_0_neq_0; |
---|
123 | wire fp_srca_53_32_neq_0; |
---|
124 | wire fp_srca_exp_eq_0; |
---|
125 | wire fp_srca_exp_neq_ffs; |
---|
126 | wire [68:0] fp_srcb_in; |
---|
127 | wire [68:0] fp_src1_in; |
---|
128 | wire [68:0] fp_src2_in; |
---|
129 | wire [154:0] inq_din_d1; |
---|
130 | wire [154:0] inq_data; |
---|
131 | wire [4:0] inq_id; |
---|
132 | wire [1:0] inq_rnd_mode; |
---|
133 | wire [1:0] inq_fcc; |
---|
134 | wire [7:0] inq_op; |
---|
135 | wire inq_in1_exp_neq_ffs; |
---|
136 | wire inq_in1_exp_eq_0; |
---|
137 | wire inq_in1_53_0_neq_0; |
---|
138 | wire inq_in1_50_0_neq_0; |
---|
139 | wire inq_in1_53_32_neq_0; |
---|
140 | wire [63:0] inq_in1; |
---|
141 | wire inq_in2_exp_neq_ffs; |
---|
142 | wire inq_in2_exp_eq_0; |
---|
143 | wire inq_in2_53_0_neq_0; |
---|
144 | wire inq_in2_50_0_neq_0; |
---|
145 | wire inq_in2_53_32_neq_0; |
---|
146 | wire [63:0] inq_in2; |
---|
147 | |
---|
148 | wire clk; |
---|
149 | |
---|
150 | wire se_l; |
---|
151 | |
---|
152 | // 6/23/03: Replaced tm_l with se_l |
---|
153 | assign se_l = ~se; |
---|
154 | |
---|
155 | clken_buf ckbuf_in_dp ( |
---|
156 | .clk(clk), |
---|
157 | .rclk(rclk), |
---|
158 | .enb_l(1'b0), |
---|
159 | .tmb_l(se_l) |
---|
160 | ); |
---|
161 | |
---|
162 | /////////////////////////////////////////////////////////////////////////////// |
---|
163 | // |
---|
164 | // Capture input information. |
---|
165 | // |
---|
166 | /////////////////////////////////////////////////////////////////////////////// |
---|
167 | |
---|
168 | dff_s #(5) i_fp_id_in ( |
---|
169 | .din (fpio_data_px2_116_112[116:112]), |
---|
170 | .clk (clk), |
---|
171 | |
---|
172 | .q (fp_id_in[4:0]), |
---|
173 | |
---|
174 | .se (se), |
---|
175 | .si (), |
---|
176 | .so () |
---|
177 | ); |
---|
178 | |
---|
179 | dff_s #(8) i_fp_op_in ( |
---|
180 | .din (fpio_data_px2_79_72[79:72]), |
---|
181 | .clk (clk), |
---|
182 | |
---|
183 | .q (fp_op_in[7:0]), |
---|
184 | |
---|
185 | .se (se), |
---|
186 | .si (), |
---|
187 | .so () |
---|
188 | ); |
---|
189 | |
---|
190 | assign fp_op_in_7in = fp_op_in[7]; |
---|
191 | assign fp_op_in_7 = fp_op_in[7]; |
---|
192 | assign fp_op_in_7_inv = ~fp_op_in[7]; |
---|
193 | |
---|
194 | dff_s #(2) i_fp_fcc_in ( |
---|
195 | .din (fpio_data_px2_67_0[67:66]), |
---|
196 | .clk (clk), |
---|
197 | |
---|
198 | .q (fp_fcc_in[1:0]), |
---|
199 | |
---|
200 | .se (se), |
---|
201 | .si (), |
---|
202 | .so () |
---|
203 | ); |
---|
204 | |
---|
205 | dff_s #(2) i_fp_rnd_mode_in ( |
---|
206 | .din (fpio_data_px2_67_0[65:64]), |
---|
207 | .clk (clk), |
---|
208 | |
---|
209 | .q (fp_rnd_mode_in[1:0]), |
---|
210 | |
---|
211 | .se (se), |
---|
212 | .si (), |
---|
213 | .so () |
---|
214 | ); |
---|
215 | |
---|
216 | dff_s #(64) i_fp_srca_in ( |
---|
217 | .din (fpio_data_px2_67_0[63:0]), |
---|
218 | .clk (clk), |
---|
219 | |
---|
220 | .q (fp_srca_in[63:0]), |
---|
221 | |
---|
222 | .se (se), |
---|
223 | .si (), |
---|
224 | .so () |
---|
225 | ); |
---|
226 | |
---|
227 | assign fp_srca_53_0_neq_0= (|fp_srca_in[53:0]); |
---|
228 | |
---|
229 | assign fp_srca_50_0_neq_0= (|fp_srca_in[50:0]); |
---|
230 | |
---|
231 | assign fp_srca_53_32_neq_0= (|fp_srca_in[53:32]); |
---|
232 | |
---|
233 | assign fp_srca_exp_eq_0= (!((|fp_srca_in[62:55]) |
---|
234 | || (fp_op_in[1] && (|fp_srca_in[54:52])))); |
---|
235 | |
---|
236 | assign fp_srca_exp_neq_ffs= (!((&fp_srca_in[62:55]) |
---|
237 | && (fp_op_in[0] || (&fp_srca_in[54:52])))); |
---|
238 | |
---|
239 | |
---|
240 | /////////////////////////////////////////////////////////////////////////////// |
---|
241 | // |
---|
242 | // Extract the two operands. |
---|
243 | // |
---|
244 | /////////////////////////////////////////////////////////////////////////////// |
---|
245 | |
---|
246 | dffe_s #(69) i_fp_srcb_in ( |
---|
247 | .din ({fp_srca_exp_neq_ffs, fp_srca_exp_eq_0, fp_srca_53_0_neq_0, |
---|
248 | fp_srca_50_0_neq_0, fp_srca_53_32_neq_0, |
---|
249 | fp_srca_in[63:0]}), |
---|
250 | .en (fp_data_rdy), |
---|
251 | .clk (clk), |
---|
252 | |
---|
253 | .q (fp_srcb_in[68:0]), |
---|
254 | |
---|
255 | .se (se), |
---|
256 | .si (), |
---|
257 | .so () |
---|
258 | ); |
---|
259 | |
---|
260 | assign fp_src1_in[68:0]= ({69{fp_op_in_7_inv}} |
---|
261 | & {fp_srca_exp_neq_ffs, fp_srca_exp_eq_0, |
---|
262 | fp_srca_53_0_neq_0, fp_srca_50_0_neq_0, |
---|
263 | fp_srca_53_32_neq_0, fp_srca_in[63:0]}) |
---|
264 | | ({69{fp_op_in_7}} |
---|
265 | & 69'h180000000000000000); |
---|
266 | |
---|
267 | assign fp_src2_in[68:0]= ({69{fp_op_in_7_inv}} |
---|
268 | & fp_srcb_in[68:0]) |
---|
269 | | ({69{fp_op_in_7}} |
---|
270 | & {fp_srca_exp_neq_ffs, fp_srca_exp_eq_0, |
---|
271 | fp_srca_53_0_neq_0, fp_srca_50_0_neq_0, |
---|
272 | fp_srca_53_32_neq_0, fp_srca_in[63:0]}); |
---|
273 | |
---|
274 | |
---|
275 | /////////////////////////////////////////////////////////////////////////////// |
---|
276 | // |
---|
277 | // Input queue FIFO bypass and output. |
---|
278 | // |
---|
279 | /////////////////////////////////////////////////////////////////////////////// |
---|
280 | |
---|
281 | dff_s #(155) i_inq_din_d1 ( |
---|
282 | .din ({fp_id_in[4:0], fp_rnd_mode_in[1:0], fp_fcc_in[1:0], |
---|
283 | fp_op_in[7:0], fp_src1_in[68:0], fp_src2_in[68:0]}), |
---|
284 | .clk (clk), |
---|
285 | |
---|
286 | .q (inq_din_d1[154:0]), |
---|
287 | |
---|
288 | .se (se), |
---|
289 | .si (), |
---|
290 | .so () |
---|
291 | ); |
---|
292 | |
---|
293 | |
---|
294 | assign inq_data[154:0]= ({155{inq_fwrd}} |
---|
295 | & {fp_id_in[4:0], fp_rnd_mode_in[1:0], |
---|
296 | fp_fcc_in[1:0], fp_op_in[7:0], |
---|
297 | fp_src1_in[68:0], fp_src2_in[68:0]}) |
---|
298 | | ({155{inq_fwrd_inv}} |
---|
299 | & (({155{inq_bp}} |
---|
300 | & inq_din_d1[154:0]) |
---|
301 | | ({155{inq_bp_inv}} |
---|
302 | & inq_dout[154:0]))); |
---|
303 | |
---|
304 | assign inq_id[4:0]= inq_data[154:150]; |
---|
305 | assign inq_rnd_mode[1:0]= inq_data[149:148]; |
---|
306 | assign inq_fcc[1:0]= inq_data[147:146]; |
---|
307 | assign inq_op[7:0]= inq_data[145:138]; |
---|
308 | assign inq_in1_exp_neq_ffs= inq_data[137]; |
---|
309 | assign inq_in1_exp_eq_0= inq_data[136]; |
---|
310 | assign inq_in1_53_0_neq_0= inq_data[135]; |
---|
311 | assign inq_in1_50_0_neq_0= inq_data[134]; |
---|
312 | assign inq_in1_53_32_neq_0= inq_data[133]; |
---|
313 | assign inq_in1[63:0]= inq_data[132:69]; |
---|
314 | assign inq_in2_exp_neq_ffs= inq_data[68]; |
---|
315 | assign inq_in2_exp_eq_0= inq_data[67]; |
---|
316 | assign inq_in2_53_0_neq_0= inq_data[66]; |
---|
317 | assign inq_in2_50_0_neq_0= inq_data[65]; |
---|
318 | assign inq_in2_53_32_neq_0= inq_data[64]; |
---|
319 | assign inq_in2[63:0]= inq_data[63:0]; |
---|
320 | |
---|
321 | |
---|
322 | endmodule |
---|
323 | |
---|