mirror of
https://github.com/openhwgroup/cvw
synced 2025-01-24 13:34:28 +00:00
Better solution to the integer divider interrupt interaction.
This commit is contained in:
parent
16aa3127b6
commit
000d713cb5
@ -36,6 +36,7 @@ module intdivrestoring (
|
||||
input logic clk,
|
||||
input logic reset,
|
||||
input logic StallM,
|
||||
input logic TrapM,
|
||||
input logic DivSignedE, W64E,
|
||||
input logic DivE,
|
||||
//input logic [`XLEN-1:0] SrcAE, SrcBE,
|
||||
@ -116,7 +117,7 @@ module intdivrestoring (
|
||||
//////////////////////////////
|
||||
|
||||
always_ff @(posedge clk)
|
||||
if (reset) begin
|
||||
if (reset | TrapM) begin
|
||||
state <= IDLE;
|
||||
end else if (DivStartE) begin
|
||||
step <= 1;
|
||||
|
@ -43,7 +43,7 @@ module muldiv (
|
||||
output logic DivBusyE,
|
||||
output logic DivE,
|
||||
// hazards
|
||||
input logic StallM, StallW, FlushM, FlushW
|
||||
input logic StallM, StallW, FlushM, FlushW, TrapM
|
||||
);
|
||||
|
||||
logic [`XLEN-1:0] MDUResultM;
|
||||
@ -61,7 +61,7 @@ module muldiv (
|
||||
// Start a divide when a new division instruction is received and the divider isn't already busy or finishing
|
||||
assign DivE = MDUE & Funct3E[2];
|
||||
assign DivSignedE = ~Funct3E[0];
|
||||
intdivrestoring div(.clk, .reset, .StallM, .DivSignedE, .W64E, .DivE,
|
||||
intdivrestoring div(.clk, .reset, .StallM, .TrapM, .DivSignedE, .W64E, .DivE,
|
||||
.ForwardedSrcAE, .ForwardedSrcBE, .DivBusyE, .QuotM, .RemM);
|
||||
|
||||
// Result multiplexer
|
||||
|
@ -71,7 +71,7 @@ module trap (
|
||||
assign SIntGlobalEnM = (PrivilegeModeW == `U_MODE) | ((PrivilegeModeW == `S_MODE) & STATUS_SIE); // if in lower priv mode, or if S ints enabled and not in higher priv mode 3.1.9
|
||||
assign PendingIntsM = ((MIP_REGW & MIE_REGW) & ({12{MIntGlobalEnM}} & 12'h888)) | ((SIP_REGW & SIE_REGW) & ({12{SIntGlobalEnM}} & 12'h222));
|
||||
assign PendingInterruptM = (|PendingIntsM) & InstrValidM;
|
||||
assign InterruptM = PendingInterruptM & ~(CommittedM | DivE); // *** RT. temporary hack to prevent integer division from having an interrupt during divide.
|
||||
assign InterruptM = PendingInterruptM & ~(CommittedM); // *** RT. temporary hack to prevent integer division from having an interrupt during divide.
|
||||
// ideally this should be disabled for all but the first cycle. However I'm not familar with the internals of the integer divider. This should (could) be an issue for
|
||||
// floating point and integer multiply.
|
||||
//assign ExceptionM = TrapM;
|
||||
|
@ -358,7 +358,7 @@ module wallypipelinedhart (
|
||||
.ForwardedSrcAE, .ForwardedSrcBE,
|
||||
.Funct3E, .Funct3M, .MDUE, .W64E,
|
||||
.MDUResultW, .DivBusyE, .DivE,
|
||||
.StallM, .StallW, .FlushM, .FlushW
|
||||
.StallM, .StallW, .FlushM, .FlushW, .TrapM
|
||||
);
|
||||
end else begin // no M instructions supported
|
||||
assign MDUResultW = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user