Fixes for isacov
Created by: silabs-robin
This PR fixes several issues in isacov, particularly for RVC.
Some of the fixes are minor mistakes like using wrong "imm" for a particular instruction format. A big part of this PR is adding support for RVC; this was fairly incomplete before. This is not a complete cleanup; I created an issue to document what more I think could be done https://github.com/openhwgroup/core-v-verif/issues/1076.
The biggest idea I try to introduce here is to centralize how information about an instruction is obtained. Instead of each covergroup specifying what to sample (which has shown to be error prone), I would rather have functions in the instr class handle that in one single place and let all covergroups use this single source of truth (only implemented for RVC for now). By using the "2string" function and logging, one can validate that these functions give correct results by comparing to the rvfi log (I relighted the old isacov_logdiff script and it helped out a lot). Sadly though, some function (e.g. "value_type") are only used by covergroups and can't(?) be validated by the logdiff. One big challenge here is that RVC, in a way, implicitly has more instruction formats than it claims to have.
ps. I have an idea that i temporarily call "annotated pull request" that I want to try out. If I comment on the diff, then it might help review. Maybe it causes more noise than value? Since this PR is a bit complicated I want to at least try it out now, and you all can give me feedback on whether my added comments where usefull or not.
pps. Actually, I wonder if isacov could be simplified by doing more of these look up tables and flags. Could there be "one covergroup to rule them all" if we had functions/LUTs and flags to select applicable cps and bins. Or would that become more unclear instead of being more clean. That is not something to decide upon now, but I must air the idea while I have it.