-
Notifications
You must be signed in to change notification settings - Fork 48
Provide template for an efficient private RAM #379
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
Draft
mandolaerik
wants to merge
1
commit into
intel:main
Choose a base branch
from
mandolaerik:pr/provide-template-for-an-efficient-private-ram
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.
Draft
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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
© 2025 Intel Corporation | ||
SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
dml 1.4; | ||
|
||
device test; | ||
|
||
import "utility.dml"; | ||
|
||
subdevice ram { | ||
is ram; | ||
param size = 65536; | ||
} | ||
|
||
attribute trigger_test is bool_attr { | ||
// cannot run from init: RAM access requires queue to be set | ||
method set(attr_value_t _) throws { | ||
// integer across page boundary | ||
assert ram.ram.page_size == 0x2000; | ||
ram.set_u8(0x1ffe, 0x11); | ||
ram.set_u8(0x1fff, 0x22); | ||
ram.set_u8(0x2000, 0x33); | ||
ram.set_u8(0x2001, 0x44); | ||
assert ram.get_u64_le(0x1ff8) == 0x2211_0000_0000_0000; | ||
assert ram.get_u64_le(0x2000) == 0x4433; | ||
assert ram.get_u64_le(0x1ffe) == 0x44332211; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# © 2025 Intel Corporation | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
clock = SIM_create_object('clock', 'clock', freq_mhz=1) | ||
# implementer of direct_memory_update must have a clock | ||
obj.ram.queue = clock | ||
obj.trigger_test = True | ||
|
||
b=simics.buffer_t(100) | ||
obj.ram.ram.iface.ram.read(None, 0, b, 0) | ||
print(bytes(b)) |
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.
A better design is probably to create a template for a private RAM connect, without DMI support, and then create a separate template which adds DMI magic to all private RAMs within a bank/subdev/port
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.
Oh, this adds some pain: the use of get_user_data requires that you have one separate direct_memory_update ports for each RAM; if we want a shared impl, then we instead need to keep a private hashtable from handles to pages.