csr: use optree

This commit is contained in:
Sebastien Bourdeauducq 2011-12-22 19:36:56 +01:00
parent ba40f58491
commit 566295dea3
1 changed files with 2 additions and 2 deletions

View File

@ -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)