-
Notifications
You must be signed in to change notification settings - Fork 843
Description
Is there an existing CVA6 bug for this?
- I have searched the existing bug issues
Bug Description
Issue Overview
- In the CVA6 execution reports, mixed float/integer instructions such as
flt.handfcvt.wu.hare logged as if they wrote to the floating-point destination, even though they actually write to an integer register. - The core still updates the correct integer register; subsequent integer instructions observe the new value, but the trace attributes the write to the wrong register file.
Reproduction Steps
- Use the two minimal assembly snippets listed below (Scenario A and Scenario B).
- Inspect the tail of each log, locate the
flt.handfcvt.wu.hentries, and compare them with the descriptions in this report.
Expected vs. Observed
- Expected: The trace should report an update to the integer destination register (
x23,x21, …) with the correct value. - Observed: The trace instead shows the corresponding floating-point register (
f23,f21, …) being updated while the integer register retains its stale value in the log.
Evidence
-
Scenario A’s trace line for
flt.h x23, f17, f19states thatf23was written with0x0, and makes no mention ofx23. -
The next line,
addi x19, x23, 0, setsx19 = 0, proving thatx23actually received the new value despite the missing log entry. -
Scenario B reports
fcvt.wu.h x21, f18, dynas writingf21 = 0xffffffffffffffff, again ignoringx21. -
The subsequent
addi x19, x21, 0writesx19 = 0xffffffffffffffff, confirming that the integer register was updated while the trace misattributes the writeback. -
Scenario A’s log line states “
flt.h x23, f17, f19→f23=0x0,” and the next line “addi x19, x23, 0” recordsx19 = 0. -
Scenario B’s log line states “
fcvt.wu.h x21, f18, dyn→f21=0xffffffffffffffff,” followed immediately by “addi x19, x21, 0” recordingx19 = 0xffffffffffffffff.
Instruction Snippets
Scenario A
li x2, 0xfff0000000000000
fmv.d.x f17, x2
li x2, 0xffffffffffff7e00
fmv.d.x f19, x2
li x23, 0xfffffffe
li x19, 0x0
flt.h x23, f17, f19
addi x19, x23, 0got
core 0: 0x00000000800008c4 (0xa5389bd3) DASM(a5389bd3)
3 0x00000000800008c4 (0xa5389bd3) f23 0x0000000000000000
core 0: 0x00000000800008c8 (0x000089de) DASM(000089de)
3 0x00000000800008c8 (0x89de) x19 0x0000000000000000
Scenario B
li x2, 0xadf4a72d3abbcacf
fmv.d.x f18, x2
li x21, 0x0
li x19, 0x0
fcvt.wu.h x21, f18, dyn
addi x19, x21, 0got
core 0: 0x00000000800008a8 (0xc4197ad3) DASM(c4197ad3)
3 0x00000000800008a8 (0xc4197ad3) f21 0xffffffffffffffff
core 0: 0x00000000800008ac (0x000089d6) DASM(000089d6)
3 0x00000000800008ac (0x89d6) x19 0xffffffffffffffff