From 6dff371835a8f3fd87e4c30a2111541a8f72bfc6 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 30 Aug 2023 09:16:46 +0200 Subject: [PATCH] build/efinix/common: Simplify IO exclusion in EfinixTristateImpl and fix corner cases (ex eth_mdio that was not automatically excluded). --- litex/build/efinix/common.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/litex/build/efinix/common.py b/litex/build/efinix/common.py index 6bfe530ff..1c307c8a5 100644 --- a/litex/build/efinix/common.py +++ b/litex/build/efinix/common.py @@ -89,16 +89,12 @@ class EfinixTristateImpl(Module): platform.toolchain.ifacewriter.blocks.append(block) - # Remove the group from the io list - exclude = platform.get_pin_name(io[0], without_index=True) - - # In case of a single signal, there is still a '0' index - # to be remove at the end - if (nbits == 1) and (exclude[:-1] == '0'): - exclude = exclude[:-1] - - platform.toolchain.excluded_ios.append(exclude) - + # 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) class EfinixTristate(Module): @staticmethod