-
Notifications
You must be signed in to change notification settings - Fork 147
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
Add 'RenderVoid' option to blackboxes #911
Merged
Merged
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
Member
martijnbastiaan
commented
Nov 7, 2019
•
edited
Loading
edited
e1ac22b
to
ae16d03
Compare
|
ae16d03
to
ee11a1c
Compare
christiaanb
previously requested changes
Nov 11, 2019
3e0ce96
to
85c8304
Compare
11 tasks
@martijnbastiaan When CI passes, this can be merged? |
Yes. Thanks for looking into it. |
Void data (e.g., `Index 1`, `BitVector 0`, `()`) results in zero-width vectors in HDL. HDL tools handle these constructs poorly. To work around that 01843d3 added void-filtering to Clash. As a consequence, any functions solely generating a void construct aren't rendered at all. Often, this is okay: functions yielding voids are generally the result of a generalization and don't perform any actually work when instantiated with a void. _Sometimes_ though, we would like to generate them: * In the case of `BiSignal`s, one would like to completely remove any `BiSignalOut`s from the HDL, as the corresponding `BiSignalIn` will already be converted to an `inout` wire. We'd still like to render all the blackboxes yielding a `BiSignalOut` though. * (SystemVerilog) Assertions don't carry any "out" signals. They construct a comment instructing the simulator / verification tool to check some property. Clash simulation can't support this though: functions without outputs simply do not exist. In this case, we'd like to mark an "assertion result" as void, so it would get filtered in HDL. Similar to the previous use case, we'ld like the comments to be rendered still. See #864 for more information. * Some `IO ()` actions as described in #815 must result in HDL. Like the previous two features, `IO ()` would get filtered though. This commit allows blackboxes to specify whether they would like to be rendered even if their result is void. Note that any blackboxes specifying this must make sure that they do not assign anything to their result - as this is zero bits, Clash won't generate any signal declarations for it. As a happy coincidence, this removes the need for special support for BiSignalOut in the compiler.
134de5b
to
43c808a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.