This repository containing modified versions of the gem5 simulator integrated with Bine-Brake, Darch, and Microbenchmark. This repository is set up to provide an easy way for you to build and run gem5 with these modifications. Below are the steps to get started:
First, clone this repository to your local machine:
git clone https://github.com/hegdeprajwal/perf-model.git
This repository includes submodules (gem5 from Bine Brank, gem5 from Darch and Microbenchmark), which need to be initialized and updated. Navigate to the repository root directory and run:
cd perf-model
git submodule update --init --recursive
Navigate to the microbenchmark directory:
cd microbench
To build Microbenchmark for the ARM architecture (make sure you are running this on ARM Machine), run the following command:
make ARM
To collect the necessary binaries and modify to include .Y(n1 number of iterations) and .Z(n2 number of iterations) form of the benchmark, execute:
source gather_bin.sh
Note: It is crucial to execute the build and run processes for two executables—one with the .Y variant (N1: lower loop count) and the other with the .Z variant (N2: higher loop count). This approach is employed to gather statistics specifically focused on the inside loop portion. The difference of N2 stats from N1 allows us to isolate and extract the statistics pertaining only to the code section inside the loop.
Run the perf command and collect stats for all the executables:
source run_perf.sh
Move to the gem5 directory:
cd ..
cd bine or darch model/grace_new
Build gem5 for the ARM architecture using SCons. You can specify the number of processor cores to use by replacing with the desired number:
scons build/ARM/gem5.opt -j `nproc`
scons build/ALL_CHI/gem5.opt -j `nproc` --default=ALL PROTOCOL=CHI
Modify the bins BINS_DIR
and CPU_TYPE
if needed in run_all.sh
script.
source run_all.sh
Modify the _base_dir
in microbench_init_.py to point to global microbench/
directory that contains bins
repo directory as
gem5/build/ALL_MESI_Three_Level/gem5.opt run_grace_all.py `cpu-type`
Gather all the stats and execute the following command to print the stats space separated which can be easily copied to excel or csv format
python3 post_process.py `gsrc` `g_out` `p_src` `cpu`
gsrc
: Path to the gem5 stats folderg_out
: Intermediate grep output from gem5 statsp_src
: Path to the grep result of perf stats (run_perf in microbench creates grep result directly)cpu
: CPU type to filter Default : GraceCPU
- For more information on gem5 and its usage, please refer to the official gem5 documentation.
- For specific details about the Bine Brank and Darch modifications, please refer to their respective documentation or the associated repositories.
Sit back and enjoy your coffee! Happy Simulations!!