Adding mcounteren and scounteren registers
Created by: Jbalkind
Wanted to address some interest in having rdcycle
in S and U modes since the privileged spec allows this kind of delegation. Unfortunately I don't have a very minimal test case for this to check both modes, but I can see that the previous illegal access exceptions no longer appear when using rdcycle
provided that mcounteren
/scounteren
have the right values.
Probably needs some further testing.
Also the changes I made are all in csr_regfile.sv. I don't know what changes need to be done to enable readtime to work properly, too.