You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This came up on IRC a while back, and I thought I'd write it down for the sake of posterity.
Signals should have an optional must_read and must_write parameter for linting purposes. This would be used to mark Signals intended for external use by other Elaboratables, and warn (error?) when they are not used correctly; for example, a FIFO's input would be marked must_write and its output would be marked must_read, because if the input was not written to, or the output not read from, the FIFO would be useless.
I would suggest semantics for these as must_read and must_write producing a warning if they are never used as the source, or destination of a connection between Signals (I don't know the nMigen term for this).
Perhaps one could go further and warn if an Elaboratable does not declare any of its Signals must_read or must_write, as their linting purpose is unhelpful if all signals are optional. This would likely be quite noisy on an established nMigen codebase however.
The text was updated successfully, but these errors were encountered:
Comment by whitequark Monday Sep 30, 2019 at 12:56 GMT
I think attaching these attributes to Signals is probably not the right approach. I think it makes more sense to attach them to Elaboratables, perhaps as Python 3.7 type annotations, such that documentation can take those into account where currently Signal, in is written explicitly. This feature should also interact with #213.
Issue by ZirconiumX
Monday Sep 30, 2019 at 12:53 GMT
Originally opened as m-labs/nmigen#243
This came up on IRC a while back, and I thought I'd write it down for the sake of posterity.
Signals should have an optional
must_read
andmust_write
parameter for linting purposes. This would be used to mark Signals intended for external use by other Elaboratables, and warn (error?) when they are not used correctly; for example, a FIFO's input would be markedmust_write
and its output would be markedmust_read
, because if the input was not written to, or the output not read from, the FIFO would be useless.I would suggest semantics for these as
must_read
andmust_write
producing a warning if they are never used as the source, or destination of a connection between Signals (I don't know the nMigen term for this).Perhaps one could go further and warn if an Elaboratable does not declare any of its Signals
must_read
ormust_write
, as their linting purpose is unhelpful if all signals are optional. This would likely be quite noisy on an established nMigen codebase however.The text was updated successfully, but these errors were encountered: