mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
Merge pull request #1038 from antmicro/crosslinknx-ddr-tristate
build/lattice: add DDRTristate for Crosslink-NX
This commit is contained in:
commit
0daa86a8bb
2 changed files with 20 additions and 0 deletions
|
@ -298,6 +298,24 @@ class LatticeNXDDROutput:
|
||||||
def lower(dr):
|
def lower(dr):
|
||||||
return LatticeNXDDROutputImpl(dr.i1, dr.i2, dr.o, dr.clk)
|
return LatticeNXDDROutputImpl(dr.i1, dr.i2, dr.o, dr.clk)
|
||||||
|
|
||||||
|
# NX DDR Tristate ------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class LatticeNXDDRTristateImpl(Module):
|
||||||
|
def __init__(self, io, o1, o2, oe1, oe2, i1, i2, clk):
|
||||||
|
_o = Signal()
|
||||||
|
_oe = Signal()
|
||||||
|
_i = Signal()
|
||||||
|
self.specials += DDROutput(i1, i2, _o, clk)
|
||||||
|
self.specials += SDROutput(oe1|oe2, _oe, clk)
|
||||||
|
self.specials += DDRInput(_i, o1, o2, clk)
|
||||||
|
self.specials += Tristate(io, _o, _oe, _i)
|
||||||
|
_oe.attr.add("syn_useioff")
|
||||||
|
|
||||||
|
class LatticeNXDDRTristate:
|
||||||
|
@staticmethod
|
||||||
|
def lower(dr):
|
||||||
|
return LatticeNXDDRTristateImpl(dr.io, dr.o1, dr.o2, dr.oe1, dr.oe2, dr.i1, dr.i2, dr.clk)
|
||||||
|
|
||||||
# NX Special Overrides -----------------------------------------------------------------------------
|
# NX Special Overrides -----------------------------------------------------------------------------
|
||||||
|
|
||||||
lattice_NX_special_overrides = {
|
lattice_NX_special_overrides = {
|
||||||
|
@ -306,6 +324,7 @@ lattice_NX_special_overrides = {
|
||||||
SDROutput: LatticeNXSDROutput,
|
SDROutput: LatticeNXSDROutput,
|
||||||
DDRInput: LatticeNXDDRInput,
|
DDRInput: LatticeNXDDRInput,
|
||||||
DDROutput: LatticeNXDDROutput,
|
DDROutput: LatticeNXDDROutput,
|
||||||
|
DDRTristate: LatticeNXDDRTristate,
|
||||||
}
|
}
|
||||||
|
|
||||||
lattice_NX_special_overrides_for_oxide = dict(lattice_NX_special_overrides)
|
lattice_NX_special_overrides_for_oxide = dict(lattice_NX_special_overrides)
|
||||||
|
|
|
@ -108,6 +108,7 @@ def _run_script(script):
|
||||||
class LatticeOxideToolchain:
|
class LatticeOxideToolchain:
|
||||||
attr_translate = {
|
attr_translate = {
|
||||||
"keep": ("keep", "true"),
|
"keep": ("keep", "true"),
|
||||||
|
"syn_useioff": ("syn_useioff", 1),
|
||||||
}
|
}
|
||||||
|
|
||||||
special_overrides = common.lattice_NX_special_overrides_for_oxide
|
special_overrides = common.lattice_NX_special_overrides_for_oxide
|
||||||
|
|
Loading…
Reference in a new issue