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

Subversion Repositories s1_core

[/] [s1_core/] [trunk/] [hdl/] [rtl/] [sparc_core/] [sparc_exu_byp.v] - Blame information for rev 113

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 95 fafa1971
// ========== Copyright Header Begin ==========================================
2
// 
3
// OpenSPARC T1 Processor File: sparc_exu_byp.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 113 albert.wat
`ifdef SIMPLY_RISC_TWEAKS
22
`define SIMPLY_RISC_SCANIN .si(0)
23
`else
24
`define SIMPLY_RISC_SCANIN .si()
25
`endif
26 95 fafa1971
////////////////////////////////////////////////////////////////////////
27
/*
28
//  Module Name: sparc_exu_byp
29
//      Description: This block includes the muxes for the bypassing for all
30
//              3 register outputs.  It also includes the pipeline registers
31
//              for the output of the ALU.  All other operands come from
32
//              outside the bypass block.  Rs1_data chooses between the normal
33
//              bypassing paths and the PC.  Rs2_data chooses between the normal
34
//              bypassing paths and the immediate.
35
*/
36
 
37
//FPGA_SYN enables all FPGA related modifications
38 113 albert.wat
`ifdef FPGA_SYN
39
`define FPGA_SYN_CLK_EN
40
`define FPGA_SYN_CLK_DFF
41
`endif
42 95 fafa1971
 
43
module sparc_exu_byp
44
( /*AUTOARG*/
45
   // Outputs
46
   so, byp_alu_rs1_data_e, byp_alu_rs2_data_e_l, byp_alu_rs2_data_e,
47
   exu_lsu_rs3_data_e, exu_spu_rs3_data_e, exu_lsu_rs2_data_e,
48
   byp_alu_rcc_data_e, byp_irf_rd_data_w, exu_tlu_wsr_data_m,
49
   byp_irf_rd_data_w2, byp_ecc_rs3_data_e, byp_ecc_rcc_data_e,
50
   byp_ecl_rs2_31_e, byp_ecl_rs1_31_e, byp_ecl_rs1_63_e,
51
   byp_ecl_rs1_2_0_e, byp_ecl_rs2_3_0_e, byp_ecc_rs1_synd_d,
52
   byp_ecc_rs2_synd_d, byp_ecc_rs3_synd_d,
53
   // Inputs
54
   rclk, se, si, sehold, ecl_byp_rs1_mux2_sel_e,
55
   ecl_byp_rs1_mux2_sel_rf, ecl_byp_rs1_mux2_sel_ld,
56
   ecl_byp_rs1_mux2_sel_usemux1, ecl_byp_rs1_mux1_sel_m,
57
   ecl_byp_rs1_mux1_sel_w, ecl_byp_rs1_mux1_sel_w2,
58
   ecl_byp_rs1_mux1_sel_other, ecl_byp_rcc_mux2_sel_e,
59
   ecl_byp_rcc_mux2_sel_rf, ecl_byp_rcc_mux2_sel_ld,
60
   ecl_byp_rcc_mux2_sel_usemux1, ecl_byp_rcc_mux1_sel_m,
61
   ecl_byp_rcc_mux1_sel_w, ecl_byp_rcc_mux1_sel_w2,
62
   ecl_byp_rcc_mux1_sel_other, ecl_byp_rs2_mux2_sel_e,
63
   ecl_byp_rs2_mux2_sel_rf, ecl_byp_rs2_mux2_sel_ld,
64
   ecl_byp_rs2_mux2_sel_usemux1, ecl_byp_rs2_mux1_sel_m,
65
   ecl_byp_rs2_mux1_sel_w, ecl_byp_rs2_mux1_sel_w2,
66
   ecl_byp_rs2_mux1_sel_other, ecl_byp_rs3_mux2_sel_e,
67
   ecl_byp_rs3_mux2_sel_rf, ecl_byp_rs3_mux2_sel_ld,
68
   ecl_byp_rs3_mux2_sel_usemux1, ecl_byp_rs3_mux1_sel_m,
69
   ecl_byp_rs3_mux1_sel_w, ecl_byp_rs3_mux1_sel_w2,
70
   ecl_byp_rs3_mux1_sel_other, ecl_byp_rs3h_mux2_sel_e,
71
   ecl_byp_rs3h_mux2_sel_rf, ecl_byp_rs3h_mux2_sel_ld,
72
   ecl_byp_rs3h_mux2_sel_usemux1, ecl_byp_rs3h_mux1_sel_m,
73
   ecl_byp_rs3h_mux1_sel_w, ecl_byp_rs3h_mux1_sel_w2,
74
   ecl_byp_rs3h_mux1_sel_other, ecl_byp_rs1_longmux_sel_g2,
75
   ecl_byp_rs1_longmux_sel_w2, ecl_byp_rs1_longmux_sel_ldxa,
76
   ecl_byp_rs2_longmux_sel_g2, ecl_byp_rs2_longmux_sel_w2,
77
   ecl_byp_rs2_longmux_sel_ldxa, ecl_byp_rs3_longmux_sel_g2,
78
   ecl_byp_rs3_longmux_sel_w2, ecl_byp_rs3_longmux_sel_ldxa,
79
   ecl_byp_rs3h_longmux_sel_g2, ecl_byp_rs3h_longmux_sel_w2,
80
   ecl_byp_rs3h_longmux_sel_ldxa, ecl_byp_sel_load_m,
81
   ecl_byp_sel_pipe_m, ecl_byp_sel_ecc_m, ecl_byp_sel_muldiv_g,
82
   ecl_byp_sel_load_g, ecl_byp_sel_restore_g, ecl_byp_std_e_l,
83
   ecl_byp_ldxa_g, alu_byp_rd_data_e, ifu_exu_imm_data_d,
84
   irf_byp_rs1_data_d_l, irf_byp_rs2_data_d_l, irf_byp_rs3_data_d_l,
85
   irf_byp_rs3h_data_d_l, lsu_exu_dfill_data_g, lsu_exu_ldxa_data_g,
86
   div_byp_muldivout_g, ecc_byp_ecc_result_m, ecl_byp_ecc_mask_m_l,
87
   ifu_exu_pc_d, ecl_byp_3lsb_m, ecl_byp_restore_m,
88
   ecl_byp_sel_restore_m, ecl_byp_eclpr_e, div_byp_yreg_e,
89
   ifu_exu_pcver_e, tlu_exu_rsr_data_m, ffu_exu_rsr_data_m,
90
   ecl_byp_sel_yreg_e, ecl_byp_sel_eclpr_e, ecl_byp_sel_ifusr_e,
91
   ecl_byp_sel_alu_e, ecl_byp_sel_ifex_m, ecl_byp_sel_ffusr_m,
92
   ecl_byp_sel_tlusr_m
93
   );
94
 
95
   input rclk;
96
   input se;                    // scan enable
97
   input si;
98
   input sehold;
99
   input ecl_byp_rs1_mux2_sel_e;// select lines for bypass muxes for rs1
100
   input ecl_byp_rs1_mux2_sel_rf;
101
   input ecl_byp_rs1_mux2_sel_ld;
102
   input ecl_byp_rs1_mux2_sel_usemux1;
103
   input ecl_byp_rs1_mux1_sel_m;
104
   input ecl_byp_rs1_mux1_sel_w;
105
   input ecl_byp_rs1_mux1_sel_w2;
106
   input ecl_byp_rs1_mux1_sel_other;
107
   input ecl_byp_rcc_mux2_sel_e;// select lines for bypass muxes for reg condition code
108
   input ecl_byp_rcc_mux2_sel_rf;
109
   input ecl_byp_rcc_mux2_sel_ld;
110
   input ecl_byp_rcc_mux2_sel_usemux1;
111
   input ecl_byp_rcc_mux1_sel_m;
112
   input ecl_byp_rcc_mux1_sel_w;
113
   input ecl_byp_rcc_mux1_sel_w2;
114
   input ecl_byp_rcc_mux1_sel_other;
115
   input ecl_byp_rs2_mux2_sel_e;// select lines for bypass muxes for rs2
116
   input ecl_byp_rs2_mux2_sel_rf;
117
   input ecl_byp_rs2_mux2_sel_ld;
118
   input ecl_byp_rs2_mux2_sel_usemux1;
119
   input ecl_byp_rs2_mux1_sel_m;
120
   input ecl_byp_rs2_mux1_sel_w;
121
   input ecl_byp_rs2_mux1_sel_w2;
122
   input ecl_byp_rs2_mux1_sel_other;
123
   input ecl_byp_rs3_mux2_sel_e;// select lines for bypass muxes for rs3
124
   input ecl_byp_rs3_mux2_sel_rf;
125
   input ecl_byp_rs3_mux2_sel_ld;
126
   input ecl_byp_rs3_mux2_sel_usemux1;
127
   input ecl_byp_rs3_mux1_sel_m;
128
   input ecl_byp_rs3_mux1_sel_w;
129
   input ecl_byp_rs3_mux1_sel_w2;
130
   input ecl_byp_rs3_mux1_sel_other;
131
   input ecl_byp_rs3h_mux2_sel_e;// select lines for bypass muxes for rs3 double
132
   input ecl_byp_rs3h_mux2_sel_rf;
133
   input ecl_byp_rs3h_mux2_sel_ld;
134
   input ecl_byp_rs3h_mux2_sel_usemux1;
135
   input ecl_byp_rs3h_mux1_sel_m;
136
   input ecl_byp_rs3h_mux1_sel_w;
137
   input ecl_byp_rs3h_mux1_sel_w2;
138
   input ecl_byp_rs3h_mux1_sel_other;
139
   input ecl_byp_rs1_longmux_sel_g2;
140
   input ecl_byp_rs1_longmux_sel_w2;
141
   input ecl_byp_rs1_longmux_sel_ldxa;
142
   input ecl_byp_rs2_longmux_sel_g2;
143
   input ecl_byp_rs2_longmux_sel_w2;
144
   input ecl_byp_rs2_longmux_sel_ldxa;
145
   input ecl_byp_rs3_longmux_sel_g2;
146
   input ecl_byp_rs3_longmux_sel_w2;
147
   input ecl_byp_rs3_longmux_sel_ldxa;
148
   input ecl_byp_rs3h_longmux_sel_g2;
149
   input ecl_byp_rs3h_longmux_sel_w2;
150
   input ecl_byp_rs3h_longmux_sel_ldxa;
151
   input ecl_byp_sel_load_m;        // m instruction uses load in w1 port
152
   input ecl_byp_sel_pipe_m;
153
   input ecl_byp_sel_ecc_m;
154
   input ecl_byp_sel_muldiv_g;
155
   input ecl_byp_sel_load_g;
156
   input ecl_byp_sel_restore_g;
157
   input ecl_byp_std_e_l;
158
   input ecl_byp_ldxa_g;
159
   input [63:0] alu_byp_rd_data_e;           // data from alu for bypass
160
   input [31:0] ifu_exu_imm_data_d;     // immediate
161
   input [71:0] irf_byp_rs1_data_d_l;  // RF rs1_data
162
   input [71:0] irf_byp_rs2_data_d_l;  // RF rs2_data
163
   input [71:0] irf_byp_rs3_data_d_l;  // RF rs3_data
164
   input [31:0] irf_byp_rs3h_data_d_l;// RF rs3 double data
165
   input [63:0] lsu_exu_dfill_data_g; // load data
166
   input [63:0] lsu_exu_ldxa_data_g;
167
   input [63:0] div_byp_muldivout_g;
168
   input [63:0] ecc_byp_ecc_result_m;// result from ecc
169
   input [7:0]  ecl_byp_ecc_mask_m_l;
170
   input [47:0]  ifu_exu_pc_d;
171
   input [2:0]   ecl_byp_3lsb_m;
172
   input         ecl_byp_restore_m;
173
   input         ecl_byp_sel_restore_m;
174
   input [7:0]   ecl_byp_eclpr_e;
175
   input [31:0]  div_byp_yreg_e;
176
   input [63:0]  ifu_exu_pcver_e;
177
   input [63:0]  tlu_exu_rsr_data_m;
178
   input [63:0]  ffu_exu_rsr_data_m;
179
   input         ecl_byp_sel_yreg_e;
180
   input         ecl_byp_sel_eclpr_e;
181
   input         ecl_byp_sel_ifusr_e;
182
   input         ecl_byp_sel_alu_e;
183
   input         ecl_byp_sel_ifex_m;
184
   input         ecl_byp_sel_ffusr_m;
185
   input         ecl_byp_sel_tlusr_m;
186
 
187
   output        so;
188
   output [63:0] byp_alu_rs1_data_e; // rs1_data operand for alu
189
   output [63:0] byp_alu_rs2_data_e_l; // rs2_data operand for alu
190
   output [63:0] byp_alu_rs2_data_e;
191
   output [63:0] exu_lsu_rs3_data_e; // rs3_data operand for lsu
192
   output [63:0] exu_spu_rs3_data_e;// rs3 data for spu
193
   output [63:0]  exu_lsu_rs2_data_e;
194
   output [63:0]  byp_alu_rcc_data_e;// data for reg condition codes
195
   output [71:0] byp_irf_rd_data_w;
196
   output [63:0] exu_tlu_wsr_data_m;          // data for writeback
197
   output [71:0] byp_irf_rd_data_w2;
198
   output [63:0] byp_ecc_rs3_data_e;
199
   output [63:0] byp_ecc_rcc_data_e;
200
   output        byp_ecl_rs2_31_e;
201
   output        byp_ecl_rs1_31_e;
202
   output        byp_ecl_rs1_63_e;
203
   output [2:0]  byp_ecl_rs1_2_0_e;
204
   output [3:0]  byp_ecl_rs2_3_0_e;
205
   output [7:0]  byp_ecc_rs1_synd_d;
206
   output [7:0]  byp_ecc_rs2_synd_d;
207
   output [7:0]  byp_ecc_rs3_synd_d;
208
 
209
   wire          clk;
210
   wire          sehold_clk;
211
   wire [63:0] irf_byp_rs1_data_d;  // RF rs1_data
212
   wire [63:0] irf_byp_rs2_data_d;  // RF rs2_data
213
   wire [63:0] irf_byp_rs3_data_d;  // RF rs3_data
214
   wire [31:0] irf_byp_rs3h_data_d;  // RF rs3_data double
215
   wire [63:0] byp_alu_rs1_data_d; // rs1 operand for alu
216
   wire [63:0] byp_alu_rcc_data_d; // rcc operand for alu
217
   wire [63:0] byp_alu_rs2_data_d; // rs2_data operand for alu
218
   wire [63:0]   rd_data_e;          // e stage rd_data
219
   wire [63:0]   rd_data_m;          // m stage non-load rd_data
220
   wire [63:0]   full_rd_data_m;          // m stage non-load rd_data including rdsr
221
   wire [63:0]   rd_data_g;
222
   wire [63:0]   byp_irf_rd_data_m;// m stage rd_data
223
   wire [63:0]   rs1_data_btwn_mux;  // intermediate net for rs1_data muxes
224
   wire [63:0]   rcc_data_btwn_mux;  // intermediate net for rs1_data muxes
225
   wire [63:0]   rs2_data_btwn_mux;  // intermediate net for rs2_data muxes
226
   wire [63:0]   rs3_data_btwn_mux;  // intermediate net for rs3_data muxes
227
   wire [31:0]   rs3h_data_btwn_mux;  // intermediate net for rs3h_data muxes
228
   wire [63:0]   rs3_data_d;
229
   wire [63:0]   rs3_data_e;
230
   wire [31:0]   rs3h_data_d;
231
   wire [31:0]   rs3h_data_e;
232
   wire [63:0]   restore_rd_data;
233
   wire [63:0]   restore_rd_data_next;
234
   wire [63:0]   dfill_data_g;
235
   wire [63:0]   dfill_data_g2;
236
   wire          ecl_byp_std_e;
237
   wire [7:0]    rd_synd_w_l;
238
   wire [7:0]    rd_synd_w2_l;
239
 
240
   assign        clk = rclk;
241 113 albert.wat
`ifdef FPGA_SYN_CLK_EN
242
`else
243
   clken_buf irf_write_clkbuf (
244
                                .rclk   (clk),
245
                                .enb_l  (sehold),
246
                                .tmb_l  (~se),
247
                                .clk    (sehold_clk)
248
                                ) ;
249
`endif
250 95 fafa1971
 
251
 
252
   assign        byp_ecc_rs1_synd_d[7:0] = ~irf_byp_rs1_data_d_l[71:64];
253
   assign        byp_ecc_rs2_synd_d[7:0] = ~irf_byp_rs2_data_d_l[71:64];
254
   assign        byp_ecc_rs3_synd_d[7:0] = ~irf_byp_rs3_data_d_l[71:64];
255
   /////////////////////////////////////////
256
   // Load returns go straight into a flop after mux with ldxa_data
257
   /////////////////////////////////////////
258
   dp_mux2es #(64) dfill_data_mux (.dout(dfill_data_g[63:0]),
259
                                   .in0(lsu_exu_dfill_data_g[63:0]),
260
                                   .in1(lsu_exu_ldxa_data_g[63:0]),
261
                                   .sel(ecl_byp_ldxa_g));
262 113 albert.wat
   dff_s #(64) dfill_data_dff (.din(dfill_data_g[63:0]), .clk(clk),
263
                             .q(dfill_data_g2[63:0]), .se(se), `SIMPLY_RISC_SCANIN, .so());
264 95 fafa1971
 
265
   //////////////////////////////////////////////////
266
   // RD of PR or SR
267
   //////////////////////////////////////////////////
268
 
269
   // Mux outputs for rdpr/rdsr
270
   mux4ds #(64) ifu_exu_sr_mux(.dout(rd_data_e[63:0]),
271
                               .in0({32'b0, div_byp_yreg_e[31:0]}),
272
                               .in1({56'b0, ecl_byp_eclpr_e[7:0]}),
273
                               .in2(ifu_exu_pcver_e[63:0]),
274
                               .in3(alu_byp_rd_data_e[63:0]),
275
                               .sel0(ecl_byp_sel_yreg_e),
276
                               .sel1(ecl_byp_sel_eclpr_e),
277
                               .sel2(ecl_byp_sel_ifusr_e),
278
                               .sel3(ecl_byp_sel_alu_e));
279
 
280
   // mux in the rdsr data from ffu and tlu
281
   mux3ds #(64) sr_out_mux(.dout(full_rd_data_m[63:0]),
282
                           .in0({rd_data_m[63:3], ecl_byp_3lsb_m[2:0]}),
283
                           .in1(ffu_exu_rsr_data_m[63:0]),
284
                           .in2(tlu_exu_rsr_data_m[63:0]),
285
                           .sel0(ecl_byp_sel_ifex_m),
286
                           .sel1(ecl_byp_sel_ffusr_m),
287
                           .sel2(ecl_byp_sel_tlusr_m));
288
 
289
   // Pipeline registers for rd_data
290 113 albert.wat
   dff_s #(64) dff_rd_data_e2m(.din(rd_data_e[63:0]), .clk(clk), .q(rd_data_m[63:0]),
291
                           .se(se), `SIMPLY_RISC_SCANIN, .so());
292 95 fafa1971
   dp_buffer #(64) wsr_data_buf(.dout(exu_tlu_wsr_data_m[63:0]), .in(rd_data_m[63:0]));
293
 
294
   // Flop for storing result from restore
295
   dp_mux2es #(64) restore_buf_mux(.dout(restore_rd_data_next[63:0]),
296
                                   .in0(restore_rd_data[63:0]),
297
                                   .in1(rd_data_m[63:0]),
298
                                   .sel(ecl_byp_restore_m));
299 113 albert.wat
   dff_s #(64) dff_restore_buf(.din(restore_rd_data_next[63:0]),
300 95 fafa1971
                             .q(restore_rd_data[63:0]), .clk(clk),
301 113 albert.wat
                             .se(se), `SIMPLY_RISC_SCANIN, .so());
302 95 fafa1971
   // Mux for rd_data_m between ALU and load data and ECC result and restore result
303
   mux4ds #(64) rd_data_m_mux(.dout(byp_irf_rd_data_m[63:0]),
304
                              .in0(full_rd_data_m[63:0]),
305
                              .in1(dfill_data_g2[63:0]),
306
                              .in2(ecc_byp_ecc_result_m[63:0]),
307
                              .in3(restore_rd_data[63:0]),
308
                              .sel0(ecl_byp_sel_pipe_m),
309
                              .sel1(ecl_byp_sel_load_m),
310
                              .sel2(ecl_byp_sel_ecc_m),
311
                              .sel3(ecl_byp_sel_restore_m));
312 113 albert.wat
`ifdef FPGA_SYN_CLK_DFF
313
   dffe_s #(64) dff_rd_data_m2w(.din(byp_irf_rd_data_m[63:0]), .en (~(sehold)), .clk(clk), .q(byp_irf_rd_data_w[63:0]),
314
                           .se(se), `SIMPLY_RISC_SCANIN, .so());
315
`else
316
   dff_s #(64) dff_rd_data_m2w(.din(byp_irf_rd_data_m[63:0]), .clk(sehold_clk), .q(byp_irf_rd_data_w[63:0]),
317
                           .se(se), `SIMPLY_RISC_SCANIN, .so());
318
`endif
319 95 fafa1971
 
320
   // W2 flop
321 113 albert.wat
`ifdef FPGA_SYN_CLK_DFF
322
   dffe_s #(64) dff_rd_data_g2w(.din(rd_data_g[63:0]), .en (~(sehold)), .clk(clk), .q(byp_irf_rd_data_w2[63:0]),
323
                           .se(se), `SIMPLY_RISC_SCANIN, .so());
324
`else
325
   dff_s #(64) dff_rd_data_g2w(.din(rd_data_g[63:0]), .clk(sehold_clk), .q(byp_irf_rd_data_w2[63:0]),
326
                           .se(se), `SIMPLY_RISC_SCANIN, .so());
327
`endif
328 95 fafa1971
 
329
 
330
   // D-E pipeline registers for rs_data
331 113 albert.wat
   dff_s #(64) rs1_data_dff(.din(byp_alu_rs1_data_d[63:0]), .clk(clk),
332 95 fafa1971
                        .q(byp_alu_rs1_data_e[63:0]), .se(se),
333 113 albert.wat
                        `SIMPLY_RISC_SCANIN, .so());
334
   dff_s #(64) rs2_data_dff(.din(byp_alu_rs2_data_d[63:0]), .clk(clk),
335 95 fafa1971
                        .q(byp_alu_rs2_data_e[63:0]), .se(se),
336 113 albert.wat
                        `SIMPLY_RISC_SCANIN, .so());
337 95 fafa1971
   assign        byp_alu_rs2_data_e_l[63:0] = ~byp_alu_rs2_data_e[63:0];
338
   assign        byp_ecl_rs2_31_e = byp_alu_rs2_data_e[31];
339
   assign        byp_ecl_rs1_63_e = byp_alu_rs1_data_e[63];
340
   assign        byp_ecl_rs1_31_e = byp_alu_rs1_data_e[31];
341
   assign        byp_ecl_rs1_2_0_e[2:0] = byp_alu_rs1_data_e[2:0];
342
   assign        byp_ecl_rs2_3_0_e[3:0] = byp_alu_rs2_data_e[3:0];
343
 
344
 
345 113 albert.wat
   dff_s #(64) rs3_data_dff(.din(rs3_data_d[63:0]), .clk(clk),
346 95 fafa1971
                        .q(rs3_data_e[63:0]), .se(se),
347 113 albert.wat
                        `SIMPLY_RISC_SCANIN, .so());
348
   dff_s #(32) rs3h_data_dff(.din(rs3h_data_d[31:0]), .clk(clk),
349 95 fafa1971
                           .q(rs3h_data_e[31:0]), .se(se),
350 113 albert.wat
                           `SIMPLY_RISC_SCANIN, .so());
351
   dff_s #(64) rcc_data_dff(.din(byp_alu_rcc_data_d[63:0]), .clk(clk),
352 95 fafa1971
                        .q(byp_alu_rcc_data_e[63:0]), .se(se),
353 113 albert.wat
                        `SIMPLY_RISC_SCANIN, .so());
354 95 fafa1971
 
355
   assign        ecl_byp_std_e = ~ecl_byp_std_e_l;
356
   dp_mux2es #(64) rs2_data_out_mux(.dout(exu_lsu_rs2_data_e[63:0]),
357
                                    .in0(byp_alu_rs2_data_e[63:0]),
358
                                    .in1(rs3_data_e[63:0]),
359
                                    .sel(ecl_byp_std_e));
360
   dp_mux2es #(64) rs3_data_out_mux(.dout(exu_lsu_rs3_data_e[63:0]),
361
                                    .in0(rs3_data_e[63:0]),
362
                                    .in1({32'b0,rs3h_data_e[31:0]}),
363
                                    .sel(ecl_byp_std_e));
364
   // part of rs3 goes to spu.  Buffer off to help timing/loading
365
   assign        exu_spu_rs3_data_e[63:0] = rs3_data_e[63:0];
366
 
367
   assign        byp_ecc_rs3_data_e[63:0] = rs3_data_e[63:0];
368
   assign        byp_ecc_rcc_data_e[63:0] = byp_alu_rcc_data_e[63:0];
369
 
370
   // Forwarding Muxes
371
   // Select lines are as follows:
372
   // mux1[M, W, W2, OTHER(optional)]
373
   // mux2[mux1, RF, E, LD]
374
   assign        irf_byp_rs1_data_d[63:0] = ~irf_byp_rs1_data_d_l[63:0];
375
   assign        irf_byp_rs2_data_d[63:0] = ~irf_byp_rs2_data_d_l[63:0];
376
   assign        irf_byp_rs3_data_d[63:0] = ~irf_byp_rs3_data_d_l[63:0];
377
   assign        irf_byp_rs3h_data_d[31:0] = ~irf_byp_rs3h_data_d_l[31:0];
378
 
379
/* -----\/----- EXCLUDED -----\/-----
380
   // the w2 bypass path is either what is being written that cycle
381
   // or the load result that will be written next cycle.
382
 -----/\----- EXCLUDED -----/\----- */
383
   wire [63:0]   rs1_data_w2;
384
   wire [63:0]   rs2_data_w2;
385
   wire [63:0]   rs3_data_w2;
386
   wire [31:0]   rs3h_data_w2;
387
   mux3ds #(64) rs1_w2_mux(.dout(rs1_data_w2[63:0]),
388
                           .in0(byp_irf_rd_data_w2[63:0]),
389
                           .in1(dfill_data_g2[63:0]),
390
                           .in2(lsu_exu_ldxa_data_g[63:0]),
391
                           .sel0(ecl_byp_rs1_longmux_sel_w2),
392
                           .sel1(ecl_byp_rs1_longmux_sel_g2),
393
                           .sel2(ecl_byp_rs1_longmux_sel_ldxa));
394
   mux3ds #(64) rs2_w2_mux(.dout(rs2_data_w2[63:0]),
395
                           .in0(byp_irf_rd_data_w2[63:0]),
396
                           .in1(dfill_data_g2[63:0]),
397
                           .in2(lsu_exu_ldxa_data_g[63:0]),
398
                           .sel0(ecl_byp_rs2_longmux_sel_w2),
399
                           .sel1(ecl_byp_rs2_longmux_sel_g2),
400
                           .sel2(ecl_byp_rs2_longmux_sel_ldxa));
401
   mux3ds #(64) rs3_w2_mux(.dout(rs3_data_w2[63:0]),
402
                           .in0(byp_irf_rd_data_w2[63:0]),
403
                           .in1(dfill_data_g2[63:0]),
404
                           .in2(lsu_exu_ldxa_data_g[63:0]),
405
                           .sel0(ecl_byp_rs3_longmux_sel_w2),
406
                           .sel1(ecl_byp_rs3_longmux_sel_g2),
407
                           .sel2(ecl_byp_rs3_longmux_sel_ldxa));
408
   mux3ds #(32) rs3h_w2_mux(.dout(rs3h_data_w2[31:0]),
409
                            .in0(byp_irf_rd_data_w2[31:0]),
410
                            .in1(dfill_data_g2[31:0]),
411
                            .in2(lsu_exu_ldxa_data_g[31:0]),
412
                            .sel0(ecl_byp_rs3h_longmux_sel_w2),
413
                            .sel1(ecl_byp_rs3h_longmux_sel_g2),
414
                            .sel2(ecl_byp_rs3h_longmux_sel_ldxa));
415
 
416
 
417
   // rs1_data muxes: RF and E are critical paths
418
   mux4ds #(64) mux_rs1_data_1(.dout(rs1_data_btwn_mux[63:0]),
419
                               .in0(rd_data_m[63:0]),
420
                               .in1(byp_irf_rd_data_w[63:0]),
421
                               .in2(rs1_data_w2[63:0]),
422
                               .in3({{16{ifu_exu_pc_d[47]}}, ifu_exu_pc_d[47:0]}),
423
                             .sel0(ecl_byp_rs1_mux1_sel_m),
424
                             .sel1(ecl_byp_rs1_mux1_sel_w),
425
                             .sel2(ecl_byp_rs1_mux1_sel_w2),
426
                             .sel3(ecl_byp_rs1_mux1_sel_other));
427
   mux4ds #(64) mux_rs1_data_2(.dout(byp_alu_rs1_data_d[63:0]),
428
                             .in0(rs1_data_btwn_mux[63:0]),
429
                             .in1(irf_byp_rs1_data_d[63:0]),
430
                             .in2(alu_byp_rd_data_e[63:0]),
431
                             .in3(lsu_exu_dfill_data_g[63:0]),
432
                             .sel0(ecl_byp_rs1_mux2_sel_usemux1),
433
                             .sel1(ecl_byp_rs1_mux2_sel_rf),
434
                             .sel2(ecl_byp_rs1_mux2_sel_e),
435
                             .sel3(ecl_byp_rs1_mux2_sel_ld));
436
 
437
   // rcc_data muxes: RF and E are critical paths
438
   mux4ds #(64) mux_rcc_data_1(.dout(rcc_data_btwn_mux[63:0]),
439
                               .in0(rd_data_m[63:0]),
440
                               .in1(byp_irf_rd_data_w[63:0]),
441
                               .in2(rs1_data_w2[63:0]),
442
                               .in3({64{1'b0}}),
443
                             .sel0(ecl_byp_rcc_mux1_sel_m),
444
                             .sel1(ecl_byp_rcc_mux1_sel_w),
445
                             .sel2(ecl_byp_rcc_mux1_sel_w2),
446
                             .sel3(ecl_byp_rcc_mux1_sel_other));
447
   mux4ds #(64) mux_rcc_data_2(.dout(byp_alu_rcc_data_d[63:0]),
448
                             .in0(rcc_data_btwn_mux[63:0]),
449
                             .in1(irf_byp_rs1_data_d[63:0]),
450
                             .in2(alu_byp_rd_data_e[63:0]),
451
                             .in3(lsu_exu_dfill_data_g[63:0]),
452
                             .sel0(ecl_byp_rcc_mux2_sel_usemux1),
453
                             .sel1(ecl_byp_rcc_mux2_sel_rf),
454
                             .sel2(ecl_byp_rcc_mux2_sel_e),
455
                             .sel3(ecl_byp_rcc_mux2_sel_ld));
456
 
457
   // rs2_data muxes: RF and E are critical paths, optional is imm
458
   mux4ds #(64) mux_rs2_data_1(.dout(rs2_data_btwn_mux[63:0]),
459
                             .in0(rd_data_m[63:0]),
460
                             .in1(byp_irf_rd_data_w[63:0]),
461
                             .in2(rs2_data_w2[63:0]),
462
                             .in3({{32{ifu_exu_imm_data_d[31]}},
463
                                   ifu_exu_imm_data_d[31:0]}),
464
                             .sel0(ecl_byp_rs2_mux1_sel_m),
465
                             .sel1(ecl_byp_rs2_mux1_sel_w),
466
                             .sel2(ecl_byp_rs2_mux1_sel_w2),
467
                             .sel3(ecl_byp_rs2_mux1_sel_other));
468
   mux4ds #(64) mux_rs2_data_2(.dout(byp_alu_rs2_data_d[63:0]),
469
                             .in0(rs2_data_btwn_mux[63:0]),
470
                             .in1(irf_byp_rs2_data_d[63:0]),
471
                             .in2(alu_byp_rd_data_e[63:0]),
472
                             .in3(lsu_exu_dfill_data_g[63:0]),
473
                             .sel0(ecl_byp_rs2_mux2_sel_usemux1),
474
                             .sel1(ecl_byp_rs2_mux2_sel_rf),
475
                             .sel2(ecl_byp_rs2_mux2_sel_e),
476
                             .sel3(ecl_byp_rs2_mux2_sel_ld));
477
 
478
   // rs3_data muxes: RF and E are critical paths, no optional
479
   mux4ds #(64) mux_rs3_data_1(.dout(rs3_data_btwn_mux[63:0]),
480
                                .in0(rd_data_m[63:0]),
481
                             .in1(byp_irf_rd_data_w[63:0]),
482
                             .in2(rs3_data_w2[63:0]), .in3({64{1'b0}}),
483
                             .sel0(ecl_byp_rs3_mux1_sel_m),
484
                             .sel1(ecl_byp_rs3_mux1_sel_w),
485
                             .sel2(ecl_byp_rs3_mux1_sel_w2),
486
                             .sel3(ecl_byp_rs3_mux1_sel_other));
487
   mux4ds #(64) mux_rs3_data_2(.dout(rs3_data_d[63:0]),
488
                                .in0(rs3_data_btwn_mux[63:0]),
489
                                .in1(irf_byp_rs3_data_d[63:0]),
490
                                .in2(alu_byp_rd_data_e[63:0]),
491
                                .in3(lsu_exu_dfill_data_g[63:0]),
492
                                .sel0(ecl_byp_rs3_mux2_sel_usemux1),
493
                                .sel1(ecl_byp_rs3_mux2_sel_rf),
494
                                .sel2(ecl_byp_rs3_mux2_sel_e),
495
                                .sel3(ecl_byp_rs3_mux2_sel_ld));
496
 
497
   // rs3_data muxes: RF and E are critical paths, no optional
498
   mux4ds #(32) mux_rs3h_data_1(.dout(rs3h_data_btwn_mux[31:0]),
499
                                .in0(rd_data_m[31:0]),
500
                             .in1(byp_irf_rd_data_w[31:0]),
501
                             .in2(rs3h_data_w2[31:0]), .in3({32{1'b0}}),
502
                             .sel0(ecl_byp_rs3h_mux1_sel_m),
503
                             .sel1(ecl_byp_rs3h_mux1_sel_w),
504
                             .sel2(ecl_byp_rs3h_mux1_sel_w2),
505
                             .sel3(ecl_byp_rs3h_mux1_sel_other));
506
   mux4ds #(32) mux_rs3h_data_2(.dout(rs3h_data_d[31:0]),
507
                                .in0(rs3h_data_btwn_mux[31:0]),
508
                                .in1(irf_byp_rs3h_data_d[31:0]),
509
                                .in2(alu_byp_rd_data_e[31:0]),
510
                                .in3(lsu_exu_dfill_data_g[31:0]),
511
                                .sel0(ecl_byp_rs3h_mux2_sel_usemux1),
512
                                .sel1(ecl_byp_rs3h_mux2_sel_rf),
513
                                .sel2(ecl_byp_rs3h_mux2_sel_e),
514
                                .sel3(ecl_byp_rs3h_mux2_sel_ld));
515
 
516
   // ECC for W1
517 113 albert.wat
`ifdef FPGA_SYN_CLK_DFF
518 95 fafa1971
   sparc_exu_byp_eccgen w1_eccgen(.d(byp_irf_rd_data_m[63:0]),
519
                                   .msk(ecl_byp_ecc_mask_m_l[7:0]),
520
                                   .p(rd_synd_w_l[7:0]),
521
                                  .clk(clk), .se(se));
522 113 albert.wat
`else
523
   sparc_exu_byp_eccgen w1_eccgen(.d(byp_irf_rd_data_m[63:0]),
524
                                   .msk(ecl_byp_ecc_mask_m_l[7:0]),
525
                                   .p(rd_synd_w_l[7:0]),
526
                                  .clk(sehold_clk), .se(se));
527
`endif
528 95 fafa1971
   assign        byp_irf_rd_data_w[71:64] = ~rd_synd_w_l[7:0];
529
 
530
   ////////////////////////
531
   // G arbitration muxes and W2 ECC
532
   ////////////////////////
533
   mux3ds #(64) mux_w2_data(.dout(rd_data_g[63:0]),
534
                            .in0(div_byp_muldivout_g[63:0]),
535
                            .in1(dfill_data_g2[63:0]),
536
                            .in2(restore_rd_data[63:0]),
537
                            .sel0(ecl_byp_sel_muldiv_g),
538
                            .sel1(ecl_byp_sel_load_g),
539
                            .sel2(ecl_byp_sel_restore_g));
540 113 albert.wat
`ifdef FPGA_SYN_CLK_DFF
541 95 fafa1971
   sparc_exu_byp_eccgen w2_eccgen(.d(rd_data_g[63:0]),
542
                                   .msk(ecl_byp_ecc_mask_m_l[7:0]),
543
                                  .p(rd_synd_w2_l[7:0]),
544
                                  .clk(clk), .se(se));
545 113 albert.wat
`else
546
   sparc_exu_byp_eccgen w2_eccgen(.d(rd_data_g[63:0]),
547
                                   .msk(ecl_byp_ecc_mask_m_l[7:0]),
548
                                  .p(rd_synd_w2_l[7:0]),
549
                                  .clk(sehold_clk), .se(se));
550
`endif
551 95 fafa1971
   assign        byp_irf_rd_data_w2[71:64] = ~rd_synd_w2_l[7:0];
552
 
553
endmodule // sparc_exu_byp
554
 
555
 

powered by: WebSVN 2.1.0

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