soc/interconnect/wishbone: add FlipFlop (should be removed)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 25 Apr 2016 17:14:20 +0000 (19:14 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 25 Apr 2016 17:14:20 +0000 (19:14 +0200)
litex/soc/interconnect/wishbone.py

index 48d002c40aad38bdd798ad11ceccf5faf33b55e8..73ba6e0ba5b320c6c126c95f2a9158cd83c3206f 100644 (file)
@@ -10,6 +10,13 @@ from litex.gen.genlib.fsm import FSM, NextState
 from litex.soc.interconnect import csr
 
 # TODO: rewrite without FlipFlop and Counter
+@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)
 
 
 _layout = [