riscv-opcodes icon indicating copy to clipboard operation
riscv-opcodes copied to clipboard

Spike crashing after adding new instruction!!

Open nikita890-art opened this issue 3 years ago • 2 comments

I created a new.h file in the riscv-isa-sim/riscv/insns folder to combine 2 instructions,

addi a5,gp,-1436 add a5,a5,a3

So, the code I wrote to combine these instructions is,

int32_t v0 = sext_xlen(RS1 + insn.i_imm()); WRITE_RD(sext_xlen(v0 + RS1));

When I compiled and ran spike, it crashed.

I think there is something wrong with the logic of my code but I do not know how to fix it.

nikita890-art avatar Aug 24 '21 13:08 nikita890-art

Neither of my custom instructions failed so I am sure it is not an issue of spike. Consider doing this:

  1. Ensure that your instruction is listed in encoding.h
  2. Ensure that your instruction is listed in riscv/riscv.mk.in
  3. Ensure there is no typos in match/mack/encoding/name/etc
  4. Ensure that your instruction disassembles properly

marcfedorow avatar Sep 10 '21 13:09 marcfedorow

@nikita890-art Could you provide a branch pointing to your repo or patches ? It is hard to tell what goes wrong.

chihminchao avatar Sep 13 '21 15:09 chihminchao