-
Notifications
You must be signed in to change notification settings - Fork 60
add assert primitive and basic test #2463
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
Conversation
TODO: get it working with runt
|
|
The error originates from cider which the Calyx interpreter. Cider reimplements each primitive in Rust. Unless @EclecticGriffin sees an obvious use case for this, we can just shim it out as a noop or a warning that is logged? |
|
It would be an easy implementation in Cider fwiw. And if we're including it in the standard library, albeit in the unsynthesizable section, I think we should implement it in Cider. Happy to take care of that tomorrow or offer pointers. If that would be a blocker, you can also elide this particular test case in the runt invocation for the cider test suite. |
|
Ok, trying to implement a cider |
|
It looks like the (expected/correct) |
|
@elamdf That seems fine to me? Would you rather like assertions to log and not crash the program (software asserts generally crash the program as well). |
|
I agree it should crash the sim. I think it's a bit shady, however, to define the Do you think there's an elegant/generic way to handle this that's not 'catch this hardcoded case in |
|
This pull request has not seen activity in 14 days and is being marked as stale. If you're continuing work on this, please reply and state how to get this PR in a mergeable state or what issues it is blocked on. If the PR is not ready for review, please mark it as a draft. The PR will be closed in 7 days if there is no further activity. |
|
Just trying to save this PR from staleness!
You know, taking a "perfect is the enemy of the good" approach here, maybe this situation is not so bad… just requiring some kind of crash seems like maybe it's a fine first step. @elamdf, what do you think about just keeping it that way for now? I think just making the Runt config a little smarter (grepping the log for an appropriate message) would be the appropriate next step, but just doing the obvious/dubious thing here seems like it might be better than nothing. |
|
done- the tests now pass (with output expecting ninja to crash) |
3f6ed29 to
257a266
Compare
|
does this need anything else b4 merge? cc @rachitnigam |
primitives/assert.futil
Outdated
| extern "assert.sv" { | ||
| primitive std_assert(@data in: 1, en: 1, @clk clk:1, @reset reset: 1) -> (out: 1); | ||
| // WARNING: the assert will be optimized out unless it is `@protected`, or `out` is referenced | ||
| // TODO: there should be a way to globally protect a component/primitive |
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.
Please open an issue about this and remove this line.
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.
|
Workflows are running now! |
|
resolved comments |
|
@EclecticGriffin there seem to be a bunch of errors related to clippy formats? Any thoughts on what could be going wrong (for example, the recent change to Rust version)? |
|
that's strange. I'm not sure what could be causing that but I'll take a look |
|
On further inspection it seems that these are all legitimate warnings from clippy |
|
it looks like my brittle hack (expecting "ninja exited with status 1" as the log msg for the assert tests) has shown its brittleness, and doesn't work now seemingly due to some new backtrace being emitted. Is there a way to wildcard log messages in runt, or some grepping that could be done? |
|
Ah yes, this comes from You can check the bottom of the cider |
|
This pull request has not seen activity in 14 days and is being marked as stale. If you're continuing work on this, please reply and state how to get this PR in a mergeable state or what issues it is blocked on. If the PR is not ready for review, please mark it as a draft. The PR will be closed in 7 days if there is no further activity. |
|
This stale PR is being closed because it has not seen any activity in 7 days. If you're planning to continue work on it, please reopen it and mention how to make progress on it. |
Pull request was closed
TODO: get it working with runt. When I invoke the test with
fudit (correctly) fails, but runt seems to complain that the primitive doesn't exist (perhaps for fud2 they have to be registered)?