Skip to content

Commit 1787354

Browse files
arch-riscv: Add RVV support for riscv32 ISA (gem5#2337)
Previous version configure the mstatus and misa only in riscv64, illegal instruction exception occurs when simulate workload which compiled as riscv-32 target, this commit set the CSR once 'enable_rvv' is true Test: run scons build/RISCV/unittests.opt
1 parent 61de99c commit 1787354

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/arch/riscv/isa.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,6 @@ void ISA::clear()
403403
case RV64:
404404
misa.rv64_mxl = 2;
405405
status.uxl = status.sxl = 2;
406-
if (getEnableRvv()) {
407-
status.vs = VPUStatus::INITIAL;
408-
misa.rvv = 1;
409-
}
410406
if (misa.rvh) {
411407
HSTATUS hstatus = 0;
412408
hstatus.vsxl = 2;
@@ -425,6 +421,10 @@ void ISA::clear()
425421
default:
426422
panic("%s: Unknown _rvType: %d", name(), (int)_rvType);
427423
}
424+
if (getEnableRvv()) {
425+
status.vs = VPUStatus::INITIAL;
426+
misa.rvv = 1;
427+
}
428428

429429
miscRegFile[MISCREG_ISA] = misa;
430430
miscRegFile[MISCREG_STATUS] = status;

0 commit comments

Comments
 (0)