cores/clock: add with_reset parameter (default to True)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 31 Oct 2018 15:23:23 +0000 (16:23 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 31 Oct 2018 15:23:23 +0000 (16:23 +0100)
In some cases we want to generate the reset externally.

litex/soc/cores/clock.py

index 069772ee747cdd497725e64a6549c5bf70d8b432..c11dfb16f11d51d1feed897c3cde45a8eea95835 100644 (file)
@@ -40,12 +40,13 @@ class S7Clocking(Module, AutoCSR):
             raise ValueError
         self.clkin_freq = freq
 
-    def create_clkout(self, cd, freq, phase=0, buf="bufg", margin=1e-2):
+    def create_clkout(self, cd, freq, phase=0, buf="bufg", margin=1e-2, with_reset=True):
         assert self.nclkouts < self.nclkouts_max
         clkout = Signal()
         self.clkouts[self.nclkouts] = (clkout, freq, phase, margin)
         self.nclkouts += 1
-        self.specials += AsyncResetSynchronizer(cd, ~self.locked | self.reset)
+        if with_reset:
+            self.specials += AsyncResetSynchronizer(cd, ~self.locked | self.reset)
         if buf is None:
             self.comb += cd.clk.eq(clkout)
         else: