diff --git a/litex/build/generic_platform.py b/litex/build/generic_platform.py index 3054103c0..894508cce 100644 --- a/litex/build/generic_platform.py +++ b/litex/build/generic_platform.py @@ -132,6 +132,12 @@ def _resource_type(resource): class ConnectorManager: def __init__(self, connectors): self.connector_table = dict() + self.add_connector(connectors) + + def add_connector(self, connectors): + if isinstance(connectors, tuple): + connectors = [connectors] + for connector in connectors: cit = iter(connector) conn_name = next(cit) @@ -193,6 +199,9 @@ class ConstraintManager: def add_extension(self, io): self.available.extend(io) + def add_connector(self, connectors): + self.connector_manager.add_connector(connectors) + def request(self, name, number=None, loose=False): resource = _lookup(self.available, name, number, loose) if resource is None: @@ -356,6 +365,9 @@ class GenericPlatform: def add_extension(self, *args, **kwargs): return self.constraint_manager.add_extension(*args, **kwargs) + def add_connector(self, *args, **kwargs): + self.constraint_manager.add_connector(*args, **kwargs) + def finalize(self, fragment, *args, **kwargs): if self.finalized: raise ConstraintError("Already finalized")