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

Revision 6, 11.2 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.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 request input.
24//
25///////////////////////////////////////////////////////////////////////////////
26
27module fpu_in (
28        pcx_fpio_data_rdy_px2,
29        pcx_fpio_data_px2,
30        a1stg_step,
31        m1stg_step,
32        d1stg_step,
33        add_pipe_active,
34        mul_pipe_active,
35        div_pipe_active,
36        inq_dout,
37        sehold,
38        arst_l,
39        grst_l,
40        rclk,
41
42        fadd_clken_l,
43        fmul_clken_l,
44        fdiv_clken_l,
45       
46        inq_add,
47        inq_mul,
48        inq_div,
49        inq_id,
50        inq_rnd_mode,
51        inq_fcc,
52        inq_op,
53        inq_in1_exp_neq_ffs,
54        inq_in1_exp_eq_0,
55        inq_in1_53_0_neq_0,
56        inq_in1_50_0_neq_0,
57        inq_in1_53_32_neq_0,
58        inq_in1,
59        inq_in2_exp_neq_ffs,
60        inq_in2_exp_eq_0,
61        inq_in2_53_0_neq_0,
62        inq_in2_50_0_neq_0,
63        inq_in2_53_32_neq_0,
64        inq_in2,
65
66        fp_id_in,
67        fp_rnd_mode_in,
68        fp_fcc_in,
69        fp_op_in,
70        fp_src1_in,
71        fp_src2_in,
72        inq_rdaddr,
73        inq_wraddr,
74        inq_read_en,
75        inq_we,
76
77        se,
78        si,
79        so
80);
81
82
83input           pcx_fpio_data_rdy_px2;  // FPU request ready from PCX
84input [123:0]   pcx_fpio_data_px2;      // FPU request data from PCX
85input           a1stg_step;             // add pipe load
86input           m1stg_step;             // multiply pipe load
87input           d1stg_step;             // divide pipe load
88input           add_pipe_active;        // add pipe is executing a valid instr
89input           mul_pipe_active;        // mul pipe is executing a valid instr
90input           div_pipe_active;        // div pipe is executing a valid instr
91input [154:0] inq_dout; // data read out from input Q SRAM
92input sehold; // macrotest hold for sram output mux in fpu_in_dp
93input           arst_l;                 // global async. reset- asserted low
94input           grst_l;                 // global sync. reset- asserted low
95input           rclk;                   // global clock
96
97output          fadd_clken_l;           // add      pipe clk enable - asserted low
98output          fmul_clken_l;           // multiply pipe clk enable - asserted low
99output          fdiv_clken_l;           // divide   pipe clk enable - asserted low
100
101output          inq_add;                // add pipe request
102output          inq_mul;                // multiply pipe request
103output          inq_div;                // divide pipe request
104output [4:0]    inq_id;                 // request ID to the operation pipes
105output [1:0]    inq_rnd_mode;           // request rounding mode to op pipes
106output [1:0]    inq_fcc;                // request cc ID to op pipes
107output [7:0]    inq_op;                 // request opcode to op pipes
108output          inq_in1_exp_neq_ffs;    // request operand 1 exp!=ff's
109output          inq_in1_exp_eq_0;       // request operand 1 exp==0
110output          inq_in1_53_0_neq_0;     // request operand 1[53:0]!=0
111output          inq_in1_50_0_neq_0;     // request operand 1[50:0]!=0
112output          inq_in1_53_32_neq_0;    // request operand 1[53:32]!=0
113output [63:0]   inq_in1;                // request operand 1 to op pipes
114output          inq_in2_exp_neq_ffs;    // request operand 2 exp!=ff's
115output          inq_in2_exp_eq_0;       // request operand 2 exp==0
116output          inq_in2_53_0_neq_0;     // request operand 2[53:0]!=0
117output          inq_in2_50_0_neq_0;     // request operand 2[50:0]!=0
118output          inq_in2_53_32_neq_0;    // request operand 2[53:32]!=0
119output [63:0]   inq_in2;                // request operand 2 to op pipes
120
121// 6/20/03: New outputs to drive fpu-level i_fpu_inq_sram inputs
122output [4:0] fp_id_in; // id to be written into inq_sram
123output [1:0] fp_rnd_mode_in; // rnd_mode to be written into inq_sram
124output [1:0] fp_fcc_in; // fcc to be written into inq_sram
125output [7:0] fp_op_in; // op field to be written into inq_sram
126output [68:0] fp_src1_in; // operand1 and its pre-computed bits portion
127output [68:0] fp_src2_in; // operand2, includes pre-computed bits
128output [3:0] inq_rdaddr; // read address for inq_sram
129output [3:0] inq_wraddr; // write address for inq_sram
130output inq_read_en; // read enable for inq_sram
131output inq_we; // write enable for inq_sram
132
133input           se;                     // scan_enable
134input           si;                     // scan in
135output          so;                     // scan out
136
137
138// Assertions
139//
140// PCX/FPU Protocol Assumptions:
141// -----------------------------
142//
143// (1) If a split transaction occurs (fpu packet type A --> N stall cycles -->
144// fpu packet type B), the next valid packet after the N stall cycles will always
145// be "fpu packet type B"
146//
147// not0in state_transition -var {pcx_fpio_data_rdy_px2, (pcx_fpio_data_px2[123] & (pcx_fpio_data_px2[122:118]==5'h0a)), (pcx_fpio_data_px2[122:118]==5'h0b)} -val {1'b1, 1'b1, 1'b0} -next {1'b1, 1'b0, 1'b1} {1'b0, 1'b0, 1'b0} {1'b0, 1'b0, 1'b1} {1'b0, 1'b1, 1'b0} -match_by_cycle -message "PCX/FPU protocol violation"
148//
149// (3) Crossbar always provides a two beat fpu transfer (packet types A and B).
150// Single source instructions produce an invalid transfer on the second beat
151// (packet type B).
152//
153// not0in custom -fire (pcx_fpio_data_rdy_px2 & pcx_fpio_data_px2[123] & (pcx_fpio_data_px2[122:118]==5'h0b) & pcx_fpio_data_px2[79]) -message "FPU given valid PCX packet B for single src fpop"
154//
155// (4) For single precision operands, the unused 32-bit region of the 64-bit
156// source is forced to zero by the FFU. The 32-bits of single precision data is
157// always contained in the upper 32-bits of the 64-bit source.
158//
159// not0in custom -fire (pcx_fpio_data_rdy_px2 & pcx_fpio_data_px2[123] & (pcx_fpio_data_px2[122:118]==5'h0a) & ~pcx_fpio_data_px2[73] & ~(pcx_fpio_data_px2[31:0]==32'b0)) -message "FPU given invalid SP data in PCX packet A"
160// not0in custom -fire (pcx_fpio_data_rdy_px2 & pcx_fpio_data_px2[123] & (pcx_fpio_data_px2[122:118]==5'h0b) & ~pcx_fpio_data_px2[73] & ~(pcx_fpio_data_px2[31:0]==32'b0)) -message "FPU given invalid SP data in PCX packet B"
161
162
163///////////////////////////////////////////////////////////////////////////////
164//
165//      Outputs of fpu_in_ctl.
166//
167///////////////////////////////////////////////////////////////////////////////
168
169wire            inq_we;                 // input Q write enable
170wire [3:0]      inq_wraddr;             // input Q write address
171wire            inq_read_en;            // input Q read enable
172wire [3:0]      inq_rdaddr;             // input Q read address
173wire            inq_bp;                 // bypass the input Q SRAM
174wire            inq_bp_inv;             // don't bypass the input Q SRAM
175wire            inq_fwrd;               // input Q is fwrd
176wire            inq_fwrd_inv;           // input Q is not fwrd
177wire            inq_add;                // add pipe request
178wire            inq_mul;                // multiply pipe request
179wire            inq_div;                // divide pipe request
180wire            fadd_clken_l;           // add      pipe clk enable - asserted low
181wire            fmul_clken_l;           // multiply pipe clk enable - asserted low
182wire            fdiv_clken_l;           // divide   pipe clk enable - asserted low
183
184
185///////////////////////////////////////////////////////////////////////////////
186//
187//      Outputs of fpu_in_dp.
188//
189///////////////////////////////////////////////////////////////////////////////
190
191wire [7:0]      fp_op_in;               // request opcode
192wire            fp_op_in_7in;           // request opcode
193wire [4:0]      inq_id;                 // request ID to the operation pipes
194wire [1:0]      inq_rnd_mode;           // request rounding mode to op pipes
195wire [1:0]      inq_fcc;                // request cc ID to op pipes
196wire [7:0]      inq_op;                 // request opcode to op pipes
197wire            inq_in1_exp_neq_ffs;    // request operand 1 exp!=ff's
198wire            inq_in1_exp_eq_0;       // request operand 1 exp==0
199wire            inq_in1_53_0_neq_0;     // request operand 1[53:0]!=0
200wire            inq_in1_50_0_neq_0;     // request operand 1[50:0]!=0
201wire            inq_in1_53_32_neq_0;    // request operand 1[53:32]!=0
202wire [63:0]     inq_in1;                // request operand 1 to op pipes
203wire            inq_in2_exp_neq_ffs;    // request operand 2 exp!=ff's
204wire            inq_in2_exp_eq_0;       // request operand 2 exp==0
205wire            inq_in2_53_0_neq_0;     // request operand 2[53:0]!=0
206wire            inq_in2_50_0_neq_0;     // request operand 2[50:0]!=0
207wire            inq_in2_53_32_neq_0;    // request operand 2[53:32]!=0
208wire [63:0]     inq_in2;                // request operand 2 to op pipes
209
210// 6/20/03: New outputs to drive fpu-level i_fpu_inq_sram inputs
211wire [4:0] fp_id_in; // id to be written into inq_sram
212wire [1:0] fp_rnd_mode_in; // rnd_mode to be written into inq_sram
213wire [1:0] fp_fcc_in; // fcc to be written into inq_sram
214wire [68:0] fp_src1_in; // operand1 and its pre-computed bits portion
215wire [68:0] fp_src2_in; // operand2, includes pre-computed bits
216
217wire fp_data_rdy;
218
219
220///////////////////////////////////////////////////////////////////////////////
221//
222//      Instantiations.
223//
224///////////////////////////////////////////////////////////////////////////////
225
226fpu_in_ctl fpu_in_ctl (
227        .pcx_fpio_data_rdy_px2          (pcx_fpio_data_rdy_px2),
228        .pcx_fpio_data_px2              (pcx_fpio_data_px2[123:118]),
229        .fp_op_in                       (fp_op_in[3:2]),
230        .fp_op_in_7in                   (fp_op_in_7in),
231        .a1stg_step                     (a1stg_step),
232        .m1stg_step                     (m1stg_step),
233        .d1stg_step                     (d1stg_step),
234        .add_pipe_active                (add_pipe_active),
235        .mul_pipe_active                (mul_pipe_active),
236        .div_pipe_active                (div_pipe_active),
237        .sehold (sehold),
238        .arst_l                         (arst_l),
239        .grst_l                         (grst_l),
240        .rclk                   (rclk),
241
242        .fp_data_rdy                    (fp_data_rdy),
243        .fadd_clken_l                   (fadd_clken_l),
244        .fmul_clken_l                   (fmul_clken_l),
245        .fdiv_clken_l                   (fdiv_clken_l),
246
247        .inq_we                         (inq_we),
248        .inq_wraddr                     (inq_wraddr[3:0]),
249        .inq_read_en                    (inq_read_en),
250        .inq_rdaddr                     (inq_rdaddr[3:0]),
251        .inq_bp                         (inq_bp),
252        .inq_bp_inv                     (inq_bp_inv),
253        .inq_fwrd                       (inq_fwrd),
254        .inq_fwrd_inv                   (inq_fwrd_inv),
255        .inq_add                        (inq_add),
256        .inq_mul                        (inq_mul),
257        .inq_div                        (inq_div),
258
259        .se           (se),
260  .si           (si),
261  .so           (scan_out_fpu_in_ctl)
262);
263
264
265fpu_in_dp fpu_in_dp (
266        .fp_data_rdy                    (fp_data_rdy),
267        .fpio_data_px2_116_112          (pcx_fpio_data_px2[116:112]),
268        .fpio_data_px2_79_72            (pcx_fpio_data_px2[79:72]),
269        .fpio_data_px2_67_0             (pcx_fpio_data_px2[67:0]),
270        .inq_fwrd                       (inq_fwrd),
271        .inq_fwrd_inv                   (inq_fwrd_inv),
272        .inq_bp                         (inq_bp),
273        .inq_bp_inv                     (inq_bp_inv),
274        .inq_dout    (inq_dout[154:0]),
275        .rclk                   (rclk),
276
277        .fp_op_in_7in                   (fp_op_in_7in),
278        .inq_id                         (inq_id[4:0]),
279        .inq_rnd_mode                   (inq_rnd_mode[1:0]),
280        .inq_fcc                        (inq_fcc[1:0]),
281        .inq_op                         (inq_op[7:0]),
282        .inq_in1_exp_neq_ffs            (inq_in1_exp_neq_ffs),
283        .inq_in1_exp_eq_0               (inq_in1_exp_eq_0),
284        .inq_in1_53_0_neq_0             (inq_in1_53_0_neq_0),
285        .inq_in1_50_0_neq_0             (inq_in1_50_0_neq_0),
286        .inq_in1_53_32_neq_0            (inq_in1_53_32_neq_0),
287        .inq_in1                        (inq_in1[63:0]),
288        .inq_in2_exp_neq_ffs            (inq_in2_exp_neq_ffs),
289        .inq_in2_exp_eq_0               (inq_in2_exp_eq_0),
290        .inq_in2_53_0_neq_0             (inq_in2_53_0_neq_0),
291        .inq_in2_50_0_neq_0             (inq_in2_50_0_neq_0),
292        .inq_in2_53_32_neq_0            (inq_in2_53_32_neq_0),
293        .inq_in2                        (inq_in2[63:0]),
294
295        .fp_id_in (fp_id_in[4:0]),
296        .fp_rnd_mode_in (fp_rnd_mode_in[1:0]),
297        .fp_fcc_in (fp_fcc_in[1:0]),
298        .fp_op_in (fp_op_in[7:0]),
299        .fp_src1_in (fp_src1_in[68:0]),
300        .fp_src2_in (fp_src2_in[68:0]),
301
302        .se                             (se),
303        .si                             (scan_out_fpu_in_ctl),
304        .so                             (so)
305);
306
307
308endmodule
309
310
Note: See TracBrowser for help on using the repository browser.