Skip to content

Commit

Permalink
Split uhdm-integration into 3 packages
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Jurtsch <[email protected]>
  • Loading branch information
tjurtsch committed Jul 10, 2020
1 parent c8fca62 commit 04a32e9
Show file tree
Hide file tree
Showing 16 changed files with 242 additions and 110 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ env:
- PACKAGE=surelog
- PACKAGE=sv-parser
- PACKAGE=verible USE_SYSTEM_GCC_VERSION="8"
- PACKAGE=uhdm-integration
- PACKAGE=surelog-uhdm
- PACKAGE=verilator-uhdm
- PACKAGE=yosys-uhdm
# protocol analyzers
- PACKAGE=sigrok-cli
- PACKAGE=symbiflow-yosys-plugins
Expand Down
1 change: 1 addition & 0 deletions .travis/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export GIT_SSL_NO_VERIFY=1
export GITREV="$(git describe --long 2>/dev/null || echo "unknown")"
export CONDA_BUILD_ARGS=$PACKAGE
export CONDA_OUT="$(conda render --output $CONDA_BUILD_ARGS 2> /dev/null | grep conda-bld | grep tar.bz2 | sed -e's/-[0-9]\+\.tar/*.tar/' -e's/-git//' | tr '\n' ';')"
export UHDM_INTEGRATION_REV="$(git ls-remote https://github.com/alainmarcel/uhdm-integration.git HEAD | awk '{ print $1}')"

echo " GITREV: $GITREV"
echo " CONDA_PATH: $CONDA_PATH"
Expand Down
30 changes: 30 additions & 0 deletions surelog-uhdm/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

set -xe

if [ x"$TRAVIS" = xtrue ]; then
CPU_COUNT=2
fi

TOP=$PWD
export PKG_CONFIG_PATH="$BUILD_PREFIX/lib/pkgconfig/"
export CXXFLAGS="$CXXFLAGS \
-I$BUILD_PREFIX/include \
-I$TOP/UHDM/include \
-I$TOP/UHDM/headers \
-I$TOP/UHDM \
-I$TOP/yosys/frontends/uhdm \
-I$PREFIX/include"
export LDFLAGS="$CXXFLAGS \
-L$TOP/UHDM/build/lib \
-L$TOP/UHDM/build/third_party/capnproto/c++/src/capnp \
-L$TOP/UHDM/build/third_party/capnproto/c++/src/kj \
-L$PREFIX/lib/uhdm \
-L$BUILD_PREFIX/lib -L$PREFIX/lib -lrt -ltinfo"

cd $TOP
cd Surelog
make -j$CPU_COUNT PREFIX=$PREFIX
make install

cp "$PREFIX/bin/surelog" "$PREFIX/bin/surelog-uhdm"
File renamed without changes.
37 changes: 37 additions & 0 deletions surelog-uhdm/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{% set version = '%s_%04i_%s'|format(GIT_DESCRIBE_TAG|replace('v','') or '0.X.X', GIT_DESCRIBE_NUMBER|int, GIT_DESCRIBE_HASH or 'gUNKNOWN') %}

package:
name: surelog-uhdm
version: {{ version }}

source:
git_rev: {{ environ.get('UHDM_INTEGRATION_REV') }}
git_url: https://github.com/alainmarcel/uhdm-integration.git

build:
script_env:
- CI
- TRAVIS

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- python {{ python }}
- cmake
- pkg-config
- libuuid
- gperftools
- flex
- libunwind
- swig
run:
- ncurses
- gperftools
- libunwind
- python {{ python }}

test:
commands:
- surelog-uhdm --version

18 changes: 0 additions & 18 deletions uhdm-integration/build.sh

This file was deleted.

69 changes: 0 additions & 69 deletions uhdm-integration/meta.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions uhdm-integration/surelog-flow.sh

This file was deleted.

10 changes: 0 additions & 10 deletions uhdm-integration/verilator-flow.sh

This file was deleted.

5 changes: 0 additions & 5 deletions uhdm-integration/yosys-flow.sh

This file was deleted.

50 changes: 50 additions & 0 deletions verilator-uhdm/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

set -xe

if [ x"$TRAVIS" = xtrue ]; then
CPU_COUNT=2
fi

TOP=$PWD

unset VERILATOR_ROOT
export PKG_CONFIG_PATH="$BUILD_PREFIX/lib/pkgconfig/"
export CXXFLAGS="$CXXFLAGS \
-I$BUILD_PREFIX/include \
-I$TOP/UHDM/include \
-I$TOP/UHDM/headers \
-I$TOP/UHDM \
-I$TOP/yosys/frontends/uhdm \
-I$PREFIX/include"
export LDFLAGS="$CXXFLAGS \
-L$TOP/UHDM/build/lib \
-L$TOP/UHDM/build/third_party/capnproto/c++/src/capnp \
-L$TOP/UHDM/build/third_party/capnproto/c++/src/kj \
-L$PREFIX/lib/uhdm \
-L$BUILD_PREFIX/lib -L$PREFIX/lib -lrt -ltinfo"

cd $TOP
mkdir -p UHDM/build
cd UHDM/build
cmake \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-D_GLIBCXX_DEBUG=1 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS='-D_GLIBCXX_USE_CXX11_ABI=1 -DWITH_LIBCXX=Off' \
../
make install

cd $TOP
cd verilator
autoconf
./configure --prefix=$PREFIX
make -j$CPU_COUNT
make install

sed -i 's/"verilator_bin"/"verilator_bin-uhdm"/g' "$PREFIX/bin/verilator"
sed -i 's/"verilator_bin_dbg"/"verilator_bin_dbg-uhdm"/g' "$PREFIX/bin/verilator"
mv "$PREFIX/bin/verilator" "$PREFIX/bin/verilator-uhdm"
mv "$PREFIX/bin/verilator_bin" "$PREFIX/bin/verilator_bin-uhdm"
mv "$PREFIX/bin/verilator_bin_dbg" "$PREFIX/bin/verilator_bin_dbg-uhdm"
sed -i 's@'$BUILD_PREFIX'@$(CONDA_PREFIX)@g' "$PREFIX/share/verilator/include/verilated.mk"
2 changes: 2 additions & 0 deletions verilator-uhdm/condarc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
channels:
- conda-forge
37 changes: 37 additions & 0 deletions verilator-uhdm/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{% set version = '%s_%04i_%s'|format(GIT_DESCRIBE_TAG|replace('v','') or '0.X.X', GIT_DESCRIBE_NUMBER|int, GIT_DESCRIBE_HASH or 'gUNKNOWN') %}

package:
name: verilator-uhdm
version: {{ version }}

source:
git_rev: {{ environ.get('UHDM_INTEGRATION_REV') }}
git_url: https://github.com/alainmarcel/uhdm-integration.git

build:
script_env:
- CI
- TRAVIS

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- python {{ python }}
- cmake
- pkg-config
- libuuid
- gperftools
- flex
- libunwind
- swig
run:
- {{ compiler('cxx') }}
- bison
- flex
- ncurses

test:
commands:
- verilator-uhdm --version

46 changes: 46 additions & 0 deletions yosys-uhdm/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

set -xe

if [ x"$TRAVIS" = xtrue ]; then
CPU_COUNT=2
fi

TOP=$PWD
export PKG_CONFIG_PATH="$BUILD_PREFIX/lib/pkgconfig/"
export CXXFLAGS="$CXXFLAGS \
-I$BUILD_PREFIX/include \
-I$TOP/UHDM/include \
-I$TOP/UHDM/headers \
-I$TOP/UHDM \
-I$TOP/yosys/frontends/uhdm \
-I$PREFIX/include"
export LDFLAGS="$CXXFLAGS \
-L$TOP/UHDM/build/lib \
-L$TOP/UHDM/build/third_party/capnproto/c++/src/capnp \
-L$TOP/UHDM/build/third_party/capnproto/c++/src/kj \
-L$PREFIX/lib/uhdm \
-L$BUILD_PREFIX/lib -L$PREFIX/lib -lrt -ltinfo"

# Build uhdm, only for yosys build
make uhdm/build -j$CPU_COUNT
cd $TOP
cd yosys
env
make ENABLE_READLINE=0 -j$CPU_COUNT
make install

# Rebuild UHDM, this time with conda PREFIX
cd $TOP
rm -rf UHDM/build
mkdir -p UHDM/build
cd UHDM/build
cmake \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-D_GLIBCXX_DEBUG=1 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS='-D_GLIBCXX_USE_CXX11_ABI=1 -DWITH_LIBCXX=Off' \
../
make install

mv "$PREFIX/bin/yosys" "$PREFIX/bin/yosys-uhdm"
2 changes: 2 additions & 0 deletions yosys-uhdm/condarc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
channels:
- conda-forge
34 changes: 34 additions & 0 deletions yosys-uhdm/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{% set version = '%s_%04i_%s'|format(GIT_DESCRIBE_TAG|replace('v','') or '0.X.X', GIT_DESCRIBE_NUMBER|int, GIT_DESCRIBE_HASH or 'gUNKNOWN') %}

package:
name: yosys-uhdm
version: {{ version }}

source:
git_rev: {{ environ.get('UHDM_INTEGRATION_REV') }}
git_url: https://github.com/alainmarcel/uhdm-integration.git

build:
script_env:
- CI
- TRAVIS

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- python {{ python }}
- cmake
- pkg-config
- libuuid
- gperftools
- flex
- libunwind
- swig
run:
- ncurses

test:
commands:
- yosys-uhdm --version

0 comments on commit 04a32e9

Please sign in to comment.