sail-riscv
sail-riscv copied to clipboard
Small improvements to new regidx newtypes
Now that #617 is merged I think there are a few little things we could do to improve the code:
- Add operators for
regidxand removeregidx_offset. - Add
overload bits_of = {...}forregidx_bits,physaddr_bits, etc. - Maybe use the same case for
newtype regidx : Regidx, i.e.newtype regidx : regidx. I think it's a bit less to think about.physaddr/virtaddrdoes that.
3 was discussed in the meeting. @Alasdair prefers to change physaddr/virtaddr case to be Physaddr etc. so we'll do that instead.
Removing regidx_offset might make certain future affordances more of a nuisance, requiring sign-extension at call-sites. That might be fine, but just to say.