hdl.xfrm: handle classes that inherit from Record.
authorwhitequark <cz@m-labs.hk>
Thu, 18 Apr 2019 17:06:33 +0000 (17:06 +0000)
committerwhitequark <cz@m-labs.hk>
Thu, 18 Apr 2019 17:06:33 +0000 (17:06 +0000)
nmigen/hdl/xfrm.py

index 7c51a6194c3c4f10d05272492debdcb7c8e7041f..1385ce8c59f9da7631d4471a248f1bc91cbd11d8 100644 (file)
@@ -89,7 +89,8 @@ class ValueVisitor(metaclass=ABCMeta):
             new_value = self.on_AnySeq(value)
         elif type(value) is Signal:
             new_value = self.on_Signal(value)
-        elif type(value) is Record:
+        elif isinstance(value, Record):
+            # Uses `isinstance()` and not `type() is` to allow inheriting from Record.
             new_value = self.on_Record(value)
         elif type(value) is ClockSignal:
             new_value = self.on_ClockSignal(value)