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
Here, specifying driven_by=self on the count signal performs two functions:
It acts as documentation of the MyCounter interface, making it clear that count is an output. Since advance is not specified to be driven by this Elaboratable, it can be assumed to be an input.
It provides a mechanism to find some class of bugs, such as forgetting to drive the signal from this module or also driving it from a second module.
It is probably only worth adding a driven_by type property if it is programatically checked.
Not every Signal would need to have a specified driver. Probably the vast majority of uses would be as above: documenting the outputs of an Elaboratable by specifying driven_by=self on those Signals.
The text was updated successfully, but these errors were encountered:
I'm not confident that a driven_by attribute on Signals is a good way of addressing this problem. The issue you're having is that you want an interface defined on a particular Elaboratable which defines outputs/inputs/etc. This is a feature that will be coming soon and address this better than a marker attribute.
There should be an RFC for interfaces very soon so I'm closing in favor of that approach.
It would be useful to have a way to specify that a Signal is driven by a specific Elaboratable.
Consider this example, which presupposes a
driven_by
attribute on Signal().Here, specifying
driven_by=self
on the count signal performs two functions:count
is an output. Sinceadvance
is not specified to be driven by this Elaboratable, it can be assumed to be an input.It is probably only worth adding a
driven_by
type property if it is programatically checked.Not every Signal would need to have a specified driver. Probably the vast majority of uses would be as above: documenting the outputs of an Elaboratable by specifying
driven_by=self
on those Signals.The text was updated successfully, but these errors were encountered: