From: Michael Nolan Date: Wed, 13 May 2020 14:26:38 +0000 (-0400) Subject: Add assertions to ALU and shift_rot test that the instruction FU is right X-Git-Tag: div_pipeline~1263 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c767b21b701471cfeb0a5d75f88c5539fc864d2e;p=soc.git Add assertions to ALU and shift_rot test that the instruction FU is right --- diff --git a/src/soc/alu/test/test_pipe_caller.py b/src/soc/alu/test/test_pipe_caller.py index faec4593..bdc66574 100644 --- a/src/soc/alu/test/test_pipe_caller.py +++ b/src/soc/alu/test/test_pipe_caller.py @@ -6,7 +6,7 @@ import unittest from soc.decoder.isa.caller import ISACaller, special_sprs from soc.decoder.power_decoder import (create_pdecode) from soc.decoder.power_decoder2 import (PowerDecode2) -from soc.decoder.power_enums import (XER_bits) +from soc.decoder.power_enums import (XER_bits, Function) from soc.decoder.selectable_int import SelectableInt from soc.simulator.program import Program from soc.decoder.isa.all import ISA @@ -200,6 +200,8 @@ class TestRunner(FHDLTestCase): yield pdecode2.dec.bigendian.eq(0) # little / big? yield instruction.eq(ins) # raw binary instr. yield Settle() + fn_unit = yield pdecode2.e.fn_unit + self.assertEqual(fn_unit, Function.ALU.value) yield from set_alu_inputs(alu, pdecode2, simulator) yield from set_extra_alu_inputs(alu, pdecode2, simulator) yield diff --git a/src/soc/shift_rot/test/test_pipe_caller.py b/src/soc/shift_rot/test/test_pipe_caller.py index 24a03c12..6a836d78 100644 --- a/src/soc/shift_rot/test/test_pipe_caller.py +++ b/src/soc/shift_rot/test/test_pipe_caller.py @@ -6,7 +6,7 @@ import unittest from soc.decoder.isa.caller import ISACaller, special_sprs from soc.decoder.power_decoder import (create_pdecode) from soc.decoder.power_decoder2 import (PowerDecode2) -from soc.decoder.power_enums import (XER_bits) +from soc.decoder.power_enums import (XER_bits, Function) from soc.decoder.selectable_int import SelectableInt from soc.simulator.program import Program from soc.decoder.isa.all import ISA @@ -200,6 +200,8 @@ class TestRunner(FHDLTestCase): yield pdecode2.dec.bigendian.eq(0) # little / big? yield instruction.eq(ins) # raw binary instr. yield Settle() + fn_unit = yield pdecode2.e.fn_unit + self.assertEqual(fn_unit, Function.SHIFT_ROT.value) yield from set_alu_inputs(alu, pdecode2, simulator) yield from set_extra_alu_inputs(alu, pdecode2, simulator) yield