mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Divider cleaup
This commit is contained in:
parent
10ef563211
commit
36bbf0c502
@ -33,7 +33,7 @@ module intdivrestoring (
|
||||
input logic StallM, FlushM,
|
||||
input logic SignedDivideE, W64E,
|
||||
input logic StartDivideE,
|
||||
input logic [`XLEN-1:0] XE, DE,
|
||||
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) dsavereg(~clk, StartDivideE, DE, DSavedE);
|
||||
flopen #(`XLEN) xsavereg(~clk, StartDivideE, XE, XSavedE);
|
||||
flopen #(`XLEN) xsavereg(~clk, StartDivideE, SrcAE, XSavedE);
|
||||
flopen #(`XLEN) dsavereg(~clk, StartDivideE, SrcBE, DSavedE);
|
||||
|
||||
// Handle sign extension for W-type instructions
|
||||
generate
|
||||
|
@ -62,7 +62,7 @@ module muldiv (
|
||||
assign DivBusyE = StartDivideE | BusyE;
|
||||
assign SignedDivideE = ~Funct3E[0];
|
||||
intdivrestoring div(.clk, .reset, .StallM, .FlushM,
|
||||
.SignedDivideE, .W64E, .StartDivideE, .XE(SrcAE), .DE(SrcBE), .BusyE, .DivDoneM, .QuotM, .RemM);
|
||||
.SignedDivideE, .W64E, .StartDivideE, .SrcAE, .SrcBE, .BusyE, .DivDoneM, .QuotM, .RemM);
|
||||
|
||||
// Result multiplexer
|
||||
always_comb
|
||||
@ -86,7 +86,7 @@ module muldiv (
|
||||
end
|
||||
|
||||
// Writeback stage pipeline register
|
||||
|
||||
|
||||
flopenrc #(`XLEN) MulDivResultWReg(clk, reset, FlushW, ~StallW, MulDivResultM, MulDivResultW);
|
||||
|
||||
end else begin // no M instructions supported
|
||||
|
Loading…
Reference in New Issue
Block a user