Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split UHDM package into three packages #117

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}')"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, why do you need this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to make sure we don't have any race conditions in package compatibility, for example uhdm surelog build starts -> in the meantime somebody upgrades the submodules in uhdm integration -> only then uhdm verilator build starts with different submodules. Checking the revision once and using it for all packages ensures this won't happen.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you have solved the problem you think you have solved here... Give me a while to think about it....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tgorochowik - Do you know what the state of conda build prepare that @PiotrZierhoffer was managing? That was designed to solve exactly this problem by separating the "generating / freezing the conda recipe" from the build / test / etc steps.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tgorochowik @tjurtsch @mithro This is kinda unrelated to conda-build-prepare.

The problem here is that we can have different revisions for different uhdm packages - Travis will not preserve the value across packages. They are built in different VMs.

Conda-build-prepare will help you debug/alter the code before building, but this is a totally different scope.

I think that you can share the git versions between packages in an external storage, no other way for that in Travis.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a review where I wanted to add a comment. It's below


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.
39 changes: 39 additions & 0 deletions surelog-uhdm/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{% 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
host:
- python {{ python }}
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