From 2ed7212701268bc2c67f60827c174770e4b6338d Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 20 Jun 2016 21:40:32 +0200 Subject: [PATCH] frontend/crossbar: fix sign on adr_shift --- litedram/frontend/crossbar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litedram/frontend/crossbar.py b/litedram/frontend/crossbar.py index b6a88e7..5eaeaec 100644 --- a/litedram/frontend/crossbar.py +++ b/litedram/frontend/crossbar.py @@ -45,9 +45,9 @@ class LiteDRAMCrossbar(Module): # data width convertion if dw != self.dw: if dw > self.dw: - adr_shift = log2_int(dw//self.dw) + adr_shift = -log2_int(dw//self.dw) else: - adr_shift = -log2_int(self.dw//dw) + adr_shift = log2_int(self.dw//dw) new_port = LiteDRAMPort(mode, port.aw + adr_shift, dw, cd=cd) self.submodules += ClockDomainsRenamer(cd)(LiteDRAMPortConverter(new_port, port)) port = new_port