Skip to content

Commit

Permalink
build/efinix/common: Switch to LiteXModule.
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Sep 26, 2024
1 parent 95e5e73 commit 9760493
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions litex/build/efinix/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def assert_is_signal_or_clocksignal(obj):

# Efinix AsyncResetSynchronizer --------------------------------------------------------------------

class EfinixAsyncResetSynchronizerImpl(Module):
class EfinixAsyncResetSynchronizerImpl(LiteXModule):
def __init__(self, cd, async_reset):
rst1 = Signal()
self.specials += [
Expand Down Expand Up @@ -71,7 +71,7 @@ def lower(dr):

# Efinix Clk Input ---------------------------------------------------------------------------------

class EfinixClkInputImpl(Module):
class EfinixClkInputImpl(LiteXModule):
n = 0
def __init__(self, i, o):
platform = LiteXContext.platform
Expand Down Expand Up @@ -102,14 +102,14 @@ def __init__(self, i, o):
o = clk_out
EfinixClkInputImpl.n += 1 # FIXME: Improve.

class EfinixClkInput(Module):
class EfinixClkInput(LiteXModule):
@staticmethod
def lower(dr):
return EfinixClkInputImpl(dr.i, dr.o)

# Efinix Clk Output --------------------------------------------------------------------------------

class EfinixClkOutputImpl(Module):
class EfinixClkOutputImpl(LiteXModule):
def __init__(self, i, o):
assert_is_signal_or_clocksignal(i)
platform = LiteXContext.platform
Expand All @@ -124,14 +124,14 @@ def __init__(self, i, o):
platform.toolchain.ifacewriter.blocks.append(block)
platform.toolchain.excluded_ios.append(o)

class EfinixClkOutput(Module):
class EfinixClkOutput(LiteXModule):
@staticmethod
def lower(dr):
return EfinixClkOutputImpl(dr.i, dr.o)

# Efinix Tristate ----------------------------------------------------------------------------------

class EfinixTristateImpl(Module):
class EfinixTristateImpl(LiteXModule):
def __init__(self, io, o, oe, i=None):
platform = LiteXContext.platform
if len(io) == 1:
Expand Down Expand Up @@ -162,14 +162,14 @@ def __init__(self, io, o, oe, i=None):
platform.toolchain.ifacewriter.blocks.append(block)
platform.toolchain.excluded_ios.append(platform.get_pin(io))

class EfinixTristate(Module):
class EfinixTristate(LiteXModule):
@staticmethod
def lower(dr):
return EfinixTristateImpl(dr.target, dr.o, dr.oe, dr.i)

# Efinix DifferentialOutput ------------------------------------------------------------------------

class EfinixDifferentialOutputImpl(Module):
class EfinixDifferentialOutputImpl(LiteXModule):
def __init__(self, i, o_p, o_n):
platform = LiteXContext.platform
# only keep _p
Expand Down Expand Up @@ -214,7 +214,7 @@ def lower(dr):

# Efinix DifferentialInput -------------------------------------------------------------------------

class EfinixDifferentialInputImpl(Module):
class EfinixDifferentialInputImpl(LiteXModule):
def __init__(self, i_p, i_n, o):
platform = LiteXContext.platform
# only keep _p
Expand Down Expand Up @@ -274,7 +274,7 @@ def lower(dr):

# Efinix DDRTristate -------------------------------------------------------------------------------

class EfinixDDRTristateImpl(Module):
class EfinixDDRTristateImpl(LiteXModule):
def __init__(self, io, o1, o2, oe1, oe2, i1, i2, clk):
assert oe1 == oe2
assert_is_signal_or_clocksignal(clk)
Expand Down Expand Up @@ -319,7 +319,7 @@ def lower(dr):

# Efinix SDRTristate -------------------------------------------------------------------------------

class EfinixSDRTristateImpl(Module):
class EfinixSDRTristateImpl(LiteXModule):
def __init__(self, io, o, oe, i, clk):
assert_is_signal_or_clocksignal(clk)
platform = LiteXContext.platform
Expand Down Expand Up @@ -353,14 +353,14 @@ def __init__(self, io, o, oe, i, clk):
platform.toolchain.excluded_ios.append(platform.get_pin(io))


class EfinixSDRTristate(Module):
class EfinixSDRTristate(LiteXModule):
@staticmethod
def lower(dr):
return EfinixSDRTristateImpl(dr.io, dr.o, dr.oe, dr.i, dr.clk)

# Efinix SDROutput ---------------------------------------------------------------------------------

class EfinixSDROutputImpl(Module):
class EfinixSDROutputImpl(LiteXModule):
def __init__(self, i, o, clk):
assert_is_signal_or_clocksignal(clk)
platform = LiteXContext.platform
Expand All @@ -386,14 +386,14 @@ def __init__(self, i, o, clk):
platform.toolchain.excluded_ios.append(platform.get_pin(o))


class EfinixSDROutput(Module):
class EfinixSDROutput(LiteXModule):
@staticmethod
def lower(dr):
return EfinixSDROutputImpl(dr.i, dr.o, dr.clk)

# Efinix DDROutput ---------------------------------------------------------------------------------

class EfinixDDROutputImpl(Module):
class EfinixDDROutputImpl(LiteXModule):
def __init__(self, i1, i2, o, clk):
assert_is_signal_or_clocksignal(clk)
platform = LiteXContext.platform
Expand Down Expand Up @@ -427,7 +427,7 @@ def lower(dr):

# Efinix SDRInput ----------------------------------------------------------------------------------

class EfinixSDRInputImpl(Module):
class EfinixSDRInputImpl(LiteXModule):
def __init__(self, i, o, clk):
assert_is_signal_or_clocksignal(clk)
platform = LiteXContext.platform
Expand Down Expand Up @@ -457,7 +457,7 @@ def lower(dr):

# Efinix DDRInput ----------------------------------------------------------------------------------

class EfinixDDRInputImpl(Module):
class EfinixDDRInputImpl(LiteXModule):
def __init__(self, i, o1, o2, clk):
assert_is_signal_or_clocksignal(clk)
platform = LiteXContext.platform
Expand Down

0 comments on commit 9760493

Please sign in to comment.