From: Sebastien Bourdeauducq Date: Thu, 22 Dec 2011 18:36:56 +0000 (+0100) Subject: csr: use optree X-Git-Tag: 24jan2021_ls180~2099^2~1112 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=566295dea30f18c5524e25b1c0859abf57af7b8f;p=litex.git csr: use optree --- diff --git a/migen/bus/csr.py b/migen/bus/csr.py index 8e5af9a6..740fcb30 100644 --- a/migen/bus/csr.py +++ b/migen/bus/csr.py @@ -1,4 +1,5 @@ from migen.fhdl.structure import * +from migen.corelogic.misc import optree from migen.bus.simple import Simple _desc = [ @@ -23,11 +24,10 @@ class Interconnect: def get_fragment(self): comb = [] - rb = Constant(0, BV(8)) for slave in self.slaves: comb.append(slave.a_i.eq(self.master.a_o)) comb.append(slave.we_i.eq(self.master.we_o)) comb.append(slave.d_i.eq(self.master.d_o)) - rb = rb | slave.d_o + rb = optree('|', [slave.d_o for slave in self.slaves]) comb.append(self.master.d_i.eq(rb)) return Fragment(comb)