mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Simplified fdivsqrtpostproc QmM logic
This commit is contained in:
parent
8647de5ee4
commit
5b13140078
@ -43,6 +43,7 @@ module fdivsqrtpostproc(
|
|||||||
);
|
);
|
||||||
|
|
||||||
logic [`DIVb+3:0] W;
|
logic [`DIVb+3:0] W;
|
||||||
|
logic [`DIVb:0] PreQmM;
|
||||||
logic NegSticky;
|
logic NegSticky;
|
||||||
logic weq0;
|
logic weq0;
|
||||||
|
|
||||||
@ -70,12 +71,7 @@ module fdivsqrtpostproc(
|
|||||||
assign NegSticky = W[`DIVb+3];
|
assign NegSticky = W[`DIVb+3];
|
||||||
|
|
||||||
// division takes the result from the next cycle, which is shifted to the left one more time so the square root also needs to be shifted
|
// division takes the result from the next cycle, which is shifted to the left one more time so the square root also needs to be shifted
|
||||||
always_comb
|
|
||||||
if (SqrtM) begin
|
assign PreQmM = NegSticky ? FirstUM : FirstU; // Select U or U-1 depending on negative sticky bit
|
||||||
if(NegSticky) QmM = FirstUM[`DIVb:0] << 1;
|
assign QmM = SqrtM ? (PreQmM << 1) : PreQmM;
|
||||||
else QmM = FirstU[`DIVb:0] << 1;
|
|
||||||
end else begin // divide
|
|
||||||
if(NegSticky) QmM = FirstUM[`DIVb:0];
|
|
||||||
else QmM = FirstU[`DIVb:0];
|
|
||||||
end
|
|
||||||
endmodule
|
endmodule
|
Loading…
Reference in New Issue
Block a user