Running on Gem5

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.

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.

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.

If you encounter difftest errors during Gem5 execution, you can follow these steps:

  1. Visit the Gem5 releases page
  2. Download a stable version of NEMU
  3. Set the corresponding $GCBV_REF_SO environment variable

This approach can help resolve difftest errors and ensure proper execution of checkpoints on Gem5.

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.

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:

https://github.com/shinezyy/gem5_data_proc

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".

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.