sail-riscv icon indicating copy to clipboard operation
sail-riscv copied to clipboard

Small improvements to new regidx newtypes

Open Timmmm opened this issue 9 months ago • 2 comments

Now that #617 is merged I think there are a few little things we could do to improve the code:

  1. Add operators for regidx and remove regidx_offset.
  2. Add overload bits_of = {...} for regidx_bits, physaddr_bits, etc.
  3. 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/virtaddr does that.

Timmmm avatar Mar 10 '25 14:03 Timmmm

3 was discussed in the meeting. @Alasdair prefers to change physaddr/virtaddr case to be Physaddr etc. so we'll do that instead.

Timmmm avatar Mar 10 '25 14:03 Timmmm

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.

nwf avatar Apr 07 '25 20:04 nwf