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
To unify the syntax with how ports are usually defined (self.io = self.Port(DigitalBidir(models))) with when a base class defines an io (self.io = self.Port(DigitalBidir.empty())), instead of using .init_from, support an implicit .init_from using redeclaration syntax.
It is still an error to redeclare a port in any other context, including a partially-initialized port.
Related: to better support IO re-exporting, perhaps there needs to be a Block.export_ios_from, which (asserting the IOs exist in the block already) connects the internal to the external, matching by name.
It is an error if there is an internal IO that does not have an external counterpart, but it is not an error if there are extra external IOs
IOs still must be explicitly instantiated, to allow for static checking. One pattern might be to define an MyClassIo(Block) base class that only instantiates empty IOs of the right type.
To unify the syntax with how ports are usually defined (
self.io = self.Port(DigitalBidir(models))) with when a base class defines an io (self.io = self.Port(DigitalBidir.empty())), instead of using .init_from, support an implicit .init_from using redeclaration syntax.It is still an error to redeclare a port in any other context, including a partially-initialized port.
Related: to better support IO re-exporting, perhaps there needs to be a Block.export_ios_from, which (asserting the IOs exist in the block already) connects the internal to the external, matching by name.
MyClassIo(Block)base class that only instantiates empty IOs of the right type.Related: #114 compositional passive