3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-15 19:55:41 +00:00
Commit graph

243 commits

Author SHA1 Message Date
Mohamed Gaber
e58125b605
Merge remote-tracking branch 'upstream/main' into silimate 2026-06-09 16:22:51 +03:00
Catherine
afc0e78d11 Update top-level Python project for CMake compatibility.
This commit reimplements the (no longer recommended) setuptools based
build system using a standards-based in-tree PEP517 build backend.
The implementation is partially based on
  https://codeberg.org/ziglang/zig-pypi/src/branch/main/make_wheels.py
which is licensed under BSD-0-clause.

It also adds a new option `YOSYS_BUILD_PYTHON_ONLY` that is available
only if the binary or the library aren't going to be installed, which
turns off these targets entirely, as well as some dependent ones
(e.g. tests).

Co-authored-by: Mohamed Gaber <me@donn.website>
2026-06-03 09:03:23 +00:00
Catherine
0d15cb55bf Fix Windows portability issues that break MSVC build. 2026-06-03 08:58:11 +00:00
Catherine
a727e7f6e7 Migrate build system to CMake
See #5895 for details.

This commit does not include CI or documentation changes.
2026-06-03 08:58:10 +00:00
Miodrag Milanovic
75dcbe03c6 Convert RTLIL::unescape_id of IdString to unescape() 2026-05-16 19:49:45 +02:00
Codexplorer
e41b969da2 Refactored uses of log_id() 2026-05-08 20:59:24 -07:00
Petter Reinholdtsen
89d360aa4a Rewrote Linux edition of proc_self_dirname() to handle any symlink length.
This make sure the method work also when the program is located in
deep or long file paths, longer than both PATH_MAX and "getconf
PATH_MAX .".  Use the same code on GNU Hurd, where it now work.

I am not sure how to test this in a platform independent way.
2026-04-19 20:56:05 +02:00
Emil J. Tywoniak
5216d32d1b yosys: use newcelltypes for yosys_celltypes 2026-03-04 12:22:47 +01:00
Akash Levy
a121255f47
Merge branch 'YosysHQ:main' into main 2026-01-13 11:28:34 -08:00
Miodrag Milanovic
0e6973037d Update year in banner and license 2026-01-13 14:23:51 +01:00
Akash Levy
4a25f63699 Merge from upstream 2025-11-29 11:53:48 -05:00
Robert O'Callahan
8f0ecce53f Forbid creating IdStrings and incrementing autoidx during multithreaded phases, and add dynamic checks for that
We could make it safe to increment autoidx during multithreaded passes, but that's
actually undesirable because it would lead to nondeterminism. If/when we need new
IDs during parallel passes, we'll have to figure out how to allocate them in a
deterministic way, and that will depend on the details of what the pass does.
So don't try to tackle that now.
2025-11-25 21:57:46 +00:00
Akash Levy
a705042d2e
Merge branch 'YosysHQ:main' into main 2025-11-20 23:05:40 -05:00
Emil J. Tywoniak
5a798b64ef sdc: separate out 2025-11-19 15:25:22 +01:00
Emil Jiří Tywoniak
c281bac461 sdc: add initial stubbed demo 2025-11-19 15:25:03 +01:00
Akash Levy
a90a5e10d6
Merge branch 'YosysHQ:main' into main 2025-11-18 11:48:04 -05:00
Emil J. Tywoniak
65d7d70507 driver: move IdString collection to yosys_shutdown 2025-11-14 15:31:45 +01:00
Akash Levy
71586d39b0 Merge from upstream 2025-11-12 08:14:33 -08:00
Robert O'Callahan
e95ed7bbab Make NEW_ID create IDs whose string allocation is delayed 2025-11-12 11:52:04 +01:00
Robert O'Callahan
9577a028c8 Make new_id/new_id_suffix taking string_view to avoid allocating strings 2025-11-12 11:52:04 +01:00
Mohamed Gaber
dec28f65ae
Merge remote-tracking branch 'donn/pyosys_bugfixes' into merge_pybind11 2025-10-26 02:39:43 +03: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
54799bb8be
pyosys: globals, set operators for opaque types
There is so much templating going on that compiling wrappers.cc now takes 1m1.668s on an Apple M4…
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
Akash Levy
045e7a83c8 Bump abc for multi-threading 2025-09-15 11:17:04 -07:00
Robert O'Callahan
27462da208 Run ABCs in parallel.
Large circuits can run hundreds or thousands of ABCs in a single AbcPass.
For some circuits, some of those ABC runs can run for hundreds of seconds.
Running ABCs in parallel with each other and in parallel with main-thread
processing (reading and writing BLIF files, copying ABC BLIF output into
the design) can give large speedups.
2025-09-15 17:18:42 +02:00
Akash Levy
f5cb0c328f Bump Yosys to latest 2025-09-13 04:35:52 -07:00
Robert O'Callahan
e0ae7b7af4 Remove .c_str() calls from log()/log_error()
There are some leftovers, but this is an easy regex-based approach that removes most of them.
2025-09-11 20:59:37 +00:00
Akash Levy
1b3375d8df Merge upstream in 2025-09-09 05:50:48 -07:00
Jannis Harder
a97381448a Ensure static IdStrings get prepopulated when initializing yosys
An alternative would be to call ensure_prepopulated() in various
IdString methods.
2025-09-09 09:56:55 +12:00
Robert O'Callahan
23af52c3c8 Use well-known constants in ID macro and make the constant values known at compile time 2025-09-09 09:56:55 +12:00
Robert O'Callahan
c7df6954b9 Remove .c_str() from stringf parameters 2025-09-01 23:34:42 +00:00
Akash Levy
faaac21ec8 Merge from upstream 2025-06-25 22:11:00 -07:00
RonxBulld
d079240d38
Allows calling yosys_shutdown and then yosys_setup to restart. 2025-06-07 22:21:09 +08:00
Akash Levy
13e053fb11 Fixups 2025-05-12 14:49:37 -07:00
Akash Levy
aeed1ddb74 Update from upstream 2025-05-11 15:16:52 -07:00
Emil J. Tywoniak
b05c0c70af io: don't accept a directory when file expected 2025-05-09 22:33:30 +02:00
Emil J. Tywoniak
90a2c92370 driver: allow --no-version still write things like Generated by Yosys 2025-05-07 11:34:23 +02:00
Emil J. Tywoniak
d7affb8821 driver: add --no-version to suppress writing Yosys version in command outputs 2025-05-05 13:12:08 +02:00
Akash Levy
e241c9d513
Merge branch 'YosysHQ:main' into main 2025-04-10 14:28:10 -07:00
Krystine Sherwin
cd3b914132
Reinstate #4768
Revert the reversion so that we can fix the bugs that the PR missed.
2025-04-08 11:58:05 +12:00
Akash Levy
06c614a010
Merge branch 'YosysHQ:main' into main 2025-04-07 07:28:06 -07:00
Miodrag Milanović
d49364d96f
Revert "Refactor full_selection" 2025-04-07 12:11:55 +02:00
Akash Levy
0dab4308a3 Actual merge here 2025-04-06 18:53:43 -07:00
KrystalDelusion
98d4355b82
Merge pull request #4768 from YosysHQ/krys/refactor_selections
Refactor full_selection
2025-04-05 14:15:27 +13:00
Akash Levy
95f489beec Merge nice gzip refactor 2025-03-20 16:47:12 -07:00
Emil J. Tywoniak
4f3fdc8457 io: refactor string and file work into new unit 2025-03-19 13:43:42 +01:00
Krystine Sherwin
add5eba9b2
Design::selection_stack should never be empty
Add a `log_assert` for it in `Design::check()`.
Remove unneeded checks in other places.
2025-03-14 14:08:16 +13:00
Krystine Sherwin
dac2bb7d4d
Use selection helpers
Catch more uses of selection constructor without assigning a design.
2025-03-14 14:08:13 +13:00