renamed DivStart

This commit is contained in:
David Harris 2021-10-10 08:32:04 -07:00
parent 64ed267825
commit 39bbeefa78
2 changed files with 8 additions and 8 deletions

View File

@ -32,7 +32,7 @@ module intdivrestoring (
input logic reset,
input logic StallM, FlushM,
input logic DivSignedE, W64E,
input logic StartDivideE,
input logic DivStartE,
input logic [`XLEN-1:0] SrcAE, SrcBE,
output logic BusyE, DivDoneM,
output logic [`XLEN-1:0] QuotM, RemM
@ -50,8 +50,8 @@ module intdivrestoring (
// save inputs on the negative edge of the execute clock.
// This is unusual practice, but the inputs are not guaranteed to be stable due to some hazard and forwarding logic.
// Saving the inputs is the most hardware-efficient way to fix the issue.
flopen #(`XLEN) xsavereg(~clk, StartDivideE, SrcAE, XSavedE);
flopen #(`XLEN) dsavereg(~clk, StartDivideE, SrcBE, DSavedE);
flopen #(`XLEN) xsavereg(~clk, DivStartE, SrcAE, XSavedE);
flopen #(`XLEN) dsavereg(~clk, DivStartE, SrcBE, DSavedE);
// Handle sign extension for W-type instructions
generate
@ -111,7 +111,7 @@ module intdivrestoring (
always_ff @(posedge clk)
if (reset) begin
BusyE = 0; DivDoneM = 0; step = 0; DivInitE = 0;
end else if (StartDivideE & ~StallM) begin
end else if (DivStartE & ~StallM) begin
if (Div0E) DivDoneM = 1;
else begin
BusyE = 1; step = 0; DivInitE = 1;

View File

@ -48,7 +48,7 @@ module muldiv (
logic [`XLEN-1:0] QuotM, RemM;
logic [`XLEN*2-1:0] ProdE, ProdM;
logic StartDivideE, BusyE, DivDoneM;
logic DivStartE, BusyE, DivDoneM;
logic DivSignedE;
logic W64M;
@ -58,11 +58,11 @@ module muldiv (
// Divide
// Start a divide when a new division instruction is received and the divider isn't already busy or finishing
assign StartDivideE = MulDivE & Funct3E[2] & ~BusyE & ~DivDoneM;
assign DivBusyE = StartDivideE | BusyE;
assign DivStartE = MulDivE & Funct3E[2] & ~BusyE & ~DivDoneM;
assign DivBusyE = DivStartE | BusyE;
assign DivSignedE = ~Funct3E[0];
intdivrestoring div(.clk, .reset, .StallM, .FlushM,
.DivSignedE, .W64E, .StartDivideE, .SrcAE, .SrcBE, .BusyE, .DivDoneM, .QuotM, .RemM);
.DivSignedE, .W64E, .DivStartE, .SrcAE, .SrcBE, .BusyE, .DivDoneM, .QuotM, .RemM);
// Result multiplexer
always_comb