Skip to content

Commit 7dc2563

Browse files
committed
docs: rewrite: running on gem5
1 parent 839d1df commit 7dc2563

File tree

1 file changed

+55
-14
lines changed

1 file changed

+55
-14
lines changed

docs/usages/4.running/gem5.md

+55-14
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,67 @@
1-
# Running on Gem5
1+
# GEM5
22

3-
The checkpoints generated by this repository can be run on Gem5, Nemu, and XiangShan RTL in the XiangShan repository. Here we explain the considerations for running on Gem5.
3+
生成的工作负载(例如切片)可以在多个香山平台上运行,包括GEM5、Nemu和香山RTL。
44

5-
Since the checkpoints in this repository are currently single-core and without V extension (will be updated once vector extension support is stable), please configure according to the README in https://github.com/OpenXiangShan/GEM5.
5+
The generated workloads (e.g. checkpoints) are compatible with multiple XiangShan platforms including GEM5, Nemu, and XiangShan RTL.
66

7-
Note: This repository's checkpoints by default place the checkpoint restorer code at the beginning of the checkpoint address space (refer to opensbi/default.nix). Therefore, there's no need to specify the $GCB_RESTORER environment variable; you can set it to empty.
7+
## 用法(Usage)
88

9+
请按照[OpenXiangShan/GEM5](https://github.com/OpenXiangShan/GEM5)仓库中的配置指南进行设置。
910

10-
If you encounter difftest errors during Gem5 execution, you can follow these steps:
11+
Please follow the configuration guidelines in the [OpenXiangShan/GEM5](https://github.com/OpenXiangShan/GEM5) repository.
1112

12-
1. Visit the Gem5 releases page
13-
2. Download a stable version of NEMU
14-
3. Set the corresponding `$GCBV_REF_SO` environment variable
13+
注意:生成的切片中已包含恢复代码(见`opensbi/default.nix`),
14+
因此不用设置$GCB_RESTORER环境变量。
1515

16-
This approach can help resolve difftest errors and ensure proper execution of checkpoints on Gem5.
16+
Note: The generated checkpoints has included the restorer code (see `opensbi/default.nix`),
17+
eliminating the need to set the $GCB_RESTORER environment variable.
1718

18-
If you encounter other Gem5 runtime errors, try debugging by adding `gdb --args` before the gem5 command. You can also open an issue in this repository or the Gem5 repository.
19+
## 故障排除(Troubleshooting)
1920

20-
Please note that some checkpoints may fail to run in Gem5. This issue is currently being addressed. However, over 90% of the checkpoints should run correctly, and the resulting scores should be generally accurate. After running all checkpoints in Gem5, you can use the following script to calculate the SPEC CPU 2006 slice scores:
21+
请考虑在[Deterload issues](https://github.com/OpenXiangShan/Deterload/issues)中报告你遇到的问题。
2122

22-
https://github.com/shinezyy/gem5_data_proc
23+
Please consider reporting your issues in [Deterload issues](https://github.com/OpenXiangShan/Deterload/issues).
2324

24-
You may need to make some minor modifications to this repository, as gem5_data_proc is designed for internal checkpoints, and there are slight differences in file naming between it and the Nix checkpoints. For example, "hmmer" vs "456.hmmer".
25+
### Difftest错误(Difftest Errors)
2526

26-
This script can help you process the data generated by Gem5 and calculate the final scores for the SPEC CPU 2006 benchmark. Even if a few checkpoints fail to run, this script should still provide you with a fairly accurate performance assessment.
27+
* 访问香山GEM5的release页面
28+
* 下载稳定版本的NEMU
29+
* 设置相应的$GCBV_REF_SO环境变量
30+
31+
32+
* Visit the XiangShan GEM5 releases page
33+
* Download a stable version of NEMU
34+
* Set the corresponding `$GCBV_REF_SO` environment variable
35+
36+
### 常见运行时问题(General Runtime Issues)
37+
38+
* 在gem5命令前添加`gdb --args`进行调试
39+
* 在本仓库或香山GEM5仓库中报告问题
40+
41+
42+
* Debug by prefixing your gem5 command with `gdb --args`
43+
* Report issues in either this repository or the XiangShan GEM5 repository
44+
45+
### 部分切片运行失败(Failures in Some Checkpoints)
46+
47+
虽然目前部分切片可能在GEM5中运行失败(这个问题正在解决中),
48+
但约90%的切片应该能够正确执行,提供可靠的性能指标。
49+
50+
While some checkpoints may currently fail in GEM5 (this is being addressed),
51+
approximately 90% should execute correctly, providing reliable performance metrics.
52+
53+
## 分数计算(Score Calculation)
54+
55+
要在使用GEM5运行切片后计算SPEC CPU 2006分数,
56+
请使用[gem5_data_proc](https://github.com/shinezyy/gem5_data_proc)工具。
57+
由于该工具最初是为内部切片设计的,可能需要进行一些小的调整。
58+
例如,基准测试名称可能需要调整(如"hmmer"改为"456.hmmer")。
59+
即使偶尔有切片运行失败,
60+
这个工具仍然能够为SPEC CPU 2006提供准确的整体性能指标。
61+
62+
To calculate SPEC CPU 2006 scores after running the checkpoints using GEM5,
63+
use the [gem5_data_proc](https://github.com/shinezyy/gem5_data_proc) tool.
64+
Minor adjustments to the tool may be necessary as it was designed for internal checkpoints.
65+
For example, benchmark names may need adaptation (e.g., "hmmer" to "456.hmmer").
66+
Even with occasional checkpoint failures,
67+
this tool should provide accurate overall performance metrics for SPEC CPU 2006.

0 commit comments

Comments
 (0)