-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow empty bitfield? #899
Comments
I don't see any harm in allowing an empty bitfield, but I think a plain bitvector would be fine for most use cases - you would just use |
There are some interesting issues to do with empty bitranges: in a normal Turing-complete software setting, an empty bitvector is type-isomorphic to the But what happens with RTL, e.g. Verilog? Should we still generate a port for empty bitvectors? There are reasonable arguments either way ... |
In this case it's about having a bitfield with no fields, but the underlying bits type would still be non-empty like I don't think it's correct to say that unit tells you anything about termination, as both:
have type |
For Sail zero-width bitvectors, i.e. |
Some registers in riscv currently have no bits defined.
like
mstateen1
,mstateen2
...https://riscv-specs.timhutt.co.uk/spec/riscv-isa-release-b5aa38c-2025-01-17/riscv-privileged.html#_state_enable_0_registers
But sail doesn't accept empty bitfield
| bitfield <id> : <typ> = { <r_def_body> }
I can use
But things like
mstateen1.bits
are not avaliable. So could we make sail accept empty bitfield for future use?The text was updated successfully, but these errors were encountered: