-
Notifications
You must be signed in to change notification settings - Fork 13
[feat] Enforce semantics for write once memory (wom) #1834
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
OlivierBBB
wants to merge
10
commits into
main
Choose a base branch
from
1560-feat-enforce-semantics-for-write-once-memory-wom
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
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ea6b692
wip
OlivierBBB 6671d63
ras
OlivierBBB 3721199
feat: unified memory
OlivierBBB c0cc361
ras: renaming of p to env in environment.go
OlivierBBB 0f2959c
Merge branch 'main' into 1560-feat-enforce-semantics-for-write-once-m…
OlivierBBB 544f1da
Merge branch 'main' into 1560-feat-enforce-semantics-for-write-once-m…
OlivierBBB d3c68ba
ras
OlivierBBB e587dd4
ras: documentation
OlivierBBB dee6fbf
feat: AOM constraints
OlivierBBB adc023d
Merge branch 'main' into 1560-feat-enforce-semantics-for-write-once-m…
OlivierBBB 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 |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # Memory design space | ||
|
|
||
| Designing a memory module `m` requires at a minimum categorizing it along the following dimensions: | ||
|
|
||
| - **ACCESS**: how do other modules communicate with it ? | ||
| - **COHERENCE**: is a coherence argument (i.e. memory consistency argument) required ? | ||
| - **MUTABILITY**: is that memory mutable or immutable ? | ||
| - **ADDRESS SPACE**: is data stored in a contiguous fashion or can it be sparse ? | ||
| - **SEGMENTATION**: is the memory accessible across several trace segments or not ? | ||
|
|
||
| We provide constraints for memories below: | ||
|
|
||
| ## RAM: Random Access Memory | ||
|
|
||
| - **ACCESS**: logUpBus based | ||
| - **COHERENCE**: logUpBus-based `Σ ≡ 0` coherence argument involving timestamps | ||
| - **MUTABILITY**: unrestricted reads and writes | ||
| - **ADDRESS SPACE**: sparse | ||
| - **SEGMENTATION**: multi-segment | ||
|
|
||
| Use case: standard computer memory | ||
|
|
||
| ## AOM: Access Once Memory | ||
|
|
||
| **AOM**'s provide an immutable memory that gets read start to finish in a single segment. | ||
|
|
||
| **Note.** I suggest using **AOM** as a replacement for **ROM** / **WOM**: these two notions are functionally identical and differ, AFAICT, only in their intended use cases. Both are meant to hold immutable data that's avaiable from the start of tracing, and either seen as _providing_ inputs or _receiving_ output. In any case, they are functionally identical. | ||
|
|
||
| - **ACCESS**: lookup based | ||
| - **COHERENCE**: none required | ||
| - **MUTABILITY**: immutable | ||
| - **ADDRESS SPACE**: contiguous | ||
| - **SEGMENTATION**: all accesses concentrated in one segment | ||
|
|
||
| Use case: provide inputs or extract outputs in one go, | ||
| e.g. read `m` start to finish in one trace segment. | ||
|
|
||
| ## WOM: Write Once Memory | ||
|
|
||
| **WOM**'s provide an initially empty memory where every cell may be read from and written to, but the initial write is definitive. | ||
|
|
||
| - **ACCESS**: logUpBus based | ||
| - **COHERENCE**: logUpBus-based `Σ ≡ 0` coherence argument involving timestamps | ||
| - **MUTABILITY**: | ||
| - arbitrary reads | ||
| - first write sets value in stone (subsequent writes mustn't modify the current value) | ||
| - first write marks an address as `WAS_ALREADY_WRITTEN_TO` | ||
| - **ADDRESS SPACE**: contiguous | ||
| - **SEGMENTATION**: multi-segment | ||
|
|
||
| Use case: extract definitive outputs that may be read by other processes | ||
|
|
||
| - is `m` single access ? | ||
| - there are concrete cases (e.g. guest program ELF sections, guest program input) | ||
| - can it be assumed that the accesses land in a single trace segment ? if so one doesn't have to care about inter segment coherence | ||
| - is `m` | ||
| - immutable ? | ||
| - set once ? | ||
| - arbitrarily modifiable ? | ||
| - the answer to that question dictates whether one requires whether access must be tracked or not | ||
| - e.g. for WRITE ONCE MEMORY one should track | ||
| - is memory access confined to a single segment ? | ||
| - the answer to that question dictates whether | ||
| - memory consistency can be handled in module (and without permutation) or should be handled using a bus argument | ||
| - whether timestamps are required to order accesses or not | ||
| - does the memory permit writes ? | ||
| - if so, does it permit more than one write per address ? | ||
| - does the memory permit reads ? | ||
| - are accesses sequential and confined to a single segment or can they occur at any point in the execution ? | ||
| - one can talk of the ONE TIME ACCESS property | ||
| - are accesses sequential and confined to a single segment or can they occur at any point in the execution ? | ||
| - does the touched address space have gaps ? | ||
| - CONTIGUOUS memory allows potential initialization / finalization phases to increment addresses via `addr.next() = addr + 1` |
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
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
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
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 |
|---|---|---|
|
|
@@ -88,7 +88,8 @@ func (p *StmtCompiler) compileStatement(pc uint, mapping []uint, s Stmt) VectorI | |
| // | ||
| // > struct tmp { x u32, y u32 } | ||
| // > ... | ||
| // > var t tmp > tmp = f(...) | ||
| // > var t tmp | ||
| // > tmp = f(...) | ||
|
Comment on lines
+91
to
+92
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. Agreed, this is a typo |
||
| // | ||
| // In this case, we want to "compile out" the struct, so we end up with this: | ||
| // | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.