NVDLA VP for Beginners - JunningWu/Learning-NVDLA-Notes GitHub Wiki

1. checkout nvdla hw & vp

mkdir NVDLA
$ cd NVDLA
$ git clone https://github.com/nvdla/vp.git git-nvdla-vp
$ cd vp
$ git submodule update --init --recursive
$ git clone https://github.com/nvdla/hw.git git-nvdlav1

2. Install Dependencies

  • OS: Ubuntu 14.04
    
  • g++ 4.8.4
    
  • git > 1.8.2
    
  • systemc 2.3.0
    
  • cmake > 2.8
    
  • libboost > 1.34
    
  • python dev
    
  • glib2 dev
    
  • pixman dev
    
  • lua 5.2 dev
    
  • swig
    
  • libcap dev
    
  • libattr1 dev
    
$ sudo apt-get install g++ cmake libboost-dev python-dev libglib2.0-dev libpixman-1-dev liblua5.2-dev swig libcap-dev libattr1-dev

3. Build and Install Systemc(SystemC 2.3.0)

$ wget -O systemc-2.3.0a.tar.gz http://www.accellera.org/images/downloads/standards/systemc/systemc-2.3.0a.tar.gz
$ tar -xzvf systemc-2.3.0a.tar.gz
$ cd systemc-2.3.0a
$ sudo mkdir -p /your path/systemc-2.3.0/
$ mkdir objdir
$ cd objdir
$ ../configure --prefix=/your path/systemc-2.3.0
$ make
$ sudo make install

4. Build NVDLA Cmod

$ cd NVDLA/git-nvdlav1
$ make
$ tools/bin/tmake -build cmod_top

5. Build and Install the Virtual Simulator(aarch64_toplevel)

$ cmake -DCMAKE_INSTALL_PREFIX=[install dir] -DSYSTEMC_PREFIX=[systemc prefix] -DNVDLA_HW_PREFIX=[nvdla_hw prefix] -DNVDLA_HW_PROJECT=[nvdla_hw project name]

For my Case

$ cmake -DCMAKE_INSTALL_PREFIX=build -DSYSTEMC_PREFIX=/home/nvdla/systemc-2.3.0/ -DNVDLA_HW_PREFIX=/home/nvdla/NVDLA/git-nvdlav1 -DNVDLA_HW_PROJECT=nvdla_full
$ make
$ sudo make install

6. Running the Virtual Simulator

Not Using Docker **Pre-Build Kernel Image and FS, default QEMU Config, *.ko **

$ export SC_SIGNAL_WRITE_CHECK=DISABLE
$ ./build/bin/aarch64_toplevel -c conf/aarch64_nvdla.lua

7. Login and Hello_World

Login the kernel. The demo image uses account 'root' and password 'nvdla'.

# mount -t 9p -o trans=virtio r /mnt
# cd /mnt/tests/hello
# ./aarch64_hello

Then You can run some Huge CNN Applications, such as LeNet-5 and AlexNet.

8. Build an Debug Version VP

$ cmake -DCMAKE_INSTALL_PREFIX=build -DSYSTEMC_PREFIX=/home/nvdla/systemc-2.3.0/ -DNVDLA_HW_PREFIX=/home/nvdla/NVDLA/git-nvdlav1 -DNVDLA_HW_PROJECT=nvdla_full **-DCMAKE_BUILD_TYPE=Debug**
$ make
$ sudo make install

export SC_LOG=control_string

export SC_LOG="outfile:sc.log;verbosity_level:sc_debug;csb_adaptor:enable" -- print the register access transaction from QEMU to NVDLA