From c4d90bf6e19f4a16adba68b8af9a7ae5005a7062 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 9 Jun 2020 18:33:22 +0100 Subject: [PATCH] allow LenExpand to output both byte- and bit- mask expansion --- src/soc/scoreboard/addr_match.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/soc/scoreboard/addr_match.py b/src/soc/scoreboard/addr_match.py index 704e1b9b..1fa56524 100644 --- a/src/soc/scoreboard/addr_match.py +++ b/src/soc/scoreboard/addr_match.py @@ -126,28 +126,35 @@ class LenExpand(Elaboratable): def __init__(self, bit_len, cover=1): self.bit_len = bit_len self.cover = cover - cl = log2_int(cover) self.len_i = Signal(bit_len, reset_less=True) self.addr_i = Signal(bit_len, reset_less=True) - self.lexp_o = Signal((cover<<(bit_len))+(cl< 1: + self.rexp_o = Signal(self.llen(cover), reset_less=True) print ("LenExpand", bit_len, cover, self.lexp_o.shape()) + def llen(self, cover): + cl = log2_int(self.cover) + return (cover<<(self.bit_len))+(cl<