tactcomplabs / rev

RISC-V SST CPU Component
Other
17 stars 21 forks source link

Refactor the performance counters code #297

Closed leekillough closed 3 months ago

leekillough commented 3 months ago

Refactor the performance counters code so that the operation of reading a performance counter is separate and orthogonal to the CSRRW, CSRRS, and CSRRC instructions.

This cuts down on the code needed, since the CSRRW, CSRRS, and CSRRCinstructions operate the same for all CSR registers, and the RevRegFile handles CSRs with special meanings through its GetCSR() and SetCSR() functions.