Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bus/dfi: filter signals by direction

  • Loading branch information...
commit c08687b9c6032c4236c413ec32c52c4a481901a1 1 parent ef7aea0
Sébastien Bourdeauducq sbourdeauducq authored
Showing with 9 additions and 8 deletions.
  1. +9 −8 migen/bus/dfi.py
17 migen/bus/dfi.py
View
@@ -26,19 +26,20 @@ def __init__(self, a, ba, d, nphases=1):
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:
Please sign in to comment.
Something went wrong with that request. Please try again.