compat.genlib.fifo: adjust _FIFOInterface shim to not require fwft=.
authorwhitequark <whitequark@whitequark.org>
Tue, 22 Jan 2019 06:56:46 +0000 (06:56 +0000)
committerwhitequark <whitequark@whitequark.org>
Tue, 22 Jan 2019 06:56:46 +0000 (06:56 +0000)
nmigen/compat/genlib/fifo.py

index fee37b8c7a40f267074aabdd406d85398892de8c..896b26be4b95dc53015f7203492ea3fd485a498d 100644 (file)
@@ -1,5 +1,16 @@
-from ...lib.fifo import FIFOInterface as _FIFOInterface, \
-  SyncFIFO, SyncFIFOBuffered
+from ...tools import deprecated
+from ...lib.fifo import FIFOInterface as NativeFIFOInterface, \
+  SyncFIFO, SyncFIFOBuffered, AsyncFIFO, AsyncFIFOBuffered
 
 
-__all__ = ["_FIFOInterface", "SyncFIFO", "SyncFIFOBuffered"]
+__all__ = ["_FIFOInterface", "SyncFIFO", "SyncFIFOBuffered", "AsyncFIFO", "AsyncFIFOBuffered"]
+
+
+@deprecated("attribute `fwft` must be provided to FIFOInterface constructor")
+class CompatFIFOInterface(NativeFIFOInterface):
+    def __init__(self, width, depth):
+        super().__init__(width, depth, fwft=False)
+        del self.fwft
+
+
+_FIFOInterface = CompatFIFOInterface