From 3bab6f202433c216098520a95a5238fbf019c4fe Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 4 Sep 2020 11:10:48 +0200 Subject: [PATCH] common/PHYPadsReducer: make Cat optional (disabled by default). --- litedram/common.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/litedram/common.py b/litedram/common.py index 2127caa..311843f 100644 --- a/litedram/common.py +++ b/litedram/common.py @@ -66,17 +66,20 @@ class PHYPadsReducer: For testing purposes, we often need to use only some of the DRAM modules. PHYPadsReducer allows selecting specific modules and avoid re-definining dram pins in the Platform for this. """ - def __init__(self, pads, modules): - self.pads = pads - self.modules = modules + def __init__(self, pads, modules, with_cat=False): + self.pads = pads + self.modules = modules + self.with_cat = with_cat def __getattr__(self, name): if name in ["dq"]: - return Cat(Array([getattr(self.pads, name)[8*i + j] + r = Array([getattr(self.pads, name)[8*i + j] for i in self.modules - for j in range(8)])) + for j in range(8)]) + return r if not self.with_cat else Cat(r) if name in ["dm", "dqs", "dqs_p", "dqs_n"]: - return Cat(Array([getattr(self.pads, name)[i] for i in self.modules])) + r = Array([getattr(self.pads, name)[i] for i in self.modules]) + return r if not self.with_cat else Cat(r) else: return getattr(self.pads, name)