From: Florent Kermarrec Date: Wed, 30 Apr 2014 16:03:56 +0000 (+0200) Subject: wishbone2lasmi: fix wordbits computation X-Git-Tag: 24jan2021_ls180~2099^2~359 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9c1d95f6a4bbe6e3d5288f4191d433133c08d7b0;p=litex.git wishbone2lasmi: fix wordbits computation --- diff --git a/migen/bus/wishbone2lasmi.py b/migen/bus/wishbone2lasmi.py index cda742e6..bf722c27 100644 --- a/migen/bus/wishbone2lasmi.py +++ b/migen/bus/wishbone2lasmi.py @@ -23,7 +23,7 @@ class WB2LASMI(Module): addressbits = lasmim.aw + offsetbits linebits = log2_int(cachesize) - offsetbits tagbits = addressbits - linebits - wordbits = data_width//lasmim.dw + wordbits = log2_int(max(data_width//lasmim.dw, 1)) adr_offset, adr_line, adr_tag = split(self.wishbone.adr, offsetbits, linebits, tagbits) word = Signal(wordbits) if wordbits else None