Use FlushE to reset integer divider FSM

This commit is contained in:
David Harris 2022-12-15 11:00:54 -08:00
parent 4365c99b52
commit b7abc0037e
3 changed files with 5 additions and 5 deletions

View File

@ -36,7 +36,7 @@ module intdivrestoring (
input logic clk,
input logic reset,
input logic StallM,
input logic TrapM,
input logic FlushE,
input logic DivSignedE, W64E,
input logic DivE,
//input logic [`XLEN-1:0] SrcAE, SrcBE,
@ -122,7 +122,7 @@ module intdivrestoring (
//////////////////////////////
always_ff @(posedge clk)
if (reset | TrapM) begin
if (reset | FlushE) begin
state <= IDLE;
end else if (DivStartE) begin
step <= 1;

View File

@ -42,7 +42,7 @@ module muldiv (
// Divide Done
output logic DivBusyE,
// hazards
input logic StallM, StallW, FlushM, FlushW, TrapM
input logic StallM, StallW, FlushE, FlushM, FlushW
);
logic [`XLEN-1:0] MDUResultM;
@ -67,7 +67,7 @@ module muldiv (
end else begin
assign DivE = MDUE & Funct3E[2];
assign DivSignedE = ~Funct3E[0];
intdivrestoring div(.clk, .reset, .StallM, .TrapM, .DivSignedE, .W64E, .DivE,
intdivrestoring div(.clk, .reset, .StallM, .FlushE, .DivSignedE, .W64E, .DivE,
.ForwardedSrcAE, .ForwardedSrcBE, .DivBusyE, .QuotM, .RemM);
end

View File

@ -375,7 +375,7 @@ module wallypipelinedcore (
.ForwardedSrcAE, .ForwardedSrcBE,
.Funct3E, .Funct3M, .MDUE, .W64E,
.MDUResultW, .DivBusyE,
.StallM, .StallW, .FlushM, .FlushW, .TrapM
.StallM, .StallW, .FlushE, .FlushM, .FlushW
);
end else begin // no M instructions supported
assign MDUResultW = 0;