arch-riscv: Get vl, vtype and vlenb from PCState

Change-Id: I0ded57a3dc2db6fcc7121f147bcaf6d8a8873f6a
This commit is contained in:
Roger Chang
2023-09-04 15:15:23 +08:00
parent 8918302239
commit 1bde42760f

View File

@@ -40,6 +40,7 @@
#include "arch/riscv/mmu.hh"
#include "arch/riscv/pagetable.hh"
#include "arch/riscv/pmp.hh"
#include "arch/riscv/pcstate.hh"
#include "arch/riscv/regs/float.hh"
#include "arch/riscv/regs/int.hh"
#include "arch/riscv/regs/misc.hh"
@@ -503,9 +504,19 @@ ISA::readMiscReg(RegIndex idx)
}
case MISCREG_VLENB:
{
return VLENB;
auto rpc = tc->pcState().as<PCState>();
return rpc.vlenb();
}
case MISCREG_VTYPE:
{
auto rpc = tc->pcState().as<PCState>();
return rpc.vtype();
}
case MISCREG_VL:
{
auto rpc = tc->pcState().as<PCState>();
return (RegVal)rpc.vl();
}
break;
case MISCREG_VCSR:
{
return readMiscRegNoEffect(MISCREG_VXSAT) &