-
Notifications
You must be signed in to change notification settings - Fork 572
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
Added disallowIOCreation as a public API #3575
Conversation
this is kinda a location dependent api(while chisel doesn't provide a useful feature to let user permute the execution sequence.) e.g. if this API exist in a trait, user can change the sequence of mixin sequence to workaround, can you describe the use case more detail? |
In module body io creation blocking can be done with existing fixed io and refactoring diplomacy to force people to compute their iOS first... I don't think this is the right way to achieve this for diplomacy. Agree that this could get brittle with trait mixing order... but note scala can also execute code before the existing fixed io class (maybe a deprecated feature?) |
I thought I made this impossible to pull off, however, I figured out how to do it. |
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
This helps pave the way to use of FixedIORawModule
, or other evolutions of this idea, that can be used to build stronger interfaces between modules.
I had originally thought that it would be best to start this API out as @deprecate
given the fact that it may be somewhat dangerous to rely on. However, we can claw it back if it becomes problematic. Adam has some good points about how if you are already in a MultiIOModule
-style pattern that it can only help. I think this makes sense. 👍
Description
This PR introduces two APIs (for discussion) for disabling IO creation.
The first disables IO creation for the rest of the execution of the body of a module. This is in effect a way to separate IO creation from body creation, without forcing a user to declare a bundle/record of the IO's ahead of time.
An example of how this is useful is below. A bunch of trait mix-ins to RawModule define IOs. Then, you can write user code expecting modules of type
HasBlahIO
, and call associated functions to do stuff. In a way, it enables the scala type of the RawModule contain useful information for connecting to the IOs it declares.Basically, if you want multi-IO-modules, but also lock down IOs, FixedIORawModule doesn't work well.
The second creates a scope such that any Chisel construction within the scope cannot add an IO. It is a mechanism for the caller to ensure that the callee code does not affect its interface. In general, its a good way to enforce the expected behavior of calling reusable generator code.
Contributor Checklist
docs/src
?Type of Improvement
Desired Merge Strategy
Release Notes
Enable users to lock-down the IO-creation of any module by calling
disallowIOCreation()
. This is useful for building chisel libraries which desire this behavior, but don't want to force a user to declare the entire IO in one bundle.Reviewer Checklist (only modified by reviewer)
3.5.x
,3.6.x
, or5.x
depending on impact, API modification or big change:6.0
)?Enable auto-merge (squash)
, clean up the commit message, and label withPlease Merge
.Create a merge commit
.