source: XOpenSparcT1/trunk/T1-FPU/fpu_in_dp.v @ 6

Revision 6, 8.8 KB checked in by pntsvt00, 13 years ago (diff)

versione iniziale opensparc

Line 
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
27module 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
70input           fp_data_rdy;
71input [116:112] fpio_data_px2_116_112;  // FPU request data from PCX
72input [79:72]   fpio_data_px2_79_72;    // FPU request data from PCX
73input [67:0]    fpio_data_px2_67_0;     // FPU request data from PCX
74input           inq_fwrd;               // input Q is empty
75input           inq_fwrd_inv;           // input Q is not empty
76input           inq_bp;                 // bypass the input Q SRAM
77input           inq_bp_inv;             // don't bypass the input Q SRAM
78input [154:0] inq_dout; // data read out from input Q SRAM
79input           rclk;           // global clock
80
81output          fp_op_in_7in;           // request opcode
82output [4:0]    inq_id;                 // request ID to the operation pipes
83output [1:0]    inq_rnd_mode;           // request rounding mode to op pipes
84output [1:0]    inq_fcc;                // request cc ID to op pipes
85output [7:0]    inq_op;                 // request opcode to op pipes
86output          inq_in1_exp_neq_ffs;    // request operand 1 exp!=ff's
87output          inq_in1_exp_eq_0;       // request operand 1 exp==0
88output          inq_in1_53_0_neq_0;     // request operand 1[53:0]!=0
89output          inq_in1_50_0_neq_0;     // request operand 1[50:0]!=0
90output          inq_in1_53_32_neq_0;    // request operand 1[53:32]!=0
91output [63:0]   inq_in1;                // request operand 1 to op pipes
92output          inq_in2_exp_neq_ffs;    // request operand 2 exp!=ff's
93output          inq_in2_exp_eq_0;       // request operand 2 exp==0
94output          inq_in2_53_0_neq_0;     // request operand 2[53:0]!=0
95output          inq_in2_50_0_neq_0;     // request operand 2[50:0]!=0
96output          inq_in2_53_32_neq_0;    // request operand 2[53:32]!=0
97output [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
100output [4:0] fp_id_in; // id to be written into inq_sram
101output [1:0] fp_rnd_mode_in; // rnd_mode to be written into inq_sram
102output [1:0] fp_fcc_in; // fcc to be written into inq_sram
103output [7:0] fp_op_in; // request opcode
104output [68:0] fp_src1_in; // operand1 and its pre-computed bits portion
105output [68:0] fp_src2_in; // operand2, includes pre-computed bits
106
107input           se;                     // scan_enable
108input           si;                     // scan in
109output          so;                     // scan out
110
111
112wire [154:0]    inq_dout;
113wire [4:0]      fp_id_in;
114wire [7:0]      fp_op_in;
115wire            fp_op_in_7;             // request opcode bit[7]
116wire            fp_op_in_7_inv;         // inverted request opcode bit[7]
117wire            fp_op_in_7in;
118wire [1:0]      fp_fcc_in;
119wire [1:0]      fp_rnd_mode_in;
120wire [63:0]     fp_srca_in;
121wire            fp_srca_53_0_neq_0;
122wire            fp_srca_50_0_neq_0;
123wire            fp_srca_53_32_neq_0;
124wire            fp_srca_exp_eq_0;
125wire            fp_srca_exp_neq_ffs;
126wire [68:0]     fp_srcb_in;
127wire [68:0]     fp_src1_in;
128wire [68:0]     fp_src2_in;
129wire [154:0]    inq_din_d1;
130wire [154:0]    inq_data;
131wire [4:0]      inq_id;
132wire [1:0]      inq_rnd_mode;
133wire [1:0]      inq_fcc;
134wire [7:0]      inq_op;
135wire            inq_in1_exp_neq_ffs;
136wire            inq_in1_exp_eq_0;
137wire            inq_in1_53_0_neq_0;
138wire            inq_in1_50_0_neq_0;
139wire            inq_in1_53_32_neq_0;
140wire [63:0]     inq_in1;
141wire            inq_in2_exp_neq_ffs;
142wire            inq_in2_exp_eq_0;
143wire            inq_in2_53_0_neq_0;
144wire            inq_in2_50_0_neq_0;
145wire            inq_in2_53_32_neq_0;
146wire [63:0]     inq_in2;
147
148wire clk;
149
150wire se_l;
151
152// 6/23/03: Replaced tm_l with se_l
153assign se_l = ~se;
154
155clken_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
168dff_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
179dff_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
190assign fp_op_in_7in = fp_op_in[7];
191assign fp_op_in_7 = fp_op_in[7];
192assign fp_op_in_7_inv = ~fp_op_in[7];
193
194dff_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
205dff_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
216dff_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
227assign fp_srca_53_0_neq_0= (|fp_srca_in[53:0]);
228
229assign fp_srca_50_0_neq_0= (|fp_srca_in[50:0]);
230
231assign fp_srca_53_32_neq_0= (|fp_srca_in[53:32]);
232
233assign fp_srca_exp_eq_0= (!((|fp_srca_in[62:55])
234                || (fp_op_in[1] && (|fp_srca_in[54:52]))));
235
236assign 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
246dffe_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
260assign 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
267assign 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
281dff_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
294assign 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
304assign inq_id[4:0]= inq_data[154:150];
305assign inq_rnd_mode[1:0]= inq_data[149:148];
306assign inq_fcc[1:0]= inq_data[147:146];
307assign inq_op[7:0]= inq_data[145:138];
308assign inq_in1_exp_neq_ffs= inq_data[137];
309assign inq_in1_exp_eq_0= inq_data[136];
310assign inq_in1_53_0_neq_0= inq_data[135];
311assign inq_in1_50_0_neq_0= inq_data[134];
312assign inq_in1_53_32_neq_0= inq_data[133];
313assign inq_in1[63:0]= inq_data[132:69];
314assign inq_in2_exp_neq_ffs= inq_data[68];
315assign inq_in2_exp_eq_0= inq_data[67];
316assign inq_in2_53_0_neq_0= inq_data[66];
317assign inq_in2_50_0_neq_0= inq_data[65];
318assign inq_in2_53_32_neq_0= inq_data[64];
319assign inq_in2[63:0]= inq_data[63:0];
320
321
322endmodule
323
Note: See TracBrowser for help on using the repository browser.