From 0ea7a9b2e695571cabdf87b16c63d4e7bf6cac7c Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 13 Dec 2011 00:25:46 +0100 Subject: [PATCH] wishbone2csr: fix double-write bug --- migen/bus/wishbone2csr.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/migen/bus/wishbone2csr.py b/migen/bus/wishbone2csr.py index 9c0a4c24..b6d72ed5 100644 --- a/migen/bus/wishbone2csr.py +++ b/migen/bus/wishbone2csr.py @@ -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), -- 2.30.2