Line 16... |
Line 16... |
// You should have received a copy of the GNU General Public
|
// You should have received a copy of the GNU General Public
|
// License along with this work; if not, write to the Free Software
|
// License along with this work; if not, write to the Free Software
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
//
|
//
|
// ========== Copyright Header End ============================================
|
// ========== Copyright Header End ============================================
|
|
`ifdef SIMPLY_RISC_TWEAKS
|
|
`define SIMPLY_RISC_SCANIN .si(0)
|
|
`else
|
|
`define SIMPLY_RISC_SCANIN .si()
|
|
`endif
|
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
/*
|
/*
|
// Module Name: sparc_exu_byp
|
// Module Name: sparc_exu_byp
|
// Description: This block includes the muxes for the bypassing for all
|
// Description: This block includes the muxes for the bypassing for all
|
// 3 register outputs. It also includes the pipeline registers
|
// 3 register outputs. It also includes the pipeline registers
|
Line 28... |
Line 33... |
// bypassing paths and the PC. Rs2_data chooses between the normal
|
// bypassing paths and the PC. Rs2_data chooses between the normal
|
// bypassing paths and the immediate.
|
// bypassing paths and the immediate.
|
*/
|
*/
|
|
|
//FPGA_SYN enables all FPGA related modifications
|
//FPGA_SYN enables all FPGA related modifications
|
|
`ifdef FPGA_SYN
|
|
`define FPGA_SYN_CLK_EN
|
|
`define FPGA_SYN_CLK_DFF
|
|
`endif
|
|
|
module sparc_exu_byp
|
module sparc_exu_byp
|
( /*AUTOARG*/
|
( /*AUTOARG*/
|
// Outputs
|
// Outputs
|
so, byp_alu_rs1_data_e, byp_alu_rs2_data_e_l, byp_alu_rs2_data_e,
|
so, byp_alu_rs1_data_e, byp_alu_rs2_data_e_l, byp_alu_rs2_data_e,
|
Line 231... |
Line 236... |
wire ecl_byp_std_e;
|
wire ecl_byp_std_e;
|
wire [7:0] rd_synd_w_l;
|
wire [7:0] rd_synd_w_l;
|
wire [7:0] rd_synd_w2_l;
|
wire [7:0] rd_synd_w2_l;
|
|
|
assign clk = rclk;
|
assign clk = rclk;
|
|
`ifdef FPGA_SYN_CLK_EN
|
|
`else
|
|
clken_buf irf_write_clkbuf (
|
|
.rclk (clk),
|
|
.enb_l (sehold),
|
|
.tmb_l (~se),
|
|
.clk (sehold_clk)
|
|
) ;
|
|
`endif
|
|
|
|
|
assign byp_ecc_rs1_synd_d[7:0] = ~irf_byp_rs1_data_d_l[71:64];
|
assign byp_ecc_rs1_synd_d[7:0] = ~irf_byp_rs1_data_d_l[71:64];
|
assign byp_ecc_rs2_synd_d[7:0] = ~irf_byp_rs2_data_d_l[71:64];
|
assign byp_ecc_rs2_synd_d[7:0] = ~irf_byp_rs2_data_d_l[71:64];
|
assign byp_ecc_rs3_synd_d[7:0] = ~irf_byp_rs3_data_d_l[71:64];
|
assign byp_ecc_rs3_synd_d[7:0] = ~irf_byp_rs3_data_d_l[71:64];
|
Line 252... |
Line 257... |
/////////////////////////////////////////
|
/////////////////////////////////////////
|
dp_mux2es #(64) dfill_data_mux (.dout(dfill_data_g[63:0]),
|
dp_mux2es #(64) dfill_data_mux (.dout(dfill_data_g[63:0]),
|
.in0(lsu_exu_dfill_data_g[63:0]),
|
.in0(lsu_exu_dfill_data_g[63:0]),
|
.in1(lsu_exu_ldxa_data_g[63:0]),
|
.in1(lsu_exu_ldxa_data_g[63:0]),
|
.sel(ecl_byp_ldxa_g));
|
.sel(ecl_byp_ldxa_g));
|
dff #(64) dfill_data_dff (.din(dfill_data_g[63:0]), .clk(clk),
|
dff_s #(64) dfill_data_dff (.din(dfill_data_g[63:0]), .clk(clk),
|
.q(dfill_data_g2[63:0]), .se(se), .si(), .so());
|
.q(dfill_data_g2[63:0]), .se(se), `SIMPLY_RISC_SCANIN, .so());
|
|
|
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
// RD of PR or SR
|
// RD of PR or SR
|
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
|
|
Line 280... |
Line 285... |
.sel0(ecl_byp_sel_ifex_m),
|
.sel0(ecl_byp_sel_ifex_m),
|
.sel1(ecl_byp_sel_ffusr_m),
|
.sel1(ecl_byp_sel_ffusr_m),
|
.sel2(ecl_byp_sel_tlusr_m));
|
.sel2(ecl_byp_sel_tlusr_m));
|
|
|
// Pipeline registers for rd_data
|
// Pipeline registers for rd_data
|
dff #(64) dff_rd_data_e2m(.din(rd_data_e[63:0]), .clk(clk), .q(rd_data_m[63:0]),
|
dff_s #(64) dff_rd_data_e2m(.din(rd_data_e[63:0]), .clk(clk), .q(rd_data_m[63:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
dp_buffer #(64) wsr_data_buf(.dout(exu_tlu_wsr_data_m[63:0]), .in(rd_data_m[63:0]));
|
dp_buffer #(64) wsr_data_buf(.dout(exu_tlu_wsr_data_m[63:0]), .in(rd_data_m[63:0]));
|
|
|
// Flop for storing result from restore
|
// Flop for storing result from restore
|
dp_mux2es #(64) restore_buf_mux(.dout(restore_rd_data_next[63:0]),
|
dp_mux2es #(64) restore_buf_mux(.dout(restore_rd_data_next[63:0]),
|
.in0(restore_rd_data[63:0]),
|
.in0(restore_rd_data[63:0]),
|
.in1(rd_data_m[63:0]),
|
.in1(rd_data_m[63:0]),
|
.sel(ecl_byp_restore_m));
|
.sel(ecl_byp_restore_m));
|
dff #(64) dff_restore_buf(.din(restore_rd_data_next[63:0]),
|
dff_s #(64) dff_restore_buf(.din(restore_rd_data_next[63:0]),
|
.q(restore_rd_data[63:0]), .clk(clk),
|
.q(restore_rd_data[63:0]), .clk(clk),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
// Mux for rd_data_m between ALU and load data and ECC result and restore result
|
// Mux for rd_data_m between ALU and load data and ECC result and restore result
|
mux4ds #(64) rd_data_m_mux(.dout(byp_irf_rd_data_m[63:0]),
|
mux4ds #(64) rd_data_m_mux(.dout(byp_irf_rd_data_m[63:0]),
|
.in0(full_rd_data_m[63:0]),
|
.in0(full_rd_data_m[63:0]),
|
.in1(dfill_data_g2[63:0]),
|
.in1(dfill_data_g2[63:0]),
|
.in2(ecc_byp_ecc_result_m[63:0]),
|
.in2(ecc_byp_ecc_result_m[63:0]),
|
.in3(restore_rd_data[63:0]),
|
.in3(restore_rd_data[63:0]),
|
.sel0(ecl_byp_sel_pipe_m),
|
.sel0(ecl_byp_sel_pipe_m),
|
.sel1(ecl_byp_sel_load_m),
|
.sel1(ecl_byp_sel_load_m),
|
.sel2(ecl_byp_sel_ecc_m),
|
.sel2(ecl_byp_sel_ecc_m),
|
.sel3(ecl_byp_sel_restore_m));
|
.sel3(ecl_byp_sel_restore_m));
|
|
`ifdef FPGA_SYN_CLK_DFF
|
dffe #(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]),
|
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]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
|
`else
|
|
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]),
|
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
|
`endif
|
|
|
// W2 flop
|
// W2 flop
|
|
`ifdef FPGA_SYN_CLK_DFF
|
dffe #(64) dff_rd_data_g2w(.din(rd_data_g[63:0]), .en (~(sehold)), .clk(clk), .q(byp_irf_rd_data_w2[63:0]),
|
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]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
|
`else
|
|
dff_s #(64) dff_rd_data_g2w(.din(rd_data_g[63:0]), .clk(sehold_clk), .q(byp_irf_rd_data_w2[63:0]),
|
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
|
`endif
|
|
|
|
|
// D-E pipeline registers for rs_data
|
// D-E pipeline registers for rs_data
|
dff #(64) rs1_data_dff(.din(byp_alu_rs1_data_d[63:0]), .clk(clk),
|
dff_s #(64) rs1_data_dff(.din(byp_alu_rs1_data_d[63:0]), .clk(clk),
|
.q(byp_alu_rs1_data_e[63:0]), .se(se),
|
.q(byp_alu_rs1_data_e[63:0]), .se(se),
|
.si(), .so());
|
`SIMPLY_RISC_SCANIN, .so());
|
dff #(64) rs2_data_dff(.din(byp_alu_rs2_data_d[63:0]), .clk(clk),
|
dff_s #(64) rs2_data_dff(.din(byp_alu_rs2_data_d[63:0]), .clk(clk),
|
.q(byp_alu_rs2_data_e[63:0]), .se(se),
|
.q(byp_alu_rs2_data_e[63:0]), .se(se),
|
.si(), .so());
|
`SIMPLY_RISC_SCANIN, .so());
|
assign byp_alu_rs2_data_e_l[63:0] = ~byp_alu_rs2_data_e[63:0];
|
assign byp_alu_rs2_data_e_l[63:0] = ~byp_alu_rs2_data_e[63:0];
|
assign byp_ecl_rs2_31_e = byp_alu_rs2_data_e[31];
|
assign byp_ecl_rs2_31_e = byp_alu_rs2_data_e[31];
|
assign byp_ecl_rs1_63_e = byp_alu_rs1_data_e[63];
|
assign byp_ecl_rs1_63_e = byp_alu_rs1_data_e[63];
|
assign byp_ecl_rs1_31_e = byp_alu_rs1_data_e[31];
|
assign byp_ecl_rs1_31_e = byp_alu_rs1_data_e[31];
|
assign byp_ecl_rs1_2_0_e[2:0] = byp_alu_rs1_data_e[2:0];
|
assign byp_ecl_rs1_2_0_e[2:0] = byp_alu_rs1_data_e[2:0];
|
assign byp_ecl_rs2_3_0_e[3:0] = byp_alu_rs2_data_e[3:0];
|
assign byp_ecl_rs2_3_0_e[3:0] = byp_alu_rs2_data_e[3:0];
|
|
|
|
|
dff #(64) rs3_data_dff(.din(rs3_data_d[63:0]), .clk(clk),
|
dff_s #(64) rs3_data_dff(.din(rs3_data_d[63:0]), .clk(clk),
|
.q(rs3_data_e[63:0]), .se(se),
|
.q(rs3_data_e[63:0]), .se(se),
|
.si(), .so());
|
`SIMPLY_RISC_SCANIN, .so());
|
dff #(32) rs3h_data_dff(.din(rs3h_data_d[31:0]), .clk(clk),
|
dff_s #(32) rs3h_data_dff(.din(rs3h_data_d[31:0]), .clk(clk),
|
.q(rs3h_data_e[31:0]), .se(se),
|
.q(rs3h_data_e[31:0]), .se(se),
|
.si(), .so());
|
`SIMPLY_RISC_SCANIN, .so());
|
dff #(64) rcc_data_dff(.din(byp_alu_rcc_data_d[63:0]), .clk(clk),
|
dff_s #(64) rcc_data_dff(.din(byp_alu_rcc_data_d[63:0]), .clk(clk),
|
.q(byp_alu_rcc_data_e[63:0]), .se(se),
|
.q(byp_alu_rcc_data_e[63:0]), .se(se),
|
.si(), .so());
|
`SIMPLY_RISC_SCANIN, .so());
|
|
|
assign ecl_byp_std_e = ~ecl_byp_std_e_l;
|
assign ecl_byp_std_e = ~ecl_byp_std_e_l;
|
dp_mux2es #(64) rs2_data_out_mux(.dout(exu_lsu_rs2_data_e[63:0]),
|
dp_mux2es #(64) rs2_data_out_mux(.dout(exu_lsu_rs2_data_e[63:0]),
|
.in0(byp_alu_rs2_data_e[63:0]),
|
.in0(byp_alu_rs2_data_e[63:0]),
|
.in1(rs3_data_e[63:0]),
|
.in1(rs3_data_e[63:0]),
|
Line 507... |
Line 512... |
.sel1(ecl_byp_rs3h_mux2_sel_rf),
|
.sel1(ecl_byp_rs3h_mux2_sel_rf),
|
.sel2(ecl_byp_rs3h_mux2_sel_e),
|
.sel2(ecl_byp_rs3h_mux2_sel_e),
|
.sel3(ecl_byp_rs3h_mux2_sel_ld));
|
.sel3(ecl_byp_rs3h_mux2_sel_ld));
|
|
|
// ECC for W1
|
// ECC for W1
|
|
`ifdef FPGA_SYN_CLK_DFF
|
sparc_exu_byp_eccgen w1_eccgen(.d(byp_irf_rd_data_m[63:0]),
|
sparc_exu_byp_eccgen w1_eccgen(.d(byp_irf_rd_data_m[63:0]),
|
.msk(ecl_byp_ecc_mask_m_l[7:0]),
|
.msk(ecl_byp_ecc_mask_m_l[7:0]),
|
.p(rd_synd_w_l[7:0]),
|
.p(rd_synd_w_l[7:0]),
|
.clk(clk), .se(se));
|
.clk(clk), .se(se));
|
|
`else
|
|
sparc_exu_byp_eccgen w1_eccgen(.d(byp_irf_rd_data_m[63:0]),
|
|
.msk(ecl_byp_ecc_mask_m_l[7:0]),
|
|
.p(rd_synd_w_l[7:0]),
|
|
.clk(sehold_clk), .se(se));
|
|
`endif
|
assign byp_irf_rd_data_w[71:64] = ~rd_synd_w_l[7:0];
|
assign byp_irf_rd_data_w[71:64] = ~rd_synd_w_l[7:0];
|
|
|
////////////////////////
|
////////////////////////
|
// G arbitration muxes and W2 ECC
|
// G arbitration muxes and W2 ECC
|
////////////////////////
|
////////////////////////
|
Line 530... |
Line 535... |
.in1(dfill_data_g2[63:0]),
|
.in1(dfill_data_g2[63:0]),
|
.in2(restore_rd_data[63:0]),
|
.in2(restore_rd_data[63:0]),
|
.sel0(ecl_byp_sel_muldiv_g),
|
.sel0(ecl_byp_sel_muldiv_g),
|
.sel1(ecl_byp_sel_load_g),
|
.sel1(ecl_byp_sel_load_g),
|
.sel2(ecl_byp_sel_restore_g));
|
.sel2(ecl_byp_sel_restore_g));
|
|
`ifdef FPGA_SYN_CLK_DFF
|
sparc_exu_byp_eccgen w2_eccgen(.d(rd_data_g[63:0]),
|
sparc_exu_byp_eccgen w2_eccgen(.d(rd_data_g[63:0]),
|
.msk(ecl_byp_ecc_mask_m_l[7:0]),
|
.msk(ecl_byp_ecc_mask_m_l[7:0]),
|
.p(rd_synd_w2_l[7:0]),
|
.p(rd_synd_w2_l[7:0]),
|
.clk(clk), .se(se));
|
.clk(clk), .se(se));
|
|
`else
|
|
sparc_exu_byp_eccgen w2_eccgen(.d(rd_data_g[63:0]),
|
|
.msk(ecl_byp_ecc_mask_m_l[7:0]),
|
|
.p(rd_synd_w2_l[7:0]),
|
|
.clk(sehold_clk), .se(se));
|
|
`endif
|
assign byp_irf_rd_data_w2[71:64] = ~rd_synd_w2_l[7:0];
|
assign byp_irf_rd_data_w2[71:64] = ~rd_synd_w2_l[7:0];
|
|
|
endmodule // sparc_exu_byp
|
endmodule // sparc_exu_byp
|
|
|
|
|