reg_t destoffs = get_field(val, SV_STATE_DESTOFFS);
state.sv().srcoffs = std::min(srcoffs , state.sv().vl-1);
state.sv().destoffs = std::min(destoffs, state.sv().vl-1);
+ int state_bank = get_field(val, SV_STATE_BANK);
+ int state_size = get_field(val, SV_STATE_SIZE);
+ set_csr(CSR_USVCFG, state_bank | (state_size << 3));
+ break;
+ }
+ case CSR_USVCFG:
+ {
int old_bank = state.sv().state_bank;
int old_size = state.sv().state_size;
state.sv().state_bank = get_field(val, SV_STATE_BANK);
#ifdef SPIKE_SIMPLEV
case CSR_USVVL:
return state.sv().vl;
+ case CSR_USVCFG:
+ return (state.sv().state_bank) | (state.sv().state_size<<3);
case CSR_USVSTATE:
return (state.sv().vl-1) | ((state.sv().mvl-1)<<6) |
(state.sv().srcoffs<<12) | (state.sv().destoffs<<18) |
#define SV_STATE_BANK (0x7<<24)
#define SV_STATE_SIZE (0x3<<27)
+#define SV_CFG_BANK (0x7)
+#define SV_CFG_SIZE (0x3<<3)
+
#endif