Commit Graph

294 Commits

Author SHA1 Message Date
Miodrag Milanovic ad3ae52e9a Upload only on manual action 2025-11-04 09:30:04 +01:00
Miodrag Milanovic db76eebc0f Remove mentions of Boost 2025-11-04 08:35:07 +01:00
Miodrag Milanovic 35e4d967c6 install UV in wheels.yml 2025-11-04 08:00:35 +01:00
Krystine Sherwin 17c1388303 Drop boost-python 2025-11-04 07:40:36 +01:00
Krystine Sherwin 684bbf6a25 CI: Move libbz2 to iverilog setup
Needed for vcd2fst.
2025-11-04 07:40:36 +01:00
Krystine Sherwin bf7c79cc85 CI: vcd2fst needs deps 2025-11-04 07:40:36 +01:00
Krystine Sherwin cc5642c904 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.
2025-11-04 07:40:36 +01:00
Krystine Sherwin a4bd40e199 CI: Fix iverilog deps 2025-11-04 07:39:06 +01:00
Krystine Sherwin 1f6ac5f392 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).
2025-11-04 07:39:06 +01:00
Krystine Sherwin c597bf70b0 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.
2025-11-04 07:39:06 +01:00
Krystine Sherwin 0e2d24edd3 CI: iverilog setup as composite action
Called during setup-build-env.
2025-11-04 07:39:06 +01:00
Krystine Sherwin 2d778a94fa action.yml: Playing with apt cache 2025-11-04 07:39:05 +01:00
Mohamed Gaber e9733d681d
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)
2025-11-03 15:39:31 +02:00
Emil Jiří Tywoniak d1a628ab26 CI: bump WASI SDK from 19 to 27 2025-10-14 15:47:08 +02:00
Mohamed Gaber 80fcce64da
pyosys: fix ref-only classes, implicit conversions
+ cleanup
2025-10-03 11:54:44 +03:00
Mohamed Gaber 447a6cb3f0
misc: `WITH_PYTHON` -> `YOSYS_ENABLE_PYTHON`
For consistency.

Also trying a new thing: only rebuilding objects that use the pybind11 library. The idea is these are the only objects that include the Python/pybind headers and thus the only ones that depend on the Python ABI in any capacity, so other objects can be reused across wheel builds. This has the potential to cut down build times.
2025-10-03 11:54:44 +03:00
Mohamed Gaber dc88906c91
tests/pyosys: print log on failed test, fix make clean 2025-10-03 11:54:44 +03:00
Mohamed Gaber 88be728353
pyosys: rewrite using pybind11
- Rewrite all Python features to use the pybind11 library instead of boost::python.
  Unlike boost::python, pybind11 is a header-only library that is just included by Pyosys code, saving a lot of compile time on wheels.
- Factor out as much "translation" code from the generator into proper C++ files
- Fix running the embedded interpreter not supporting "from pyosys import libyosys as ys" like wheels
- Move Python-related elements to `pyosys` directory at the root of the repo
- Slight shift in bridging semantics:
  - Containers are declared as "opaque types" and are passed by reference to Python - many methods have been implemented to make them feel right at home without the overhead/ambiguity of copying to Python and then copying back after mutation
  - Monitor/Pass use "trampoline" pattern to support virual methods overridable in Python: virtual methods no longer require `py_` prefix
- Create really short test set for pyosys that just exercises basic functionality
2025-10-03 11:54:44 +03:00
Emil J. Tywoniak dc7764e247 .github: typos 2025-09-30 11:03:19 +02:00
Emil J. Tywoniak b2adaeec69 .github: replace Slack and GitHub Discussions with Discourse in issue templates 2025-09-29 23:03:54 +02:00
Emil J. Tywoniak 4c17ac5ac2 .github: suggest Discourse in PR template 2025-09-29 23:03:29 +02:00
Miodrag Milanović fcc3d7132d
Fix building and running unit tests (#5374)
* Fix building and running unit tests

* Enable unit tests

* Add gtest always

* test-sanitizers.yml: Use makefile.conf

* proper test setup

* make it run on macOS

* Run libyosys build only for unit tests after testing is done

* Disable LTO on public CI

---------

Co-authored-by: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com>
2025-09-23 17:10:18 +02:00
KrystalDelusion 991561fe98
Merge pull request #5363 from KrystalDelusion/krys/yosyshq-only-jobs 2025-09-23 17:27:43 +12:00
Krystine Sherwin 6f7cd637cb
CI: Check repo for YosysHQ specific jobs
Prevents unintended bumps on the flake.lock and Yosys version on forks (provided the forks synchronize their main after this gets merged).
Update version.yml to use the same style of `if` on the job, rather than on specific actions.
Wheels will still build as a cron job, but won't try to upload if it's a fork.
2025-09-23 15:08:04 +12:00
Krystine Sherwin 19667dd6f1
CI: Don't use self-hosted runner on forks 2025-09-19 11:43:22 +12:00
Krystine Sherwin 042aff7c77
Bump test-compile to gcc-14 as newest 2025-09-19 11:39:24 +12:00
Krystine Sherwin 7e1292dd2d CI: brew install autoconf for iverilog 2025-09-12 10:41:01 +02:00
Krystine Sherwin f102b25914 Reapply "Merge pull request #5301 from KrystalDelusion/krys/re_5280"
This reverts commit 88eb83a0c3.
2025-09-12 10:41:01 +02:00
Krystine Sherwin 5d59903f36
Bump Windows SDK 2025-09-03 09:32:21 +12:00
Krystine Sherwin 7fb6c1ee52
test-compile.yml: Specify clang-19
Will trigger C++20 builds to run (which are currently failing).
2025-09-03 03:32:00 +12:00
Krystine Sherwin 5db312b6cf
Bump to llvm@20 2025-09-02 11:30:57 +12:00
Krystine Sherwin 2261c7e366
test-compile.yml: Compiler tests for arm mac 2025-09-02 11:25:31 +12:00
Krystine Sherwin 3426905e60
CI: Use brew bundle
Also skip `brew update`.
Specify llvm@20 due to problems with clang-21 and macOS .dylib.
2025-09-02 10:36:55 +12:00
Miodrag Milanovic 88eb83a0c3 Revert "Merge pull request #5301 from KrystalDelusion/krys/re_5280"
This reverts commit c9a602e882, reversing
changes made to 51eaaffe09.
2025-08-28 11:58:02 +02:00
Miodrag Milanović c9a602e882
Merge pull request #5301 from KrystalDelusion/krys/re_5280
Reapply "Workflow adjustments"
2025-08-28 10:51:49 +02:00
Miodrag Milanović 5fd9f54482
Merge pull request #5300 from donn/wheel_fixes
wheels: bison 3.8 on almalinux + memory pressure easing
2025-08-19 11:44:12 +02:00
Krystine Sherwin 1cdf058df4
ci: Fix iverilog version caching 2025-08-19 11:33:05 +12:00
Krystine Sherwin 94d07872e6
test-sanitizers.yml: Build in-tree
Should fix missing `../../yosys-abc`
2025-08-19 11:32:46 +12:00
Krystine Sherwin d63f43acf0
ci: iverilog before yosys 2025-08-19 11:32:42 +12:00
Krystine Sherwin b42be1df80
ci: Fix test-cells 2025-08-19 11:30:16 +12:00
Krystine Sherwin eb773ce071
Reapply "Workflow adjustments"
This reverts commit b640a16b07.
2025-08-19 11:29:53 +12:00
Mohamed Gaber 2ed7a7aac9
wheels: fix PATH variables 2025-08-19 01:28:46 +03:00
Mohamed Gaber 6cbd44daa5
wheels: bison 3.8 on almalinux + memory pressure easing
- cibw now builds and uses bison 3.8.2 explicitly on platforms with no or out-of-date bison — AlmaLinux 8 only goes up to Bison 3.0
- cibw environment now includes `OPTFLAGS=-O3` to avoid generating debug info for abc, saving space in memory during linking
- setup.py attempts to build `yosys-abc` independently first to avoid memory pressure from gigantic abc link step running in parallel with something else
2025-08-18 22:34:15 +03:00
Jannis Harder b640a16b07
Revert "Workflow adjustments" 2025-08-18 20:39:00 +02:00
Miodrag Milanović 1a52a714b4
Merge pull request #5280 from YosysHQ/krys/ci_changes
Workflow adjustments
2025-08-18 10:17:12 +02:00
Miodrag Milanovic 1dbf2df983 Add libfl-dev for CodeQL CI job 2025-08-14 09:15:43 +02:00
Emil J fb024c4d55
Merge pull request #5135 from YosysHQ/emil/ast-ownership
ast, read_verilog: ownership in AST, use C++ styles for parser and lexer
2025-08-12 10:58:12 +02:00
Krystine Sherwin 1e6e25c81f
ci: Use correct build artifact 2025-08-12 12:43:14 +12:00
Krystine Sherwin 0f8c040371
ci: Move SAN into a separate workflow 2025-08-12 12:22:02 +12:00
Krystine Sherwin 73403ad830
ci: Adjust workflow triggers for tests
In light of problems with concurrent skipping, disable it.
Instead, limit the `push` trigger to just main, and enable `workflow_dispatch` for manual triggering.
Don't cancel builds from main if a new commit is pushed.
2025-08-12 12:05:23 +12:00
Krystine Sherwin c630f995d5
ci: Reduce test_cell count and use a seed 2025-08-12 11:17:00 +12:00
Krystine Sherwin ba01f7c64f
ci: Run test_cell
Includes special cases for partially supported cells.
2025-08-12 10:57:59 +12:00
Emil J. Tywoniak cbccc01d38 Revert "CI: bump flex and bison on Windows"
This reverts commit efbc138ced.
2025-08-11 13:34:10 +02:00
Krystine Sherwin 4f824e4223 Sneak FlexLexer.h into VS build 2025-08-11 13:34:10 +02:00
Catherine 8455503a50 CI: fix typo 2025-08-11 13:34:10 +02:00
Catherine 4956d3cce5 CI: install flex for WASI builds. 2025-08-11 13:34:10 +02:00
Emil J. Tywoniak 0ce51029f6 fixup! CI: sneak FlexLexer.h into the WASI sysroot 2025-08-11 13:34:10 +02:00
Emil J. Tywoniak 3ec3afb414 CI: bump flex and bison on Windows 2025-08-11 13:34:10 +02:00
Emil J. Tywoniak f3ebf0557e CI: sneak FlexLexer.h into the WASI sysroot 2025-08-11 13:34:10 +02:00
Krystine Sherwin 2b7b09b81a Add libfl-dev
Should fix the missing `<FlexLexer.h>` error.
2025-08-11 13:34:10 +02:00
KrystalDelusion 6c84c4a4fc
extra-builds.yml: Bump nix 2025-08-09 11:19:24 +12:00
Krystine Sherwin ab403635e3
CI: Enable source tracking for reusable build
The `test-docs-build` jobs require source tracking enabled to prevent warnings-as-errors.
Also add an extra note to the readme in case users run into the same.
2025-08-06 13:52:13 +12:00
Krystine Sherwin 891a907a30
Add and use ENABLE_HELP_SOURCE
Conditionally include help source tracking to preserve ABI.
Docs builds can (and should) use `ENABLE_HELP_SOURCE` so that the generated sphinx docs can perform default grouping and link to source files.
Regular user-builds don't need the source tracking.
2025-08-06 13:52:13 +12:00
Krystine Sherwin 3959d19291
Reapply "Add groups to command reference"
This reverts commit 81f87ce6ed.
2025-08-06 13:52:12 +12:00
Miodrag Milanović 86ef7f7ede
Update wheels to Trusted Publisher 2025-08-04 17:43:03 +02:00
Matt Young 555c08a98a docs: update issues template with Discourse link 2025-08-01 11:30:42 +10:00
N. Engelhardt 81f87ce6ed
Revert "Add groups to command reference" 2025-07-23 14:41:49 +00:00
Krystine Sherwin 4722b07485
Docs: docs/source/cmd is source only
i.e. we don't need to clean it, and we don't need to include it in the docs artifact
2025-07-21 10:34:54 +12:00
Krystine Sherwin e6961d8c9f
CI: Test with ASAN as well
New matrix variable for sanitizer, running `undefined` and `address` separately
(because they are mutually exclusive).  Probably don't need to run both
sanitizers on both os targets, but it's probably fine.
2025-06-28 11:33:18 +12:00
Miodrag Milanovic a5edbc8836 Update CI, windows-2019 is deprecated 2025-06-09 19:07:53 +02:00
Miodrag Milanovic c79379db02 Run wheels each Sunday at 10AM 2025-04-14 15:22:38 +02:00
Miodrag Milanović 9f25f972dc
Merge pull request #5008 from donn/wheel_builds_fix
wheels: fix builds, add linux aarch64 to ci
2025-04-14 15:10:37 +02:00
KrystalDelusion a2e1d0165f
Merge pull request #5016 from YosysHQ/krys/zizmor
CI: Fixes from zizmor
2025-04-12 09:02:59 +12:00
Donn 2bc2105d82 wheels: fix builds, add linux aarch64 to ci
Essentially, something is attempting to build the Yosys EXE when you build libyosys.so now. With `ENABLE_PYTHON_CONFIG_EMBED=0`, the Yosys EXE will always fail to build.

Furthermore, because `ENABLE_PYOSYS` now attempts to build a wheel, building a wheel has become recursive.

This commit uses a supplementary set of libs for the EXE (EXE_LIBS) so it and libyosys.so can be built simultaneously, as well as a new Makefile flag, `ENABLE_WHEEL`, to prevent the aforementioned recursion.

I also enabled aarch64 Linux in the CI because it's publicly available now.
2025-04-09 10:42:40 +02:00
Catherine f5c53a99e7 CI: Sanitize for undefined behavior. 2025-02-03 10:19:19 +01:00
Miodrag Milanovic 6b449970ef test-build: Fix missing bzlib.h 2025-01-20 16:08:42 +01:00
KrystalDelusion 90b1ccf67b
test-compile: Set oldest clang to 10
clang-11 through clang-16 fail under 24.04, but clang-10 works, so we can move that up to the oldest supported and drop the extra target for ubuntu-20.04
2025-01-20 11:57:47 +13:00
KrystalDelusion 2403c406fb
test-compile: Update latest clang
Use clang-19 as latest
2025-01-20 11:21:17 +13:00
KrystalDelusion 37acfce8c4
test-compile: Update oldest clang for 24.04
Oldest clang on 24.04 appears to be 16.
2025-01-20 11:07:40 +13:00
Krystine Sherwin e609a59325
CI: Fixes from zizmor
> A static analysis tool for Github Actions
https://github.com/woodruffw/zizmor

Mostly means adding `persist-credentials: false` to checkouts and replacing `{{ env.VARNAME }}` with shell substitution.
2024-12-12 15:59:16 +13:00
KrystalDelusion 1e0e367aed
test-compile: Drop back to gcc-13 2024-11-26 10:18:09 +13:00
KrystalDelusion 6ff5823d6a
test-compile: Use clang-18 and gcc-14
The 'newest' compilers are actually not all that new, they're just the default for the image.  Instead provide explicit versions.
2024-11-26 09:59:52 +13:00
Emil J c1907ef5b7
Merge pull request #4668 from YosysHQ/emil/vendor-submodules
actions: vendor sources with submodules for releases
2024-10-21 15:37:51 +02:00
Miodrag Milanovic be8c75a3a5 CI: make CI continue even if brew objects 2024-10-18 08:38:36 +02:00
Krystine Sherwin f881ba6200
test-docs-build: Install docs prereqs 2024-10-18 05:38:49 +13:00
Emil J. Tywoniak d29499a10f actions: vendor sources with submodules for releases 2024-10-17 00:11:10 +02:00
Krystine Sherwin d1c6699125
test-docs-build: Use fast runner 2024-10-17 07:15:11 +13:00
Krystine Sherwin 5d14c3017e
test-build.yml: Add test-docs-build
Try use self hosted linux runner to build html and latexpdf to check for errors.
Trying to use the build artifact didn't seem to work, so just run it on its own.
Upload docs/build folder as artifact to enable review without having to build
locally.  Note: doesn't include verific, so will differ slightly from final
published docs.
2024-10-17 06:10:12 +13:00
Krystine Sherwin c93fd54e43
ci: Install docs/reqs (namely, furo-ys) 2024-10-15 11:37:52 +13:00
Miodrag Milanović ecec156965
Merge pull request #4643 from donn/fix_wheels
wheels: fix missing yosys-abc/share directory
2024-10-09 18:05:58 +02:00
Miodrag Milanovic a6ccf22047 force brew formula update 2024-10-09 14:09:10 +02:00
Mohamed Gaber 3d6b8b8e1a
wheels: fix missing yosys-abc/share directory
* `misc/__init__.py`:
  * checks if there's a `yosys-abc` in the same directory - if yes, sets the variable `sys._pyosys_abc`
  * checks if there's a `share` in the same directory - if yes, sets the variable `sys._pyosys_share_dirname`
* `yosys.cc::init_share_dirname`: check for `sys._pyosys_share_dirname`, use it at the highest priority if Python is enabled
* `yosys.cc::init_abc_executable_name`: check for `sys._pyosys_abc`, use it at at the highest priority if Python is enabled
* `Makefile`: add new target, `share`, to only create the extra targets
* `setup.py`: compile libyosys.so, yosys-abc and share, and copy them all as part of the pyosys build
* `test/arch/ecp5/add_sub.py`: ported `add_sub.ys` to Python to act as a test for the share directory and abc with Python wheels, used in CI
2024-10-09 13:09:14 +03:00
Miodrag Milanovic c93c7f8307 CI: lld is now separate brew package 2024-10-09 09:50:36 +02:00
Miodrag Milanović 535b3304cc
Merge pull request #4534 from donn/test_wheels
Pyosys Wheels
2024-10-08 11:24:16 +02:00
Krystine Sherwin c1604424aa
ci: Call make html directly
Since `docs/prep` is a prerequisite of `docs`, and should be the *only* prerequisite, calling `make docs` could end up hiding a problem with files missing from the uploaded artifact. Instead, call `make` from the docs directory which should be closer to what will run on RTDs.
2024-10-08 08:11:35 +13:00
Krystine Sherwin b15103625b
ci: Switch test build docs to our runner 2024-10-08 07:49:14 +13:00
Mohamed Gaber d7cf0238fd
wheels: properly migrate to artifact@v4 2024-10-07 20:17:05 +03:00
Mohamed Gaber 0bb1f899e8
wheels: convert versions to match pypa spec, add uploading
* wheel versions now replace `+` with `.post` to match spec at https://packaging.python.org/en/latest/specifications/version-specifiers/
* CI updates:
  * Bump action versions
  * Disabled Windows for now and documented why
  * Added a new job to upload all wheels
  * Added new variable, `PYPI_INDEX`: fallback 'https://pypi.org/' if unset
  * Added new secret, `PYPI_TOKEN`
* .editorconfig now uses 2 spaces for YML (it kept setting mine to tabs
  and GitHub Actions doesn't like that)
2024-10-07 16:39:54 +03:00
Mohamed Gaber 08c23b7632
wheels: skip musllinux for now 2024-10-07 16:39:54 +03:00
Mohamed Gaber 67f17a1c97
wheels: symlink python3-config 2024-10-07 16:39:54 +03:00