======================================================== _ __ __ ________________ ___ | | / /__ _____/ /_____ _____/ ____/ ____/ __ \/ | | | / / _ \/ ___/ __/ __ \/ ___/ / / / __/ /_/ / /| | | |/ / __/ /__/ /_/ /_/ / / / /___/ /_/ / _, _/ ___ | |___/\___/\___/\__/\____/_/ \____/\____/_/ |_/_/ |_| ========================================================
VectorCGRA (vectorizable Coarse-Grained Reconfigurable Accelerator) generator is a parameterizable CGRA generator to generate synthesizable Verilog for different CGRAs based on user-specified configurations (e.g., CGRA size, type of the computing units in each tile, number of lanes for vectorization, communication connection, etc.).
The docker image is available here.
VectorCGRA requires Python3.7 and has the following additional prerequisites:
- graphviz, verilator
- git, Python headers, and libffi
- virtualenv
- PyMTL3
The steps for installing these prerequisites and VectorCGRA on a fresh Ubuntu distribution are shown below. They have been tested with Ubuntu Trusty 14.04 ~ 18.04. (Ubuntu18.04 is preferred as the older versions are not well maintained)
% sudo apt-get install python3.7
% sudo apt-get install -y graphviz
Verilator is an open-source toolchain for compiling Verilog RTL models into C++ simulators. VectorCGRA uses Verilator for Verilog import.
$ sudo apt-get install git make autoconf g++ libfl-dev bison
$ mkdir -p ${HOME}/src
$ cd ${HOME}/src
$ wget http://www.veripool.org/ftp/verilator-4.036.tgz
$ tar -xzvf verilator-4.036.tgz
$ cd verilator-4.036
$ ./configure
$ make
$ sudo make install
We need to install the Python headers and libffi in order to be able to install the cffi Python package. cffi provides an elegant way to call C functions from Python, and PyMTL uses cffi to call C code generated by Verilator. We will use git to grab the PyMTL source. The following commands will install the appropriate packages:
% sudo apt-get install git python-dev libffi-dev
While not strictly necessary, we strongly recommend using virtualenv to install PyMTL3 and the Python packages that PyMTL3 depends on. virtualenv enables creating isolated Python environments. The following commands will create and activate the virtual environment:
% python3 -m venv ${HOME}/venv
% source ${HOME}/venv/bin/activate
% pip install py==1.11.0
% pip install git+https://github.com/tancheng/pymtl3.git
% pip install --upgrade pip setuptools twine
% pip install hypothesis
% pip list
Take a look at the workflow if you encounter any problem to run the test in this repo.
We can now use git to clone the VectorCGRA repo.
% mkdir -p ${HOME}/cgra
% cd ${HOME}/cgra
% git clone https://github.com/tancheng/VectorCGRA.git
In folder, just type:
% pytest --tb=short -sv CGRARTL_test.py
When you're done testing/developing, you can deactivate the virtualenv::
% deactivate