From: Sebastien Bourdeauducq Date: Fri, 10 May 2013 15:41:51 +0000 (+0200) Subject: Revert "genlib/record/connect: add match_by_position" X-Git-Tag: 24jan2021_ls180~2099^2~581 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=955a9733c8deb6236be58e3957627d61d4dae72a;p=litex.git Revert "genlib/record/connect: add match_by_position" This reverts commit df1ed32765510421fee07a8d5ff29afa9ce7c7c5. --- diff --git a/migen/genlib/record.py b/migen/genlib/record.py index d309a1b2..4d790647 100644 --- a/migen/genlib/record.py +++ b/migen/genlib/record.py @@ -96,11 +96,7 @@ class Record: def raw_bits(self): return Cat(*self.flatten()) - def connect(self, *slaves, match_by_position=False): - if match_by_position: - iters = [iter(slave.layout) for slave in slaves] - else: - iters = [iter(self.layout) for slave in slaves] + def connect(self, *slaves): r = [] for f in self.layout: field = f[0] @@ -108,16 +104,14 @@ class Record: if isinstance(self_e, Signal): direction = f[2] if direction == DIR_M_TO_S: - r += [getattr(slave, next(it)[0]).eq(self_e) for slave, it in zip(slaves, iters)] + r += [getattr(slave, field).eq(self_e) for slave in slaves] elif direction == DIR_S_TO_M: - r.append(self_e.eq(optree("|", [getattr(slave, next(it)[0]) - for slave, it in zip(slaves, iters)]))) + r.append(self_e.eq(optree("|", [getattr(slave, field) for slave in slaves]))) else: raise TypeError else: - for slave, it in zip(slaves, iters): - r += self_e.connect(getattr(slave, next(it)[0]), - match_by_position=match_by_position) + for slave in slaves: + r += self_e.connect(getattr(slave, field)) return r def __len__(self):