Build Dana on CentOS7

ccwwff發表於2017-11-28

Dana(Dynamically Allocated Neural Network Accelerator for the RISC-V)

1. Install sbt, JAVA8,

   see to http://blog.csdn.net/ccwwff/article/details/78188868

2. python3.5(anaconda, numpy, sicpy)
$ sudo yum -y install gcc gcc-c++ numpy python-devel scipy
首先上官網下載anaconda: Anaconda3-4.2.0-Linux-x86_64.sh
https://www.continuum.io/downloads#_unix
$ bash Anaconda3-4.2.0-Linux-x86_64.sh
$ export PYTHONPATH=~/anaconda3/python3.5

3. see to https://github.com/bu-icsg/dana

$ export fpga_zynq_dir=/home/paul_cao/SOC/RISC-V/ucb-bar/fpga_zynq
$ git clone https://github.com/ucb-bar/fpga-zynq $fpga_zynq_dir
$ cd $fpga_zynq_dir
$ git reset --hard f03982e
$ git submodule update --init rocket-chip testchipip

3.1 Add DANA to rocket-chip
$ cd $fpga_zynq_dir/rocket-chip
$ git submodule update --init
$ git clone https://github.com/bu-icsg/dana
$ cd $fpga_zynq_dir/rocket-chip/dana
$ git submodule update --init

3.2 Build an emulator
$ cp $fpga_zynq_dir/rocket-chip/firrtl/utils/bin/firrtl.jar $fpga_zynq_dir/rocket-chip/lib
$ cd $fpga_zynq_dir/rocket-chip/emulator
$ make ROCKETCHIP_ADDONS=dana CONFIG=DanaEmulatorConfig

3.3 Build example DANA networks in 'dana/build/nets'
$ cd $fpga_zynq_dir/rocket-chip/dana
$ make

3.4 Build toolchain:
$ export RISCV=/home/xxx/riscv-install
$ export PATH=${RISCV}/bin:${PATH}
$ export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
$ sudo yum install autoconf automake @development-tools curl dtc libmpc-devel mpfr-devel gmp-devel gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib-devel
$ git clone https://github.com/riscv/riscv-tools.git
$ cd riscv-tools
$ git submodule update --init --recursive
$ build.sh

See to: https://github.com/riscv/riscv-tools

3.5 Build bare metal tests for DANA in 'dana/tests/build'
$ cd $fpga_zynq_dir/rocket-chip/riscv-tools
$ git submodule update --init --recursive riscv-tests
$ cd $fpga_zynq_dir/rocket-chip/dana/tests
$ autoconf
$ mkdir build
$ cd build
$ ../configure
$ make


3.6 Run tests on the emulator with or without printfs
$ cd $fpga_zynq_dir/rocket-chip/emulator
$ ./emulator-rocketchip-DanaEmulatorConfig \
   ../dana/tests/build/nets/xfiles-dana-nets-p-xorSigmoidSymmetric

$ ./emulator-rocketchip-DanaEmulatorConfig \
 +verbose \
 ../dana/tests/build/nets/xfiles-dana-nets-p-xorSigmoidSymmetric \
 2>&1 | \

 spike-dasm | \ tee xfiles-dana-nets-p-xorSigmoidSymmetric.log



相關文章