From ee928a897330241bc2323b1a1d75124f6c18bc8d Mon Sep 17 00:00:00 2001
From: Yann Sionneau <ys@m-labs.hk>
Date: Wed, 26 Nov 2014 12:10:20 +0100
Subject: [PATCH] Wishbone DownConverter: Fix sel signal

---
 migen/bus/wishbone.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/migen/bus/wishbone.py b/migen/bus/wishbone.py
index 439bbd6ad..11917ebd4 100644
--- a/migen/bus/wishbone.py
+++ b/migen/bus/wishbone.py
@@ -154,7 +154,7 @@ class DownConverter(Module):
 
 		# direct connection of wishbone_i --> wishbone_o signals
 		for name, size, direction in self.wishbone_i.layout:
-			if direction == DIR_M_TO_S and name not in ["adr", "dat_w"]:
+			if direction == DIR_M_TO_S and name not in ["adr", "dat_w", "sel"]:
 				self.comb += getattr(self.wishbone_o, name).eq(getattr(self.wishbone_i, name))
 
 		# adaptation of adr & dat signals
@@ -164,6 +164,7 @@ class DownConverter(Module):
 		]
 
 		self.comb += chooser(dat_w, cnt, self.wishbone_o.dat_w, reverse=True)
+		self.comb += chooser(self.wishbone_i.sel, cnt, self.wishbone_o.sel, reverse=True)
 
 		# fsm
 		fsm = FSM(reset_state="IDLE")