efinix: add AsyncResetSynchronizer
This commit is contained in:
parent
08be77caaf
commit
a026dd8946
|
@ -5,4 +5,39 @@
|
||||||
# Copyright (c) 2015-2018 Florent Kermarrec <florent@enjoy-digital.fr>
|
# Copyright (c) 2015-2018 Florent Kermarrec <florent@enjoy-digital.fr>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
|
||||||
efinix_special_overrides = {}
|
from migen.fhdl.module import Module
|
||||||
|
from migen.genlib.resetsync import AsyncResetSynchronizer
|
||||||
|
|
||||||
|
from litex.build.io import *
|
||||||
|
|
||||||
|
# Efinix AsyncResetSynchronizer ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
class EfinixAsyncResetSynchronizerImpl(Module):
|
||||||
|
def __init__(self, cd, async_reset):
|
||||||
|
rst1 = Signal()
|
||||||
|
self.specials += [
|
||||||
|
Instance("EFX_FF",
|
||||||
|
i_D = 0,
|
||||||
|
i_SR = async_reset,
|
||||||
|
i_CLK = cd.clk,
|
||||||
|
i_CE = 1,
|
||||||
|
o_Q = rst1),
|
||||||
|
Instance("EFX_FF",
|
||||||
|
i_D = rst1,
|
||||||
|
i_SR = async_reset,
|
||||||
|
i_CLK = cd.clk,
|
||||||
|
i_CE = 1,
|
||||||
|
o_Q = cd.rst)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class EfinixAsyncResetSynchronizer:
|
||||||
|
@staticmethod
|
||||||
|
def lower(dr):
|
||||||
|
return EfinixAsyncResetSynchronizerImpl(dr.cd, dr.async_reset)
|
||||||
|
|
||||||
|
# Gowin Special Overrides --------------------------------------------------------------------------
|
||||||
|
|
||||||
|
efinix_special_overrides = {
|
||||||
|
AsyncResetSynchronizer: EfinixAsyncResetSynchronizer
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue