Giter VIP home page Giter VIP logo

shang's People

Contributors

etherzhhb avatar lynkiyee avatar polarlight1994 avatar tsingray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shang's Issues

Installation procedure described in README does not work

The installation procedure described in README.md does not work. Below is the process I used to install the tool (Ubuntu 18.04).

Installation

Prerequisites

Build Tools

  • Install build-essential, git, automake, and cmake:
sudo apt-get install git automake cmake

Libraries

  • Install liblpsolve55-dev, libgmp3-dev, libtool, and libboost-dev:
sudo apt-get install liblpsolve55-dev libgmp3-dev libtool libboost-dev

Lua and LuaBind

wget https://www.lua.org/ftp/lua-5.1.5.tar.gz
tar xvf lua-5.1.5.tar.gz
cd lua-5.1.5
  • Add the -fPIC compilation flag (and, optionally, -g) to src/Makefile:
CFLAGS= -g -O2 -Wall -fPIC $(MYCFLAGS)
  • Build the library:
make linux
make local
cd ..
wget https://sourceforge.net/projects/luabind/files/luabind/0.9.1/luabind-0.9.1.tar.gz/download -O luabind-0.9.1.tar.gz
tar xvf luabind-0.9.1.tar.gz
cd luabind-0.9.1
  • Build the library ($TOOLS points to the directory with the manually installed tools and libraries):
LUA_PATH=$(TOOLS)/lua-5.1.5
bjam --prefix=$(TOOLS)/luabind-0.9.1 install
  • Install LuaBitOp:
sudo apt-get install luarocks
sudo luarocks install luabitop

SystemC

wget https://www.accellera.org/images/downloads/standards/systemc/systemc-2.3.3.tar.gz
tar xvf systemc-2.3.3.tar.gz
  • Follow the instructions specified in INSTALL.

  • Set the environment variables ($TOOLS points to the directory with the manually installed tools and libraries):

export SYSTEMC_INCLUDE=$(TOOLS)/systemc-2.3.3/include/
export SYSTEMC_LIBDIR=$(TOOLS)/systemc-2.3.3/lib-linux64/

Verilator

git clone https://github.com/verilator/verilator
cd verilator
autoconf
./configure
make
sudo make install
  • Set the environment variable ($TOOLS points to the directory with the manually installed tools and libraries):
export VERILATOR_ROOT=$(TOOLS)/verilator/

Clang

wget https://releases.llvm.org/3.1/clang+llvm-3.1-x86_64-linux-ubuntu_12.04.tar.gz
tar xvf clang+llvm-3.1-x86_64-linux-ubuntu_12.04.tar.gz

ABC

git clone https://github.com/ispras/abc.git abc
cd abc
make ABC_USE_PIC=1 libabc.a

Build Shang

  • Clone the LLVM sources:
git clone http://llvm.org/git/llvm.git
  • Reset to the revision 16436dffb50fac4677c7162639f8da0b73eb4e99:
cd llvm
git reset --hard 16436dffb50fac4677c7162639f8da0b73eb4e99
  • Clone the Shang sources:
cd lib/Target/
git clone https://forge.ispras.ru/git/shang.git VerilogBackend
  • Apply the patch:
cd ../../
git apply lib/Target/VerilogBackend/util/llvm-16436dffb50fac4677c7162639f8da0b73eb4e99.patch
  • Create the build folder:
cd ..
mkdir build
cd build
  • Run cmake with the following flags ($TOOLS points to the directory with the manually installed tools and libraries):
/usr/bin/cmake ../llvm/
    -DCMAKE_BUILD_TYPE=Debug \
    -DENABLE_LOGIC_SYNTHESIS=OFF \
    -DLUA_INCLUDE_DIR=$TOOLS/lua-5.1.5/include \
    -DLUA_LIBRARY=$TOOLS/lua-5.1.5/lib/liblua.a \
    -DLUA_LUAC=$TOOLS/lua-5.1.5/bin/luac \
    -DLUABIND_INCLUDE_DIR=/usr/include \
    -DLUABIND_LIBRARY=$TOOLS/luabind-0.9.1/lib/libluabindd.so \
    -DLPSOLVE_INCLUDE_DIR=/usr/include/lpsolve \
    -DLPSOLVE_LIBRARY=/usr/lib/lp_solve/liblpsolve55.so \
    -DABC_INCLUDE_DIR=$TOOLS/abc \
    -DABC_LIBRARY=$TOOLS/abc/libabc.a \
    -DSYSTEMC_ROOT_DIR=$TOOLS/systemc-2.3.3/ \
    -DVERILATOR_ROOT_DIR=$TOOLS/verilator/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.