interconnect/wishbone: add FlipFlop to allow UpConverter to be used
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 9 Sep 2019 09:02:14 +0000 (11:02 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 9 Sep 2019 09:47:36 +0000 (11:47 +0200)
Note: a test should be added for Converter and DownConverter/UpConverter should be cleaned up

litex/soc/interconnect/wishbone.py

index dc242f443185110975f3c4451c592445d8ba59cc..f76cdb4c4948c9d525fdfa01ac401c446a86fb94 100644 (file)
@@ -291,6 +291,15 @@ class DownConverter(Module):
             )
 
 
+@ResetInserter()
+@CEInserter()
+class FlipFlop(Module):
+    def __init__(self, *args, **kwargs):
+        self.d = Signal(*args, **kwargs)
+        self.q = Signal(*args, **kwargs)
+        self.sync += self.q.eq(self.d)
+
+
 class UpConverter(Module):
     """UpConverter