chipsalliance / VeeR-ISS

Apache License 2.0
114 stars 33 forks source link

How to add custom CSR definition in whisper #13

Open somyadashora opened 2 years ago

somyadashora commented 2 years ago

I wanted to add my custom CSR like MRAC in Whisper, how can i do that?

Also accessing MRAC via peek c 0x7C0 gives Failed to read CSR: 0x7c0 How can i resolve that.

aprnath commented 2 years ago

Availability/visibility of non-std CSRs depends on the configuration JSON file. You can define any arbitrary CSR with its reset value, mask etc in the JSON file.

The peek will fail if the JSON file you reference does not have MRAC defined.

divastor commented 2 years ago

You can define "mrac" in the JSON file under the "csr" field like this: "csr": ... "mrac" : { "number" : "0x7c0", "exists" : "true", "reset" : "0x0", "mask" : "0xffffffff" } ...

I thought this was an error as well, but after a bit of digging, I realized it is probably an error (?) of the git repo Core-SweRV. That is if you are using their swerv.config as I do, to generate the whisper JSON file. The script did not create the entry for "mrac".