Skip to content

Conversation

@challenger1024
Copy link

Add configuration option for reserved behavior pmpcfg with R=0 and W=1.

It allows two options: a fatal error that stops the simulation, or setting it to R=0, W=0, X=0 as the default choice.

See #775

Copy link
Collaborator

@Timmmm Timmmm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! LGTM, just a few minor naming tweaks.

@github-actions
Copy link

github-actions bot commented Dec 17, 2025

Test Results

2 115 tests   2 115 ✅  17m 53s ⏱️
    1 suites      0 💤
    1 files        0 ❌

Results for commit 00aee87.

♻️ This comment has been updated with latest results.

@challenger1024
Copy link
Author

last commit,

  • change ReservedBehaviorPolicy to PmpWriteOnlyReservedBehavior
  • change SetToR0W1 to ClearPermissions
  • change some comments

@Timmmm

Copy link
Collaborator

@pmundkur pmundkur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps rebase this while you're at it?

// 1. exit the simulation with a fatal error
// 2. R, W and X are all set to 0.
let cfg = if cfg[W] == 0b1 & cfg[R] == 0b0 then (
match (config base.reserved_behavior.pmpcfg_write_only : PmpWriteOnlyReservedBehavior) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same suggestion as #1403: hoist this into a let in core/platform_config.sail.

@challenger1024
Copy link
Author

last commit, Move PmpWriteOnlyReservedBehavior from types.sail to platform_config.sail, and add the variable pmp_write_only_reserved_behavior in platform_config.sail.

@pmundkur

Copy link
Collaborator

@pmundkur pmundkur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some overlap with #1403 (e.g. in prelude/errors). so one or the other will need rebasing.

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.

3 participants