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

arch-riscv: add h ci test & config #216

Merged
merged 1 commit into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion .github/workflows/gem5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,31 @@ jobs:
export GEM5_HOME=$(pwd)
mkdir -p $GEM5_HOME/util/xs_scripts/test_l2tlb
cd $GEM5_HOME/util/xs_scripts/test_l2tlb
bash ../kmh_6wide.sh /nfs/home/share/yanyue/checkpoints/gcc13_gcb_403_61291.zstd
bash ../kmh_6wide.sh /nfs/home/share/yanyue/checkpoints/gcc13_gcb_403_61291.zstd

new_sim_script_test_gcbh:
runs-on: self-hosted
continue-on-error: false
name: XS-GEM5 - Test new simulation script on RV64GCBH
steps:
- uses: actions/checkout@v2
- name: Build DRAMSim
run: |
export GEM5_HOME=$(pwd)
cd ext/dramsim3
git clone [email protected]:umd-memsys/DRAMSim3.git DRAMsim3
cd DRAMsim3 && mkdir -p build
cd build
cmake ..
make -j 48
cd $GEM5_HOME
- name: Build GEM5 opt
run: CC=gcc CXX=g++ scons build/RISCV/gem5.opt --linker=gold -j64
- name: XS-GEM5 - Test xiangshan.py simulation scripts
run: |
export GCBH_REF_SO="/nfs-nvme/home/share/zhenhao/ref-h/build-h/riscv64-nemu-interpreter-so"
export GCBH_RESTORER="/nfs-nvme/home/share/zhenhao/LibCheckpointAlpha/build/gcpt.bin"
export GEM5_HOME=$(pwd)
mkdir -p $GEM5_HOME/util/xs_scripts/test_h
cd $GEM5_HOME/util/xs_scripts/test_h
bash ../kmh_6wide_h.sh /nfs/home/share/jiaxiaoyu/H-ext-checkpoint-uniform-zstd-nosmp/uniform/payload/820000000/_820000000_.zstd
3 changes: 3 additions & 0 deletions configs/common/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ def addCommonOptions(parser, configure_xiangshan=False):
parser.add_argument("--restore-rvv-cpt", action="store_true", default=False,
help="The input checkpoint is RVV, which requires RVV restorer")

parser.add_argument("--restore-rvh-cpt", action="store_true", default=False,
help="The input checkpoint is RVH, which requires RVH restorer")

parser.add_argument("--xiangshan-ecore", action= "store_true",
help="Use efficient core of xiangshan")

Expand Down
14 changes: 13 additions & 1 deletion configs/common/XSConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ def config_xiangshan_inputs(args: argparse.Namespace, sys):
elif "GCBV_REF_SO" in os.environ:
ref_so = os.environ["GCBV_REF_SO"]
print("Obtained ref_so from GCBV_REF_SO: ", ref_so)
elif "GCBH_REF_SO" in os.environ:
ref_so = os.environ["GCBH_REF_SO"]
print("Obtained ref_so from GCBH_REF_SO: ", ref_so)
elif "NEMU_HOME" in os.environ:
ref_so = os.path.join(os.environ["NEMU_HOME"], "build/riscv64-nemu-interpreter-so")
print("Obtained ref_so from NEMU_HOME: ", ref_so)
Expand All @@ -31,7 +34,7 @@ def config_xiangshan_inputs(args: argparse.Namespace, sys):
fatal("No valid ref_so file specified for the functional model to "
"compare against. Please 1) either specify a valid ref_so file using "
"the --difftest-ref-so option;\n"
"2) or specify GCBV_REF_SO/GCBV_MULTI_CORE_REF_SO that points to the ref_so file;\n"
"2) or specify GCBV_REF_SO/GCBV_MULTI_CORE_REF_SO/GCBH_REF_SO that points to the ref_so file;\n"
"3) or specify NEMU_HOME that contains build/riscv64-nemu-interpreter-so")
elif args.enable_difftest and args.difftest_ref_so is not None:
ref_so = args.difftest_ref_so
Expand All @@ -55,6 +58,12 @@ def config_xiangshan_inputs(args: argparse.Namespace, sys):
print("Obtained gcpt_restorer from GCBV_RESTORER: ", gcpt_restorer)
else:
fatal("Plz set $GCBV_RESTORER when running RVV checkpoints")
elif args.restore_rvh_cpt:
if "GCBH_RESTORER" in os.environ:
gcpt_restorer = os.environ["GCBH_RESTORER"]
print("Obtained gcpt_restorer from GCBH_RESTORER: ", gcpt_restorer)
else:
fatal("Plz set $GCBH_RESTORER when running RVH checkpoints")
else:
if "GCB_RESTORER" in os.environ:
gcpt_restorer = os.environ["GCB_RESTORER"]
Expand All @@ -72,6 +81,9 @@ def config_xiangshan_inputs(args: argparse.Namespace, sys):
elif args.restore_rvv_cpt:
print("Simulating single core with RVV, demanding GCPT restorer size of 0x1000.")
sys.gcpt_restorer_size_limit = 0x1000
elif args.restore_rvh_cpt:
print("Simulating single core with RVH, demanding GCPT restorer size of 0x1000.")
sys.gcpt_restorer_size_limit = 0x1000
else:
print("Simulating single core without RVV, demanding GCPT restorer size of 0x700.")
sys.gcpt_restorer_size_limit = 0x700
Expand Down
10 changes: 10 additions & 0 deletions util/xs_scripts/kmh_6wide_h.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

script_dir=$(dirname -- "$( readlink -f -- "$0"; )")
source $script_dir/common.sh

for var in GCBH_REF_SO GCBH_RESTORER gem5_home; do
checkForVariable $var
done

$gem5 $gem5_home/configs/example/xiangshan.py --generic-rv-cpt=$1 --restore-rvh-cpt