-
Notifications
You must be signed in to change notification settings - Fork 631
Add Incoming/Outgoing as alternatives to IO #3622
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
base: main
Are you sure you want to change the base?
Conversation
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.
High level: this makes sense to me and is both better than having an implicit direction and works towards removing the confusion around things often used for port creation (Input
/Output
) also being useful for interacting with flip.
Bikeshed-level: I'd opt for the terser: In
and Out
vs. Incoming
and Outgoing
. This has the coincidence that in
/out
were the compromise names between favoring terseness and explicitness that were adopted for dialects in CIRCT.
A migration strategy on how to handle existing methods would be good. IO
could be made deprecated in preparation for being made private[chisel3]
?
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.
Basically I'm thinking try to use chisel3.connectable, so maybe this API should leverage Alignment
API for connection?
* The granted iodef must be a non-flipped chisel type and not be bound to hardware. | ||
*/ | ||
def apply[T <: Data](iodef: => T)(implicit sourceInfo: SourceInfo): T = { | ||
if (SpecifiedDirection.isFlipped(iodef.specifiedDirection)) |
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.
I think we should require iodef is not coerced
yet.
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.
in or before we land this, could we add an Aligned
that basically nothing so that people can be writing:
val foo = Flipped(MyThing())
val bar = Aligned(MyThing())
Adding to the bikeshed i like that: val foo = Incoming(Bool()) line up 🤷 |
And another required thing might be providing a |
What would an explicit |
Both equal to
|
No @sequencer that is not what I mean. I am agreeing for a |
Is it the case that the following are indistinguishable from a connection/flow perspective? (modulo directly inspecting the type) |
As @seldridge mentioned, Incoming and Outgoing are unusual names. VHDL uses simply in and out. Verilog uses input and output. Both should be fine. |
Written in actual user Chisel not firrtly-psuedocode:
Not the same: https://scastie.scala-lang.org/exwHPt8vSEWpyd7N2SsKmQ
We can tell the users to write something different, but the above is the common thing people are doing intuitively. What if the wires have no flips to match:
They get an error: (https://scastie.scala-lang.org/xnj0D741RsqWhoAvSk4hZA)
|
What is the story supposed to be for the enduser? This kind of feature is technically good. But for this kind of change, what are we going to ask people to do with this new feature? When the designer "needs to add a port", are we advocating the use of |
The enduser doesn't write |
Motivation
First step in implementing what was discussed in this issue:
#2643
In short,
Incoming
andOutgoing
provide a way to create input/output ports that does not "strip flips" likeInput/Output
do. The alternative way to do this was to createIO(Flipped(..))
andIO(..)
, which requires the implicit knowledge thatIO
creates an output port.I'm in general curious for feedback on this API, so I'm marking as a draft for now. Thanks!
Contributor Checklist
docs/src
?Type of Improvement
Desired Merge Strategy
Release Notes
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
.