Merge pull request #2081 from VOGL-electronic/build_efinix_add_sdr_input

build: efinix: common.py; add `SDRInput`
This commit is contained in:
enjoy-digital 2024-09-26 11:43:20 +02:00 committed by GitHub
commit 0e337e2079
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 29 additions and 0 deletions

View File

@ -417,6 +417,34 @@ class EfinixDDROutput:
def lower(dr): def lower(dr):
return EfinixDDROutputImpl(dr.platform, dr.i1, dr.i2, dr.o, dr.clk) return EfinixDDROutputImpl(dr.platform, dr.i1, dr.i2, dr.o, dr.clk)
# Efinix SDRInput ----------------------------------------------------------------------------------
class EfinixSDRInputImpl(Module):
def __init__(self, platform, i, o, clk):
io_name = platform.get_pin_name(i)
io_pad = platform.get_pin_location(i)
io_prop = platform.get_pin_properties(i)
io_data = platform.add_iface_io(io_name)
self.comb += o.eq(io_data)
block = {
"type" : "GPIO",
"mode" : "INPUT",
"name" : io_name,
"location" : io_pad,
"properties" : io_prop,
"size" : 1,
"in_reg" : "REG",
"in_clk_pin" : clk.name_override, # FIXME.
"in_clk_inv" : 0
}
platform.toolchain.ifacewriter.blocks.append(block)
platform.toolchain.excluded_ios.append(platform.get_pin(i))
class EfinixSDRInput:
@staticmethod
def lower(dr):
return EfinixSDRInputImpl(dr.platform, dr.i, dr.o, dr.clk)
# Efinix DDRInput ---------------------------------------------------------------------------------- # Efinix DDRInput ----------------------------------------------------------------------------------
class EfinixDDRInputImpl(Module): class EfinixDDRInputImpl(Module):
@ -458,6 +486,7 @@ efinix_special_overrides = {
DifferentialOutput : EfinixDifferentialOutput, DifferentialOutput : EfinixDifferentialOutput,
DifferentialInput : EfinixDifferentialInput, DifferentialInput : EfinixDifferentialInput,
SDROutput : EfinixSDROutput, SDROutput : EfinixSDROutput,
SDRInput : EfinixSDRInput,
SDRTristate : EfinixSDRTristate, SDRTristate : EfinixSDRTristate,
DDROutput : EfinixDDROutput, DDROutput : EfinixDDROutput,
DDRInput : EfinixDDRInput, DDRInput : EfinixDDRInput,