pipistrello: add por reset counter
authorRobert Jordens <jordens@gmail.com>
Thu, 26 Mar 2015 20:12:35 +0000 (14:12 -0600)
committerSebastien Bourdeauducq <sb@m-labs.hk>
Fri, 27 Mar 2015 18:18:11 +0000 (19:18 +0100)
* this is a temporary fix that should be removed once the
combination of bitstream-in-flash, mor1kx, bios-in-flash works

targets/pipistrello.py

index ccdd499937eae91c85be28803c0d6c1cf9ef19b2..68e877f77d50d98e6261e03ab4d8ee0c60d3962e 100644 (file)
@@ -58,7 +58,12 @@ class _CRG(Module):
                )
                self.specials += Instance("BUFG", i_I=pll[5], o_O=self.cd_sys.clk)
                reset = platform.request("user_btn")
-               self.specials += AsyncResetSynchronizer(self.cd_sys, ~pll_lckd | reset)
+               self.clock_domains.cd_por = ClockDomain()
+               por = Signal(max=1 << 11, reset=(1 << 11) - 1)
+               self.sync.por += If(por != 0, por.eq(por - 1))
+               self.comb += self.cd_por.clk.eq(self.cd_sys.clk)
+               self.specials += AsyncResetSynchronizer(self.cd_por, reset)
+               self.specials += AsyncResetSynchronizer(self.cd_sys, ~pll_lckd | (por > 0))
                self.specials += Instance("BUFG", i_I=pll[2], o_O=self.cd_sdram_half.clk)
                self.specials += Instance("BUFPLL", p_DIVIDE=4,
                                                        i_PLLIN=pll[0], i_GCLK=self.cd_sys.clk,