summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pysc-v/InstructionSets/RV32I.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pysc-v/InstructionSets/RV32I.py b/pysc-v/InstructionSets/RV32I.py
index bbe88c3..8e1c1b8 100644
--- a/pysc-v/InstructionSets/RV32I.py
+++ b/pysc-v/InstructionSets/RV32I.py
@@ -100,7 +100,7 @@ class U(Instruction):
def compile(self):
# NOTE: U Type is for AUIPC and LUI that only use the high part of the
# immediate
- imm_12_32 = (imm & 0xFFFFF000)>>12
+ imm_12_32 = (self.imm & 0xFFFFF000)>>12
return c_uint32(
(imm_12_32 << 12) +\
(self.rd << 7) +\
@@ -221,11 +221,12 @@ class lbu(I):
funct3 = 0b100
@RV32I.instruction
-class lb(I):
+class lhu(I):
name = "lhu"
opcode = 0b0000011
funct3 = 0b101
+
@RV32I.instruction
class sb(S):
name = "sb"