Skip to content

Commit 314e3e0

Browse files
committed
Fix encoding for J-type instructions
The immediate (as well as being scattered crazily through the encoding!) has an offset of 1.
1 parent b475bb6 commit 314e3e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

riscvmodel/isa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ class InstructionJType(Instruction, metaclass=ABCMeta):
533533
"""
534534

535535
field_rd = Field(name="rd", base=7, size=5, description="")
536-
field_imm = Field(name="imm", base=[21,20,12,31], size=[10,1,8,1], description="")
536+
field_imm = Field(name="imm", base=[21,20,12,31], size=[10,1,8,1], description="", offset=1)
537537

538538
def __init__(self, rd: int = None, imm: int = None):
539539
super(InstructionJType, self).__init__()

0 commit comments

Comments
 (0)