riscv-software-src / riscv-isac

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`riscv_isac/InstructionObject.py` uses an unmaintained and incomplete list of instructions

cmuellner opened this issue · comments

riscv_isac/InstructionObject.py defines the following lists:

  • unsgn_rs1...instructions that have an unsigned rs1 value
  • unsgn_rs2...instructions that have an unsigned rs2 value
  • f_instrs_pref...floating-point instructions (without postfixes)

The idea is that the API gets the instruction in the form of a string (e.g. fadd.s or xor), and the code makes decisions based on the instruction.

However, instead of having yet another unmaintained list of instructions that is out of date within a few weeks, the code should be rewritten to use proper (keyword) arguments. In this particular case the name of these parameters are already in the name of the lists above.

Currently these functions are automatically called to assign the correct values to the respective variables(such as rs1 and rs2). Making the suggested changes definitely eases using the object as an API but the variables will still have to be set correctly inside ISAC. I think this can be set inside the decoder as the decoders will have to be updated to add support for any new extension.