From: Sebastien Bourdeauducq Date: Wed, 15 Feb 2012 20:48:05 +0000 (+0100) Subject: bus/dfi: filter signals by direction X-Git-Tag: 24jan2021_ls180~2099^2~1014 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c08687b9c6032c4236c413ec32c52c4a481901a1;p=litex.git bus/dfi: filter signals by direction --- diff --git a/migen/bus/dfi.py b/migen/bus/dfi.py index 3364f12f..5fb2a044 100644 --- a/migen/bus/dfi.py +++ b/migen/bus/dfi.py @@ -26,19 +26,20 @@ class Interface: self.phases = [SimpleInterface(self.pdesc) for i in range(nphases)] # Returns pairs (DFI-mandated signal name, Migen signal object) - def get_standard_names(self): + def get_standard_names(self, m2s=True, s2m=True): r = [] add_suffix = len(self.phases) > 1 for n, phase in enumerate(self.phases): for signal in self.pdesc.desc: - if add_suffix: - if signal[0] == M_TO_S: - suffix = "_p" + int(n) + if (m2s and signal[0] == M_TO_S) or (s2m and signal[0] == S_TO_M): + if add_suffix: + if signal[0] == M_TO_S: + suffix = "_p" + int(n) + else: + suffix = "_w" + int(n) else: - suffix = "_w" + int(n) - else: - suffix = "" - r.append(("dfi_" + signal[1] + suffix, getattr(self, signal[1]))) + suffix = "" + r.append(("dfi_" + signal[1] + suffix, getattr(phase, signal[1]))) return r class Interconnect: