build/efinix: Add get_pin (from sig) to EfinixPlatform and use it to simplify/fix IOs exclusion.

This commit is contained in:
Florent Kermarrec 2023-08-30 18:08:36 +02:00
parent 72590dfde3
commit ff0df100e9
2 changed files with 8 additions and 9 deletions

View File

@ -88,13 +88,7 @@ class EfinixTristateImpl(Module):
}
platform.toolchain.ifacewriter.blocks.append(block)
# Exclude IO.
if isinstance(io, Signal):
exclude_io = io
else:
exclude_io = platform.get_pin_name(io[0], without_index=True)
platform.toolchain.excluded_ios.append(exclude_io)
platform.toolchain.excluded_ios.append(platform.get_pin(io))
class EfinixTristate(Module):
@staticmethod
@ -144,7 +138,7 @@ class EfinixDDROutputImpl(Module):
"drive_strength" : 4 # FIXME: Get it from constraints.
}
platform.toolchain.ifacewriter.blocks.append(block)
# FIXME: Integrate IO exclusion.
platform.toolchain.excluded_ios.append(platform.get_pin(o))
class EfinixDDROutput:
@staticmethod
@ -174,7 +168,7 @@ class EfinixDDRInputImpl(Module):
"is_inclk_inverted" : False
}
platform.toolchain.ifacewriter.blocks.append(block)
# FIXME: Integrate IO exclusion.
platform.toolchain.excluded_ios.append(platform.get_pin(i))
class EfinixDDRInput:
@staticmethod

View File

@ -119,6 +119,11 @@ class EfinixPlatform(GenericPlatform):
return ret
return None
def get_pin(self, sig):
while isinstance(sig, _Slice) and hasattr(sig, "value"):
sig = sig.value
return sig
def get_pin_name(self, sig, without_index=False):
if sig is None:
return None