From 03a2ad6bdcdba7da1f2c0045dcd6fc751a192081 Mon Sep 17 00:00:00 2001 From: Date: Fri, 10 Aug 2018 16:35:16 -0400 Subject: [PATCH] Ensure out of order is on a per-bank basis --- litedram/common.py | 2 ++ litedram/frontend/crossbar.py | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/litedram/common.py b/litedram/common.py index f284c1c..d82fe37 100644 --- a/litedram/common.py +++ b/litedram/common.py @@ -114,6 +114,8 @@ class LiteDRAMPort: self.lock = Signal() + self.reorder = reorder + self.cmd = stream.Endpoint(cmd_description(aw)) self.wdata = stream.Endpoint(wdata_description(dw, reorder)) self.rdata = stream.Endpoint(rdata_description(dw, reorder)) diff --git a/litedram/frontend/crossbar.py b/litedram/frontend/crossbar.py index b1d2df3..e1b0935 100644 --- a/litedram/frontend/crossbar.py +++ b/litedram/frontend/crossbar.py @@ -78,14 +78,15 @@ class LiteDRAMCrossbar(Module): master_locked = [] for nm, master in enumerate(self.masters): locked = 0 - for other_nb, other_arbiter in enumerate(arbiters): - if other_nb != nb: - other_bank = getattr(controller, "bank"+str(other_nb)) - locked = locked | (other_bank.lock & (other_arbiter.grant == nm)) + if not master.reorder: + for other_nb, other_arbiter in enumerate(arbiters): + if other_nb != nb: + other_bank = getattr(controller, "bank"+str(other_nb)) + locked = locked | (other_bank.lock & (other_arbiter.grant == nm)) master_locked.append(locked) # arbitrate - bank_selected = [(ba == nb) for ba, locked in zip(m_ba, master_locked)] + bank_selected = [(ba == nb) & ~locked for ba, locked in zip(m_ba, master_locked)] bank_requested = [bs & master.cmd.valid for bs, master in zip(bank_selected, self.masters)] self.comb += [ arbiter.request.eq(Cat(*bank_requested)),