-
Notifications
You must be signed in to change notification settings - Fork 1.2k
question about adding "mod" instruction #543
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
Comments
by the way |
Spike isn't part of the toolchain, and the instructions you are following are out of date. But the problem seems obvious from your screen shot. Compare the MATCH_MOD sed command on the last line to the MATCH_AND sed command one line above. Then figure out how to fix it. |
Are you sure that the |
thank you for your advice, dear Andrew. |
Hi dear all
I have added the corresponding shell commands to riscv-gdb as well, and followed the four steps at
https://nitish2112.github.io/post/adding-instruction-riscv/
In the riscv-isa-sim/riscv/encoding.h add the following lines:
#define MATCH_MOD 0x200006b
#define MASK_MOD 0xfe00707f
...
DECLARE_INSN(add, MATCH_MOD, MASK_MOD)
Create a file riscv-isa-sim/riscv/insns/mod.h and add these lines:
WRITE_RD(sext_xlen(RS1 % RS2));
Add this file to riscv-isa-sim/riscv/riscv.mk.in
riscv_insn_list =
...
mod
...
In riscv-isa-sim/spike_main/disasm.cc add the following lines:
DEFINE_RTYPE(mod);
and I meet with new errors like the picture one(mod.cc failed) and in riscv-isa-sim there are many .cc,.o and .d of some instructions in picture two.
if I put the shell command "spike pk mod", where mod is the elf, which will occur "an illegal instruction was executed" shown in picture two.

![Uploading pic2.png…]()
The text was updated successfully, but these errors were encountered: