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

How to use profile function of verilator in XiangShan environment #2858

Open
6 tasks done
guyandeli opened this issue Apr 8, 2024 · 6 comments
Open
6 tasks done

How to use profile function of verilator in XiangShan environment #2858

guyandeli opened this issue Apr 8, 2024 · 6 comments
Labels
question Question requiring answer

Comments

@guyandeli
Copy link

guyandeli commented Apr 8, 2024

我按照Verilator 手册添加profile 选项(--prof-cfuncs),无法产生gmon.out 分析报告(我跑的coremark 可以正常结束 ),请问在香山环境中如何使用profile 功能。

Before start

PLEASE MAKE SURE you have done these:

  • (Select what you have done like this)
  • I have read the RISC-V ISA Manual and this is not a RISC-V ISA question.
  • I have read the XiangShan Documents.
  • I have searched the previous issues and did not find anything relevant.
  • I have searched the previous discussions and did not find anything relevant.
  • I have reviewed the commit messages from the relevant commit history.

Describe the question

A clear and concise description of your question.

@guyandeli guyandeli added the question Question requiring answer label Apr 8, 2024
@cebarobot
Copy link
Member

cebarobot commented Apr 8, 2024

首先,请您按照 Issue 模板的指示完成提问前步骤。
First, Please follow issue template to finish steps before asking questions.

其次,请介绍更多细节,我们尚不清楚您在哪里添加的 --prof-cfuncs
Second, please introduce more details. We still do not know where you add --prof-cfuncs.

另外,香山应该没有使用过 verilator 的 profile 功能,我们可能无法向您提供很多帮助。
Third, It seems that XiangShan have never used profile function of verilator, therefore, we may not able to provide some assistant about this.

@cebarobot cebarobot changed the title 香山环境如何使用Verilator 的profile 功能 How to use profile function of verilator in XiangShan environment Apr 8, 2024
@guyandeli
Copy link
Author

我是在difftest/verilator.mk 中添加 --prof-cfuncs

@poemonsense
Copy link
Member

Please try CONFIG=MinimalConfig. It is a smaller config of XiangShan. It should produce the gmon.out correctly.

We don't know why the DefaultConfig cannot produce gmon.out. It could be most likely due to Verilator issues.

@guyandeli
Copy link
Author

I tried it here and it turns out that gmon.out can only be generated in MinimalConfig mode, but not in default mode. But I have to use the default mode here. Can you help me see how to generate the profile file in the default mode? Is it because the code size in the default mode is too large and cannot be generated?

@poemonsense
Copy link
Member

As I said before, we don't know why the DefaultConfig cannot produce gmon.out. It could be most likely due to Verilator issues.

Please reach out to Verilator for help. https://github.com/verilator/verilator/issues

@poemonsense
Copy link
Member

It's worth noting DefaultConfig and MinimalConfig does not affect the simulation process. So we expect no differences for the workflow to profile the simulation.

We did notice that DefaultConfig cannot produce gmon.out before. However, we don't have enough resources to figure out the reason. We are happy if you would like to identify the real issues here.

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

3 participants