From 5cfe6a9c1ee66d810a5f40bedc57442dafd4b40d Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Fri, 8 Nov 2024 19:29:56 +0100 Subject: [PATCH 01/24] reduce OS ifdefs, refactor getting dirs and filenames from paths to files --- backends/cxxrtl/cxxrtl_backend.cc | 16 +--------------- frontends/ast/simplify.cc | 8 ++------ frontends/verilog/preproc.cc | 6 +----- kernel/io.cc | 19 +++++++++++++++++++ kernel/io.h | 2 ++ 5 files changed, 25 insertions(+), 26 deletions(-) diff --git a/backends/cxxrtl/cxxrtl_backend.cc b/backends/cxxrtl/cxxrtl_backend.cc index 48710aff8..d575b5879 100644 --- a/backends/cxxrtl/cxxrtl_backend.cc +++ b/backends/cxxrtl/cxxrtl_backend.cc @@ -637,20 +637,6 @@ std::string escape_cxx_string(const std::string &input) return output; } -std::string basename(const std::string &filepath) -{ -#ifdef _WIN32 - const std::string dir_seps = "\\/"; -#else - const std::string dir_seps = "/"; -#endif - size_t sep_pos = filepath.find_last_of(dir_seps); - if (sep_pos != std::string::npos) - return filepath.substr(sep_pos + 1); - else - return filepath; -} - template std::string get_hdl_name(T *object) { @@ -2858,7 +2844,7 @@ struct CxxrtlWorker { } if (split_intf) - f << "#include \"" << basename(intf_filename) << "\"\n"; + f << "#include \"" << name_from_file_path(intf_filename) << "\"\n"; else f << "#include \n"; f << "\n"; diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 81018e137..97abf7452 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -30,6 +30,7 @@ #include "libs/sha1/sha1.h" #include "frontends/verilog/verilog_frontend.h" #include "ast.h" +#include "kernel/io.h" #include #include @@ -4474,12 +4475,7 @@ std::unique_ptr AstNode::readmem(bool is_readmemh, std::string mem_file std::ifstream f; f.open(mem_filename.c_str()); if (f.fail()) { -#ifdef _WIN32 - char slash = '\\'; -#else - char slash = '/'; -#endif - std::string path = location.begin.filename->substr(0, location.begin.filename->find_last_of(slash)+1); + std::string path = parent_from_file_path(*location.begin.filename); f.open(path + mem_filename.c_str()); yosys_input_files.insert(path + mem_filename); } else { diff --git a/frontends/verilog/preproc.cc b/frontends/verilog/preproc.cc index 1858edc97..7675bab62 100644 --- a/frontends/verilog/preproc.cc +++ b/frontends/verilog/preproc.cc @@ -895,11 +895,7 @@ frontend_verilog_preproc(std::istream &f, // if the include file was not found, it is not given with an absolute path, and the // currently read file is given with a path, then try again relative to its directory ff.clear(); -#ifdef _WIN32 - fixed_fn = filename.substr(0, filename.find_last_of("/\\")+1) + fn; -#else - fixed_fn = filename.substr(0, filename.rfind('/')+1) + fn; -#endif + fixed_fn = parent_from_file_path(filename) + fn; ff.open(fixed_fn); } if (ff.fail() && fn.size() > 0 && fn_relative) { diff --git a/kernel/io.cc b/kernel/io.cc index 9e9eb9fb0..dfdb56d16 100644 --- a/kernel/io.cc +++ b/kernel/io.cc @@ -391,6 +391,25 @@ void append_globbed(std::vector& paths, std::string pattern) copy(globbed.begin(), globbed.end(), back_inserter(paths)); } +#ifdef _WIN32 +const char* const OS_PATH_SEP = "/\\"; +#else +const char* const OS_PATH_SEP = "/"; +#endif + +std::string name_from_file_path(std::string path) { + size_t sep_pos = path.find_last_of(OS_PATH_SEP); + if (sep_pos != std::string::npos) + return path.substr(sep_pos + 1); + else + return path; +} + +// Includes OS_PATH_SEP at the end if present +std::string parent_from_file_path(std::string path) { + return path.substr(0, path.find_last_of(OS_PATH_SEP)+1); +} + void format_emit_unescaped(std::string &result, std::string_view fmt) { result.reserve(result.size() + fmt.size()); diff --git a/kernel/io.h b/kernel/io.h index b3922bef0..171f47a80 100644 --- a/kernel/io.h +++ b/kernel/io.h @@ -470,6 +470,8 @@ void remove_directory(std::string dirname); bool create_directory(const std::string& dirname); std::string escape_filename_spaces(const std::string& filename); void append_globbed(std::vector& paths, std::string pattern); +std::string name_from_file_path(std::string path); +std::string parent_from_file_path(std::string path); YOSYS_NAMESPACE_END From 79cd4e08c4dc1828e697da722973c1be4c3d69ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Ji=C5=99=C3=AD=20Tywoniak?= Date: Tue, 23 Sep 2025 17:38:14 +0200 Subject: [PATCH 02/24] io: use std::filesystem --- kernel/io.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/kernel/io.cc b/kernel/io.cc index dfdb56d16..45aa496b0 100644 --- a/kernel/io.cc +++ b/kernel/io.cc @@ -2,6 +2,7 @@ #include "kernel/log.h" #include #include +#include #if !defined(WIN32) #include @@ -398,16 +399,21 @@ const char* const OS_PATH_SEP = "/"; #endif std::string name_from_file_path(std::string path) { - size_t sep_pos = path.find_last_of(OS_PATH_SEP); - if (sep_pos != std::string::npos) - return path.substr(sep_pos + 1); - else - return path; + return std::filesystem::path(path).filename().string(); } // Includes OS_PATH_SEP at the end if present std::string parent_from_file_path(std::string path) { - return path.substr(0, path.find_last_of(OS_PATH_SEP)+1); + auto parent = std::filesystem::path(path).parent_path(); + if (parent.empty()) { + return ""; + } + // Add trailing separator to match original behavior + std::string result = parent.string(); + if (!result.empty() && result.back() != std::filesystem::path::preferred_separator) { + result += std::filesystem::path::preferred_separator; + } + return result; } void format_emit_unescaped(std::string &result, std::string_view fmt) From d1a628ab2664accf6cb58189c75e05c91c198695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Ji=C5=99=C3=AD=20Tywoniak?= Date: Tue, 23 Sep 2025 17:38:32 +0200 Subject: [PATCH 03/24] CI: bump WASI SDK from 19 to 27 --- .github/workflows/extra-builds.yml | 4 ++-- Makefile | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/extra-builds.yml b/.github/workflows/extra-builds.yml index 503145e97..b22a399db 100644 --- a/.github/workflows/extra-builds.yml +++ b/.github/workflows/extra-builds.yml @@ -73,8 +73,8 @@ jobs: persist-credentials: false - name: Build run: | - WASI_SDK=wasi-sdk-19.0 - WASI_SDK_URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz + WASI_SDK=wasi-sdk-27.0-x86_64-linux + WASI_SDK_URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-27/wasi-sdk-27.0-x86_64-linux.tar.gz if ! [ -d ${WASI_SDK} ]; then curl -L ${WASI_SDK_URL} | tar xzf -; fi FLEX_VER=2.6.4 diff --git a/Makefile b/Makefile index b744763c8..04395a5a0 100644 --- a/Makefile +++ b/Makefile @@ -282,12 +282,11 @@ ifeq ($(WASI_SDK),) CXX = clang++ AR = llvm-ar RANLIB = llvm-ranlib -WASIFLAGS := -target wasm32-wasi --sysroot $(WASI_SYSROOT) $(WASIFLAGS) +WASIFLAGS := -target wasm32-wasi $(WASIFLAGS) else CXX = $(WASI_SDK)/bin/clang++ AR = $(WASI_SDK)/bin/ar RANLIB = $(WASI_SDK)/bin/ranlib -WASIFLAGS := --sysroot $(WASI_SDK)/share/wasi-sysroot $(WASIFLAGS) endif CXXFLAGS := $(WASIFLAGS) -std=$(CXXSTD) $(OPT_LEVEL) -D_WASI_EMULATED_PROCESS_CLOCKS $(filter-out -fPIC,$(CXXFLAGS)) LINKFLAGS := $(WASIFLAGS) -Wl,-z,stack-size=1048576 $(filter-out -rdynamic,$(LINKFLAGS)) From 1eb5181700e980a9a10c7c607e06c98755f8bc10 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 14 Oct 2025 14:12:24 +1300 Subject: [PATCH 04/24] Add tests/verilog/local_include.* `read_verilog` supports checking both the current directory and the source directory for relative includes. Make sure we aren't regressing that. --- tests/verilog/.gitignore | 2 ++ tests/verilog/local_include.sh | 30 ++++++++++++++++++++++++++++++ tests/verilog/local_include.v | 4 ++++ 3 files changed, 36 insertions(+) create mode 100755 tests/verilog/local_include.sh create mode 100644 tests/verilog/local_include.v diff --git a/tests/verilog/.gitignore b/tests/verilog/.gitignore index 3702f10cf..d3e8690d5 100644 --- a/tests/verilog/.gitignore +++ b/tests/verilog/.gitignore @@ -4,3 +4,5 @@ /roundtrip_proc_1.v /roundtrip_proc_2.v /assign_to_reg.v +/subdir +/temp_foo.v diff --git a/tests/verilog/local_include.sh b/tests/verilog/local_include.sh new file mode 100755 index 000000000..c10c7411b --- /dev/null +++ b/tests/verilog/local_include.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +set -eu + +# only works with read_verilog +yosys='../../yosys -f verilog' +test='-p hierarchy' +subdir=subdir +source=local_include.v +include=temp_foo.v + +# no include file should fail +rm -f $include +echo "logger -expect error $include 1; read_verilog $source" | $yosys + +# both files local +echo 'module foo (input a, output b); assign b = a; endmodule' > $include +$yosys $test $source + +# include local to cwd +mkdir -p $subdir +cp -t $subdir $source +$yosys $test $subdir/$source + +# include local to source +mv -t $subdir $include +$yosys $test $subdir/$source + +# include local to source, and source is given as an absolute path +$yosys $test $(pwd)/$subdir/$source diff --git a/tests/verilog/local_include.v b/tests/verilog/local_include.v new file mode 100644 index 000000000..a677e888e --- /dev/null +++ b/tests/verilog/local_include.v @@ -0,0 +1,4 @@ +`include "temp_foo.v" +module top (input x, output y); + foo bar (.a(x), .b(y)); +endmodule From e9733d681dca466e2d51c44cf24e3bd013f38f74 Mon Sep 17 00:00:00 2001 From: Mohamed Gaber Date: Sat, 18 Oct 2025 14:58:56 +0300 Subject: [PATCH 05/24] pyosys: uv for non-wheel builds, update instructions - add `uv` to dependencies: saves builder(s) from manually having to manage a venv for python build dependencies - when building wheels, pip automatically creates the environment with those dependencies, so no need for uv - when running simply `make ENABLE_PYOSYS=1`, this is not the case. people attempting to `pip3 install --upgrade pybind11 cxxheaderparser` to add it to their system packages will be met with a scare message about "breaking system packages" - update installation instructions to drop boost and add uv instead - update ci scripts to use `macos-15[-intel]` (`macos-13` sunset in early december) --- .github/actions/setup-build-env/action.yml | 3 ++- .github/workflows/test-compile.yml | 2 +- .github/workflows/wheels.yml | 4 ++-- Brewfile | 2 +- Makefile | 13 ++++++++++--- README.md | 4 ++-- docs/source/getting_started/installation.rst | 10 +++++----- docs/source/using_yosys/pyosys.rst | 8 ++++++++ pyproject.toml | 2 +- 9 files changed, 32 insertions(+), 16 deletions(-) diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index e4bc8ec58..209965acb 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -8,7 +8,8 @@ runs: shell: bash run: | sudo apt-get update - sudo apt-get install gperf build-essential bison flex libfl-dev libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev libbz2-dev libgtest-dev + sudo apt-get install gperf build-essential bison flex libfl-dev libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3-dev zlib1g-dev libbz2-dev libgtest-dev + curl -LsSf https://astral.sh/uv/install.sh | sh - name: Install macOS Dependencies if: runner.os == 'macOS' diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index 7c18c7ba0..1604ca9d2 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -45,7 +45,7 @@ jobs: - 'gcc-14' include: # macOS x86 - - os: macos-13 + - os: macos-15-intel compiler: 'clang-19' # macOS arm - os: macos-latest diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b6c9a51ac..9eea1468d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -27,13 +27,13 @@ jobs: { name: "macOS 13", family: "macos", - runner: "macos-13", + runner: "macos-15-intel", archs: "x86_64", }, { name: "macOS 14", family: "macos", - runner: "macos-14", + runner: "macos-15", archs: "arm64", }, ## Windows is disabled because of an issue with compiling FFI as diff --git a/Brewfile b/Brewfile index c90434e62..917f1bdb4 100644 --- a/Brewfile +++ b/Brewfile @@ -6,9 +6,9 @@ brew "git" brew "graphviz" brew "pkg-config" brew "python3" +brew "uv" brew "xdot" brew "bash" -brew "boost-python3" brew "llvm@20" brew "lld" brew "googletest" diff --git a/Makefile b/Makefile index 5d659e5e8..16843b073 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,7 @@ ENABLE_HELP_SOURCE := 0 # python wrappers ENABLE_PYOSYS := 0 +PYOSYS_USE_UV := 1 # other configuration flags ENABLE_GCOV := 0 @@ -352,16 +353,22 @@ PYTHON_OBJECTS = pyosys/wrappers.o kernel/drivers.o kernel/yosys.o passes/cmds/p ifeq ($(ENABLE_PYOSYS),1) # python-config --ldflags includes -l and -L, but LINKFLAGS is only -L + +UV_ENV := +ifeq ($(PYOSYS_USE_UV),1) +UV_ENV := uv run --no-project --with 'pybind11>3,<4' --with 'cxxheaderparser' +endif + LINKFLAGS += $(filter-out -l%,$(shell $(PYTHON_CONFIG) --ldflags)) LIBS += $(shell $(PYTHON_CONFIG) --libs) EXE_LIBS += $(filter-out $(LIBS),$(shell $(PYTHON_CONFIG_FOR_EXE) --libs)) -PYBIND11_INCLUDE ?= $(shell $(PYTHON_EXECUTABLE) -m pybind11 --includes) +PYBIND11_INCLUDE ?= $(shell $(UV_ENV) $(PYTHON_EXECUTABLE) -m pybind11 --includes) CXXFLAGS += -I$(PYBIND11_INCLUDE) -DYOSYS_ENABLE_PYTHON CXXFLAGS += $(shell $(PYTHON_CONFIG) --includes) -DYOSYS_ENABLE_PYTHON OBJS += $(PY_WRAPPER_FILE).o PY_GEN_SCRIPT = pyosys/generator.py -PY_WRAP_INCLUDES := $(shell $(PYTHON_EXECUTABLE) $(PY_GEN_SCRIPT) --print-includes) +PY_WRAP_INCLUDES := $(shell $(UV_ENV) $(PYTHON_EXECUTABLE) $(PY_GEN_SCRIPT) --print-includes) endif # ENABLE_PYOSYS ifeq ($(ENABLE_READLINE),1) @@ -777,7 +784,7 @@ endif ifeq ($(ENABLE_PYOSYS),1) $(PY_WRAPPER_FILE).cc: $(PY_GEN_SCRIPT) pyosys/wrappers_tpl.cc $(PY_WRAP_INCLUDES) pyosys/hashlib.h $(Q) mkdir -p $(dir $@) - $(P) $(PYTHON_EXECUTABLE) $(PY_GEN_SCRIPT) $(PY_WRAPPER_FILE).cc + $(P) $(UV_ENV) $(PYTHON_EXECUTABLE) $(PY_GEN_SCRIPT) $(PY_WRAPPER_FILE).cc endif %.o: %.cpp diff --git a/README.md b/README.md index 6118d6079..dd5b634f9 100644 --- a/README.md +++ b/README.md @@ -85,8 +85,8 @@ prerequisites for building yosys: $ sudo apt-get install build-essential clang lld bison flex libfl-dev \ libreadline-dev gawk tcl-dev libffi-dev git \ - graphviz xdot pkg-config python3 libboost-system-dev \ - libboost-python-dev libboost-filesystem-dev zlib1g-dev + graphviz xdot pkg-config python3-dev zlib1g-dev + $ curl -LsSf https://astral.sh/uv/install.sh | sh The environment variable `CXX` can be used to control the C++ compiler used, or run one of the following to override it: diff --git a/docs/source/getting_started/installation.rst b/docs/source/getting_started/installation.rst index 0ac85d199..fef495389 100644 --- a/docs/source/getting_started/installation.rst +++ b/docs/source/getting_started/installation.rst @@ -99,8 +99,8 @@ Installing all prerequisites for Ubuntu 22.04: sudo apt-get install gperf build-essential clang lld bison flex libfl-dev \ libreadline-dev gawk tcl-dev libffi-dev git \ - graphviz xdot pkg-config python3 libboost-system-dev \ - libboost-python-dev libboost-filesystem-dev zlib1g-dev + graphviz xdot pkg-config python3-dev zlib1g-dev + curl -LsSf https://astral.sh/uv/install.sh | sh Installing all prerequisites for macOS 13 (with Homebrew): @@ -141,7 +141,7 @@ For Cygwin use the following command to install all prerequisites, or select the missing `strdup` function when using gcc. It is instead recommended to use Windows Subsystem for Linux (WSL) and follow the instructions for Ubuntu. -.. +.. For MSYS2 (MINGW64): .. code:: console @@ -215,7 +215,7 @@ Running the build system From the root ``yosys`` directory, call the following commands: .. code:: console - + make sudo make install @@ -228,7 +228,7 @@ To use a separate (out-of-tree) build directory, provide a path to the Makefile. Out-of-tree builds require a clean source tree. -.. seealso:: +.. seealso:: Refer to :doc:`/yosys_internals/extending_yosys/test_suites` for details on testing Yosys once compiled. diff --git a/docs/source/using_yosys/pyosys.rst b/docs/source/using_yosys/pyosys.rst index 8aa7fd4fe..09b572e05 100644 --- a/docs/source/using_yosys/pyosys.rst +++ b/docs/source/using_yosys/pyosys.rst @@ -28,6 +28,14 @@ methods: ``yosys -y ./my_pyosys_script.py`` + Do note this requires some build-time dependencies to be available to Python, + namely, ``pybind11`` and ``cxxheaderparser``. By default, the required + ``uv`` package will be used to create an ephemeral environment with the + correct versions of the tools installed. + + You can force use of your current Python environment by passing the Makefile + flag ``PYOSYS_USE_UV=0``. + 2. Installing the Pyosys wheels On macOS and GNU/Linux you can install pre-built wheels of Yosys using diff --git a/pyproject.toml b/pyproject.toml index d5882084c..8893137d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "setuptools>=42", "pybind11>=3,<4", - "cxxheaderparser", + "cxxheaderparser" ] build-backend = "setuptools.build_meta" From 1a80c26bae9b4545a7f7fb7717de842071f17a85 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 4 Nov 2025 11:11:01 +1300 Subject: [PATCH 06/24] tests: Fix for macos Drop non standard `-t` flag for putting the destination directory first. --- tests/verilog/local_include.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/verilog/local_include.sh b/tests/verilog/local_include.sh index c10c7411b..aecbef713 100755 --- a/tests/verilog/local_include.sh +++ b/tests/verilog/local_include.sh @@ -19,11 +19,11 @@ $yosys $test $source # include local to cwd mkdir -p $subdir -cp -t $subdir $source +cp $source $subdir $yosys $test $subdir/$source # include local to source -mv -t $subdir $include +mv $include $subdir $yosys $test $subdir/$source # include local to source, and source is given as an absolute path From 39fab4a07fdf52ad12e50b608e0b80430a7530ed Mon Sep 17 00:00:00 2001 From: KrystalDelusion <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 4 Nov 2025 11:46:27 +1300 Subject: [PATCH 07/24] Makefile: Add gatemate genfiles Allows files to be cleaned with `make clean`, without which it breaks out-of-tree builds if an in-tree build has previously run and subsequently cleaned. --- techlibs/gatemate/Makefile.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/techlibs/gatemate/Makefile.inc b/techlibs/gatemate/Makefile.inc index aeb318cc9..8a258aec8 100644 --- a/techlibs/gatemate/Makefile.inc +++ b/techlibs/gatemate/Makefile.inc @@ -2,6 +2,9 @@ OBJS += techlibs/gatemate/synth_gatemate.o OBJS += techlibs/gatemate/gatemate_foldinv.o +GENFILES += techlibs/gatemate/lut_tree_cells.genlib +GENFILES += techlibs/gatemate/lut_tree_map.v + $(eval $(call add_share_file,share/gatemate,techlibs/gatemate/reg_map.v)) $(eval $(call add_share_file,share/gatemate,techlibs/gatemate/mux_map.v)) $(eval $(call add_share_file,share/gatemate,techlibs/gatemate/lut_map.v)) @@ -28,3 +31,4 @@ techlibs/gatemate/lut_tree_map.v: techlibs/gatemate/lut_tree_lib.mk $(eval $(call add_gen_share_file,share/gatemate,techlibs/gatemate/lut_tree_cells.genlib)) $(eval $(call add_gen_share_file,share/gatemate,techlibs/gatemate/lut_tree_map.v)) + From 336877a3535d13537e9b126407be9382e6766a0b Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 4 Nov 2025 12:27:31 +1300 Subject: [PATCH 08/24] io.cc: Drop unused variable --- kernel/io.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/kernel/io.cc b/kernel/io.cc index 45aa496b0..e9801f63e 100644 --- a/kernel/io.cc +++ b/kernel/io.cc @@ -392,12 +392,6 @@ void append_globbed(std::vector& paths, std::string pattern) copy(globbed.begin(), globbed.end(), back_inserter(paths)); } -#ifdef _WIN32 -const char* const OS_PATH_SEP = "/\\"; -#else -const char* const OS_PATH_SEP = "/"; -#endif - std::string name_from_file_path(std::string path) { return std::filesystem::path(path).filename().string(); } From 2d778a94fa01b7083184e40b3c10eace5cd09de5 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 1 Nov 2025 12:04:13 +1300 Subject: [PATCH 09/24] action.yml: Playing with apt cache --- .github/actions/setup-build-env/action.yml | 15 ++++++++++----- .github/workflows/test-build.yml | 8 ++++++++ .github/workflows/test-compile.yml | 2 ++ .github/workflows/test-sanitizers.yml | 2 ++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index 209965acb..0bd7bf71b 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -1,15 +1,20 @@ name: Build environment setup description: Configure build env for Yosys builds + +inputs: + runs-on: + required: true + type: string + runs: using: composite steps: - name: Install Linux Dependencies if: runner.os == 'Linux' - shell: bash - run: | - sudo apt-get update - sudo apt-get install gperf build-essential bison flex libfl-dev libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3-dev zlib1g-dev libbz2-dev libgtest-dev - curl -LsSf https://astral.sh/uv/install.sh | sh + uses: awalsh128/cache-apt-pkgs-action@v1.6.0 + with: + packages: gperf build-essential bison flex libfl-dev libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev libbz2-dev libgtest-dev + version: ${{ inputs.runs-on }}-buildys - name: Install macOS Dependencies if: runner.os == 'macOS' diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 2d4a7a6c8..eb52da203 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -60,6 +60,8 @@ jobs: - name: Setup environment uses: ./.github/actions/setup-build-env + with: + runs-on: ${{ matrix.os }} - name: Build shell: bash @@ -105,6 +107,8 @@ jobs: - name: Setup environment uses: ./.github/actions/setup-build-env + with: + runs-on: ${{ matrix.os }} - name: Get iverilog id: get-iverilog @@ -191,6 +195,8 @@ jobs: - name: Setup environment uses: ./.github/actions/setup-build-env + with: + runs-on: ${{ matrix.os }} - name: Download build artifact uses: actions/download-artifact@v4 @@ -229,6 +235,8 @@ jobs: - name: Setup environment uses: ./.github/actions/setup-build-env + with: + runs-on: ${{ matrix.os }} - name: Download build artifact uses: actions/download-artifact@v4 diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index 1604ca9d2..af8f1328d 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -60,6 +60,8 @@ jobs: - name: Setup environment uses: ./.github/actions/setup-build-env + with: + runs-on: ${{ matrix.os }} - name: Setup Cpp uses: aminya/setup-cpp@v1 diff --git a/.github/workflows/test-sanitizers.yml b/.github/workflows/test-sanitizers.yml index 9c0f6d746..38e51f7b4 100644 --- a/.github/workflows/test-sanitizers.yml +++ b/.github/workflows/test-sanitizers.yml @@ -44,6 +44,8 @@ jobs: - name: Setup environment uses: ./.github/actions/setup-build-env + with: + runs-on: ${{ matrix.os }} - name: Get iverilog id: get-iverilog From 0e2d24edd3b9a45c98dcc9a4dd1090918e8f402c Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 1 Nov 2025 12:43:45 +1300 Subject: [PATCH 10/24] CI: iverilog setup as composite action Called during setup-build-env. --- .github/actions/setup-build-env/action.yml | 11 +++++ .github/actions/setup-iverilog/action.yml | 57 ++++++++++++++++++++++ .github/workflows/test-build.yml | 43 +--------------- .github/workflows/test-sanitizers.yml | 48 +----------------- 4 files changed, 70 insertions(+), 89 deletions(-) create mode 100644 .github/actions/setup-iverilog/action.yml diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index 0bd7bf71b..6bf0afa15 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -5,6 +5,11 @@ inputs: runs-on: required: true type: string + get-iverilog: + description: 'Install iverilog' + default: false + required: false + type: boolean runs: using: composite @@ -38,3 +43,9 @@ runs: echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV + + - name: Setup iverilog + if: inputs.get-iverilog + uses: ./.github/actions/setup-iverilog + with: + runs-on: ${{ inputs.runs-on }} diff --git a/.github/actions/setup-iverilog/action.yml b/.github/actions/setup-iverilog/action.yml new file mode 100644 index 000000000..7f264a462 --- /dev/null +++ b/.github/actions/setup-iverilog/action.yml @@ -0,0 +1,57 @@ +name: iverilog setup +description: Cached build and install of iverilog + +inputs: + runs-on: + required: true + type: string + +runs: + using: composite + steps: + - name: Get iverilog + id: get-iverilog + shell: bash + run: | + git clone https://github.com/steveicarus/iverilog.git + cd iverilog + echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + + - name: Get vcd2fst + shell: bash + run: | + git clone https://github.com/mmicko/libwave.git + mkdir -p ${{ github.workspace }}/.local/ + cd libwave + cmake . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.local + make -j$procs + make install + + - name: Cache iverilog + id: cache-iverilog + uses: actions/cache@v4 + with: + path: .local/ + key: ${{ inputs.runs-on }}-${{ steps.get-iverilog.outputs.IVERILOG_GIT }} + + - name: iverilog macOS deps + if: steps.cache-iverilog.outputs.cache-hit != 'true' && runner.os == 'macOS' + shell: bash + run: | + brew install autoconf + + - name: Build iverilog + if: steps.cache-iverilog.outputs.cache-hit != 'true' + shell: bash + run: | + mkdir -p ${{ github.workspace }}/.local/ + cd iverilog + autoconf + CC=gcc CXX=g++ ./configure --prefix=${{ github.workspace }}/.local + make -j$procs + make install + + - name: Check iverilog + shell: bash + run: | + iverilog -V diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index eb52da203..6bd5495f0 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -109,48 +109,7 @@ jobs: uses: ./.github/actions/setup-build-env with: runs-on: ${{ matrix.os }} - - - name: Get iverilog - id: get-iverilog - shell: bash - run: | - git clone https://github.com/steveicarus/iverilog.git - cd iverilog - echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - - - name: Get vcd2fst - shell: bash - run: | - git clone https://github.com/mmicko/libwave.git - mkdir -p ${{ github.workspace }}/.local/ - cd libwave - cmake . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.local - make -j$procs - make install - - - name: Cache iverilog - id: cache-iverilog - uses: actions/cache@v4 - with: - path: .local/ - key: ${{ matrix.os }}-${{ steps.get-iverilog.outputs.IVERILOG_GIT }} - - - name: iverilog macOS deps - if: steps.cache-iverilog.outputs.cache-hit != 'true' && runner.os == 'macOS' - shell: bash - run: | - brew install autoconf - - - name: Build iverilog - if: steps.cache-iverilog.outputs.cache-hit != 'true' - shell: bash - run: | - mkdir -p ${{ github.workspace }}/.local/ - cd iverilog - autoconf - CC=gcc CXX=g++ ./configure --prefix=${{ github.workspace }}/.local - make -j$procs - make install + setup-iverilog: true - name: Download build artifact uses: actions/download-artifact@v4 diff --git a/.github/workflows/test-sanitizers.yml b/.github/workflows/test-sanitizers.yml index 38e51f7b4..6e3dfb2f2 100644 --- a/.github/workflows/test-sanitizers.yml +++ b/.github/workflows/test-sanitizers.yml @@ -46,53 +46,7 @@ jobs: uses: ./.github/actions/setup-build-env with: runs-on: ${{ matrix.os }} - - - name: Get iverilog - id: get-iverilog - shell: bash - run: | - git clone https://github.com/steveicarus/iverilog.git - cd iverilog - echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - - - name: Get vcd2fst - shell: bash - run: | - git clone https://github.com/mmicko/libwave.git - mkdir -p ${{ github.workspace }}/.local/ - cd libwave - cmake . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.local - make -j$procs - make install - - - name: Cache iverilog - id: cache-iverilog - uses: actions/cache@v4 - with: - path: .local/ - key: ${{ matrix.os }}-${{ steps.get-iverilog.outputs.IVERILOG_GIT }} - - - name: iverilog macOS deps - if: steps.cache-iverilog.outputs.cache-hit != 'true' && runner.os == 'macOS' - shell: bash - run: | - brew install autoconf - - - name: Build iverilog - if: steps.cache-iverilog.outputs.cache-hit != 'true' - shell: bash - run: | - mkdir -p ${{ github.workspace }}/.local/ - cd iverilog - autoconf - CC=gcc CXX=g++ ./configure --prefix=${{ github.workspace }}/.local - make -j$procs - make install - - - name: Check iverilog - shell: bash - run: | - iverilog -V + setup-iverilog: true - name: Build shell: bash From c597bf70b077a4211cfede64f9d1dffe4b907cd7 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 1 Nov 2025 13:03:33 +1300 Subject: [PATCH 11/24] CI: Save iverilog cache in action We still want to cache iverilog even if the rest of the action fails, so explicitly save/restore instead of standard cache. --- .github/actions/setup-build-env/action.yml | 2 +- .github/actions/setup-iverilog/action.yml | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index 6bf0afa15..6e46e1dfb 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -45,7 +45,7 @@ runs: echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV - name: Setup iverilog - if: inputs.get-iverilog + if: inputs.get-iverilog == 'true' uses: ./.github/actions/setup-iverilog with: runs-on: ${{ inputs.runs-on }} diff --git a/.github/actions/setup-iverilog/action.yml b/.github/actions/setup-iverilog/action.yml index 7f264a462..1517ad9c4 100644 --- a/.github/actions/setup-iverilog/action.yml +++ b/.github/actions/setup-iverilog/action.yml @@ -27,21 +27,20 @@ runs: make -j$procs make install - - name: Cache iverilog - id: cache-iverilog - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 + id: restore-iverilog with: path: .local/ key: ${{ inputs.runs-on }}-${{ steps.get-iverilog.outputs.IVERILOG_GIT }} - name: iverilog macOS deps - if: steps.cache-iverilog.outputs.cache-hit != 'true' && runner.os == 'macOS' + if: steps.restore-iverilog.outputs.cache-hit != 'true' && runner.os == 'macOS' shell: bash run: | brew install autoconf - name: Build iverilog - if: steps.cache-iverilog.outputs.cache-hit != 'true' + if: steps.restore-iverilog.outputs.cache-hit != 'true' shell: bash run: | mkdir -p ${{ github.workspace }}/.local/ @@ -55,3 +54,10 @@ runs: shell: bash run: | iverilog -V + + - uses: actions/cache/save@v4 + id: save-iverilog + if: steps.restore-iverilog.outputs.cache-hit != 'true' + with: + path: .local/ + key: ${{ steps.restore-iverilog.outputs.cache-primary-key }} From 1f6ac5f392b62a07c7fabe5d71327048cd3d6c7e Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 1 Nov 2025 14:29:58 +1300 Subject: [PATCH 12/24] CI: Split dependency setup Split into common + build/docs/test (common always installs, build/docs/test are installed as requested with `build-*-deps` input flag). --- .github/actions/setup-build-env/action.yml | 40 ++++++++++++++++++++-- .github/workflows/codeql.yml | 7 ++-- .github/workflows/test-build.yml | 6 +++- .github/workflows/test-compile.yml | 1 + .github/workflows/test-sanitizers.yml | 4 ++- 5 files changed, 52 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index 6e46e1dfb..24e7d84a5 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -5,6 +5,21 @@ inputs: runs-on: required: true type: string + get-build-deps: + description: 'Install Yosys build dependencies' + default: false + required: false + type: boolean + get-docs-deps: + description: 'Install Yosys docs dependencies' + default: false + required: false + type: boolean + get-test-deps: + description: 'Install Yosys test dependencies' + default: false + required: false + type: boolean get-iverilog: description: 'Install iverilog' default: false @@ -14,13 +29,34 @@ inputs: runs: using: composite steps: - - name: Install Linux Dependencies + - name: Linux common dependencies if: runner.os == 'Linux' uses: awalsh128/cache-apt-pkgs-action@v1.6.0 with: - packages: gperf build-essential bison flex libfl-dev libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev libbz2-dev libgtest-dev + packages: autoconf git make python3 + version: ${{ inputs.runs-on }}-commonys + + - name: Linux build dependencies + if: runner.os == 'Linux' && inputs.get-build-deps == 'true' + uses: awalsh128/cache-apt-pkgs-action@v1.6.0 + with: + packages: bison clang flex libboost-filesystem-dev libboost-python-dev libboost-system-dev libbz2-dev libffi-dev libfl-dev libreadline-dev pkg-config tcl-dev zlib1g-dev version: ${{ inputs.runs-on }}-buildys + - name: Linux docs dependencies + if: runner.os == 'Linux' && inputs.get-docs-deps == 'true' + uses: awalsh128/cache-apt-pkgs-action@v1.6.0 + with: + packages: graphviz xdot + version: ${{ inputs.runs-on }}-docsys + + - name: Linux test dependencies + if: runner.os == 'Linux' && inputs.get-test-deps == 'true' + uses: awalsh128/cache-apt-pkgs-action@v1.6.0 + with: + packages: gawk libgtest-dev + version: ${{ inputs.runs-on }}-testys + - name: Install macOS Dependencies if: runner.os == 'macOS' shell: bash diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 95595924a..da30e3da4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -10,8 +10,11 @@ jobs: name: Analyze runs-on: ubuntu-latest steps: - - name: Install deps - run: sudo apt-get install bison flex libfl-dev libreadline-dev tcl-dev libffi-dev + - name: Setup environment + uses: ./.github/actions/setup-build-env + with: + runs-on: ubuntu-latest + get-build-deps: true - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 6bd5495f0..8c1a3bbd2 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -62,6 +62,7 @@ jobs: uses: ./.github/actions/setup-build-env with: runs-on: ${{ matrix.os }} + get-build-deps: true - name: Build shell: bash @@ -109,7 +110,8 @@ jobs: uses: ./.github/actions/setup-build-env with: runs-on: ${{ matrix.os }} - setup-iverilog: true + get-test-deps: true + get-iverilog: true - name: Download build artifact uses: actions/download-artifact@v4 @@ -196,6 +198,8 @@ jobs: uses: ./.github/actions/setup-build-env with: runs-on: ${{ matrix.os }} + get-build-deps: true + get-docs-deps: true - name: Download build artifact uses: actions/download-artifact@v4 diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index af8f1328d..31c8bccf6 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -62,6 +62,7 @@ jobs: uses: ./.github/actions/setup-build-env with: runs-on: ${{ matrix.os }} + get-build-deps: true - name: Setup Cpp uses: aminya/setup-cpp@v1 diff --git a/.github/workflows/test-sanitizers.yml b/.github/workflows/test-sanitizers.yml index 6e3dfb2f2..4c8e3ec51 100644 --- a/.github/workflows/test-sanitizers.yml +++ b/.github/workflows/test-sanitizers.yml @@ -46,7 +46,9 @@ jobs: uses: ./.github/actions/setup-build-env with: runs-on: ${{ matrix.os }} - setup-iverilog: true + get-build-deps: true + get-test-deps: true + get-iverilog: true - name: Build shell: bash From a4bd40e1992faafd3e7d5c73af2f0928844bcc6c Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 1 Nov 2025 15:36:07 +1300 Subject: [PATCH 13/24] CI: Fix iverilog deps --- .github/actions/setup-build-env/action.yml | 4 ++-- .github/actions/setup-iverilog/action.yml | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index 24e7d84a5..c8dc5dc64 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -33,7 +33,7 @@ runs: if: runner.os == 'Linux' uses: awalsh128/cache-apt-pkgs-action@v1.6.0 with: - packages: autoconf git make python3 + packages: gawk git make python3 version: ${{ inputs.runs-on }}-commonys - name: Linux build dependencies @@ -54,7 +54,7 @@ runs: if: runner.os == 'Linux' && inputs.get-test-deps == 'true' uses: awalsh128/cache-apt-pkgs-action@v1.6.0 with: - packages: gawk libgtest-dev + packages: libgtest-dev version: ${{ inputs.runs-on }}-testys - name: Install macOS Dependencies diff --git a/.github/actions/setup-iverilog/action.yml b/.github/actions/setup-iverilog/action.yml index 1517ad9c4..ac4f33ad8 100644 --- a/.github/actions/setup-iverilog/action.yml +++ b/.github/actions/setup-iverilog/action.yml @@ -33,6 +33,13 @@ runs: path: .local/ key: ${{ inputs.runs-on }}-${{ steps.get-iverilog.outputs.IVERILOG_GIT }} + - name: iverilog Linux deps + if: steps.restore-iverilog.outputs.cache-hit != 'true' && runner.os == 'Linux' + uses: awalsh128/cache-apt-pkgs-action@v1.6.0 + with: + packages: autoconf gperf make gcc g++ bison flex + version: ${{ inputs.runs-on }}-iverilog + - name: iverilog macOS deps if: steps.restore-iverilog.outputs.cache-hit != 'true' && runner.os == 'macOS' shell: bash From cc5642c904fe610cf18937fd54ea225f6de281f7 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 1 Nov 2025 16:19:38 +1300 Subject: [PATCH 14/24] Docs: Bringing prereqs in line Add comments in setup-build-env/action.yml for where to document prereqs (and the separation between build/run and test). Add some initial (very basic) text for `test_suites.rst`, listing prereqs and how to run the tests (with subsections for the different optional tests, which is currently docs, functional and unit). Add sphinx-inline-tabs, use it for tidying up prereq instructions based on OS/platform (mostly helpful in the test suites doc where there are multiple sections split by OS). Also fixes some single backticks that should be double backtick. --- .github/actions/setup-build-env/action.yml | 4 ++ README.md | 8 ++- docs/source/conf.py | 2 +- docs/source/getting_started/installation.rst | 72 ++++++++++--------- docs/source/requirements.txt | 1 + .../extending_yosys/test_suites.rst | 69 +++++++++++++++++- 6 files changed, 117 insertions(+), 39 deletions(-) diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index c8dc5dc64..4fea7ad46 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -29,6 +29,8 @@ inputs: runs: using: composite steps: + # if updating common/build/docs dependencies, make sure to update README.md + # and docs/source/getting_started/installation.rst to match. - name: Linux common dependencies if: runner.os == 'Linux' uses: awalsh128/cache-apt-pkgs-action@v1.6.0 @@ -50,6 +52,8 @@ runs: packages: graphviz xdot version: ${{ inputs.runs-on }}-docsys + # if updating test dependencies, make sure to update + # docs/source/yosys_internals/extending_yosys/test_suites.rst to match. - name: Linux test dependencies if: runner.os == 'Linux' && inputs.get-test-deps == 'true' uses: awalsh128/cache-apt-pkgs-action@v1.6.0 diff --git a/README.md b/README.md index dd5b634f9..2e659a46f 100644 --- a/README.md +++ b/README.md @@ -83,9 +83,11 @@ Xdot (graphviz) is used by the ``show`` command in yosys to display schematics. For example on Ubuntu Linux 22.04 LTS the following commands will install all prerequisites for building yosys: - $ sudo apt-get install build-essential clang lld bison flex libfl-dev \ - libreadline-dev gawk tcl-dev libffi-dev git \ - graphviz xdot pkg-config python3-dev zlib1g-dev + $ sudo apt-get install gawk git make python3 lld \ + bison clang flex libboost-filesystem-dev libboost-python-dev \ + libboost-system-dev libbz2-dev libffi-dev libfl-dev \ + libreadline-dev pkg-config tcl-dev zlib1g-dev \ + graphviz xdot $ curl -LsSf https://astral.sh/uv/install.sh | sh The environment variable `CXX` can be used to control the C++ compiler used, or diff --git a/docs/source/conf.py b/docs/source/conf.py index 49f8f5eab..6740fab83 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -50,7 +50,7 @@ rst_prolog = """ :language: yoscrypt """ -extensions = ['sphinx.ext.autosectionlabel', 'sphinxcontrib.bibtex'] +extensions = ['sphinx.ext.autosectionlabel', 'sphinxcontrib.bibtex', 'sphinx_inline_tabs'] if os.getenv("READTHEDOCS"): # Use rtds_action if we are building on read the docs and have a github token env var diff --git a/docs/source/getting_started/installation.rst b/docs/source/getting_started/installation.rst index fef495389..48a4c5fdd 100644 --- a/docs/source/getting_started/installation.rst +++ b/docs/source/getting_started/installation.rst @@ -93,56 +93,64 @@ tools: readline, libffi, Tcl and zlib; are optional but enabled by default (see :makevar:`ENABLE_*` settings in Makefile). Graphviz and Xdot are used by the `show` command to display schematics. -Installing all prerequisites for Ubuntu 22.04: +Installing all prerequisites: -.. code:: console +.. tab:: Ubuntu 22.04 - sudo apt-get install gperf build-essential clang lld bison flex libfl-dev \ - libreadline-dev gawk tcl-dev libffi-dev git \ - graphviz xdot pkg-config python3-dev zlib1g-dev - curl -LsSf https://astral.sh/uv/install.sh | sh + .. code:: console -Installing all prerequisites for macOS 13 (with Homebrew): + sudo apt-get install gawk git make python3 lld \ + bison clang flex libboost-filesystem-dev libboost-python-dev \ + libboost-system-dev libbz2-dev libffi-dev libfl-dev \ + libreadline-dev pkg-config tcl-dev zlib1g-dev \ + graphviz xdot + curl -LsSf https://astral.sh/uv/install.sh | sh -.. code:: console +.. tab:: macOS 13 (with Homebrew) - brew tap Homebrew/bundle && brew bundle + .. code:: console -or MacPorts: + brew tap Homebrew/bundle && brew bundle -.. code:: console +.. tab:: MacPorts - sudo port install bison flex readline gawk libffi graphviz \ - pkgconfig python311 boost zlib tcl + .. code:: console -On FreeBSD use the following command to install all prerequisites: + sudo port install bison flex readline gawk libffi graphviz \ + pkgconfig python311 boost zlib tcl -.. code:: console +.. tab:: FreeBSD - pkg install bison flex readline gawk libffi graphviz \ - pkgconf python311 tcl-wrapper boost-libs + .. code:: console -.. note:: On FreeBSD system use gmake instead of make. To run tests use: - ``MAKE=gmake CXX=cxx CC=cc gmake test`` + pkg install bison flex readline gawk libffi graphviz \ + pkgconf python311 tcl-wrapper boost-libs -For Cygwin use the following command to install all prerequisites, or select these additional packages: + .. note:: On FreeBSD system use gmake instead of make. To run tests use: + ``MAKE=gmake CXX=cxx CC=cc gmake test`` -.. code:: console +.. tab:: Cygwin - setup-x86_64.exe -q --packages=bison,flex,gcc-core,gcc-g++,git,libffi-devel,libreadline-devel,make,pkg-config,python3,tcl-devel,boost-build,zlib-devel + Use the following command to install all prerequisites, or select these + additional packages: -.. warning:: + .. code:: console - As of this writing, Cygwin only supports up to Python 3.9.16 while the - minimum required version of Python is 3.11. This means that Cygwin is not - compatible with many of the Python-based frontends. While this does not - currently prevent Yosys itself from working, no guarantees are made for - continued support. You may also need to specify `CXXSTD=gnu++17` to resolve - missing `strdup` function when using gcc. It is instead recommended to use - Windows Subsystem for Linux (WSL) and follow the instructions for Ubuntu. + setup-x86_64.exe -q --packages=bison,flex,gcc-core,gcc-g++,git,libffi-devel,libreadline-devel,make,pkg-config,python3,tcl-devel,boost-build,zlib-devel -.. - For MSYS2 (MINGW64): + .. warning:: + + As of this writing, Cygwin only supports up to Python 3.9.16 while the + minimum required version of Python is 3.11. This means that Cygwin is not + compatible with many of the Python-based frontends. While this does not + currently prevent Yosys itself from working, no guarantees are made for + continued support. You may also need to specify ``CXXSTD=gnu++17`` to + resolve missing ``strdup`` function when using gcc. It is instead + recommended to use Windows Subsystem for Linux (WSL) and follow the + instructions for Ubuntu. + +.. + tab:: MSYS2 (MINGW64) .. code:: console diff --git a/docs/source/requirements.txt b/docs/source/requirements.txt index 203205169..403bfb1c6 100644 --- a/docs/source/requirements.txt +++ b/docs/source/requirements.txt @@ -1,3 +1,4 @@ furo-ys @ git+https://github.com/YosysHQ/furo-ys sphinxcontrib-bibtex rtds-action +sphinx-inline-tabs diff --git a/docs/source/yosys_internals/extending_yosys/test_suites.rst b/docs/source/yosys_internals/extending_yosys/test_suites.rst index 3e5f45b94..81a79e77f 100644 --- a/docs/source/yosys_internals/extending_yosys/test_suites.rst +++ b/docs/source/yosys_internals/extending_yosys/test_suites.rst @@ -1,7 +1,72 @@ Testing Yosys ============= -.. TODO:: more about the included test suite and how to add tests +.. todo:: adding tests (makefile-tests vs seed-tests) + +Running the included test suite +------------------------------- + +The Yosys source comes with a test suite to avoid regressions and keep +everything working as expected. Tests can be run by calling ``make test`` from +the root Yosys directory. + +Functional tests +~~~~~~~~~~~~~~~~ + +Testing functional backends (see +:doc:`/yosys_internals/extending_yosys/functional_ir`) has a few requirements in +addition to those listed in :ref:`getting_started/installation:Build +prerequisites`: + +.. tab:: Ubuntu + + .. code:: console + + sudo apt-get install racket + raco pkg install rosette + pip install pytest-xdist pytest-xdist-gnumake + +.. tab:: macOS + + .. code:: console + + brew install racket + raco pkg install rosette + pip install pytest-xdist pytest-xdist-gnumake + +If you don't have one of the :ref:`getting_started/installation:CAD suite(s)` +installed, you should also install Z3 `following their +instructions `_. + +Then, set the :makevar:`ENABLE_FUNCTIONAL_TESTS` make variable when calling +``make test`` and the functional tests will be run as well. + +Unit tests +~~~~~~~~~~ + +Running the unit tests requires the following additional packages: + +.. tab:: Ubuntu + + .. code:: console + + sudo apt-get install libgtest-dev + +.. tab:: macOS + + No additional requirements. + +Unit tests can be run with ``make unit-test``. + +Docs tests +~~~~~~~~~~ + +There are some additional tests for checking examples included in the +documentation, which can be run by calling ``make test`` from the +:file:`yosys/docs` sub-directory (or ``make -C docs test`` from the root). This +also includes checking some macro commands to ensure that descriptions of them +are kept up to date, and is mostly intended for CI. + Automatic testing ----------------- @@ -14,8 +79,6 @@ compiler versions. For up to date information, including OS versions, refer to .. _Yosys Git repo: https://github.com/YosysHQ/yosys .. _the git actions page: https://github.com/YosysHQ/yosys/actions -.. todo:: are unit tests currently working - .. How to add a unit test ---------------------- From bf7c79cc8520f13b0da30299ac07a8d59b6fe282 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 1 Nov 2025 17:27:09 +1300 Subject: [PATCH 15/24] CI: vcd2fst needs deps --- .github/actions/setup-iverilog/action.yml | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/actions/setup-iverilog/action.yml b/.github/actions/setup-iverilog/action.yml index ac4f33ad8..557ff6add 100644 --- a/.github/actions/setup-iverilog/action.yml +++ b/.github/actions/setup-iverilog/action.yml @@ -9,6 +9,19 @@ inputs: runs: using: composite steps: + - name: iverilog Linux deps + if: steps.restore-iverilog.outputs.cache-hit != 'true' && runner.os == 'Linux' + uses: awalsh128/cache-apt-pkgs-action@v1.6.0 + with: + packages: autoconf gperf make gcc g++ bison flex + version: ${{ inputs.runs-on }}-iverilog + + - name: iverilog macOS deps + if: steps.restore-iverilog.outputs.cache-hit != 'true' && runner.os == 'macOS' + shell: bash + run: | + brew install autoconf + - name: Get iverilog id: get-iverilog shell: bash @@ -33,19 +46,6 @@ runs: path: .local/ key: ${{ inputs.runs-on }}-${{ steps.get-iverilog.outputs.IVERILOG_GIT }} - - name: iverilog Linux deps - if: steps.restore-iverilog.outputs.cache-hit != 'true' && runner.os == 'Linux' - uses: awalsh128/cache-apt-pkgs-action@v1.6.0 - with: - packages: autoconf gperf make gcc g++ bison flex - version: ${{ inputs.runs-on }}-iverilog - - - name: iverilog macOS deps - if: steps.restore-iverilog.outputs.cache-hit != 'true' && runner.os == 'macOS' - shell: bash - run: | - brew install autoconf - - name: Build iverilog if: steps.restore-iverilog.outputs.cache-hit != 'true' shell: bash From 684bbf6a25f4dc8a600a9cf8cf9614313b2945d2 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 1 Nov 2025 20:08:45 +1300 Subject: [PATCH 16/24] CI: Move libbz2 to iverilog setup Needed for vcd2fst. --- .github/actions/setup-build-env/action.yml | 2 +- .github/actions/setup-iverilog/action.yml | 2 +- README.md | 4 ++-- docs/source/getting_started/installation.rst | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index 4fea7ad46..216742791 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -42,7 +42,7 @@ runs: if: runner.os == 'Linux' && inputs.get-build-deps == 'true' uses: awalsh128/cache-apt-pkgs-action@v1.6.0 with: - packages: bison clang flex libboost-filesystem-dev libboost-python-dev libboost-system-dev libbz2-dev libffi-dev libfl-dev libreadline-dev pkg-config tcl-dev zlib1g-dev + packages: bison clang flex libboost-filesystem-dev libboost-python-dev libboost-system-dev libffi-dev libfl-dev libreadline-dev pkg-config tcl-dev zlib1g-dev version: ${{ inputs.runs-on }}-buildys - name: Linux docs dependencies diff --git a/.github/actions/setup-iverilog/action.yml b/.github/actions/setup-iverilog/action.yml index 557ff6add..0acb582e3 100644 --- a/.github/actions/setup-iverilog/action.yml +++ b/.github/actions/setup-iverilog/action.yml @@ -13,7 +13,7 @@ runs: if: steps.restore-iverilog.outputs.cache-hit != 'true' && runner.os == 'Linux' uses: awalsh128/cache-apt-pkgs-action@v1.6.0 with: - packages: autoconf gperf make gcc g++ bison flex + packages: autoconf gperf make gcc g++ bison flex libbz2-dev version: ${{ inputs.runs-on }}-iverilog - name: iverilog macOS deps diff --git a/README.md b/README.md index 2e659a46f..6a204fa8d 100644 --- a/README.md +++ b/README.md @@ -85,8 +85,8 @@ prerequisites for building yosys: $ sudo apt-get install gawk git make python3 lld \ bison clang flex libboost-filesystem-dev libboost-python-dev \ - libboost-system-dev libbz2-dev libffi-dev libfl-dev \ - libreadline-dev pkg-config tcl-dev zlib1g-dev \ + libboost-system-dev libffi-dev libfl-dev libreadline-dev \ + pkg-config tcl-dev zlib1g-dev \ graphviz xdot $ curl -LsSf https://astral.sh/uv/install.sh | sh diff --git a/docs/source/getting_started/installation.rst b/docs/source/getting_started/installation.rst index 48a4c5fdd..5c538a959 100644 --- a/docs/source/getting_started/installation.rst +++ b/docs/source/getting_started/installation.rst @@ -101,8 +101,8 @@ Installing all prerequisites: sudo apt-get install gawk git make python3 lld \ bison clang flex libboost-filesystem-dev libboost-python-dev \ - libboost-system-dev libbz2-dev libffi-dev libfl-dev \ - libreadline-dev pkg-config tcl-dev zlib1g-dev \ + libboost-system-dev libffi-dev libfl-dev libreadline-dev \ + pkg-config tcl-dev zlib1g-dev \ graphviz xdot curl -LsSf https://astral.sh/uv/install.sh | sh From 17c1388303af4f5c2d71c2b03450dcb1d389a04c Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 1 Nov 2025 20:11:36 +1300 Subject: [PATCH 17/24] Drop boost-python --- .github/actions/setup-build-env/action.yml | 2 +- README.md | 5 ++--- docs/source/getting_started/installation.rst | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index 216742791..5ecb4d3a9 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -42,7 +42,7 @@ runs: if: runner.os == 'Linux' && inputs.get-build-deps == 'true' uses: awalsh128/cache-apt-pkgs-action@v1.6.0 with: - packages: bison clang flex libboost-filesystem-dev libboost-python-dev libboost-system-dev libffi-dev libfl-dev libreadline-dev pkg-config tcl-dev zlib1g-dev + packages: bison clang flex libboost-filesystem-dev libboost-system-dev libffi-dev libfl-dev libreadline-dev pkg-config tcl-dev zlib1g-dev version: ${{ inputs.runs-on }}-buildys - name: Linux docs dependencies diff --git a/README.md b/README.md index 6a204fa8d..42462efbc 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,8 @@ For example on Ubuntu Linux 22.04 LTS the following commands will install all prerequisites for building yosys: $ sudo apt-get install gawk git make python3 lld \ - bison clang flex libboost-filesystem-dev libboost-python-dev \ - libboost-system-dev libffi-dev libfl-dev libreadline-dev \ - pkg-config tcl-dev zlib1g-dev \ + bison clang flex libboost-filesystem-dev libboost-system-dev \ + libffi-dev libfl-dev libreadline-dev pkg-config tcl-dev zlib1g-dev \ graphviz xdot $ curl -LsSf https://astral.sh/uv/install.sh | sh diff --git a/docs/source/getting_started/installation.rst b/docs/source/getting_started/installation.rst index 5c538a959..8ec5c4e35 100644 --- a/docs/source/getting_started/installation.rst +++ b/docs/source/getting_started/installation.rst @@ -100,9 +100,8 @@ Installing all prerequisites: .. code:: console sudo apt-get install gawk git make python3 lld \ - bison clang flex libboost-filesystem-dev libboost-python-dev \ - libboost-system-dev libffi-dev libfl-dev libreadline-dev \ - pkg-config tcl-dev zlib1g-dev \ + bison clang flex libboost-filesystem-dev libboost-system-dev \ + libffi-dev libfl-dev libreadline-dev pkg-config tcl-dev zlib1g-dev \ graphviz xdot curl -LsSf https://astral.sh/uv/install.sh | sh From 35e4d967c6cb637bb50900196aac8e4a73b59290 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 4 Nov 2025 08:00:35 +0100 Subject: [PATCH 18/24] install UV in wheels.yml --- .github/workflows/wheels.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 9eea1468d..e75e02ad2 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -54,6 +54,11 @@ jobs: fetch-depth: 0 submodules: true persist-credentials: false + - if: ${{ matrix.os.family == 'linux' }} + name: "[Linux] Install UV" + shell: bash + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh - uses: actions/setup-python@v5 - name: Get FFI shell: bash From db76eebc0f69d791ec455f9b0f9e006d25b0bcbb Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 4 Nov 2025 08:35:07 +0100 Subject: [PATCH 19/24] Remove mentions of Boost --- .github/actions/setup-build-env/action.yml | 2 +- .github/workflows/wheels/_run_cibw_linux.py | 4 ++-- .gitignore | 1 - README.md | 3 +-- docs/source/getting_started/installation.rst | 11 +++++------ flake.nix | 2 +- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index 5ecb4d3a9..60fe481e7 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -42,7 +42,7 @@ runs: if: runner.os == 'Linux' && inputs.get-build-deps == 'true' uses: awalsh128/cache-apt-pkgs-action@v1.6.0 with: - packages: bison clang flex libboost-filesystem-dev libboost-system-dev libffi-dev libfl-dev libreadline-dev pkg-config tcl-dev zlib1g-dev + packages: bison clang flex libffi-dev libfl-dev libreadline-dev pkg-config tcl-dev zlib1g-dev version: ${{ inputs.runs-on }}-buildys - name: Linux docs dependencies diff --git a/.github/workflows/wheels/_run_cibw_linux.py b/.github/workflows/wheels/_run_cibw_linux.py index fb4e0b839..1e8a0f497 100644 --- a/.github/workflows/wheels/_run_cibw_linux.py +++ b/.github/workflows/wheels/_run_cibw_linux.py @@ -24,10 +24,10 @@ from pathlib import Path __yosys_root__ = Path(__file__).absolute().parents[3] -for source in ["boost", "ffi", "bison"]: +for source in ["ffi", "bison"]: if not (__yosys_root__ / source).is_dir(): print( - "You need to download boost, ffi and bison in a similar manner to wheels.yml first." + "You need to download ffi and bison in a similar manner to wheels.yml first." ) exit(-1) diff --git a/.gitignore b/.gitignore index 2367bccb3..a8b04ac45 100644 --- a/.gitignore +++ b/.gitignore @@ -55,7 +55,6 @@ # pyosys /kernel/*.pyh /kernel/python_wrappers.cc -/boost /ffi /bison /venv diff --git a/README.md b/README.md index 42462efbc..427d59c9e 100644 --- a/README.md +++ b/README.md @@ -83,8 +83,7 @@ Xdot (graphviz) is used by the ``show`` command in yosys to display schematics. For example on Ubuntu Linux 22.04 LTS the following commands will install all prerequisites for building yosys: - $ sudo apt-get install gawk git make python3 lld \ - bison clang flex libboost-filesystem-dev libboost-system-dev \ + $ sudo apt-get install gawk git make python3 lld bison clang flex \ libffi-dev libfl-dev libreadline-dev pkg-config tcl-dev zlib1g-dev \ graphviz xdot $ curl -LsSf https://astral.sh/uv/install.sh | sh diff --git a/docs/source/getting_started/installation.rst b/docs/source/getting_started/installation.rst index 8ec5c4e35..43b996353 100644 --- a/docs/source/getting_started/installation.rst +++ b/docs/source/getting_started/installation.rst @@ -99,8 +99,7 @@ Installing all prerequisites: .. code:: console - sudo apt-get install gawk git make python3 lld \ - bison clang flex libboost-filesystem-dev libboost-system-dev \ + sudo apt-get install gawk git make python3 lld bison clang flex \ libffi-dev libfl-dev libreadline-dev pkg-config tcl-dev zlib1g-dev \ graphviz xdot curl -LsSf https://astral.sh/uv/install.sh | sh @@ -116,14 +115,14 @@ Installing all prerequisites: .. code:: console sudo port install bison flex readline gawk libffi graphviz \ - pkgconfig python311 boost zlib tcl + pkgconfig python311 zlib tcl .. tab:: FreeBSD .. code:: console pkg install bison flex readline gawk libffi graphviz \ - pkgconf python311 tcl-wrapper boost-libs + pkgconf python311 tcl-wrapper .. note:: On FreeBSD system use gmake instead of make. To run tests use: ``MAKE=gmake CXX=cxx CC=cc gmake test`` @@ -135,7 +134,7 @@ Installing all prerequisites: .. code:: console - setup-x86_64.exe -q --packages=bison,flex,gcc-core,gcc-g++,git,libffi-devel,libreadline-devel,make,pkg-config,python3,tcl-devel,boost-build,zlib-devel + setup-x86_64.exe -q --packages=bison,flex,gcc-core,gcc-g++,git,libffi-devel,libreadline-devel,make,pkg-config,python3,tcl-devel,zlib-devel .. warning:: @@ -153,7 +152,7 @@ Installing all prerequisites: .. code:: console - pacman -S bison flex mingw-w64-x86_64-gcc git libffi-devel libreadline-devel make pkg-config python3 tcl-devel mingw-w64-x86_64-boost zlib-devel + pacman -S bison flex mingw-w64-x86_64-gcc git libffi-devel libreadline-devel make pkg-config python3 tcl-devel zlib-devel Not that I can get this to work; it's failing during ld with what looks like math library issues: ``multiple definition of `tanh'`` and diff --git a/flake.nix b/flake.nix index 19ba59f17..1993b803b 100644 --- a/flake.nix +++ b/flake.nix @@ -41,7 +41,7 @@ packages.default = yosys; defaultPackage = yosys; devShell = pkgs.mkShell { - buildInputs = with pkgs; [ clang llvmPackages.bintools gcc bison flex libffi tcl readline python3 zlib git gtest abc-verifier verilog boost python3Packages.boost ]; + buildInputs = with pkgs; [ clang llvmPackages.bintools gcc bison flex libffi tcl readline python3 zlib git gtest abc-verifier verilog ]; }; } ); From ad3ae52e9a6f830766c3b9b8fb8c99e0d2a2826a Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 4 Nov 2025 09:30:04 +0100 Subject: [PATCH 20/24] Upload only on manual action --- .github/workflows/wheels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index e75e02ad2..3fdde6abf 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -25,13 +25,13 @@ jobs: archs: "aarch64", }, { - name: "macOS 13", + name: "macOS 15 x64", family: "macos", runner: "macos-15-intel", archs: "x86_64", }, { - name: "macOS 14", + name: "macOS 15 arm64", family: "macos", runner: "macos-15", archs: "arm64", @@ -119,7 +119,7 @@ jobs: path: ./wheelhouse/*.whl upload_wheels: name: Upload Wheels - if: github.repository == 'YosysHQ/Yosys' + if: (github.repository == 'YosysHQ/Yosys') && (github.event_name == 'workflow_dispatch') runs-on: ubuntu-latest # Specifying a GitHub environment is optional, but strongly encouraged environment: pypi From 3a54ed6916f45e558e3f26d1a9abcb932ea04b32 Mon Sep 17 00:00:00 2001 From: Mohamed Gaber Date: Tue, 4 Nov 2025 14:32:38 +0200 Subject: [PATCH 21/24] hotfix: don't use uv when building wheels --- .github/workflows/wheels.yml | 5 ----- setup.py | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 3fdde6abf..b3a25a43a 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -54,11 +54,6 @@ jobs: fetch-depth: 0 submodules: true persist-credentials: false - - if: ${{ matrix.os.family == 'linux' }} - name: "[Linux] Install UV" - shell: bash - run: | - curl -LsSf https://astral.sh/uv/install.sh | sh - uses: actions/setup-python@v5 - name: Get FFI shell: bash diff --git a/setup.py b/setup.py index 59c1c4b33..8b786cb32 100644 --- a/setup.py +++ b/setup.py @@ -51,6 +51,7 @@ class libyosys_so_ext(Extension): "ENABLE_TCL=0", "ENABLE_READLINE=0", "ENABLE_EDITLINE=0", + "PYOSYS_USE_UV=0", # + install requires takes its role when building wheels # Always compile and include ABC in wheel "ABCEXTERNAL=", # Show compile commands From 51c8193643cbda5c3aefe22c9fb1235388f8fd14 Mon Sep 17 00:00:00 2001 From: Mohamed Gaber Date: Tue, 4 Nov 2025 14:58:48 +0200 Subject: [PATCH 22/24] hotfix: update libffi in wheels ci update libffi to a version where https://github.com/libffi/libffi/issues/852 is fixed --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b3a25a43a..8e055f526 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -59,7 +59,7 @@ jobs: shell: bash run: | mkdir -p ffi - curl -L https://github.com/libffi/libffi/releases/download/v3.4.6/libffi-3.4.6.tar.gz | tar --strip-components=1 -xzC ffi + curl -L https://github.com/libffi/libffi/releases/download/v3.4.8/libffi-3.4.8.tar.gz | tar --strip-components=1 -xzC ffi - if: ${{ matrix.os.family == 'linux' }} name: "[Linux] Bison 3.8.2" shell: bash From 12cb8e95110af37c46dea77f46484db72ae7cdc9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 5 Nov 2025 00:24:49 +0000 Subject: [PATCH 23/24] Bump version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a46b865ed..d72cbee7e 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,7 @@ ifeq ($(OS), Haiku) CXXFLAGS += -D_DEFAULT_SOURCE endif -YOSYS_VER := 0.58+98 +YOSYS_VER := 0.58+132 YOSYS_MAJOR := $(shell echo $(YOSYS_VER) | cut -d'.' -f1) YOSYS_MINOR := $(shell echo $(YOSYS_VER) | cut -d'.' -f2 | cut -d'+' -f1) YOSYS_COMMIT := $(shell echo $(YOSYS_VER) | cut -d'+' -f2) From e89c5914fe279bfee42e1bbaf6fd017cb333ff64 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 5 Nov 2025 07:10:08 +0100 Subject: [PATCH 24/24] CodeQL CI fix --- .github/workflows/codeql.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index da30e3da4..4bca5a8a5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -10,18 +10,18 @@ jobs: name: Analyze runs-on: ubuntu-latest steps: - - name: Setup environment - uses: ./.github/actions/setup-build-env - with: - runs-on: ubuntu-latest - get-build-deps: true - - name: Checkout repository uses: actions/checkout@v4 with: submodules: true persist-credentials: false + - name: Setup environment + uses: ./.github/actions/setup-build-env + with: + runs-on: ubuntu-latest + get-build-deps: true + - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: