From 61975afc5e4fb4462ffbb966431c82cb56c15718 Mon Sep 17 00:00:00 2001 From: Tobias Platen Date: Tue, 9 Jun 2020 15:05:10 +0200 Subject: [PATCH] undo code removed by commit 12297566322355ce5fed2e2a5460bea54f69e79e --- src/soc/experiment/l0_cache.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/soc/experiment/l0_cache.py b/src/soc/experiment/l0_cache.py index e86d9eae..e43cf9b0 100644 --- a/src/soc/experiment/l0_cache.py +++ b/src/soc/experiment/l0_cache.py @@ -318,11 +318,19 @@ class L0CacheBuffer(Elaboratable): def __init__(self, n_units, mem, regwid=64, addrwid=48): self.n_units = n_units self.mem = mem + self.regwid = regwid + self.addrwid = addrwid ul = [] for i in range(n_units): ul.append(LDSTPort(i, regwid, addrwid)) self.dports = Array(ul) + def truncaddr(self, addr): + """truncates the address to the top bits of the memory granularity + """ + nbits = log2_int(self.mem.regwid) + return addr[nbits:] + def elaborate(self, platform): m = Module() comb, sync = m.d.comb, m.d.sync -- 2.30.2