bus: fix simple interconnect
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Wed, 15 Feb 2012 15:42:05 +0000 (16:42 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Wed, 15 Feb 2012 15:42:05 +0000 (16:42 +0100)
migen/bus/simple.py

index 07c1bb366460fd868eae38065819d1fd4a00027a..f0f1049034b8e96e2d21362d978d4eb2404fe28c 100644 (file)
@@ -33,11 +33,12 @@ class SimpleInterconnect:
                self.slaves = slaves
        
        def get_fragment(self):
-               s2m = master.desc.get_names(S_TO_M)
-               m2s = master.desc.get_names(M_TO_S)
-               comb = [getattr(slave, name).eq(getattr(master, name))
-                       for name in m2s for slave in self.slave]
-               comb += [getattr(master, name).eq(
+               desc = self.master.desc 
+               s2m = desc.get_names(S_TO_M)
+               m2s = desc.get_names(M_TO_S)
+               comb = [getattr(slave, name).eq(getattr(self.master, name))
+                       for name in m2s for slave in self.slaves]
+               comb += [getattr(self.master, name).eq(
                                optree("|", [getattr(slave, name) for slave in self.slaves])
                        )
                        for name in s2m]