if (instr.stype.rs1 !='0|| instr.stype.imm0 !='0|| instr.instr[31:28] !='0)
illegal_instr =1'b1;
According to the The RISC-V Instruction Set Manual Volume I: Unprivileged ISA:
FENCE: The unused fields in the FENCE instructions—rs1 and rd—are reserved for finer-grain fences in future extensions. For forward compatibility, base implementations shall ignore these fields, and standard software shall zero these fields.
FENCE.I: The unused fields in the FENCE.I instruction, imm[11:0], rs1, and rd, are reserved for finer-grain fences in future extensions. For forward compatibility, base implementations shall ignore these fields, and standard software shall zero these fields.
In the following test case, there is a valid fence.i at 0x80000194, whose rd field is 1, and a fence with non-zero rd at 0x80000198. cva6 still throws exceptions for them.
if (instr.stype.rs1 !='0|| instr.stype.imm0 !='0|| instr.instr[31:28] !='0)
illegal_instr =1'b1;
Is not needed anymore to preserve forward compatibility. I can't seem to find how rd is factored into the equation. Would you mind trying to delete the above lines and re-run the testcase?
Our co-simulation framework found the decoder has an incorrect behavior when execute a
fence.i/fencewith non-zero rd field.As discussed before 719,
fence/fence.ishould ignores immediate, rs1, rd field. We found the patch 724 does not fix this bug.The checking after the patch still throws an exception for non-zero rd and rs1:
cva6/core/decoder.sv
Lines 238 to 239 in 909d85a
According to the The RISC-V Instruction Set Manual Volume I: Unprivileged ISA:
In the following test case, there is a valid
fence.iat 0x80000194, whose rd field is 1, and afencewith non-zero rd at 0x80000198. cva6 still throws exceptions for them.cva6-4.zip
The text was updated successfully, but these errors were encountered: