big reorg, class-ify constants
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 24 Nov 2018 01:20:35 +0000 (01:20 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 24 Nov 2018 01:20:35 +0000 (01:20 +0000)
cpu_decoder.py

index 948e10d6a4e1f281d7132c946951f64136bcaa7a..3239a0d453688de701ddb99e572cb85ce76a744a 100644 (file)
@@ -232,17 +232,17 @@ class CPUDecoder(Module):
             (funct7 in the case of arith ops).
         """
         c = {}
             (funct7 in the case of arith ops).
         """
         c = {}
-        c[OP.load] = self.calculate_load_action()
+        c[OP.load    ] = self.calculate_load_action()
         c[OP.misc_mem] = self.calculate_misc_action()
         c[OP.misc_mem] = self.calculate_misc_action()
-        c[OP.op_imm] = self.calculate_op_action()
-        c[OP.op] = self.calculate_op_action()
-        c[OP.lui] = self.decode_action.eq(DA.lui_auipc)
-        c[OP.auipc] = self.decode_action.eq(DA.lui_auipc)
-        c[OP.store] = self.calculate_store_action()
-        c[OP.branch] = self.calculate_branch_action()
-        c[OP.jalr] = self.calculate_jalr_action()
-        c[OP.jal] = self.decode_action.eq(DA.jal)
-        c[OP.system] = self.calculate_system_action()
+        c[OP.op_imm  ] = self.calculate_op_action()
+        c[OP.op      ] = self.calculate_op_action()
+        c[OP.lui     ] = self.decode_action.eq(DA.lui_auipc)
+        c[OP.auipc   ] = self.decode_action.eq(DA.lui_auipc)
+        c[OP.store   ] = self.calculate_store_action()
+        c[OP.branch  ] = self.calculate_branch_action()
+        c[OP.jalr    ] = self.calculate_jalr_action()
+        c[OP.jal     ] = self.decode_action.eq(DA.jal)
+        c[OP.system  ] = self.calculate_system_action()
 
         # big batch of unrecognised opcodes: throw trap.
         for o in [ OP.load_fp, OP.custom_0, OP.op_imm_32,
 
         # big batch of unrecognised opcodes: throw trap.
         for o in [ OP.load_fp, OP.custom_0, OP.op_imm_32,