From 7c3ee3852518f27c62513e77b1eae0b41089b579 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 14 Mar 2020 11:56:07 +0000 Subject: [PATCH] add beginnings of PartialAddrBitmap elaborate --- src/soc/scoreboard/addr_match.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/soc/scoreboard/addr_match.py b/src/soc/scoreboard/addr_match.py index e03b036f..8e81157c 100644 --- a/src/soc/scoreboard/addr_match.py +++ b/src/soc/scoreboard/addr_match.py @@ -31,6 +31,7 @@ Notes: from nmigen.compat.sim import run_simulation from nmigen.cli import verilog, rtlil from nmigen import Module, Signal, Const, Array, Cat, Elaboratable +from nmigen.lib.coding import Decoder from nmutil.latch import latchregister, SRLatch @@ -61,7 +62,7 @@ class PartialAddrMatch(Elaboratable): sync = m.d.sync # array of address-latches - m.submodules.l = l = SRLatch(llen=self.n_adr, sync=False) + m.submodules.l = self.l = l = SRLatch(llen=self.n_adr, sync=False) self.addrs_r = addrs_r = Array(Signal(self.bitwid, name="a_r") \ for i in range(self.n_adr)) @@ -106,6 +107,30 @@ class PartialAddrBitmap(PartialAddrMatch): PartialAddrMatch.__init__(self, n_adr, bitwid) self.bitlen = bitlen # number of bits to turn into unary + # inputs: length of the LOAD/STORE + self.len_i = Array(Signal(bitwid, name="len") for i in range(n_adr)) + + def elaborate(self, platform): + m = PartialAddrMatch.elaborate(self, platform) + + # intermediaries + addrs_r, l = self.addrs_r, self.l + expwid = 8 + (1<