build/lattice/common: Add ECP5 Differential Output support.

This commit is contained in:
Florent Kermarrec 2021-06-23 11:43:41 +02:00
parent c395a8068a
commit edc4c85615
1 changed files with 19 additions and 3 deletions

View File

@ -121,6 +121,21 @@ class LatticeECP5DifferentialInput:
def lower(dr):
return LatticeECP5DifferentialInputImpl(dr.i_p, dr.i_n, dr.o)
# ECP5 Differential Output -------------------------------------------------------------------------
class LatticeECP5DifferentialOutputImpl(Module):
def __init__(self, i, o_p, o_n):
self.specials += Instance("OLVDS",
i_A = i,
o_Z = o_p,
o_ZN = o_n,
)
class LatticeECP5DifferentialOutput:
@staticmethod
def lower(dr):
return LatticeECP5DifferentialOutputImpl(dr.i, dr.o_p, dr.o_n)
# ECP5 Special Overrides ---------------------------------------------------------------------------
lattice_ecp5_special_overrides = {
@ -130,6 +145,7 @@ lattice_ecp5_special_overrides = {
DDRInput: LatticeECP5DDRInput,
DDROutput: LatticeECP5DDROutput,
DifferentialInput: LatticeECP5DifferentialInput,
DifferentialOutput: LatticeECP5DifferentialOutput,
}
# ECP5 Trellis Tristate ----------------------------------------------------------------------------