Framework for a hybrid system with a RISC-V core and a Dynamically Reconfigurable Accelerator, including:
-
CGRA-MG: DRA+RISC-V SoC modeling
-
App-Compiler: LLVM-based DFG generator
-
CGRA-Compiler: CGRA mapper and task scheduler.
-
Bechmarks: C programs with target loop kernel annotated
- install dependence tools
sudo apt-get install -y build-essential bison flex software-properties-common curl
sudo apt-get install -y libgmp-dev libmpfr-dev libmpc-dev zlib1g-dev vim default-jdk default-jre
sudo apt-get install -y texinfo gengetopt
sudo apt-get install -y libexpat1-dev libusb-dev libncurses5-dev cmake
sudo apt-get install -y python3.8 patch diffstat texi2html texinfo subversion chrpath wget
sudo apt-get install -y libgtk-3-dev gettext
sudo apt-get install -y python3-pip python3.8-dev rsync libguestfs-tools expat ctags
sudo apt-get install -y device-tree-compiler- clone repo and build
git clone https://github.com/ucb-bar/chipyard.git
cd chipyard
git checkout 1.5.0
./scripts/init-submodules-no-riscv-tools.sh
./scripts/build-toolchains.sh esp-tools --ignore-qemu-
download llvm source codes from https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-10.0.0.tar.gz
extract and change directory name
tar xvf llvmorg-10.0.0.tar.gz
mv llvmorg-10.0.0 llvm-project-10.0.0- build llvm
mkdir llvm-10.0.0-built
cd llvm-project-10.0.0
mkdir build
cd build
cmake -DLLVM_ENABLE_PROJECTS='polly;clang' -G "Unix Makefiles" ../llvm
# multi-thread consumes lots of memory, e.g. -j4 : 30G+
make -j4
# DESTDIR set install directory
make install DESTDIR=/xxx/llvm/llvm-10.0.0-built- set llvm env
# add following env to .bashrc and then source ~/.bashrc.
# or directly export the env
export LLVM_HOME=/xxx/llvm/llvm-10.0.0-built/usr/local/bin
export PATH=$LLVM_HOME:$PATH
# or set the LLVM path in the CMakeLists.txt
set(LLVM_INCLUDE_DIRS "/xxx/llvm-10.0.0-built/usr/local/include")
set(LLVM_LIBRARY_DIRS "/xxx/llvm-10.0.0-built/usr/local/lib")-
copy this repo to the chipyard/generators/ directory
-
Add the following configuration in the chipyard/build.sbt file
lazy val chipyard = (project in file("generators/chipyard"))
.dependsOn(
...
fdra
)
lazy val fdra = (project in file("generators/fdra/cgra-mg"))
.dependsOn(testchipip, rocketchip)
.settings(libraryDependencies ++= rocketLibDeps.value)
.settings(chiselTestSettings)
.settings(commonSettings)
- copy config file to chipyard
cd chipyard/generators/fdra
./scripts/setup-paths.sh- build verilog
source env.sh
cd generators/fdra
./scripts/build-verilog.sh- build simulator based on Verilator
./scripts/build-verilator.shDownload LLVM-10.0.0 and build
Set LLVM env
Using the script build.sh in this app-compiler directory. The internal path should be changed.
./build.shUsing the script build.sh
cd cgra-compiler
./build.shUsing the script run.sh
./run.shChange the benchmark file path as you need.
The generated result files are in the same directory as the benchmark.
Automatically generate with CGRA Compiler, or
Manually replace the target loop kernel with CGRA call function and binding codes generated by CGRA Mapper
-
copy the application file to generators/fdra/software/tests
-
add the application in the Makefile
-
compile with the build.sh file.
cd generators/fdra
./scripts/run-verilator.sh app-name