diff --git a/ci.sh b/ci.sh index 3aa27b5..2dca184 100755 --- a/ci.sh +++ b/ci.sh @@ -34,26 +34,43 @@ set +x gend } -# Build yosys (from scratch) -# Not used: too long. +# Build yosys (from scratch) using CMake. +# ABI guarantee: plugin and yosys are compiled with the same toolchain and +# headers, so std::source_location symbol names will always match. do_yosys_build () { gstart "[Build] yosys" "$ANSI_MAGENTA" +set -x + +# CMake 3.28+ is required. Ubuntu 22.04 apt ships 3.22, so get a recent +# version via pip. --break-system-packages not needed on 22.04. sudo apt-get install -y --no-install-recommends \ build-essential clang bison flex \ - libreadline-dev gawk tcl-dev libffi-dev git \ - graphviz xdot pkg-config python3 libboost-system-dev \ - libboost-python-dev libboost-filesystem-dev zlib1g-dev - -git clone https://github.com/YosysHQ/yosys.git -cd yosys -git submodule update --init -make config-clang -make -j4 -sudo make install -cd .. + libreadline-dev tcl-dev libffi-dev git \ + pkg-config python3 python3-pip zlib1g-dev +pip3 install --quiet --upgrade cmake +export PATH="$HOME/.local/bin:$PATH" + +cmake --version + +git clone --recursive https://github.com/YosysHQ/yosys.git +cmake \ + -S yosys \ + -B yosys/build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/local \ + -DYOSYS_INSTALL_DRIVER=ON \ + -DYOSYS_INSTALL_LIBRARY=ON \ + -DYOSYS_WITH_PYTHON=OFF \ + -DBUILD_SHARED_LIBS=ON +cmake --build yosys/build -j$(nproc) +sudo cmake --install yosys/build + +which yosys +yosys --version +set +x gend } @@ -116,12 +133,8 @@ yosys --version clang++ --version make -#cp ghdl.so /tmp/ghdl_yosys.so - -ldd -v ghdl.so gend - } # Run the testsuite