From 04a32e97eaeb742406dc13f21a2fd583c287f585 Mon Sep 17 00:00:00 2001 From: Tomasz Jurtsch Date: Tue, 30 Jun 2020 17:36:21 +0200 Subject: [PATCH 1/2] Split uhdm-integration into 3 packages Signed-off-by: Tomasz Jurtsch --- .travis.yml | 4 +- .travis/common.sh | 1 + surelog-uhdm/build.sh | 30 ++++++++++ {uhdm-integration => surelog-uhdm}/condarc | 0 surelog-uhdm/meta.yaml | 37 ++++++++++++ uhdm-integration/build.sh | 18 ------ uhdm-integration/meta.yaml | 69 ---------------------- uhdm-integration/surelog-flow.sh | 7 --- uhdm-integration/verilator-flow.sh | 10 ---- uhdm-integration/yosys-flow.sh | 5 -- verilator-uhdm/build.sh | 50 ++++++++++++++++ verilator-uhdm/condarc | 2 + verilator-uhdm/meta.yaml | 37 ++++++++++++ yosys-uhdm/build.sh | 46 +++++++++++++++ yosys-uhdm/condarc | 2 + yosys-uhdm/meta.yaml | 34 +++++++++++ 16 files changed, 242 insertions(+), 110 deletions(-) create mode 100644 surelog-uhdm/build.sh rename {uhdm-integration => surelog-uhdm}/condarc (100%) create mode 100644 surelog-uhdm/meta.yaml delete mode 100644 uhdm-integration/build.sh delete mode 100644 uhdm-integration/meta.yaml delete mode 100644 uhdm-integration/surelog-flow.sh delete mode 100644 uhdm-integration/verilator-flow.sh delete mode 100644 uhdm-integration/yosys-flow.sh create mode 100644 verilator-uhdm/build.sh create mode 100644 verilator-uhdm/condarc create mode 100644 verilator-uhdm/meta.yaml create mode 100644 yosys-uhdm/build.sh create mode 100644 yosys-uhdm/condarc create mode 100644 yosys-uhdm/meta.yaml diff --git a/.travis.yml b/.travis.yml index 12a3fbab..3414ea2a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/.travis/common.sh b/.travis/common.sh index f1ecac41..89c22ec5 100644 --- a/.travis/common.sh +++ b/.travis/common.sh @@ -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" diff --git a/surelog-uhdm/build.sh b/surelog-uhdm/build.sh new file mode 100644 index 00000000..dda7ee71 --- /dev/null +++ b/surelog-uhdm/build.sh @@ -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" diff --git a/uhdm-integration/condarc b/surelog-uhdm/condarc similarity index 100% rename from uhdm-integration/condarc rename to surelog-uhdm/condarc diff --git a/surelog-uhdm/meta.yaml b/surelog-uhdm/meta.yaml new file mode 100644 index 00000000..0507e69a --- /dev/null +++ b/surelog-uhdm/meta.yaml @@ -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 + diff --git a/uhdm-integration/build.sh b/uhdm-integration/build.sh deleted file mode 100644 index 8809dcb9..00000000 --- a/uhdm-integration/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -set -e -set -x - -if [ x"$TRAVIS" = xtrue ]; then - CPU_COUNT=2 -fi - -export PKG_CONFIG_PATH="$BUILD_PREFIX/lib/pkgconfig/" -export CXXFLAGS="$CXXFLAGS -I$BUILD_PREFIX/include" -export LDFLAGS="$CXXFLAGS -L$BUILD_PREFIX/lib -lrt -ltinfo" - -make -j$CPU_COUNT surelog/parse -make -j$CPU_COUNT uhdm/build -make -j$CPU_COUNT uhdm/verilator/build -make -j$CPU_COUNT ENABLE_READLINE=0 yosys/yosys - diff --git a/uhdm-integration/meta.yaml b/uhdm-integration/meta.yaml deleted file mode 100644 index 407222fa..00000000 --- a/uhdm-integration/meta.yaml +++ /dev/null @@ -1,69 +0,0 @@ -{% 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: uhdm-integration - version: {{ version }} - -source: - git_rev: master - 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 - -outputs: - - name: surelog-uhdm - script: surelog-flow.sh - requirements: - run: - - python {{ python }} - - gperftools - - libunwind - test: - commands: - - surelog-uhdm --version - - name: verilator-uhdm - script: verilator-flow.sh - requirements: - run: - - {{ compiler('cxx') }} - - bison - - flex - - ncurses - test: - commands: - - verilator-uhdm --version - - name: yosys-uhdm - script: yosys-flow.sh - requirements: - run: - - ncurses - test: - commands: - - yosys-uhdm --version - # empty meta-packages with dependencies only - - name: uhdm-integration-verilator - requirements: - run: - - surelog-uhdm {{version}} - - verilator-uhdm {{version}} - - name: uhdm-integration-yosys - requirements: - run: - - surelog-uhdm {{version}} - - yosys-uhdm {{version}} diff --git a/uhdm-integration/surelog-flow.sh b/uhdm-integration/surelog-flow.sh deleted file mode 100644 index 676dab65..00000000 --- a/uhdm-integration/surelog-flow.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -mkdir -p "$PREFIX/bin" -mkdir -p "$PREFIX/lib/surelog/sv" - -cp "$SRC_DIR/image/lib/surelog/sv/builtin.sv" "$PREFIX/lib/surelog/sv/builtin.sv" -cp "$SRC_DIR/image/bin/surelog" "$PREFIX/bin/surelog-uhdm" diff --git a/uhdm-integration/verilator-flow.sh b/uhdm-integration/verilator-flow.sh deleted file mode 100644 index 64351668..00000000 --- a/uhdm-integration/verilator-flow.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -mkdir -p "$PREFIX/bin" - -sed -i 's/"verilator_bin"/"verilator_bin-uhdm"/g' image/bin/verilator -sed -i 's/"verilator_bin_dbg"/"verilator_bin_dbg-uhdm"/g' image/bin/verilator - -cp "$SRC_DIR/image/bin/verilator" "$PREFIX/bin/verilator-uhdm" -cp "$SRC_DIR/image/bin/verilator_bin" "$PREFIX/bin/verilator_bin-uhdm" -cp "$SRC_DIR/image/bin/verilator_bin_dbg" "$PREFIX/bin/verilator_bin_dbg-uhdm" diff --git a/uhdm-integration/yosys-flow.sh b/uhdm-integration/yosys-flow.sh deleted file mode 100644 index 4d259216..00000000 --- a/uhdm-integration/yosys-flow.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -mkdir -p "$PREFIX/bin" - -cp "$SRC_DIR/yosys/yosys" "$PREFIX/bin/yosys-uhdm" diff --git a/verilator-uhdm/build.sh b/verilator-uhdm/build.sh new file mode 100644 index 00000000..f245f7f3 --- /dev/null +++ b/verilator-uhdm/build.sh @@ -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" diff --git a/verilator-uhdm/condarc b/verilator-uhdm/condarc new file mode 100644 index 00000000..42825518 --- /dev/null +++ b/verilator-uhdm/condarc @@ -0,0 +1,2 @@ +channels: + - conda-forge diff --git a/verilator-uhdm/meta.yaml b/verilator-uhdm/meta.yaml new file mode 100644 index 00000000..aa303994 --- /dev/null +++ b/verilator-uhdm/meta.yaml @@ -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 + diff --git a/yosys-uhdm/build.sh b/yosys-uhdm/build.sh new file mode 100644 index 00000000..a1f9fe77 --- /dev/null +++ b/yosys-uhdm/build.sh @@ -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" diff --git a/yosys-uhdm/condarc b/yosys-uhdm/condarc new file mode 100644 index 00000000..42825518 --- /dev/null +++ b/yosys-uhdm/condarc @@ -0,0 +1,2 @@ +channels: + - conda-forge diff --git a/yosys-uhdm/meta.yaml b/yosys-uhdm/meta.yaml new file mode 100644 index 00000000..3f8c7274 --- /dev/null +++ b/yosys-uhdm/meta.yaml @@ -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 + From 0cd9a10280077bd1d5ed2a3503e53ccbad602ea4 Mon Sep 17 00:00:00 2001 From: Tomasz Jurtsch Date: Fri, 10 Jul 2020 12:53:38 +0200 Subject: [PATCH 2/2] surelog-uhdm: add python to host requirements This way we ensure that python will be included in the Conda package build string. Signed-off-by: Tomasz Jurtsch --- surelog-uhdm/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/surelog-uhdm/meta.yaml b/surelog-uhdm/meta.yaml index 0507e69a..eaa2690e 100644 --- a/surelog-uhdm/meta.yaml +++ b/surelog-uhdm/meta.yaml @@ -25,6 +25,8 @@ requirements: - flex - libunwind - swig + host: + - python {{ python }} run: - ncurses - gperftools