Skip to content
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 specifying privilege modes for simulation #984

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wsipak
Copy link

@wsipak wsipak commented Jun 28, 2024

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 of msu.)

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:

  1. default is "", which means M mode enabled, allows selecting S and U as [su]. (currently implemented)
  2. default is "m", which means M mode enabled, allows selecting S and U as m[su] - in my view this is worse because M is mandatory anyway. Contrary to (1.) this doesn't use empty string for default.
  3. default is "msu" - which means M,S,U modes are enabled. This wouldn't affect the default spike command line

Here's a PR in VeeR where I've proven VeeR's CI passes with these changes and --priv u:
chipsalliance/Cores-VeeR-EL2#197

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant