wishbone2csr: fix double-write bug
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Mon, 12 Dec 2011 23:25:46 +0000 (00:25 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Mon, 12 Dec 2011 23:25:46 +0000 (00:25 +0100)
migen/bus/wishbone2csr.py

index 9c0a4c24ff203567957eccee9f11919c19c34c2c..b6d72ed5b704642a8dd5a238209e894491be6b11 100644 (file)
@@ -8,11 +8,12 @@ class Inst():
                self.wishbone = wishbone.Slave("to_csr")
                self.csr = csr.Master("from_wishbone")
                self.timeline = timeline.Inst(self.wishbone.cyc_i & self.wishbone.stb_i,
-                       [(2, [f.Assign(self.wishbone.ack_o, 1)])])
+                       [(1, [f.Assign(self.csr.we_o, self.wishbone.we_i)]),
+                       (2, [f.Assign(self.wishbone.ack_o, 1)])])
        
        def GetFragment(self):
                sync = [
-                       f.Assign(self.csr.we_o, self.wishbone.we_i),
+                       f.Assign(self.csr.we_o, 0),
                        f.Assign(self.csr.d_o, self.wishbone.dat_i),
                        f.Assign(self.csr.a_o, self.wishbone.adr_i[2:16]),
                        f.Assign(self.wishbone.ack_o, 0),