allow specifying privilege modes for simulation #984
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.
Currently we're using the default settings of privilege modes in ISS tools.
Whisper needs a 'u' in the ISA string for the User mode to be enabled. Spike, on the other hand, enables both Supervisor and User modes by default (it has a
--priv
arugment with the default ofmsu
.)We can make it consistent by adding an argument to select the modes to be enabled in simulation.
With these changes, the default selection is M-mode only.
The
--priv
argument allows enabling Supervisor and User mode, while Machine mode is mandatory and can't be disabled.I would appreciate feedback on the default value for the
--priv
argument. I can see several ways to implement it here:""
, which means M mode enabled, allows selecting S and U as[su]
. (currently implemented)"m"
, which means M mode enabled, allows selecting S and U asm[su]
- in my view this is worse because M is mandatory anyway. Contrary to (1.) this doesn't use empty string for default."msu"
- which means M,S,U modes are enabled. This wouldn't affect the defaultspike
command lineHere's a PR in VeeR where I've proven VeeR's CI passes with these changes and
--priv u
:chipsalliance/Cores-VeeR-EL2#197