Separate the install script into five steps

This commit is contained in:
Guojie Luo 2023-01-04 09:52:42 +00:00
parent 122e2f99c8
commit 57aafd93fb
9 changed files with 122 additions and 2 deletions

4
InstructionGenerator/CGRAInstruction.cpp Executable file → Normal file
View File

@ -20,7 +20,7 @@ CGRA_Instruction::CGRA_Instruction(unsigned long Instructionword)
ENCODE_instruction();
}
CGRA_Instruction::CGRA_Instruction(Datatype dt, OPCode opc,int predic,PEInputMux LMuxSel, PEInputMux RMuxSel, int RRegAdd1,int RRegAdd2, int WAdd, bool WE, int ImmVal, bool EDMAdd, bool DMData)
CGRA_Instruction::CGRA_Instruction(Datatype dt, OPCode opc,int predic,PEInputMux LMuxSel, PEInputMux RMuxSel, int RRegAdd1,int RRegAdd2, int WAdd, bool WE, long ImmVal, bool EDMAdd, bool DMData)
{
DType=dt;
@ -387,7 +387,7 @@ Pred_Instruction::Pred_Instruction(unsigned long Instructionword)
ENCODE_Pred_instruction();
}
Pred_Instruction::Pred_Instruction(Datatype dt, PredOPCode popc,PEInputMux LMuxSel, PEInputMux RMuxSel, PEInputMux PMuxSel, int RRegAdd1,int RRegAdd2, int RRegAddP, int ImmVal)
Pred_Instruction::Pred_Instruction(Datatype dt, PredOPCode popc,PEInputMux LMuxSel, PEInputMux RMuxSel, PEInputMux PMuxSel, int RRegAdd1,int RRegAdd2, int RRegAddP, long ImmVal)
{
DType = dt;
popCode=popc;

0
InstructionGenerator/CGRAInstruction.h Executable file → Normal file
View File

0
InstructionGenerator/CGRAdefinitions.h Executable file → Normal file
View File

6
install-s0-setup.sh Normal file
View File

@ -0,0 +1,6 @@
#Before running this bash script, please read REAMME.md
ccf_root=$(pwd)
#Change this to the path you want and make sure it is a true path!
install_path="/sw"
mapping_debug=1

23
install-s1-openssl.sh Normal file
View File

@ -0,0 +1,23 @@
#Before running this bash script, please read REAMME.md
source install-s0-setup.sh
# ==============================================================================
# Installing OpenSSL if necessary
openssl_version="$(openssl version | grep -Eo '[+-]?[0-9]+([.][0-9]+)?' | head -1)"
openssl_exist=$(which openssl)
if [ $(echo "$openssl_version > 1.1" | bc) -eq 0 -o -z "$openssl_exist" ]; then
echo Installing OpenSSL 1.1.1j in case CMake 3.19.5 needs it
wget https://www.openssl.org/source/openssl-1.1.1j.tar.gz --no-check-certificate
tar zxvf openssl-1.1.1j.tar.gz
cd openssl-1.1.1j
./config --prefix=${install_path}
make -j 8 && make -j 8 install
cd ..
rm -rf openssl-1.1.1j*
fi
# ==============================================================================

21
install-s2-cmake.sh Normal file
View File

@ -0,0 +1,21 @@
#Before running this bash script, please read REAMME.md
source install-s0-setup.sh
# ==============================================================================
# Installing CMake'
cmake_version="$(cmake -version | grep -Eo '[+-]?[0-9]+([.][0-9]+)?' | head -1)"
cmake_exist=$(which cmake)
if [ $(echo "$cmake_version > 3.19" | bc) -eq 0 -o -z "$cmake_exist" ]; then
echo Installing CMake 3.19.5
wget https://github.com/Kitware/CMake/releases/download/v3.19.5/cmake-3.19.5.tar.gz --no-check-certificate
tar zxvf cmake-3.19.5.tar.gz
cd cmake-3.19.5
./configure --prefix=${install_path}
make -j 8 && make -j 8 install
cd ..
rm -rf cmake-3.19.5*
fi
# ==============================================================================

16
install-s3-llvm.sh Normal file
View File

@ -0,0 +1,16 @@
#Before running this bash script, please read REAMME.md
source install-s0-setup.sh
# ==============================================================================
# Installing LLVM
echo Installing Clang/LLVM + LLVM-Gold
cd llvm-project
llvm_dir=$(pwd)
mkdir build
cd build
cmake -DPython3_EXECUTABLE=/usr/bin/python3 -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_BINUTILS_INCDIR="${llvm_dir}/binutils/include" --enable-pic -DCMAKE_BUILD_TYPE=Release ../llvm -DCMAKE_INSTALL_PREFIX=${install_path}
make -j 8 && make -j 8 install
cd ../..
# ==============================================================================

43
install-s4-cgracc.sh Normal file
View File

@ -0,0 +1,43 @@
#Before running this bash script, please read REAMME.md
source install-s0-setup.sh
# ==============================================================================
# Compiling Mapping Algorithms
# Add the following lines below when you know what is going on with the directories
#if [ $(echo "$mapping_debug" | bc) -eq 1 ]; then
#fi
cd mappings
echo $(pwd)
find . -maxdepth 1 -mindepth 1 -type d | while read dir; do
cd $dir/Release
make
cd ../DFGFiles
g++ -O3 nodefile.cpp -o nodefile
g++ -O3 edgefile.cpp -o edgefile
cd ../../
done
echo "Mapping compilation complete"
cd ..
# ==============================================================================
# Building Instruction Generation files
cd InstructionGenerator
make clean && make insgen && make falcon_insgen
echo "Instruction Generator compilation complete"
cd ..
# ==============================================================================
# Changing toolchain path of cgracc and cgra++ and copying them
# into ${install_path}/bin
cd scripts/CGRALib
sed -i "/ccf_root\=/c\ccf_root=\"${ccf_root}\"" cgracc
sed -i "/ccf_root\=/c\ccf_root=\"${ccf_root}\"" cgra++
sed -i "/ccf_root\=/c\ccf_root=\"${ccf_root}\"" cgraexe
sed -i "/ccf_root\=/c\ccf_root=\"${ccf_root}\"" cgradb
sed -i "/install_path\=/c\install_path=\"${install_path}\"" cgracc
sed -i "/install_path\=/c\install_path=\"${install_path}\"" cgra++
sed -i "/install_path\=/c\install_path=\"${install_path}\"" cgraexe
sed -i "/install_path\=/c\install_path=\"${install_path}\"" cgradb
cp cgracc cgra++ cgraexe cgradb ${install_path}/bin
echo "cgracc, cgra++, and cgraexe manipulation and copy complete"
cd ../..
# ==============================================================================

11
install-s5-gem5.sh Normal file
View File

@ -0,0 +1,11 @@
#Before running this bash script, please read REAMME.md
source install-s0-setup.sh
# ==============================================================================
# Build gem5
python3 -m pip install scons six
cd gem5
scons build/ARM/gem5.opt -j8
sed -i "s|AtomicSimpleCPU|AtomicCGRA,AtomicSimpleCPU|g" ./build/variables/ARM
scons build/ARM/gem5.opt -j8
scons build/ARM/gem5.debug -j8
cd ../