OpenXiangShan / XiangShan

Open-source high-performance RISC-V processor
Other
4.56k stars 634 forks source link

invalid opcode #3153

Open mlabaf2 opened 1 month ago

mlabaf2 commented 1 month ago

Before start

Describe the question

HI i added some new opcode to XiangShan. I modify Instruction.scala, ALU.scala, parameters.scala, DecodeUnit.scala. when I run my workspace , I recieved this message in report of .log file . I cannot find from which .scala code this message is produced "invalid opcode...." image

mlabaf2 commented 1 month ago

Another question is which .scala file call class Alu in Alu.scala file? I cannot find it to trace the mentioned error message...

cebarobot commented 1 month ago

This invalid opcode message is come from NEMU, the golden reference model of XiangShan. You may modify the NEMU to support your new instruction, or just add --no-diff argument to run emu in no diff mode.

cebarobot commented 1 month ago

Another question is which .scala file call class Alu in Alu.scala file? I cannot find it to trace the mentioned error message...

I think it's here.

https://github.com/OpenXiangShan/XiangShan/blob/c2ce03f70f78cf3e4a3588a9396eaf9b67952cd9/src/main/scala/xiangshan/backend/fu/FuConfig.scala#L297-L307

And this fuGen is called here.

https://github.com/OpenXiangShan/XiangShan/blob/7ffbf5fd74959ca8274ee07f523682ef2495c1d6/src/main/scala/xiangshan/backend/exu/ExeUnit.scala#L62-L66

mlabaf2 commented 3 weeks ago

thanks solved