wishbone: only send ack to the active master in arbiter
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Mon, 12 Dec 2011 23:25:25 +0000 (00:25 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Mon, 12 Dec 2011 23:25:25 +0000 (00:25 +0100)
migen/bus/wishbone.py

index ee579fb1f174b800b2519458cf720da23db442ee..bca7fce4850cd50e78c186cb125ab80420cb0b0b 100644 (file)
@@ -44,9 +44,14 @@ class Arbiter:
                s2m_names = [GetSigName(x, False) for x in _desc if not x[0]]
                for name in s2m_names:
                        source = getattr(self.target, name)
+                       i = 0
                        for m in self.masters:
                                dest = getattr(m, name)
-                               comb.append(f.Assign(dest, source))
+                               if name == "ack_i" or name == "err_i":
+                                       comb.append(f.Assign(dest, source & (self.rr.grant == f.Constant(i, self.rr.grant.bv))))
+                               else:
+                                       comb.append(f.Assign(dest, source))
+                               i += 1
                
                # connect bus requests to round-robin selector
                reqs = [m.cyc_o for m in self.masters]
@@ -54,7 +59,6 @@ class Arbiter:
                
                return f.Fragment(comb) + self.rr.GetFragment()
 
-
 class Decoder:
        # slaves is a list of pairs:
        # 0) structure.Constant defining address (always decoded on the upper bits)