cleanup & timing

This commit is contained in:
2018-10-03 11:29:17 -04:00
parent c1f44e2286
commit 6b99c7f92b
2 changed files with 7 additions and 12 deletions

View file

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

View file

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