Delete RISCV_FORMAL_ALTOPS.
This commit is contained in:
parent
f02c0b23c4
commit
3feacd84c4
36
picorv32.v
36
picorv32.v
|
@ -2127,15 +2127,8 @@ module picorv32_pcpi_fast_mul #(
|
||||||
assign pcpi_wr = active[EXTRA_MUL_FFS ? 3 : 1];
|
assign pcpi_wr = active[EXTRA_MUL_FFS ? 3 : 1];
|
||||||
assign pcpi_wait = 0;
|
assign pcpi_wait = 0;
|
||||||
assign pcpi_ready = active[EXTRA_MUL_FFS ? 3 : 1];
|
assign pcpi_ready = active[EXTRA_MUL_FFS ? 3 : 1];
|
||||||
`ifdef RISCV_FORMAL_ALTOPS
|
|
||||||
assign pcpi_rd =
|
|
||||||
instr_mul ? (pcpi_rs1 + pcpi_rs2) ^ 32'h5876063e :
|
|
||||||
instr_mulh ? (pcpi_rs1 + pcpi_rs2) ^ 32'hf6583fb7 :
|
|
||||||
instr_mulhsu ? (pcpi_rs1 - pcpi_rs2) ^ 32'hecfbe137 :
|
|
||||||
instr_mulhu ? (pcpi_rs1 + pcpi_rs2) ^ 32'h949ce5e8 : 1'bx;
|
|
||||||
`else
|
|
||||||
assign pcpi_rd = shift_out ? (EXTRA_MUL_FFS ? rd_q : rd) >> 32 : (EXTRA_MUL_FFS ? rd_q : rd);
|
assign pcpi_rd = shift_out ? (EXTRA_MUL_FFS ? rd_q : rd) >> 32 : (EXTRA_MUL_FFS ? rd_q : rd);
|
||||||
`endif
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
|
|
||||||
|
@ -2207,30 +2200,21 @@ module picorv32_pcpi_div (
|
||||||
running <= 0;
|
running <= 0;
|
||||||
pcpi_ready <= 1;
|
pcpi_ready <= 1;
|
||||||
pcpi_wr <= 1;
|
pcpi_wr <= 1;
|
||||||
`ifdef RISCV_FORMAL_ALTOPS
|
|
||||||
case (1)
|
if (instr_div || instr_divu)
|
||||||
instr_div: pcpi_rd <= (pcpi_rs1 - pcpi_rs2) ^ 32'h7f8529ec;
|
pcpi_rd <= outsign ? -quotient : quotient;
|
||||||
instr_divu: pcpi_rd <= (pcpi_rs1 - pcpi_rs2) ^ 32'h10e8fd70;
|
else
|
||||||
instr_rem: pcpi_rd <= (pcpi_rs1 - pcpi_rs2) ^ 32'h8da68fa5;
|
pcpi_rd <= outsign ? -dividend : dividend;
|
||||||
instr_remu: pcpi_rd <= (pcpi_rs1 - pcpi_rs2) ^ 32'h3138d0e1;
|
|
||||||
endcase
|
|
||||||
`else
|
|
||||||
if (instr_div || instr_divu)
|
|
||||||
pcpi_rd <= outsign ? -quotient : quotient;
|
|
||||||
else
|
|
||||||
pcpi_rd <= outsign ? -dividend : dividend;
|
|
||||||
`endif
|
|
||||||
end else begin
|
end else begin
|
||||||
if (divisor <= dividend) begin
|
if (divisor <= dividend) begin
|
||||||
dividend <= dividend - divisor;
|
dividend <= dividend - divisor;
|
||||||
quotient <= quotient | quotient_msk;
|
quotient <= quotient | quotient_msk;
|
||||||
end
|
end
|
||||||
divisor <= divisor >> 1;
|
divisor <= divisor >> 1;
|
||||||
`ifdef RISCV_FORMAL_ALTOPS
|
|
||||||
quotient_msk <= quotient_msk >> 5;
|
quotient_msk <= quotient_msk >> 1;
|
||||||
`else
|
|
||||||
quotient_msk <= quotient_msk >> 1;
|
|
||||||
`endif
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
endmodule
|
endmodule
|
||||||
|
|
Loading…
Reference in New Issue