lib.fifo: make fwft a keyword-only argument.
authorwhitequark <whitequark@whitequark.org>
Thu, 12 Sep 2019 19:36:45 +0000 (19:36 +0000)
committerwhitequark <whitequark@whitequark.org>
Thu, 12 Sep 2019 19:38:18 +0000 (19:38 +0000)
Because it accepts a boolean.

nmigen/lib/fifo.py
nmigen/test/test_lib_fifo.py

index ae1ed2d81940da9baad9c82ae87e7939f7e7008e..ad8172f551ac7238a1144e60bc4ba0b3d8601052 100644 (file)
@@ -58,7 +58,7 @@ class FIFOInterface:
     w_attributes="",
     r_attributes="")
 
-    def __init__(self, width, depth, fwft):
+    def __init__(self, width, depth, *, fwft):
         self.width = width
         self.depth = depth
         self.fwft  = fwft
@@ -121,8 +121,8 @@ class SyncFIFO(Elaboratable, FIFOInterface):
     """.strip(),
     w_attributes="")
 
-    def __init__(self, width, depth, fwft=True):
-        super().__init__(width, depth, fwft)
+    def __init__(self, width, depth, *, fwft=True):
+        super().__init__(width, depth, fwft=fwft)
 
         self.level = Signal.range(depth + 1)
 
index 0b7daaa5fb6f3e5864b051848e1448a87e6d119f..972afcbde43881b658bfd2c4f3e0dbc924fa6053 100644 (file)
@@ -46,7 +46,7 @@ class FIFOModel(Elaboratable, FIFOInterface):
     Non-synthesizable first-in first-out queue, implemented naively as a chain of registers.
     """
     def __init__(self, width, depth, fwft, rdomain, wdomain):
-        super().__init__(width, depth, fwft)
+        super().__init__(width, depth, fwft=fwft)
 
         self.rdomain = rdomain
         self.wdomain = wdomain