lib.io: fix Pin.eq to work when FlippedInterface is involved.
This was broken by #915, when platform started handing out `FlippedInterface` versions of `Pin`.
This commit is contained in:
parent
74e613b49d
commit
57748a66a6
2 changed files with 14 additions and 2 deletions
|
|
@ -4,7 +4,7 @@ from .. import *
|
|||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings(action="ignore", category=DeprecationWarning)
|
||||
from ..hdl.rec import *
|
||||
from ..lib.wiring import In, Out, Signature
|
||||
from ..lib.wiring import In, Out, Signature, flipped, FlippedInterface
|
||||
|
||||
|
||||
__all__ = ["pin_layout", "Pin"]
|
||||
|
|
@ -135,4 +135,7 @@ class Pin(Record):
|
|||
first_field, _, _ = next(iter(Pin(1, dir="o").layout))
|
||||
warnings.warn(f"`pin.eq(...)` is deprecated; use `pin.{first_field}.eq(...)` here",
|
||||
DeprecationWarning, stacklevel=2)
|
||||
return super().eq(other)
|
||||
if isinstance(self, FlippedInterface):
|
||||
return Record.eq(flipped(self), other)
|
||||
else:
|
||||
return Record.eq(self, other)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue