This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 177
smt: add support for write-first memories #1948
Merged
mergify
merged 1 commit into
chipsalliance:master
from
ekiwi:smt-support-write-first-memories
Nov 11, 2020
Merged
smt: add support for write-first memories #1948
mergify
merged 1 commit into
chipsalliance:master
from
ekiwi:smt-support-write-first-memories
Nov 11, 2020
Conversation
This file contains 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
ekiwi
force-pushed
the
smt-support-write-first-memories
branch
from
November 10, 2020 22:39
8450800
to
611d93d
Compare
jackkoenig
approved these changes
Nov 11, 2020
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.
LGTM
I confess I don't understand the code 100% but it looks right and the tests look great.
Comment on lines
+64
to
+87
"Registered read-first memory" should "not return written data after one cycle" taggedAs (RequiresZ3) in { | ||
val cmds = | ||
""" | ||
|reg past_in: UInt<8>, clock | ||
|past_in <= in | ||
| | ||
|assume(clock, eq(read_addr, write_addr), UInt(1), "read_addr = write_addr") | ||
|assert(clock, eq(out, past_in), past_valid, "out = past(in)") | ||
|""".stripMargin | ||
test(registeredTestMem("Mem00", cmds, "old"), MCFail(1), kmax = 3) | ||
} | ||
|
||
"Registered write-first memory" should "return written data after one cycle" taggedAs (RequiresZ3) in { | ||
val cmds = | ||
""" | ||
|reg past_in: UInt<8>, clock | ||
|past_in <= in | ||
| | ||
|assume(clock, eq(read_addr, write_addr), UInt(1), "read_addr = write_addr") | ||
|assert(clock, eq(out, past_in), past_valid, "out = past(in)") | ||
|""".stripMargin | ||
test(registeredTestMem("Mem00", cmds, "new"), MCSuccess, kmax = 3) | ||
} | ||
|
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.
Love formal tests 🙂
ekiwi
added
the
Please Merge
Accepted PRs that are ready to be merged. Useful when waiting on CI.
label
Nov 11, 2020
mergify bot
pushed a commit
that referenced
this pull request
Nov 11, 2020
(cherry picked from commit 7d637e2)
mergify
bot
added
the
Backported
This PR has been backported to marked stable branch
label
Nov 11, 2020
mergify bot
added a commit
that referenced
this pull request
Nov 13, 2020
* smt: add support for write-first memories (#1948) (cherry picked from commit 7d637e2) * smt: add old functions for binary compatibility Co-authored-by: Kevin Laeufer <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Backported
This PR has been backported to marked stable branch
Please Merge
Accepted PRs that are ready to be merged. Useful when waiting on CI.
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.
Contributor Checklist
Type of Improvement
API Impact
Backend Code Generation Impact
Desired Merge Strategy
Reviewer Checklist (only modified by reviewer)
Please Merge
?