Add tests for minor_30 and minor_31 decoding tables
authorMichael Nolan <mtnolan2640@gmail.com>
Sat, 29 Feb 2020 22:45:02 +0000 (17:45 -0500)
committerMichael Nolan <mtnolan2640@gmail.com>
Sat, 29 Feb 2020 22:45:02 +0000 (17:45 -0500)
src/decoder/power_decoder.py
src/decoder/test/test_power_decoder.py

index 22e52435d42b4f8ac923321e274b4e0c631499ac..52e4f7911372023ef300e4f17d32f9b49bd20ff9 100644 (file)
@@ -30,6 +30,8 @@ class PowerDecoder(Elaboratable):
         with m.Switch(self.opcode_in):
             for row in self.opcodes:
                 opcode = int(row['opcode'], 0)
+                if not row['unit']:
+                    continue
                 with m.Case(opcode):
                     comb += self.function_unit.eq(Function[row['unit']])
                     comb += self.internal_op.eq(InternalOp[row['internal op']])
index 5f3f3e2e67b0ac8638ee092a916ad7410cc0e146..df85c6e88d319c84eb7038160d6a8b391a6f5323 100644 (file)
@@ -43,6 +43,8 @@ class DecoderTestCase(FHDLTestCase):
 
         def process():
             for row in dut.opcodes:
+                if not row['unit']:
+                    continue
                 yield opcode.eq(int(row['opcode'], 0))
                 yield Delay(1e-6)
                 signals = [(function_unit, Function, 'unit'),
@@ -80,10 +82,19 @@ class DecoderTestCase(FHDLTestCase):
 
     def test_major(self):
         self.run_test(6, "major.csv")
+        self.generate_ilang(6, "major.csv")
 
     def test_minor_19(self):
         self.run_test(3, "minor_19.csv")
+        self.generate_ilang(3, "minor_19.csv")
 
+    def test_minor_30(self):
+        self.run_test(4, "minor_30.csv")
+        self.generate_ilang(4, "minor_30.csv")
+
+    def test_minor_31(self):
+        self.run_test(10, "minor_31.csv")
+        self.generate_ilang(10, "minor_31.csv")
 
 if __name__ == "__main__":
     unittest.main()