From: Michael Nolan Date: Mon, 2 Mar 2020 15:40:28 +0000 (-0500) Subject: Add recursive decoding X-Git-Tag: div_pipeline~1793 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8ef8a90c823cd7edb4d85c8099e9a912adbe4ea4;p=soc.git Add recursive decoding --- diff --git a/src/decoder/power_decoder.py b/src/decoder/power_decoder.py index f0d44876..148e1c37 100644 --- a/src/decoder/power_decoder.py +++ b/src/decoder/power_decoder.py @@ -83,6 +83,8 @@ class PowerDecoder(Elaboratable): self.op = PowerOp() self.suffix = suffix + if suffix[1] - suffix[0] >= width: + self.suffix = None self.width = width def suffix_mask(self): @@ -116,7 +118,8 @@ class PowerDecoder(Elaboratable): for key, row in opcodes.items(): subdecoder = PowerDecoder(width=self.width - opc_in.width, opcodes=row, - opint=False) + opint=False, + suffix=self.suffix) setattr(m.submodules, "dec%d" % key, subdecoder) comb += subdecoder.opcode_in.eq(self.opcode_in[self.suffix[1]:]) with m.Case(key): diff --git a/src/decoder/test/test_power_decoder.py b/src/decoder/test/test_power_decoder.py index b1851c91..c0a82863 100644 --- a/src/decoder/test/test_power_decoder.py +++ b/src/decoder/test/test_power_decoder.py @@ -105,5 +105,6 @@ class DecoderTestCase(FHDLTestCase): self.run_test(32, "extra.csv", False) self.generate_ilang(32, "extra.csv", False) + if __name__ == "__main__": unittest.main()