diff --git a/config/rv32gc/config.vh b/config/rv32gc/config.vh index 3b306a005..e095e6252 100644 --- a/config/rv32gc/config.vh +++ b/config/rv32gc/config.vh @@ -74,8 +74,8 @@ localparam ICACHE_LINELENINBITS = 32'd512; // Integer Divider Configuration // IDIV_BITSPERCYCLE must be 1, 2, or 4 -localparam IDIV_BITSPERCYCLE = 32'd4; -localparam IDIV_ON_FPU = 1; +localparam IDIV_BITSPERCYCLE = 32'd2; +localparam IDIV_ON_FPU = 0; // Legal number of PMP entries are 0, 16, or 64 localparam PMP_ENTRIES = 32'd16; diff --git a/src/ieu/datapath.sv b/src/ieu/datapath.sv index bb7638514..8c366a2ef 100644 --- a/src/ieu/datapath.sv +++ b/src/ieu/datapath.sv @@ -131,7 +131,7 @@ module datapath import cvw::*; #(parameter cvw_t P) ( if (P.F_SUPPORTED) begin:fpmux mux2 #(P.XLEN) resultmuxM(IEUResultM, FIntResM, FWriteIntM, IFResultM); mux2 #(P.XLEN) cvtresultmuxW(IFResultW, FCvtIntResW, FCvtIntW, IFCvtResultW); - if (P.IDIV_ON_FPU) begin + if (P.IDIV_ON_FPU & P.F_SUPPORTED) begin mux2 #(P.XLEN) divresultmuxW(MDUResultW, FIntDivResultW, IntDivW, MulDivResultW); end else begin assign MulDivResultW = MDUResultW; diff --git a/src/mdu/mdu.sv b/src/mdu/mdu.sv index 83327a460..e152fc6de 100644 --- a/src/mdu/mdu.sv +++ b/src/mdu/mdu.sv @@ -57,7 +57,7 @@ module mdu import cvw::*; #(parameter cvw_t P) ( // Start a divide when a new division instruction is received and the divider isn't already busy or finishing // When IDIV_ON_FPU is set, use the FPU divider instead // In ZMMUL, with M_SUPPORTED = 0, omit the divider - if ((P.IDIV_ON_FPU) || (!P.M_SUPPORTED)) begin:nodiv + if ((P.IDIV_ON_FPU & P.F_SUPPORTED) || (!P.M_SUPPORTED)) begin:nodiv assign QuotM = 0; assign RemM = 0; assign DivBusyE = 0;