#define CSR_MHPMEVENT29 0x33d
#define CSR_MHPMEVENT30 0x33e
#define CSR_MHPMEVENT31 0x33f
-#define CSR_SVGETVL 0xcf0
-#define CSR_SVSETVL 0xcf1
-#define CSR_SVGETMVL 0xcf2
-#define CSR_SVSETMVL 0xcf3
+#define CSR_SVVL 0xcf0
+#define CSR_SVREALVL 0xcf1
+#define CSR_SVMVL 0xcf2
#define CSR_MVENDORID 0xf11
#define CSR_MARCHID 0xf12
#define CSR_MIMPID 0xf13
DECLARE_INSN(custom3_rd_rs1_rs2, MATCH_CUSTOM3_RD_RS1_RS2, MASK_CUSTOM3_RD_RS1_RS2)
#endif
#ifdef DECLARE_CSR
-DECLARE_CSR(svsetvl, CSR_SVSETVL)
-DECLARE_CSR(svgetvl, CSR_SVGETVL)
-DECLARE_CSR(svsetmvl, CSR_SVSETMVL)
-DECLARE_CSR(svgetmvl, CSR_SVGETMVL)
+DECLARE_CSR(svvl, CSR_SVVL)
+DECLARE_CSR(svrealvl, CSR_SVREALVL)
+DECLARE_CSR(svmvl, CSR_SVMVL)
DECLARE_CSR(fflags, CSR_FFLAGS)
DECLARE_CSR(frm, CSR_FRM)
DECLARE_CSR(fcsr, CSR_FCSR)
switch (which)
{
#ifdef SPIKE_SIMPLEV
- case CSR_SVSETMVL:
+ case CSR_SVMVL:
state.mvl = std::min(val, (uint64_t)63); // limited to XLEN width
break;
- case CSR_SVSETVL:
+ case CSR_SVREALVL:
+ state.vl = std::min(val, state.mvl); // limited to MVL
+ break;
+ case CSR_SVVL:
state.vl = std::min(state.mvl, state.XPR[val]);
state.XPR.write(val, state.vl);
break;
switch (which)
{
#ifdef SPIKE_SIMPLEV
- case CSR_SVGETVL:
+ case CSR_SVVL:
+ case CSR_SVREALVL:
return state.vl;
- case CSR_SVGETMVL:
+ case CSR_SVMVL:
return state.mvl;
#endif
case CSR_FFLAGS: