mirror of
https://github.com/openhwgroup/cva6.git
synced 2025-04-24 06:07:19 -04:00
decoder.sv: fix sfence.vma when rs1 != 0 (#933)
unlike other instructions with minor opcode == PRIV, SFENCE.VMA do not check for rs1 != 0. Only check for rd !=0 to raise illegal instruction Signed-off-by: Guillaume Chauvon <guillaume.chauvon@thalesgroup.com>
This commit is contained in:
parent
56ccf8089e
commit
b6c1d04b6f
1 changed files with 1 additions and 1 deletions
|
@ -158,7 +158,7 @@ module decoder import ariane_pkg::*; (
|
|||
if (instr.instr[31:25] == 7'b1001) begin
|
||||
// check privilege level, SFENCE.VMA can only be executed in M/S mode
|
||||
// otherwise decode an illegal instruction
|
||||
illegal_instr = (priv_lvl_i inside {riscv::PRIV_LVL_M, riscv::PRIV_LVL_S}) ? illegal_instr : 1'b1;
|
||||
illegal_instr = ((priv_lvl_i inside {riscv::PRIV_LVL_M, riscv::PRIV_LVL_S}) && instr.itype.rd == '0) ? 1'b0 : 1'b1;
|
||||
instruction_o.op = ariane_pkg::SFENCE_VMA;
|
||||
// check TVM flag and intercept SFENCE.VMA call if necessary
|
||||
if (priv_lvl_i == riscv::PRIV_LVL_S && tvm_i)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue