aboutsummaryrefslogtreecommitdiff
path: root/riscv/csrs.h
AgeCommit message (Collapse)AuthorFilesLines
2021-10-06Make vxsat into its own classScott Johnson1-0/+8
Since its rules will need to be different than other vector CSRs (coming next). No functional change intended.
2021-10-06Let each sstatus CSR determine extension enableScott Johnson1-0/+2
No functional change intended. This will allow me to consider whether the given field exists at all, which I will eventually use to fix #823.
2021-10-06Give sstatus_csr_t handles to its base_status_csr_t constituentsScott Johnson1-1/+6
So I can add specialized methods to base_status_csr_t next, for use from within sstatus_csr_t.
2021-09-29Convert vlenb to csr_tScott Johnson1-1/+1
Since it's constant, no new trace events will be seen.
2021-09-29Convert vstart to csr_tScott Johnson1-0/+5
Adds commit log events for vstart to many vector instructions.
2021-09-29Convert vxsat to csr_tScott Johnson1-0/+11
Adds commit log events for vxsat to many vector instructions.
2021-09-28Convert sentropy to csr_tScott Johnson1-0/+11
2021-09-27Convert FCSR to csr_tScott Johnson1-0/+17
2021-09-27Convert frm & fflags to csr_tScott Johnson1-0/+9
Adds proper logging of fflags on FP arithmetic ops.
2021-09-27Merge pull request #815 from scottj97/mstatushAndrew Waterman1-0/+13
Convert mstatush to csr_t
2021-09-27Make mstatush bits writable on hypervisor configsScott Johnson1-0/+1
Fixes #812. Note that only GVA & MPV are actually writable; MBE and SBE are fixed inside mstatus_csr_t::unlogged_write().
2021-09-27Convert mstatush to csr_tScott Johnson1-0/+12
Maintains non-writability reported as issue #812
2021-09-26Convert dcsr to csr_tScott Johnson1-3/+11
2021-09-26Move dcsr_t definition to csrs.hScott Johnson1-0/+13
In prep for its conversion to csr_t.
2021-09-26Convert dpc to csr_tScott Johnson1-0/+6
2021-09-26Convert dscratch0/1 to csr_tScott Johnson1-0/+7
2021-09-26Convert tdata2 to csr_tScott Johnson1-0/+13
2021-09-26Convert tdata1 to csr_tScott Johnson1-0/+9
2021-09-26Convert tselect to csr_tScott Johnson1-0/+8
2021-09-25Remove no-longer-used counteren_csr_tScott Johnson1-9/+0
2021-09-25Convert hgatp to csr_tScott Johnson1-0/+10
2021-09-25Convert hstatus_csr_t to more generic masked_csr_tScott Johnson1-2/+5
Which I will reuse next for other CSRs.
2021-09-25Convert mtval2 to csr_tScott Johnson1-0/+8
2021-09-20Fix logged value of minstretScott Johnson1-0/+1
It was off by 1.
2021-09-20Provide mechanism (not yet used) for the logged value to be different from ↵Scott Johnson1-0/+4
read() I will need this soon for minstret.
2021-09-20Simplify logic and eliminate cpp macrosScott Johnson1-0/+2
2021-09-20Convert unprivileged counter shadows to csr_tScott Johnson1-0/+7
Soon I will simplify some of these cpp macros.
2021-09-16Convert mhpmcounter, mhpmevents to csr_tScott Johnson1-0/+12
2021-09-16Convert mcycle[h] (which is a mirror of minstret[h]) to csr_tScott Johnson1-0/+15
2021-09-16Convert minstreth to csr_tScott Johnson1-0/+12
2021-09-16Convert minstret to csr_tScott Johnson1-0/+18
This is a little messy in RV32 since it's accessed via two different CSRs (upper and lower halves). This changes logging of mcycle[h] to log a change to minstret[h], since that's how it's always been implemented in Spike. There is no separate mcycle register.
2021-09-16Add new method csr_t::log_special_write()Scott Johnson1-0/+3
For use by minstreth next.
2021-09-08Remove class logged_csr_tScott Johnson1-17/+10
2021-09-08Move logging functionality into root classScott Johnson1-11/+8
So I can remove logged_csr_t next.
2021-09-08Implement mip_proxy_csr_t as child of logged_csr_tScott Johnson1-2/+3
2021-09-08Implement mie_proxy_csr_t as child of logged_csr_tScott Johnson1-2/+3
2021-09-08Implement virtualized_csr_t as logged_csr_tScott Johnson1-4/+4
Goal is to eventually fold logged_csr_t back up into csr_t.
2021-09-08Let compute_new_satp call read() himselfScott Johnson1-1/+1
2021-09-08Move satp methods into satp classesScott Johnson1-0/+3
2021-09-08Give virtualized_satp_csr_t a handle to satpScott Johnson1-1/+5
Parent class has orig_csr but it's generic csr_t_p, and I will need to call methods on satp_csr_t next.
2021-09-08Use virtualized_csr_t for satp and vsatpScott Johnson1-0/+25
This was much more complicated than the others because of the mstatus.TVM and hstatus.VTVM bits, and because of the special WARL-ness of satp that doesn't apply to vsatp. It appears (based on reading the code) that the commitlog for these two was problematic. CSRW to satp when V=1 was reporting a write to satp instead of vsatp which was actually written. Also a CSRW to vsatp looks like it was not being logged at all. Both problems should be fixed now.
2021-09-08Convert mcounteren to csr_tScott Johnson1-0/+8
2021-09-08Move backdoor write method to mip-specialized classScott Johnson1-3/+5
Since that's the only one that needs it.
2021-09-08Declare mip/mie to use customized classesScott Johnson1-2/+5
Because I plan to make these two have slightly different APIs next.
2021-09-08Convert hstatus to csr_t familyScott Johnson1-0/+8
2021-09-08Convert medeleg to csr_t familyScott Johnson1-0/+11
2021-09-08Convert mideleg to csr_t familyScott Johnson1-0/+11
2021-09-08Convert sie/hie/vsie to csr_t familyScott Johnson1-0/+14
2021-09-08Convert mie to csr_t familyScott Johnson1-0/+7
This changes the commitlog of `csrw sie` so that it only logs a change to `mie`, instead of both `mie` and `sie`. This is arguably preferable, since there is no real `sie` register -- it is only a view into `mie`. It also adds proper tracing of the modification to `mie` when doing `csrw` to `hie` and `vsie`, which were both missing previously.
2021-09-08Make proper subclass for mipScott Johnson1-2/+11
To segregate things that differ from mie.