case CSR_SVREGCFG5:
case CSR_SVREGCFG6:
case CSR_SVREGCFG7:
+ {
+ // identify which (pair) of SV config CAM registers are being set
+ int tbidx = (which - CSR_SVREGCFG0) * 2;
+ // lower 16 bits go into even, upper into odd...
+ state.sv_csrs[tbidx].u = get_field(val, 0xffff);
+ state.sv_csrs[tbidx+1].u = get_field(val, 0xffff0000);
+ // clear out all CSRs above the one(s) being set: this ensures that
+ // when it comes to context-switching, it's clear what needs to be saved
+ for (int i = tbidx+2; i < 16; i++)
+ {
+ state.sv_csrs[i].u = 0;
+ }
+ // okaaay and now "unpack" the CAM to make it easier to use. this
+ // approach is not designed to be efficient right now. optimise later
+ for (int i = 0; i < SV_CSR_SZ; i++)
+ {
+ // TODO
+ }
break;
+ }
#endif
case CSR_FFLAGS:
dirty_fp_state;