cv32e40p icon indicating copy to clipboard operation
cv32e40p copied to clipboard

Incorrect F Extension Result Calculation - Dynamic Rounding Mode

Open shetalani opened this issue 5 years ago • 1 comments

RISC-V Specification:

  • "Floating-point operations use either a static rounding mode encoded in the instruction, or a dynamic rounding mode held in frm."
  • "Rounding modes are encoded as shown in Table 11.1. A value of 111 in the instruction’s rm field selects the dynamic rounding mode held in frm."
  • "All floating-point to integer and integer to floating-point conversion instructions round according to the rm field."

Issue Description: A wrong value is written to the normal RF for an F-extension instruction that has a dynamic rounding mode.

Example:

As shown below, the instruction 32'hc00f77d3 (fcvt.w.s x15, f30) is decoded at time point t##0 where rm field has the value 111, and frm has the value 011 (written by a previous instruction). Where f30 has the value 32'h02000000 already by a previous instruction as well. Hence, the result has to be rounded up according to the value of frm. However, the rounding mode signal "...fpnew_bulk.rnd_mode_i" has the value associated with RNE and x15 is written with the value 0 instead of the right result 1.

Apparently, ri5cy doesn't support dynamic rounding mode! Is that right?

Issue_11


Product: OneSpin 360 DV-Verify App: RVV Tool's version: 2019.2.2

shetalani avatar Sep 30 '19 16:09 shetalani

This bug is related to #169 where the change to frm in the previous cycle is not seen by the fcvt instruction following it. Leaving this open until #169 is closed.

stmach avatar Oct 08 '19 10:10 stmach

Resolved with PR #801

pascalgouedo avatar Oct 09 '23 08:10 pascalgouedo