ThinkOpenly / sail-riscv

Sail RISC-V model
Other
12 stars 14 forks source link

Add instruction names #1

Open ThinkOpenly opened 11 months ago

ThinkOpenly commented 11 months ago

It would be really nice to be able to extract the names of the respective instructions from their definitions. One suggestion is to use "attributes":

$[name jump and link register]
union clause ast = RISCV_JALR : (bits(12), regidx, regidx)
ThinkOpenly commented 5 months ago

Commit 65fca04aaf11f0e929ebfcac5a9f220b8df66552 includes some additional names, and a mechanism for adding names for instructions whose mnemonics are within mappings:

mapping itype_mnemonic : iop <-> string = {
  $[name add immediate]
    RISCV_ADDI  <-> "addi",
  $[name set less than immediate]
    RISCV_SLTI  <-> "slti",
[...]