-
Notifications
You must be signed in to change notification settings - Fork 8
/
patch.sh
executable file
·51 lines (43 loc) · 1.28 KB
/
patch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
if [[ -n "${SIMULATOR_ROOT}" ]]; then
echo "SIMULATOR_ROOT is: ${SIMULATOR_ROOT}"
else
echo "The environment variable SIMULATOR_ROOT is not defined."
exit
fi
cd ${SIMULATOR_ROOT}
rm -rf .changed_files
mkdir .changed_files
# Pathc for Sniper
cd ${SIMULATOR_ROOT}/snipersim
git diff > ../interchiplet/patch/snipersim.diff
snipersim_changed_file_list="$(git diff --name-only)"
cd ${SIMULATOR_ROOT}
file_list=($snipersim_changed_file_list)
echo ${#file_list[@]} "Files has changed."
for item in "${file_list[@]}"; do
echo $item
cp --parent snipersim/$item .changed_files/
done
# Patch for GPGPUSim
cd ${SIMULATOR_ROOT}/gpgpu-sim
git diff > ../interchiplet/patch/gpgpu-sim.diff
gpgpu_sim_changed_file_list="$(git diff --name-only)"
cd ${SIMULATOR_ROOT}
file_list=($gpgpu_sim_changed_file_list)
echo ${#file_list[@]} "Files has changed."
for item in "${file_list[@]}"; do
echo $item
cp --parent gpgpu-sim/$item .changed_files/
done
# Patch for GEM5
cd ${SIMULATOR_ROOT}/gem5
git diff > ../interchiplet/patch/gem5.diff
gem5_changed_file_list="$(git diff --name-only)"
cd ${SIMULATOR_ROOT}
file_list=($gem5_changed_file_list)
echo ${#file_list[@]} "Files has changed."
for item in "${file_list[@]}"; do
echo $item
cp --parent gem5/$item .changed_files/
done