projects
/
gram.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7e0cd1f
)
Fix multiple drive issue
author
Jean THOMAS
<git0@pub.jeanthomas.me>
Mon, 8 Jun 2020 09:15:12 +0000
(11:15 +0200)
committer
Jean THOMAS
<git0@pub.jeanthomas.me>
Mon, 8 Jun 2020 09:15:12 +0000
(11:15 +0200)
gram/core/multiplexer.py
patch
|
blob
|
history
diff --git
a/gram/core/multiplexer.py
b/gram/core/multiplexer.py
index a31d82c25adb228e0033a23118e873ce830cc584..a4fecda6bf1b00865c55531c794fb3d8f980a525 100644
(file)
--- a/
gram/core/multiplexer.py
+++ b/
gram/core/multiplexer.py
@@
-56,6
+56,7
@@
class _CommandChooser(Elaboratable):
# cas/ras/we are 0 when valid is inactive
self.cmd = stream.Endpoint(cmd_request_rw_layout(a, ba))
# cas/ras/we are 0 when valid is inactive
self.cmd = stream.Endpoint(cmd_request_rw_layout(a, ba))
+ self.ready = Signal(len(requests))
def elaborate(self, platform):
m = Module()
def elaborate(self, platform):
m = Module()
@@
-90,8
+91,9
@@
class _CommandChooser(Elaboratable):
m.d.comb += getattr(self.cmd, name).eq(choices[arbiter.grant])
for i, request in enumerate(self._requests):
m.d.comb += getattr(self.cmd, name).eq(choices[arbiter.grant])
for i, request in enumerate(self._requests):
- with m.If(self.cmd.valid & self.cmd.ready & (arbiter.grant == i)):
- m.d.comb += request.ready.eq(1)
+ #with m.If(self.cmd.valid & self.cmd.ready & (arbiter.grant == i)):
+ #m.d.comb += request.ready.eq(1) # TODO: this shouldn't be commented
+ self.ready[i].eq(self.cmd.valid & self.cmd.ready & (arbiter.grant == i))
# Arbitrate if a command is being accepted or if the command is not valid to ensure a valid
# command is selected when cmd.ready goes high.
# Arbitrate if a command is being accepted or if the command is not valid to ensure a valid
# command is selected when cmd.ready goes high.
@@
-254,6
+256,8
@@
class Multiplexer(Peripheral, Elaboratable):
requests = [bm.cmd for bm in bank_machines]
m.submodules.choose_cmd = choose_cmd = _CommandChooser(requests)
m.submodules.choose_req = choose_req = _CommandChooser(requests)
requests = [bm.cmd for bm in bank_machines]
m.submodules.choose_cmd = choose_cmd = _CommandChooser(requests)
m.submodules.choose_req = choose_req = _CommandChooser(requests)
+ for i, request in enumerate(requests):
+ m.d.comb += request.ready.eq(choose_cmd.ready[i] | choose_req.ready[i])
if settings.phy.nphases == 1:
# When only 1 phase, use choose_req for all requests
choose_cmd = choose_req
if settings.phy.nphases == 1:
# When only 1 phase, use choose_req for all requests
choose_cmd = choose_req