Skip to content
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

Specifying logical signal direction for ports of an elaboratable #243

Closed
nmigen-issue-migration opened this issue Sep 30, 2019 · 2 comments
Labels

Comments

@nmigen-issue-migration
Copy link

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 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.

@nmigen-issue-migration
Copy link
Author

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.

@whitequark
Copy link
Member

This was done as a part of RFC 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants