From 253d1cfb9ba1c2381d55f05a4248b9e2bd827698 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 26 Feb 2024 17:28:03 +0100 Subject: [PATCH] build/generic_platform/ConstraintManager: Add prepend parameter to add_extension. In some cases, prepend is useful when we want to replace existing IOs. --- litex/build/generic_platform.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/litex/build/generic_platform.py b/litex/build/generic_platform.py index 847435c81..24dda751d 100644 --- a/litex/build/generic_platform.py +++ b/litex/build/generic_platform.py @@ -205,8 +205,11 @@ class ConstraintManager: self.platform_commands = [] self.connector_manager = ConnectorManager(connectors) - def add_extension(self, io): - self.available.extend(io) + def add_extension(self, io, prepend=False): + if prepend: + self.available = list(io) + self.available + else: + self.available.extend(io) def add_connector(self, connectors): self.connector_manager.add_connector(connectors)