From 14c9166429d44b3c98a1ed93dde9ceaac7c0ca43 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 6 Aug 2020 20:00:07 +0200 Subject: [PATCH] build/generic_platform: add request_all method. --- litex/build/generic_platform.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/litex/build/generic_platform.py b/litex/build/generic_platform.py index 21608831..235eee7e 100644 --- a/litex/build/generic_platform.py +++ b/litex/build/generic_platform.py @@ -5,7 +5,7 @@ import os -from migen.fhdl.structure import Signal +from migen.fhdl.structure import Signal, Cat from migen.genlib.record import Record from litex.gen.fhdl import verilog @@ -210,6 +210,17 @@ class ConstraintManager: self.matched.append((resource, obj)) return obj + def request_all(self, name): + r = [] + while True: + try: + r.append(self.request(name, len(r))) + except ConstraintError: + break + if not len(r): + raise ValueError + return Cat(r) + def lookup_request(self, name, number=None, loose=False): subname = None if ":" in name: name, subname = name.split(":") @@ -288,6 +299,9 @@ class GenericPlatform: def request(self, *args, **kwargs): return self.constraint_manager.request(*args, **kwargs) + def request_all(self, *args, **kwargs): + return self.constraint_manager.request_all(*args, **kwargs) + def lookup_request(self, *args, **kwargs): return self.constraint_manager.lookup_request(*args, **kwargs) -- 2.30.2