Skip to content

Commit

Permalink
[ISAC] Add Zacas support (#583)
Browse files Browse the repository at this point in the history
Co-authored-by: Umer Shahid <[email protected]>
  • Loading branch information
trdthg and UmerShahidengr authored Jan 1, 2025
1 parent 076ce72 commit 6418806
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions riscv-isac/riscv_isac/plugins/internaldecoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1607,6 +1607,12 @@ def rv64i_arith_ops(self, instrObj):
0b11100: 'amomaxu.d'
}

zacas_instr_names = {
0b010: 'zacas.w',
0b011: 'zacas.d',
0b100: 'zacas.q',
}

def rv64_rv32_atomic_ops(self, instrObj):

instr = instrObj.instr
Expand All @@ -1625,25 +1631,28 @@ def rv64_rv32_atomic_ops(self, instrObj):
instrObj.rl = rl
instrObj.aq = aq

#RV32A instructions
if funct3 == 0b010:
if funct5 == 0b00010:
instrObj.rs2 = None
instrObj.instr_name = self.rv32a_instr_names[funct5]
else:
instrObj.instr_name = self.rv32a_instr_names[funct5]
if funct5 == 0b00101:
instrObj.instr_name = self.zacas_instr_names[funct3]
else:
#RV32A instructions
if funct3 == 0b010:
if funct5 == 0b00010:
instrObj.rs2 = None
instrObj.instr_name = self.rv32a_instr_names[funct5]
else:
instrObj.instr_name = self.rv32a_instr_names[funct5]

return instrObj
return instrObj

#RV64A instructions
if funct3 == 0b011:
if funct5 == 0b00010:
instrObj.rs2 = None
instrObj.instr_name = self.rv64a_instr_names[funct5]
else:
instrObj.instr_name = self.rv64a_instr_names[funct5]
#RV64A instructions
if funct3 == 0b011:
if funct5 == 0b00010:
instrObj.rs2 = None
instrObj.instr_name = self.rv64a_instr_names[funct5]
else:
instrObj.instr_name = self.rv64a_instr_names[funct5]

return instrObj
return instrObj

def flw_fld(self, instrObj):
instr = instrObj.instr
Expand Down

0 comments on commit 6418806

Please sign in to comment.