parent
e4e26717be
commit
e18385b613
13 changed files with 208 additions and 240 deletions
5
nmigen/vendor/lattice_ice40.py
vendored
5
nmigen/vendor/lattice_ice40.py
vendored
|
|
@ -350,16 +350,18 @@ class LatticeICE40Platform(TemplatedPlatform):
|
|||
rst_i = Const(0)
|
||||
|
||||
m = Module()
|
||||
|
||||
# Power-on-reset domain
|
||||
m.domains += ClockDomain("por", reset_less=True, local=True)
|
||||
delay = int(15e-6 * self.default_clk_frequency)
|
||||
timer = Signal(max=delay)
|
||||
timer = Signal(range(delay))
|
||||
ready = Signal()
|
||||
m.d.comb += ClockSignal("por").eq(clk_i)
|
||||
with m.If(timer == delay):
|
||||
m.d.por += ready.eq(1)
|
||||
with m.Else():
|
||||
m.d.por += timer.eq(timer + 1)
|
||||
|
||||
# Primary domain
|
||||
m.domains += ClockDomain("sync")
|
||||
m.d.comb += ClockSignal("sync").eq(clk_i)
|
||||
|
|
@ -367,6 +369,7 @@ class LatticeICE40Platform(TemplatedPlatform):
|
|||
m.submodules.reset_sync = ResetSynchronizer(~ready | rst_i, domain="sync")
|
||||
else:
|
||||
m.d.comb += ResetSignal("sync").eq(~ready)
|
||||
|
||||
return m
|
||||
|
||||
def should_skip_port_component(self, port, attrs, component):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue