Skip to content

FDU-ME-ARC/FDRA

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FDRA Framework

Framework for a hybrid system with a RISC-V core and a Dynamically Reconfigurable Accelerator, including:

  1. CGRA-MG: DRA+RISC-V SoC modeling

  2. App-Compiler: LLVM-based DFG generator

  3. CGRA-Compiler: CGRA mapper and task scheduler.

  4. Bechmarks: C programs with target loop kernel annotated

Build and run flow of FDRA in Chipyard

Dependencies

Chipyard 1.5.0

  1. 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
  1. 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

LLVM-10.0.0 with Polly included

  1. 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
  1. 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
  1. 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")

CGRA-MG

Setup

  1. copy this repo to the chipyard/generators/ directory

  2. 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)
  1. copy config file to chipyard
    cd chipyard/generators/fdra
    ./scripts/setup-paths.sh

Build and run

  1. build verilog
    source env.sh
    cd generators/fdra
    ./scripts/build-verilog.sh
  1. build simulator based on Verilator
    ./scripts/build-verilator.sh

App-Compiler

Setup

Download LLVM-10.0.0 and build
Set LLVM env

Build and Run

Using the script build.sh in this app-compiler directory. The internal path should be changed.
    ./build.sh

CGRA-Compiler

Build

Using the script build.sh
    cd cgra-compiler
    ./build.sh

Run

Using the script run.sh
    ./run.sh
Change the benchmark file path as you need.
The generated result files are in the same directory as the benchmark.

Build & Run Application on SoC

SoC application code generation

Automatically generate with CGRA Compiler, or   
Manually replace the target loop kernel with CGRA call function and binding codes generated by CGRA Mapper

Compile SoC application code with RISC-V toolchain

  1. copy the application file to generators/fdra/software/tests

  2. add the application in the Makefile

  3. compile with the build.sh file.

Run SoC application with simulator

    cd generators/fdra
    ./scripts/run-verilator.sh app-name

About

DRA+RISC-V Exploration Framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 59.6%
  • C 21.7%
  • Assembly 7.6%
  • Scala 7.1%
  • Python 2.7%
  • Perl 0.5%
  • Other 0.8%