Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike crashing after adding new instruction!! #83

Open
nikita890-art opened this issue Aug 24, 2021 · 2 comments
Open

Spike crashing after adding new instruction!! #83

nikita890-art opened this issue Aug 24, 2021 · 2 comments

Comments

@nikita890-art
Copy link

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.

@marcfedorow
Copy link
Contributor

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

@chihminchao
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants