cause_load_page_fault = Constant(0xD, 4)
cause_store_amo_page_fault = Constant(0xF, 4)
-opcode_load = Constant(0x03, 7)
-opcode_load_fp = Constant(0x07, 7)
-opcode_custom_0 = Constant(0x0B, 7)
-opcode_misc_mem = Constant(0x0F, 7)
-opcode_op_imm = Constant(0x13, 7)
-opcode_auipc = Constant(0x17, 7)
-opcode_op_imm_32 = Constant(0x1B, 7)
-opcode_48b_escape_0 = Constant(0x1F, 7)
-
-opcode_store = Constant(0x23, 7)
-opcode_store_fp = Constant(0x27, 7)
-opcode_custom_1 = Constant(0x2B, 7)
-opcode_amo = Constant(0x2F, 7)
-opcode_op = Constant(0x33, 7)
-opcode_lui = Constant(0x37, 7)
-opcode_op_32 = Constant(0x3B, 7)
-opcode_64b_escape = Constant(0x3F, 7)
-
-opcode_madd = Constant(0x43, 7)
-opcode_msub = Constant(0x47, 7)
-opcode_nmsub = Constant(0x4B, 7)
-opcode_nmadd = Constant(0x4F, 7)
-opcode_op_fp = Constant(0x53, 7)
-opcode_reserved_10101 = Constant(0x57, 7)
-opcode_rv128_0 = Constant(0x5B, 7)
-opcode_48b_escape_1 = Constant(0x5F, 7)
-
-opcode_branch = Constant(0x63, 7)
-opcode_jalr = Constant(0x67, 7)
-opcode_reserved_11010 = Constant(0x6B, 7)
-opcode_jal = Constant(0x6F, 7)
-opcode_system = Constant(0x73, 7)
-opcode_reserved_11101 = Constant(0x77, 7)
-opcode_rv128_1 = Constant(0x7B, 7)
-opcode_80b_escape = Constant(0x7F, 7)
-
-funct3_jalr = Constant(0x0, 3)
-funct3_beq = Constant(0x0, 3)
-funct3_bne = Constant(0x1, 3)
-funct3_blt = Constant(0x4, 3)
-funct3_bge = Constant(0x5, 3)
-funct3_bltu = Constant(0x6, 3)
-funct3_bgeu = Constant(0x7, 3)
-
-funct3_lb = Constant(0x0, 3)
-funct3_lh = Constant(0x1, 3)
-funct3_lw = Constant(0x2, 3)
-funct3_lbu = Constant(0x4, 3)
-funct3_lhu = Constant(0x5, 3)
-
-funct3_sb = Constant(0x0, 3)
-funct3_sh = Constant(0x1, 3)
-funct3_sw = Constant(0x2, 3)
-
-funct3_addi = Constant(0x0, 3)
-funct3_slli = Constant(0x1, 3)
-funct3_slti = Constant(0x2, 3)
-funct3_sltiu = Constant(0x3, 3)
-funct3_xori = Constant(0x4, 3)
-funct3_srli_srai = Constant(0x5, 3)
-funct3_ori = Constant(0x6, 3)
-funct3_andi = Constant(0x7, 3)
-
-funct3_add_sub = Constant(0x0, 3)
-funct3_sll = Constant(0x1, 3)
-funct3_slt = Constant(0x2, 3)
-funct3_sltu = Constant(0x3, 3)
-funct3_xor = Constant(0x4, 3)
-funct3_srl_sra = Constant(0x5, 3)
-funct3_or = Constant(0x6, 3)
-funct3_and = Constant(0x7, 3)
-
-funct3_fence = Constant(0x0, 3)
-funct3_fence_i = Constant(0x1, 3)
-
-funct3_ecall_ebreak = Constant(0x0, 3)
-funct3_csrrw = Constant(0x1, 3)
-funct3_csrrs = Constant(0x2, 3)
-funct3_csrrc = Constant(0x3, 3)
-funct3_csrrwi = Constant(0x5, 3)
-funct3_csrrsi = Constant(0x6, 3)
-funct3_csrrci = Constant(0x7, 3)
+class OP:
+ """ Opcode constants
+ """
+ load = Constant(0x03, 7)
+ load_fp = Constant(0x07, 7)
+ custom_0 = Constant(0x0B, 7)
+ misc_mem = Constant(0x0F, 7)
+ op_imm = Constant(0x13, 7)
+ auipc = Constant(0x17, 7)
+ op_imm_32 = Constant(0x1B, 7)
+ op_48b_escape_0 = Constant(0x1F, 7)
+
+ store = Constant(0x23, 7)
+ store_fp = Constant(0x27, 7)
+ custom_1 = Constant(0x2B, 7)
+ amo = Constant(0x2F, 7)
+ op = Constant(0x33, 7)
+ lui = Constant(0x37, 7)
+ op_32 = Constant(0x3B, 7)
+ op_64b_escape = Constant(0x3F, 7)
+
+ madd = Constant(0x43, 7)
+ msub = Constant(0x47, 7)
+ nmsub = Constant(0x4B, 7)
+ nmadd = Constant(0x4F, 7)
+ op_fp = Constant(0x53, 7)
+ reserved_10101 = Constant(0x57, 7)
+ rv128_0 = Constant(0x5B, 7)
+ op_48b_escape_1 = Constant(0x5F, 7)
+
+ branch = Constant(0x63, 7)
+ jalr = Constant(0x67, 7)
+ reserved_11010 = Constant(0x6B, 7)
+ jal = Constant(0x6F, 7)
+ system = Constant(0x73, 7)
+ reserved_11101 = Constant(0x77, 7)
+ rv128_1 = Constant(0x7B, 7)
+ op_80b_escape = Constant(0x7F, 7)
+
+class F3:
+ """ Funct3 constants
+ """
+ jalr = Constant(0x0, 3)
+ beq = Constant(0x0, 3)
+ bne = Constant(0x1, 3)
+ blt = Constant(0x4, 3)
+ bge = Constant(0x5, 3)
+ bltu = Constant(0x6, 3)
+ bgeu = Constant(0x7, 3)
+
+ lb = Constant(0x0, 3)
+ lh = Constant(0x1, 3)
+ lw = Constant(0x2, 3)
+ lbu = Constant(0x4, 3)
+ lhu = Constant(0x5, 3)
+
+ sb = Constant(0x0, 3)
+ sh = Constant(0x1, 3)
+ sw = Constant(0x2, 3)
+
+ addi = Constant(0x0, 3)
+ slli = Constant(0x1, 3)
+ slti = Constant(0x2, 3)
+ sltiu = Constant(0x3, 3)
+ xori = Constant(0x4, 3)
+ srli_srai = Constant(0x5, 3)
+ ori = Constant(0x6, 3)
+ andi = Constant(0x7, 3)
+
+ add_sub = Constant(0x0, 3)
+ sll = Constant(0x1, 3)
+ slt = Constant(0x2, 3)
+ sltu = Constant(0x3, 3)
+ xor = Constant(0x4, 3)
+ srl_sra = Constant(0x5, 3)
+ _or = Constant(0x6, 3)
+ _and = Constant(0x7, 3)
+
+ fence = Constant(0x0, 3)
+ fence_i = Constant(0x1, 3)
+
+ ecall_ebreak = Constant(0x0, 3)
+ csrrw = Constant(0x1, 3)
+ csrrs = Constant(0x2, 3)
+ csrrc = Constant(0x3, 3)
+ csrrwi = Constant(0x5, 3)
+ csrrsi = Constant(0x6, 3)
+ csrrci = Constant(0x7, 3)
csr_ustatus = Constant(0x000, 12)
csr_fflags = Constant(0x001, 12)