mirror of
https://github.com/enjoy-digital/litedram.git
synced 2025-01-04 09:52:25 -05:00
cleanup & timing
This commit is contained in:
parent
c1f44e2286
commit
6b99c7f92b
2 changed files with 7 additions and 12 deletions
|
@ -61,9 +61,12 @@ class BankMachine(Module):
|
|||
cmd_bufferRead.sink.valid.eq(cmd_buffer_lookahead.source.valid & ~cmd_buffer_lookahead.source.we),
|
||||
cmd_bufferWrite.sink.valid.eq(cmd_buffer_lookahead.source.valid & cmd_buffer_lookahead.source.we),
|
||||
|
||||
cmd_buffer_lookahead.source.ready.eq(
|
||||
((cmd_bufferRead.sink.ready | cmd_bufferRead.source.ready) & ~cmd_buffer_lookahead.source.we)
|
||||
| ((cmd_bufferWrite.sink.ready | cmd_bufferWrite.source.ready) & cmd_buffer_lookahead.source.we)),
|
||||
cmd_buffer_lookahead.source.ready.eq(req.rdata_valid | req.wdata_ready
|
||||
| (cmd_buffer_lookahead.source.we & cmd_bufferWrite.source.ready)
|
||||
| (~cmd_buffer_lookahead.source.we & cmd_bufferRead.source.ready)),
|
||||
#cmd_buffer_lookahead.source.ready.eq(
|
||||
# ((cmd_bufferRead.sink.ready | cmd_bufferRead.source.ready) & ~cmd_buffer_lookahead.source.we)
|
||||
# | ((cmd_bufferWrite.sink.ready | cmd_bufferWrite.source.ready) & cmd_buffer_lookahead.source.we)),
|
||||
|
||||
cmd_bufferRead.source.ready.eq(req.rdata_valid),
|
||||
cmd_bufferWrite.source.ready.eq(req.wdata_ready),
|
||||
|
|
|
@ -46,18 +46,10 @@ class _CommandChooser(Module):
|
|||
cmd.valid.eq(choices[arbiter.grant])
|
||||
]
|
||||
|
||||
for name in ["a", "ba", "is_read", "is_write", "is_cmd", "is_activate"]:
|
||||
for name in ["a", "ba", "cas", "ras", "we", "is_read", "is_write", "is_cmd", "is_activate"]:
|
||||
choices = Array(getattr(req, name) for req in requests)
|
||||
self.comb += getattr(cmd, name).eq(choices[arbiter.grant])
|
||||
|
||||
for name in ["cas", "ras", "we"]:
|
||||
# we should only assert those signals when valid is 1
|
||||
choices = Array(getattr(req, name) for req in requests)
|
||||
self.comb += \
|
||||
If(cmd.valid,
|
||||
getattr(cmd, name).eq(choices[arbiter.grant])
|
||||
)
|
||||
|
||||
for i, request in enumerate(requests):
|
||||
self.comb += \
|
||||
If(cmd.valid & cmd.ready & (arbiter.grant == i),
|
||||
|
|
Loading…
Reference in a new issue