-
Notifications
You must be signed in to change notification settings - Fork 49
Document bank's set, get, unmapped_get -- SIMICS-23287
#404
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
Open
lwaern-intel
wants to merge
1
commit into
intel:main
Choose a base branch
from
lwaern-intel:lw/23287
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1803,11 +1803,49 @@ of `unmapped_read` if the access is not fully | |
| mapped. | ||
| </dd><dt> | ||
|
|
||
| <small>unmapped\_read(uint64 offset, uint64 bits, void \*aux) throws</small> | ||
| <small>unmapped\_read(uint64 offset, uint64 bits, void \*aux) -> (uint64) throws</small> | ||
| </dt><dd> | ||
|
|
||
| Like `unmapped_write` but for reads. The default | ||
| implementation unconditionally throws an exception. | ||
| Like `unmapped_write` but for reads. The default implementation unconditionally | ||
| throws an exception, which causes the read access to be rejected. However, the | ||
| method may be overridden to instead return a value specifying the read bits | ||
| corresponding to the unmapped bytes, which will then be composed together with | ||
| the values read from the accessed registers. | ||
| </dd><dt> | ||
|
|
||
| <small>set(uint64 offset, uint64 size, uint64 value)</small> | ||
| </dt><dd> | ||
| A simpler variant of `write()` used exclusively for inquiry write accesses to | ||
| the bank. Unlike `write()`, `set()` unconditionally operates over an entire | ||
| range of bytes (hence `size` rather than `enabled_bytes`), does not have an | ||
| `aux` parameter, and cannot throw. Any invocation of `write` is considered | ||
| valid, even if some part of the access is not covered by mapped registers (in | ||
| which case no action should be taken for those bytes.) | ||
|
|
||
| The default implementation invokes `set()` of the accessed registers rather | ||
| than `write_register()`, and instead of calling to something similar to | ||
| `unmapped_write()`, the default implementation simply logs a low-level `info` | ||
| message about unmapped accesses. | ||
| </dd><dt> | ||
|
|
||
| <small>get(uint64 offset, uint64 size) -> (uint64) throws</small> | ||
| </dt><dd> | ||
| A simpler variant of `read()` used exclusively for inquiry read accesses to | ||
| the bank. Unlike `read`, `get()` unconditionally operates over an entire | ||
| range of bytes (hence `size` rather than `enabled_bytes`) and does not have an | ||
| `aux` parameter. Unlike `set()`, invocations to `get()` may throw, in | ||
| particular when some part of the access is not covered by mapped registers. | ||
|
Comment on lines
+1836
to
+1837
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it could be worth mentioning something about the semantics of an exception, which for many years was not obvious to me. An exception indicates that some part of the accessed bytes is not mapped, and this is used by Simics in inspection commands such as |
||
|
|
||
| The default implementation invokes `get()` of the accessed registers rather | ||
| than `read_register()`, and calls to `unmapped_get()` upon unmapped accesses | ||
| rather than `unmapped_read()`. | ||
| </dd></dt> | ||
|
|
||
| <small>unmapped\_get(uint64 offset, uint64 bits) -> (uint64) throws</small> | ||
| </dt><dd> | ||
|
|
||
| Like `unmapped_read` but for inquiry reads. The default implementation | ||
| unconditionally throws an exception. | ||
| </dd></dl> | ||
|
|
||
| The `bank` template contains the following parameters: | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider something like
, ...,or, ...; also,instead of(...)(and same thing inset). Parentheses are generally harmful for text flow, so it's good to avoid them if that's easy.