The GraphAttack compiler is adapted from the DECADES compiler. Below are instructions on how to build and run the compiler:
Prerequisites -----
DEC++ is built on LLVM/Clang. It is able to compile to riscv64 binaries using the riscv gcc sysroot.
To obtain these (large) depedencies, please go to the ext directory and run build. This will a large install (~13 GB) and take several hours. It will build LLVM and riscv64 GCC and OpenMP.
Once you have successfully installed/acquired the right versions of CMake and LLVM, run the following:
mkdir build
cd build
cmake ../
make
be sure that cmake is pointing to the right version of LLVM, this can be done with CMAKE variables, e.g.:
cmake -DLLVM_DIR=/home/ts20/DECADES_compiler/ext/build_llvm/lib/cmake/llvm ../
DEC++ can be invoked from the command line with the following possible arguments:
DEC++ -m MODE [-t] [NUM_THREADS] [-sps] [SCRATCHPAD_SIZE] [-s] [BISCUIT_SYNC_MODE] [-spp] [SIMULATOR_PREPROCESSING_SCRIPT] [--target] [TARGET] $FILE [$ARGS]
MODE must be one of the following:
-
Native ("n"): simply compiles the source files with no LLVM transformations or passes (useful for verification of correct program output and debugging, as well as application development outside of any DECADES features)
DEC++ -m n $FILE [$ARGS]No additional arguments are necessary.
-
DECADES Base ("db"): the default DEC++ mode that identifies the
kernelfunction, performs function inlining and wraps the function invocation in the tile launcherDEC++ -m db [-t] [NUM_THREADS] [--target] [TARGET] $FILE [$ARGS]where
NUM_THREADSis the number of threads to utilize in parallel andTARGETcan be either "x86" (default), "simulator" (https://github.com/PrincetonUniversity/pythia), or "riscv64" (generate a RISC-V binary to run on the DECADES FPGA emulation and chip platform). If the target is "simulator", then the path to the simulator preprocessing script is necessary:DEC++ -m db [-t] [NUM_THREADS] [-spp] [SIMULATOR_PREPROCESSING_SCRIPT] [--target] [TARGET] $FILE [$ARGS] -
Decoupled Implicit ("di"): the decoupling compilation mode that slices the
kernelfunction into supply and compute programs completely automaticallyDEC++ -m di [-t] [NUM_THREADS] [--target] [TARGET] $FILE [$ARGS]where
NUM_THREADSis the number of threads to utilize in parallel andTARGETcan be either "x86" (default) or "simulator".
We provide further workloads, used withing the DECADES project in the next repo: