-
Notifications
You must be signed in to change notification settings - Fork 0
spec/MEMW_R: register access fast path #457
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
f38c1c7
spec/memw: read/write from/to -> read from/write to
erik-3milabs 677b166
spec/memw: rename add_limb_overflow as carry
erik-3milabs ad3f093
spec/memw: minor var desc updates
erik-3milabs 109489b
spec/memw: remove superfluous minus symbol
erik-3milabs 03a2338
spec/memw: update description
erik-3milabs b8fc0b7
spec/memw_a: minor optimization
erik-3milabs b6b00c6
Apply suggestions from code review
erik-3milabs a099bbd
spec/MEMW: fix interaction typing
erik-3milabs 448555d
spec/MEMW: drop superfluous notes
erik-3milabs 4936d8c
spec/MEMW: update alignment requirement
erik-3milabs 0e3d0f8
spec/MEMW: intentionally separate carry's prose and .toml descriptions
erik-3milabs 46b9e97
spec/REGW: introduce REGW chip
erik-3milabs 1e2cb68
spec/MEMW_R: move REG to MEMW_R
erik-3milabs e01db15
spec/MEMW_R: optimize
erik-3milabs 5eaacc2
spec/MEMW_A: padding
erik-3milabs 7c8927b
spec/MEMW_R: touch ups
erik-3milabs 2a1d8e3
spec/MEMW_R: drop superfluous constraints
erik-3milabs ed889ff
spec/MEMW_R: minor fixes
erik-3milabs cc33da8
spec/MEMW_R: fix address mul 2 bug
erik-3milabs 75199d5
spec/MEMW: fix multiplicities
erik-3milabs 55ed2e6
spec/MEMW_A: padding
erik-3milabs 0b99118
spec/MEMW: padding
erik-3milabs c7203e5
spec/MEMW: bit check multiplicities
erik-3milabs 80886a6
Merge branch 'spec/memw_update2' into spec/MEMW_R
erik-3milabs 6c6fcf0
Merge branch 'spec/main' into spec/MEMW_R
erik-3milabs ea69070
spec/MEMW_R: apply 2x to address
erik-3milabs f5a27aa
spec/MEMW_R: remove superfluous casts
erik-3milabs 3750f40
spec/MEMW_R: list future optimization
erik-3milabs c9ed517
spec/MEMW_R: fix typo
erik-3milabs 42b6d18
spec/MEMW_R: fix address
erik-3milabs 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
Some comments aren't visible on the classic Files Changed page.
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,141 @@ | ||
| name = "MEMW_R" | ||
|
|
||
| # Variables | ||
|
|
||
| [[variables.input]] | ||
| name = "address" | ||
| type = "Byte" | ||
| desc = "address of the register being accessed" | ||
| pad = 0 | ||
|
|
||
| [[variables.input]] | ||
| name = "timestamp" | ||
| type = "DWordWL" | ||
| desc = "timestamp at which the access takes place" | ||
| pad = 0 | ||
|
|
||
| [[variables.input]] | ||
| name = "val" | ||
| type = "DWordWL" | ||
| desc = "value being written to this register" | ||
| pad = 0 | ||
|
|
||
| [[variables.output]] | ||
| name = "old" | ||
| type = "DWordWL" | ||
| desc = "value of this register at `old_timestamp`." | ||
| pad = 0 | ||
|
|
||
| [[variables.auxiliary]] | ||
| name = "old_timestamp_lo" | ||
| type = "Word" | ||
| desc = "the lower limb of `old_timestamp`" | ||
| pad = 0 | ||
|
|
||
| [[variables.virtual]] | ||
| name = "old_timestamp" | ||
| type = "DWordWL" | ||
| desc = "timestamp at which this register was last accessed" | ||
| def = ["cast", ["arr", "old_timestamp_lo", ["idx", "timestamp", 1]], "DWordWL"] | ||
|
erik-3milabs marked this conversation as resolved.
RobinJadoul marked this conversation as resolved.
|
||
|
|
||
| [[variables.virtual]] | ||
| name = "μ_sum" | ||
| type = "Bit" | ||
| desc = "" | ||
| def = ["+", "μ_read", "μ_write"] | ||
|
|
||
| [[variables.multiplicity]] | ||
| name = "μ_read" | ||
| type = "Bit" | ||
| desc = "Whether we are performing a read (and hence return `out`)" | ||
| pad = 0 | ||
|
|
||
| [[variables.multiplicity]] | ||
| name = "μ_write" | ||
| type = "Bit" | ||
| desc = "Whether we are performing a write (and hence not return `out`)" | ||
| pad = 0 | ||
|
|
||
|
|
||
|
|
||
| # Assumptions | ||
|
|
||
| [[assumptions]] | ||
| desc = "`IS_WORD[val[i]]`" | ||
| iter = ["i", 0, 1] | ||
| ref = "regw:a:val" | ||
|
|
||
| [[assumptions]] | ||
| desc = "`IS_WORD[timestamp[i]]`" | ||
| iter = ["i", 0, 1] | ||
| ref = "regw:a:timestamp" | ||
|
|
||
| # Constraints | ||
|
|
||
| [[constraint_groups]] | ||
| name = "diff" | ||
|
|
||
| [[constraints.diff]] | ||
| kind = "interaction" | ||
| tag = "IS_HALF" | ||
|
RobinJadoul marked this conversation as resolved.
|
||
| input = [["-", ["idx", "timestamp", 0], ["idx", "old_timestamp", 0], 1]] | ||
| multiplicity = "μ_sum" | ||
| ref = "regw:c:diff" | ||
|
|
||
|
|
||
| [[constraint_groups]] | ||
| name = "multiplicities" | ||
|
|
||
| [[constraints.multiplicities]] | ||
| kind = "template" | ||
| tag = "IS_BIT" | ||
| input = ["μ_read"] | ||
| ref = "regw:c:μ_read_is_bit" | ||
|
|
||
| [[constraints.multiplicities]] | ||
|
erik-3milabs marked this conversation as resolved.
|
||
| kind = "template" | ||
| tag = "IS_BIT" | ||
| input = ["μ_write"] | ||
| ref = "regw:c:μ_write_is_bit" | ||
|
|
||
| [[constraints.multiplicities]] | ||
| kind = "template" | ||
| tag = "IS_BIT" | ||
| input = ["μ_sum"] | ||
| ref = "regw:c:μ_sum_is_bit" | ||
|
|
||
| [[constraint_groups]] | ||
| name = "interactions" | ||
|
|
||
| [[constraints.interactions]] | ||
| kind = "interaction" | ||
| tag = "memory" | ||
| input = [1, ["arr", ["cast", ["+", ["*", 2, "address"], "i"], "Word"], 0], "old_timestamp", ["idx", "old", "i"]] | ||
| iter = ["i", 0, 1] | ||
| multiplicity = "μ_sum" | ||
|
erik-3milabs marked this conversation as resolved.
|
||
| ref = "regw:c:read_old" | ||
|
|
||
| [[constraints.interactions]] | ||
| kind = "interaction" | ||
| tag = "memory" | ||
| input = [1, ["arr", ["cast", ["+", ["*", 2, "address"], "i"], "Word"], 0], "timestamp", ["idx", "val", "i"]] | ||
| iter = ["i", 0, 1] | ||
| multiplicity = ["-", "μ_sum"] | ||
| ref = "regw:c:write_val" | ||
|
|
||
|
|
||
| [[constraint_groups]] | ||
| name = "output" | ||
|
|
||
| [[constraints.output]] | ||
| kind = "interaction" | ||
| tag = "MEMW" | ||
| input = [1, ["arr", ["cast", ["*", 2, "address"], "Word"], 0], ["arr", ["idx", "val", 0], ["idx", "val", 1], 0, 0, 0, 0, 0, 0], "timestamp", 1, 0, 0] | ||
| output = ["arr", ["idx", "old", 0], ["idx", "old", 1], 0, 0, 0, 0, 0, 0] | ||
| multiplicity = ["-", "μ_read"] | ||
|
|
||
| [[constraints.output]] | ||
| kind = "interaction" | ||
| tag = "MEMW" | ||
| input = [1, ["arr", ["cast", ["*", 2, "address"], "Word"], 0], ["arr", ["idx", "val", 0], ["idx", "val", 1], 0, 0, 0, 0, 0, 0], "timestamp", 1, 0, 0] | ||
| multiplicity = ["-", "μ_write"] | ||
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.