PandA – bambu install

Installation Instructions

In order to install the PandA framework, you need to perform the following steps:

1) Give write permission to your user on /opt:

   $chown -R <username.usergroup> /opt

2) Install required packages (for Ubuntu/Debian/CentOS/Scientific Linux/ArchLinux/Fedora systems, see below)

3) Prepare the configuration script:

   $make -f Makefile.init

4) Create the directory for the building:

   $mkdir obj
   $cd obj

5) Configure PandA:

   $../configure [--enable-<ext-feature>...] --prefix=/opt/panda

Currently accepted parameters are:

  --enable-flopoco: add floating point support by leveraging FloPoCo Library 
                   http://flopoco.gforge.inria.fr/
  --enable-xilinx: enable Xilinx RTL synthesis and simulation tools execution 
                   within the framework
  --enable-altera: enable Altera RTL synthesis tool execution within the framework
  --enable-lattice: enable Lattice RTL synthesis tool execution within the framework
  --enable-modelsim: enable Modelsim-based simulation directly within the framework
  --with-mentor-license=<license-file/license-server>
  --enable-icarus: enable Icarus-based simulation
                   http://iverilog.icarus.com/
  --enable-verilator: enable Verilator-based simulation
                   http://www.veripool.org/wiki/verilator
  --enable-debug: add debugging symbols to the binaries 
  --enable-opt: Compile the framework with GCC optimizations enabled
  --enable-release: Remove further tests not useful in a production environment

Note that the scripts for synthesis and simulation are generated even if the
corresponding tools are not configured as described above. In this case, the
synthesis/simulation has to be performed using the standard shell command line.
Since FloPoCo generates a VHDL-based description, co-simulation requires a
mixed-language simulator. Both Modelsim from Mentor and XSIM/ISIM from Xilinx
have such support.

The suggested configuration is

../configure --prefix=/opt/panda --enable-flopoco --enable-icarus --enable-verilator --enable-xilinx --enable-modelsim --enable-altera --enable-opt --enable-lattice --enable-release --with-mentor-license=<license-string>

A subset of such tools is obviously acceptable.
7) Compile the tool:

  $make

8) Install the tool:

  $make install

At the end, if the installation has been successful, you can run the tool:

  $/opt/panda/bin/bambu

which prints its help message.
Additional documentation about the configuration, the execution of the test
examples, and the creation of the basic documentation of the framework can be
found at: http://panda.dei.polimi.it/?page_id=88

Testcases

In the directory examples, you can find several different testcases, with the
bash scripts for their execution.

These scripts automatically create subdirectories containing all the results
of the execution. You can start from them to build your own hardware
accelerators with bambu.

Documentation

After configuring the framework in the directory for the building, you can
create a preliminary documentation of the framework by executing the following
command:

  $cd obj
  $make documentation

Then, you can start browsing the documentation from the file

  obj/doc/PANDA_html/index.html

Ubuntu packages

The following packages have to be installed under Ubuntu to compile PandA

Ubuntu 17.04 64bit and Ubuntu 17.04 32bit:

- autoconf
- autoconf-archive
- automake
- libtool
- g++
- gcc-4.8
- g++-4.8
- gcc-4.9
- g++-4.9
- gcc-4.8-plugin-dev
- gcc-4.9-plugin-dev
- gcc-5-plugin-dev
- gcc-6-plugin-dev
- gcc-4.8-multiplib
- gcc-4.9-multiplib
- gcc-5-multiplib
- gcc-6-multiplib
- libboost-all-dev
- libmpc-dev
- libmpfr-dev
- libxml2-dev
- liblzma-dev
- libmpfi-dev
- zlib1g-dev
- libicu-dev
- bison
- doxygen
- flex
- graphviz
- iverilog
- verilator
- pkg-config
- libsuitesparse-dev
- libglpk-dev
- make

In a single line:

sudo apt install autoconf autoconf-archive automake libtool g++ gcc-4.8 g++-4.8 gcc-4.9 g++-4.9 gcc-5 g++-5 gcc-6 g++-6 gcc-4.8-plugin-dev gcc-4.9-plugin-dev gcc-5-plugin-dev gcc-6-plugin-dev gcc-4.8-multilib gcc-4.9-multilib gcc-5-multilib gcc-6-multilib libboost-all-dev libmpc-dev libmpfr-dev libxml2-dev liblzma-dev libmpfi-dev zlib1g-dev libicu-dev bison doxygen flex graphviz iverilog verilator make libsuitesparse-dev libglpk-dev

Ubuntu 16.10 64bit:

- autoconf
- autoconf-archive
- automake
- libtool
- g++
- gcc-4.8
- g++-4.8
- gcc-4.9
- g++-4.9
- gcc-4.8-plugin-dev
- gcc-4.9-plugin-dev
- gcc-5-plugin-dev
- gcc-6-plugin-dev
- gcc-4.8-multiplib
- gcc-4.9-multiplib
- gcc-5-multiplib
- gcc-6-multiplib
- libboost-all-dev
- libmpc-dev
- libmpfr-dev
- libxml2-dev
- liblzma-dev
- libmpfi-dev
- zlib1g-dev
- libicu-dev
- bison
- doxygen
- flex
- graphviz
- iverilog
- verilator
- pkg-config
- libsuitesparse-dev
- libglpk-dev
- make

In a single line:

sudo apt install autoconf autoconf-archive automake libtool g++ gcc-4.8 g++-4.8 gcc-4.9 g++-4.9 gcc-5 g++-5 gcc-6 g++-6 gcc-4.8-plugin-dev gcc-4.9-plugin-dev gcc-5-plugin-dev gcc-6-plugin-dev gcc-4.8-multilib gcc-4.9-multilib gcc-5-multilib gcc-6-multilib libboost-all-dev libmpc-dev libmpfr-dev libxml2-dev liblzma-dev libmpfi-dev zlib1g-dev libicu-dev bison doxygen flex graphviz iverilog verilator make libsuitesparse-dev libglpk-dev

Ubuntu 16.04 64bit:

- autoconf
- autoconf-archive
- automake
- libtool
- g++
- gcc-4.8
- g++-4.8
- gcc-4.9
- g++-4.9
- g++-5
- gcc-4.8-plugin-dev
- gcc-4.9-plugin-dev
- gcc-5-plugin-dev
- gcc-4.8-multilib
- gcc-4.9-multilib
- gcc-5-multiplib
- libboost-all-dev
- libmpc-dev
- libmpfr-dev
- libxml2-dev
- liblzma-dev
- libmpfi-dev
- zlib1g-dev
- libicu-dev
- bison
- doxygen
- flex
- graphviz
- iverilog
- verilator
- pkg-config
- libsuitesparse-dev
- libglpk-dev
- make

In a single line:

sudo apt-get install autoconf autoconf-archive automake libtool g++ gcc-4.8 g++-4.8 gcc-4.9 g++-4.9 gcc-5 g++-5 gcc-4.8-plugin-dev gcc-4.9-plugin-dev gcc-5-plugin-dev  gcc-4.8-multilib gcc-4.9-multilib gcc-5-multilib libboost-all-dev libmpc-dev libmpfr-dev libxml2-dev liblzma-dev libmpfi-dev zlib1g-dev libicu-dev bison doxygen flex graphviz iverilog verilator make libsuitesparse-dev libglpk-dev

Ubuntu 14.04 LTS 64bit and Ubuntu 14.04 LTS 32bit:

- autoconf
- autoconf-archive
- automake
- libtool
- g++
- gcc-4.6
- g++-4.6
- gcc-4.7
- g++-4.7
- gcc-4.8-plugin-dev
- gcc-4.7-plugin-dev
- gcc-4.6-plugin-dev
- gcc-4.8-multilib
- gcc-4.7-multilib
- gcc-4.6-multilib
- libboost-all-dev
- libmpc-dev
- libmpfr-dev
- libxml2-dev
- liblzma-dev
- libmpfi-dev
- zlib1g-dev
- libicu-dev
- bison
- doxygen
- flex
- graphviz
- iverilog
- verilator
- pkg-config
- libsuitesparse-dev
- libglpk-dev
- make

In a single line:

sudo apt-get install autoconf autoconf-archive automake libtool g++ gcc-4.6 g++-4.6 gcc-4.6-plugin-dev gcc-4.6-plugin-dev gcc-4.7 g++-4.7 gcc-4.8-plugin-dev gcc-4.7-plugin-dev gcc-4.8-multilib gcc-4.7-multilib  gcc-4.6-multilib libboost-all-dev libmpc-dev libmpfr-dev libxml2-dev liblzma-dev libmpfi-dev zlib1g-dev libicu-dev bison doxygen flex graphviz iverilog verilator libsuitesparse-dev libglpk-dev make

Debian packages

The following packages have to be installed under Debian to compile PandA.

Debian unstable (sid):

- autoconf
- autoconf-archive
- libtool
- make
- g++
- gcc-5
- g++-5
- gcc-6
- g++-6
- gcc-5-plugin-dev
- gcc-6-plugin-dev
- gcc-7-plugin-dev
- gcc-5-multilib
- gcc-6-multilib
- gcc-7-multilib
- libboost-all-dev
- libmpc-dev
- libmpfr-dev
- libxml2-dev
- liblzma-dev
- libmpfi-dev
- zlib1g-dev
- libicu-dev
- bison
- doxygen
- flex
- graphviz
- iverilog
- verilator
- pkg-config
- libsuitesparse-dev
- libglpk-dev
- make

In a single line (as root user):

apt install autoconf autoconf-archive libtool make g++ gcc-5 g++-5 gcc-6 g++-6 gcc-5-plugin-dev gcc-6-plugin-dev gcc-7-plugin-dev gcc-5-multilib gcc-6-multilib gcc-7-multilib libboost-all-dev libmpc-dev libmpfr-dev libxml2-dev liblzma-dev libmpfi-dev zlib1g-dev libicu-dev bison doxygen flex graphviz iverilog verilator pkg-config

Debian 9 (Stretch):

- autoconf
- autoconf-archive
- libtool
- make
- gcc
- g++
- gcc-multilib
- gcc-6-plugin-dev
- libcloog-ppl1
- libboost-all-dev
- libmpc-dev
- libmpfr-dev
- libxml2-dev
- liblzma-dev
- libmpfi-dev
- zlib1g-dev
- libicu-dev
- bison
- doxygen
- flex
- graphviz
- iverilog
- verilator
- pkg-config
- libsuitesparse-dev
- libglpk-dev

In a single line (as root user):

apt install autoconf autoconf-archive libtool make gcc g++ gcc-multilib gcc-6-plugin-dev libcloog-ppl1 libboost-all-dev libmpc-dev libmpfr-dev libxml2-dev liblzma-dev libmpfi-dev zlib1g-dev libicu-dev bison doxygen flex graphviz iverilog verilator pkg-config libsuitesparse-dev libglpk-dev

CentOS 6/Scientific Linux distributions

These two distributions are very similar and present the very same problems. They use an old gcc compiler, not compatible with the PandA framework and they do not have a compatible version of boost libraries. So these are few notes for those who are still willing to install the PandA framework on such systems.
First, some dependencies need to be satisfied:

   $ sudo yum install python-devel zlib-devel bzip2-devel libicu-devel glibc-devel.i686 libgcc.i686 wget tar bzip2 gcc glibc-devel gcc-c++ suiteparse-devel libtool-ltdl-devel glpk-devel

autoconf-archive package is also required, but it is not present in CentOS repositories:

   $ wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/pelliott11:/autoconf-archive/CentOS_CentOS-6/noarch/autoconf-archive-2012.04.07-7.3.noarch.rpm
   $sudo rpm -Uvh autoconf-archive-2012.04.07-7.3.noarch.rpm

Then a recent version of boost has to be installed by hand.

   $ wget http://sourceforge.net/projects/boost/files/boost/1.48.0/boost_1_48_0.tar.bz2/download
   $ cp download boost_1_48_0.tar.bz2
   $ tar xf boost_1_48_0.tar.bz2 -C /tmp
   $ cd /tmp/boost_1_48_0/
   $ sudo mkdir -p /opt/boost/1.48.0
   $ sudo ./bootstrap.sh
   $ sudo ./bjam --prefix=/opt/boost/1.48.0/ variant=release install

Once you have boost installed, you need a recent gcc to compile the PandA sources. This can be done with devtools

On CentOS you can retrieve the devtools repos with the following line:

   $ sudo wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo -O /etc/yum.repos.d/devtools-1.1.repo

On Scientific Linux you can follow the instructions at this link http://linux.web.cern.ch/linux/devtoolset/ to retrieve the repos info.

Then for gcc-4.7.2 run the following line:

   $ sudo yum install devtoolset-1.1 devtoolset-1.1-runtime devtoolset-1.1-binutils devtoolset-1.1-binutils-devel devtoolset-1.1-build devtoolset-1.1-dwz devtoolset-1.1-elfutils devtoolset-1.1-elfutils-devel devtoolset-1.1-elfutils-libelf devtoolset-1.1-elfutils-libelf-devel devtoolset-1.1-elfutils-libs devtoolset-1.1-gcc devtoolset-1.1-gcc-c++ devtoolset-1.1-gcc-gfortran devtoolset-1.1-gcc-plugin-devel devtoolset-1.1-gdb devtoolset-1.1-libitm-devel devtoolset-1.1-libquadmath-devel devtoolset-1.1-libstdc++-devel devtoolset-1.1-valgrind

After this you can enable gcc-4-7 by typing:

   $ scl enable devtoolset-1.1 bash

Finally the following packages have to be installed:

   $ sudo yum install automake bison flex libtool libxml2-devel mpfr-devel

This enviroment allows the compilation of the PandA framework with a minimal configuration without flopoco library and without Icarus verilog simulator.
The configure we tested for centos is the following one:

   $ CXX=/opt/centos/devtoolset-1.1/root/usr/bin/g++ CC=/opt/centos/devtoolset-1.1/root/usr/bin/gcc ../configure --prefix=/opt/panda --enable-opt --enable-release --with-boost=/opt/boost/1.48.0/ --with-gcc47=/opt/centos/devtoolset-1.1/root/usr/bin/gcc

where –with-boost specifies the manually installed boost library and –with-gcc47 specifies the gcc executable provided by devtools-1.1.
FloPoCo is currently not supported by bambu under CentOS 6.

Note that, before the configure, you need to run the make -f Makefile.init command as described in the standard PandA *Installation Instructions*.

CentOS 7

The following packages have to be installed under Centos 7 to compile PandA:

- autoconf
- autoconf-archive
- automake
- bison
- boost-devel
- flex
- gcc-c++
- gcc-plugin-devel
- glibc-devel.i686
- glpk-devel
- libgcc.i686
- libicu-devel
- libtool
- libtool-ltdl-devel
- libxml2-devel
- make
- mpfr-devel
- suitesparse-static
- xz-devel
- zlib-devel

Extra packages for Enterprise Linux (EPEL) is required:

yum install epel-release

In a single line (as root):

yum install autoconf autoconf-archive automake bison boost-devel flex gcc-c++ gcc-plugin-devel glibc-devel.i686 glpk-devel libgcc.i686 libicu-devel libtool libtool-ltdl-devel libxml2-devel make mpfr-devel suitesparse-static xz-devel zlib-devel

FloPoCo is currently not supported by bambu under CentOS 7.

Fedora

The following packages have to be installed under Fedora 23 (64 bit) to compile PandA:

sudo dnf install autoconf autoconf-archive libtool boost-devel mpfr-devel xml2 lzma-devel mpfi-devel zlib-devel bison flex doxygen graphviz iverilog verilator gcc gcc-c++ gcc-plugin-devel.x86_64 gcc-plugin-devel.i686 libxml2-devel glibc glibc-devel glibc.i686 glibc-devel.i686 libgcc.i686 make suitesparse-static libtool-ltdl-devel glpk-devel gawk

The following packages have to be installed under Fedora 24 (64 bit) to compile PandA:

sudo dnf install autoconf autoconf-archive libtool boost-devel mpfr-devel xml2 lzma-devel mpfi-devel zlib-devel bison flex doxygen graphviz iverilog verilator gcc gcc-c++ gcc-plugin-devel.x86_64 gcc-plugin-devel.i686 libxml2-devel glibc glibc-devel glibc.i686 glibc-devel.i686 libgcc.i686 make suitesparse-static libtool-ltdl-devel glpk-devel gawk which

The following packages have to be installed under Fedora 25 (64 bit) to compile PandA:

sudo dnf install autoconf autoconf-archive libtool boost-devel mpfr-devel xml2 lzma-devel mpfi-devel zlib-devel bison flex doxygen graphviz iverilog verilator gcc gcc-c++ gcc-plugin-devel.x86_64 gcc-plugin-devel.i686 libxml2-devel glibc glibc-devel glibc.i686 glibc-devel.i686 libgcc.i686 make suitesparse-static libtool-ltdl-devel glpk-devel gawk

ArchLinux

First of all let’s start installing all the dependencies. Before starting you
will need to enable the multilib repository in pacman. If you don’t know how to
do it, take a look at
https://wiki.archlinux.org/index.php/multilib.

After a `pacman -Sy` you can proceed to install part of the
dependencies with

    $ pacman -S base-devel multilib-devel boost iverilog gcc-multilib autoconf-archive

After this command has completed, you only miss mpfi that unfortunately is not in the official repositories. However you can find it in the AUR at https://aur.archlinux.org.

If you have never installed something from AUR, these are the instruction to install yaourt, a wrapper for pacman which adds automated access to the AUR using the same syntax as pacman.
– Open pacman’s configuration file to add the custom repository.

    $ sudo vi /etc/pacman.conf

– Add the archlinuxfr repository to the bottom.

[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch

The $arch variable just specifies whether your distribution is x86 or x86_64. It will be replaced when the file is processed.
– After the custom repository has been added to pacman.conf, the package database needs to be synchronized to include packages from archlinuxfr and any updates from standard packages that yaourt or its dependencies need.

sudo pacman -Sy

– Now, yaourt and its dependencies can be installed just like any other package via pacman.

sudo pacman -S yaourt

yaour can now be used to install aur packages:

    $ yaourt --noconfirm -Sb mpfi

Anyway you can find more information at
https://wiki.archlinux.org/index.php/Arch_User_Repository.

As an option you can install verilator. Again, it is not available on
the official repos but you can find the PKGBUILD in the AUR at
https://aur.archlinux.org/packages/verilator/.

Once all the dependencies are installed you’re ready to compile PandA.
Extract PandA from the archive and procede with the usual configure,
make and make install sequence.

    $ ../configure --with-gcc48=/usr/bin/gcc --enable-bambu \
         --enable-icarus  --prefix=/opt/panda --enable-flopoco \
         --enable-verilator --disable-release
    $ make -j4
    $ make install

At the time of writing ArchLinux comes with gcc-4.8 but in the future
you will need to pass –with-gcc49.

Notes on Ubuntu 13.04 64bit and XILINX ISE 14.6

The vendor version of stdlibc++ does not have the correct versions of GLIBC for Ubuntu 13.04.
This is probably due to the fact that the tool is loading a mixture of system libraries and vendor libraries.
The solution is to replace the Xilinx version of stdlibc++ with the system version:
In case ISE is installed in /opt/Xilinx/14.6/ the solution is:

  $cd /opt/Xilinx/14.6/ISE_DS/ISE/lib/lin64/
  $sudo mv libstdc++.so.6 libstdc++.so.6.orig
  $sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6

Notes on Debian/Ubuntu and Lattice Diamond 3.9

Lattice Diamond is currently distributed in rpm form for Linux distributions. To convert an rpm archive file into a .deb you can use the following instructions:

  $sudo apt-get install alien
  $sudo alien --scripts diamond_3_9-base_x64-99-2-x86_64-linux.rpm

once the package has been converted you can install with:

  $sudo dpkg -i diamond-3-9-base-x64_3.9-100_amd64.deb

Notes on Modelsim

PandA/bambu supports both Modelsim full version and Student/Free version by adding –enable-modelsim option to the PandA configure.
When the Free/Student version of Modelsim is used, PandA/bambu should be configured by further adding the –disable-mentor-optimizer option. The Student/Free version does not have the optimization feature.

Notes on backend installation directories

PandA/bambu automatically looks for the RTL synthesis/simulation backends once they are enabled. By default, it looks into specific directories of the filesystem.
For Altera it checks this set of directories /opt/altera/* /opt/intelFPGA/*
For Lattice it checks this set of directories /usr/local/diamond/*
For Mentor it checks this set of directories /opt/mentor and /opt/mentor/*
For Xilinx ISE it checks these sets of directories /opt/Xilinx/* and /opt/Xilinx/*/ISE*
For Xilinx VIVADO it checks this set of directories /opt/Xilinx/* and /opt/Xilinx/Vivado/*
Anyway, it is possible to specify a different position of the filesystem for the configuration script to look into.
This is the list of options that may be useful for this purpose:

  --with-altera-dir=DIR  where the root where ALTERA tools are installed
  --with-lattice-dir=DIR  where the root where LATTICE tools are installed
  --with-mentor-dir=DIR  where the root where MENTOR tools are installed
  --with-xilinx-root-dir=DIR  where the root where XILINX tools are installed

A framework for Hardware-Software Co-Design of Embedded Systems