diff --git a/.github/workflows/gem5.yml b/.github/workflows/gem5.yml index c536c34ba7..da764c935b 100644 --- a/.github/workflows/gem5.yml +++ b/.github/workflows/gem5.yml @@ -31,6 +31,30 @@ jobs: bash util/memory_check/run-xs-with-valgrind.sh cd $GEM5_HOME + valgrind_memory_check_ideal: + runs-on: self-hosted + continue-on-error: false + name: XS-GEM5 - Check memory corruption with ideal-kmhv3 + steps: + - uses: actions/checkout@v2 + - name: Build DRAMSim + run: | + export GEM5_HOME=$(pwd) + cd ext/dramsim3 + git clone https://github.com/umd-memsys/DRAMsim3.git DRAMsim3 + cd DRAMsim3 && mkdir -p build + cd build + cmake .. + make -j 48 + cd $GEM5_HOME + - name: Build GEM5 debug + run: CC=gcc CXX=g++ scons build/RISCV/gem5.debug --linker=gold -j64 + - name: Memory check + run: | + export GEM5_HOME=$(pwd) + bash util/memory_check/run-xs-with-valgrind.sh ideal + cd $GEM5_HOME + new_sim_script_test_gcb: runs-on: self-hosted continue-on-error: false diff --git a/util/memory_check/run-xs-with-valgrind.sh b/util/memory_check/run-xs-with-valgrind.sh index 798b4b8cd4..a00c89f053 100644 --- a/util/memory_check/run-xs-with-valgrind.sh +++ b/util/memory_check/run-xs-with-valgrind.sh @@ -1,32 +1,33 @@ set -x gem5_home=$(pwd) -gcpt_restore_path=/nfs/home/share/gem5_shared_tools/normal-gcb-restorer.bin -ref_so_path=/nfs-nvme/home/share/zhenhao/ref-h/build/riscv64-nemu-interpreter-so -test_cpt=/nfs/home/share/jiaxiaoyu/simpoint_checkpoint_archive/spec06_rv64gcb_O3_20m_gcc12.2.0-intFpcOff-jeMalloc/checkpoint-0-0-0/GemsFDTD/30385/_30385_0.268180_.gz +ref_so_path=/nfs/home/share/gem5_ci/ref/normal/riscv64-nemu-interpreter-so +export GCBV_REF_SO=$ref_so_path -export NEMU_HOME=$ref_so_path # dummy +raw_cpt=/nfs/home/share/gem5_ci/checkpoints/coremark-riscv64-xs.bin +# ideal config, $1 means ideal-kmhv3 +IDEAL_CONFIG="" +if [ "$1" ]; then + IDEAL_CONFIG="--ideal-kmhv3" +fi +echo "IDEAL_CONFIG: $IDEAL_CONFIG" mkdir -p $gem5_home/valgrind-test cd $gem5_home/valgrind-test valgrind -s --track-origins=yes --log-file=valgrind-out.txt --error-limit=no \ --suppressions=$gem5_home/util/valgrind-suppressions \ - $gem5_home/build/RISCV/gem5.debug $gem5_home/configs/example/fs.py \ - --xiangshan-system --cpu-type=DerivO3CPU --mem-size=8GB --caches --cacheline_size=64 \ - --l1i_size=64kB --l1i_assoc=8 --l1d_size=64kB --l1d_assoc=8 \ - --l1d-hwp-type=XSCompositePrefetcher --short-stride-thres=0 \ - --l2cache --l2_size=1MB --l2_assoc=8 \ - --l3cache --l3_size=16MB --l3_assoc=16 \ - --l1-to-l2-pf-hint --l2-hwp-type=CompositeWithWorkerPrefetcher \ - --l2-to-l3-pf-hint --l3-hwp-type=WorkerPrefetcher \ - --mem-type=DRAMsim3 \ - --dramsim3-ini=$gem5_home/ext/dramsim3/xiangshan_configs/xiangshan_DDR4_8Gb_x8_3200_2ch.ini \ - --bp-type=DecoupledBPUWithFTB --enable-loop-predictor \ - --enable-difftest --difftest-ref-so=$ref_so_path \ - --generic-rv-cpt=$test_cpt \ - --gcpt-restorer=$gcpt_restore_path \ - --warmup-insts-no-switch=40000 --maxinsts=80000 + $gem5_home/build/RISCV/gem5.debug \ + $gem5_home/configs/example/xiangshan.py \ + $IDEAL_CONFIG \ + --raw-cpt \ + --generic-rv-cpt=$raw_cpt + +# if $? != 0, exit +if [ $? -ne 0 ]; then + echo "Valgrind test failed" + exit 1 +fi python3 $gem5_home/util/memory_check/check-memory-error.py $gem5_home/valgrind-test/valgrind-out.txt