Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sail for a while now (at least several versions at this point) has supported bitfield syntax that is closer to regular bit vector syntax. This PR updates the model to use this newer syntax. In theory this might be even more efficient (although I have not benchmarked), as the old syntax used special accessor functions that are generated by the
bitfield
declaration, whereas the new syntax avoids that indirection.To summarise, for a bitfield:
x[F]
rather thanx.F()
.x[F] = 0x00
rather thanx->F() = 0x00
.[x with F = 0x00]
rather thanupdate_F(x, 0x00)
.x.bits
rather thanx.bits()
, and the same for setting withx.bits = 0x0000_0000
.Alternatively, one can look at the manual section on bitfields
The commit adding the update syntax is separate, as it was slightly more manual than the other changes. In general, code that looked like:
can be changed to
I avoided making this update change in code I know is going to change soon (like the virtual memory code), or the PMP definitions, and I have no plans to remove the
update_
functions anyway.