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

Subversion Repositories sparc64soc

[/] [sparc64soc/] [trunk/] [T1-FPU/] [fpu_in.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_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
 
27
module 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
 
83
input           pcx_fpio_data_rdy_px2;  // FPU request ready from PCX
84
input [123:0]    pcx_fpio_data_px2;      // FPU request data from PCX
85
input           a1stg_step;             // add pipe load
86
input           m1stg_step;             // multiply pipe load
87
input           d1stg_step;             // divide pipe load
88
input           add_pipe_active;        // add pipe is executing a valid instr
89
input           mul_pipe_active;        // mul pipe is executing a valid instr
90
input           div_pipe_active;        // div pipe is executing a valid instr
91
input [154:0] inq_dout; // data read out from input Q SRAM
92
input sehold; // macrotest hold for sram output mux in fpu_in_dp
93
input           arst_l;                 // global async. reset- asserted low
94
input           grst_l;                 // global sync. reset- asserted low
95
input           rclk;                   // global clock
96
 
97
output          fadd_clken_l;           // add      pipe clk enable - asserted low
98
output          fmul_clken_l;           // multiply pipe clk enable - asserted low
99
output          fdiv_clken_l;           // divide   pipe clk enable - asserted low
100
 
101
output          inq_add;                // add pipe request
102
output          inq_mul;                // multiply pipe request
103
output          inq_div;                // divide pipe request
104
output [4:0]     inq_id;                 // request ID to the operation pipes
105
output [1:0]     inq_rnd_mode;           // request rounding mode to op pipes
106
output [1:0]     inq_fcc;                // request cc ID to op pipes
107
output [7:0]     inq_op;                 // request opcode to op pipes
108
output          inq_in1_exp_neq_ffs;    // request operand 1 exp!=ff's
109
output          inq_in1_exp_eq_0;       // request operand 1 exp==0
110
output          inq_in1_53_0_neq_0;     // request operand 1[53:0]!=0
111
output          inq_in1_50_0_neq_0;     // request operand 1[50:0]!=0
112
output          inq_in1_53_32_neq_0;    // request operand 1[53:32]!=0
113
output [63:0]    inq_in1;                // request operand 1 to op pipes
114
output          inq_in2_exp_neq_ffs;    // request operand 2 exp!=ff's
115
output          inq_in2_exp_eq_0;       // request operand 2 exp==0
116
output          inq_in2_53_0_neq_0;     // request operand 2[53:0]!=0
117
output          inq_in2_50_0_neq_0;     // request operand 2[50:0]!=0
118
output          inq_in2_53_32_neq_0;    // request operand 2[53:32]!=0
119
output [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 
122
output [4:0] fp_id_in; // id to be written into inq_sram
123
output [1:0] fp_rnd_mode_in; // rnd_mode to be written into inq_sram
124
output [1:0] fp_fcc_in; // fcc to be written into inq_sram
125
output [7:0] fp_op_in; // op field to be written into inq_sram
126
output [68:0] fp_src1_in; // operand1 and its pre-computed bits portion
127
output [68:0] fp_src2_in; // operand2, includes pre-computed bits
128
output [3:0] inq_rdaddr; // read address for inq_sram
129
output [3:0] inq_wraddr; // write address for inq_sram
130
output inq_read_en; // read enable for inq_sram
131
output inq_we; // write enable for inq_sram
132
 
133
input           se;                     // scan_enable
134
input           si;                     // scan in
135
output          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
 
169
wire            inq_we;                 // input Q write enable
170
wire [3:0]       inq_wraddr;             // input Q write address
171
wire            inq_read_en;            // input Q read enable
172
wire [3:0]       inq_rdaddr;             // input Q read address
173
wire            inq_bp;                 // bypass the input Q SRAM
174
wire            inq_bp_inv;             // don't bypass the input Q SRAM
175
wire            inq_fwrd;               // input Q is fwrd
176
wire            inq_fwrd_inv;           // input Q is not fwrd
177
wire            inq_add;                // add pipe request
178
wire            inq_mul;                // multiply pipe request
179
wire            inq_div;                // divide pipe request
180
wire            fadd_clken_l;           // add      pipe clk enable - asserted low
181
wire            fmul_clken_l;           // multiply pipe clk enable - asserted low
182
wire            fdiv_clken_l;           // divide   pipe clk enable - asserted low
183
 
184
 
185
///////////////////////////////////////////////////////////////////////////////
186
//
187
//      Outputs of fpu_in_dp.
188
//
189
///////////////////////////////////////////////////////////////////////////////
190
 
191
wire [7:0]       fp_op_in;               // request opcode
192
wire            fp_op_in_7in;           // request opcode
193
wire [4:0]       inq_id;                 // request ID to the operation pipes
194
wire [1:0]       inq_rnd_mode;           // request rounding mode to op pipes
195
wire [1:0]       inq_fcc;                // request cc ID to op pipes
196
wire [7:0]       inq_op;                 // request opcode to op pipes
197
wire            inq_in1_exp_neq_ffs;    // request operand 1 exp!=ff's
198
wire            inq_in1_exp_eq_0;       // request operand 1 exp==0
199
wire            inq_in1_53_0_neq_0;     // request operand 1[53:0]!=0
200
wire            inq_in1_50_0_neq_0;     // request operand 1[50:0]!=0
201
wire            inq_in1_53_32_neq_0;    // request operand 1[53:32]!=0
202
wire [63:0]      inq_in1;                // request operand 1 to op pipes
203
wire            inq_in2_exp_neq_ffs;    // request operand 2 exp!=ff's
204
wire            inq_in2_exp_eq_0;       // request operand 2 exp==0
205
wire            inq_in2_53_0_neq_0;     // request operand 2[53:0]!=0
206
wire            inq_in2_50_0_neq_0;     // request operand 2[50:0]!=0
207
wire            inq_in2_53_32_neq_0;    // request operand 2[53:32]!=0
208
wire [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 
211
wire [4:0] fp_id_in; // id to be written into inq_sram
212
wire [1:0] fp_rnd_mode_in; // rnd_mode to be written into inq_sram
213
wire [1:0] fp_fcc_in; // fcc to be written into inq_sram
214
wire [68:0] fp_src1_in; // operand1 and its pre-computed bits portion
215
wire [68:0] fp_src2_in; // operand2, includes pre-computed bits
216
 
217
wire fp_data_rdy;
218
 
219
 
220
///////////////////////////////////////////////////////////////////////////////
221
//
222
//      Instantiations.
223
//
224
///////////////////////////////////////////////////////////////////////////////
225
 
226
fpu_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
 
265
fpu_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
 
308
endmodule
309
 
310
 

powered by: WebSVN 2.1.0

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