@@ -265,11 +265,6 @@ def __str__(self):
265265 return "{} x{}, x{}, x{}" .format (self .mnemonic , self .rd , self .rs1 ,
266266 self .rs2 )
267267
268- def __eq__ (self , other ):
269- if not super ().__eq__ (other ):
270- return False
271- return self .rs1 == other .rs1 and self .rs2 == other .rs2 and self .rd == other .rd
272-
273268
274269class InstructionIType (InstructionFunct3Type , metaclass = ABCMeta ):
275270 """
@@ -392,12 +387,6 @@ def __str__(self):
392387 return "{} x{}, x{}, 0x{:02x}" .format (self .mnemonic , self .rd , self .rs1 ,
393388 self .shamt )
394389
395- def __eq__ (self , other ):
396- if not super ().__eq__ (other ):
397- return False
398- return (self .rd == other .rd and self .rs1 == other .rs1
399- and self .shamt == other .shamt )
400-
401390
402391class InstructionSType (InstructionFunct3Type , metaclass = ABCMeta ):
403392 """
@@ -539,13 +528,21 @@ class InstructionJType(Instruction, metaclass=ABCMeta):
539528 :param imm: Immediate for the jump (21-bit, signed, 16-bit aligned)
540529 :type imm: int
541530 """
531+
532+ field_rd = Field (name = "rd" , base = 7 , size = 5 , description = "" )
533+ field_imm = Field (name = "imm" , base = [21 ,20 ,12 ,31 ], size = [10 ,1 ,8 ,1 ], description = "" )
534+
542535 def __init__ (self , rd : int = None , imm : int = None ):
543536 super (InstructionJType , self ).__init__ ()
544537 self .rd = rd # pylint: disable=invalid-name
545538 self .imm = Immediate (bits = 21 , signed = True , lsb0 = True )
546539 if imm is not None :
547540 self .imm .set (imm )
548541
542+ def ops_from_list (self , ops ):
543+ self .rd = int (ops [0 ][1 :])
544+ self .imm .set (int (ops [1 ]))
545+
549546 def randomize (self , variant : Variant ):
550547 self .rd = randrange (0 , variant .xlen )
551548 self .imm .randomize ()
0 commit comments