Merge pull request #1505 from antmicro/fix-wishbone-arbiter

Fix Wishbone arbiter
This commit is contained in:
enjoy-digital 2022-11-15 10:11:59 +01:00 committed by GitHub
commit 703bd16a96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -166,7 +166,8 @@ class Arbiter(Module):
if controllers is not None: if controllers is not None:
masters = controllers masters = controllers
self.submodules.rr = roundrobin.RoundRobin(len(masters)) self.submodules.rr = roundrobin.RoundRobin(len(masters), roundrobin.SP_CE)
cycs = Array(m.cyc for m in masters)
# mux master->slave signals # mux master->slave signals
for name, size, direction in _layout: for name, size, direction in _layout:
@ -185,6 +186,8 @@ class Arbiter(Module):
else: else:
self.comb += dest.eq(source) self.comb += dest.eq(source)
self.comb += self.rr.ce.eq(target.ack | ~cycs[self.rr.grant])
# connect bus requests to round-robin selector # connect bus requests to round-robin selector
reqs = [m.cyc for m in masters] reqs = [m.cyc for m in masters]
self.comb += self.rr.request.eq(Cat(*reqs)) self.comb += self.rr.request.eq(Cat(*reqs))