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

invalid opcode #3153

Open
5 tasks done
mlabaf2 opened this issue Jul 6, 2024 · 4 comments
Open
5 tasks done

invalid opcode #3153

mlabaf2 opened this issue Jul 6, 2024 · 4 comments
Labels
question Question requiring answer

Comments

@mlabaf2
Copy link

mlabaf2 commented Jul 6, 2024

Before start

  • I have read the RISC-V ISA Manual and this is not a RISC-V ISA question. 我已经阅读过 RISC-V 指令集手册,这不是一个指令集相关的问题。
  • I have read the XiangShan Documents. 我已经阅读过香山文档。
  • I have searched the previous issues and did not find anything relevant. 我已经搜索过之前的 issue,并没有找到相关的。
  • I have searched the previous discussions and did not find anything relevant. 我已经搜索过之前的 discussions,并没有找到相关的。
  • I have reviewed the commit messages from the relevant commit history. 我已经浏览过相关的提交历史和提交信息。

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 mlabaf2 added the question Question requiring answer label Jul 6, 2024
@mlabaf2
Copy link
Author

mlabaf2 commented Jul 6, 2024

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

@cebarobot
Copy link
Member

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
Copy link
Member

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.

val AluCfg: FuConfig = FuConfig (
name = "alu",
fuType = FuType.alu,
fuGen = (p: Parameters, cfg: FuConfig) => Module(new Alu(cfg)(p).suggestName("Alu")),
srcData = Seq(
Seq(IntData(), IntData()),
),
piped = true,
writeIntRf = true,
immType = Set(SelImm.IMM_I, SelImm.IMM_U, SelImm.IMM_LUI32),
)

And this fuGen is called here.

val funcUnits = fuCfgs.map(cfg => {
assert(cfg.fuGen != null, cfg.name + "Cfg'fuGen is null !!!")
val module = cfg.fuGen(p, cfg)
module
})

@mlabaf2
Copy link
Author

mlabaf2 commented Jul 30, 2024

thanks solved

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

No branches or pull requests

2 participants