Commit Graph
33 Commits
Author SHA1 Message Date
Mohamed Gaber 1ded625f0f wheels: fix cmake argument passing
- use CIBW_CONFIG_SETTINGS to pass cmake options
- disable homebrew for wheel build - bison is set explicitly
- update cmake option parsing to use shlex so multiple arguments can be provided
- use common CIBW environment (MACOSX_DEPLOYMENT_TARGET has no effect on linux)
2026-10-01 13:32:09 +02:00
Miodrag Milanovic 18239a6fbb logger: add LogSourceLocation 2026-09-15 14:29:36 +02:00
Emil J 5274c96506 Merge pull request #6161 from YosysHQ/emil/remove-dead-bindings
rtlil: remove dead verilog bindings
2026-09-09 16:51:35 +00:00
Miodrag Milanović 28b7a17675 Merge pull request #6115 from YosysHQ/log-sink
log rewrite [sc-748]
2026-09-02 13:03:29 +00:00
Emil J. Tywoniak fbd7c249ec rtlil: remove dead verilog bindings 2026-08-31 22:13:01 +02:00
Miodrag Milanovic 726aff678f log: remove log_ prefix and unified some namings 2026-08-31 11:20:21 +02:00
tangxifan 02dc5a82d7 [core] add a cmake option to disable unit test during compilation; Use cmake_current_source for submodule integration
[core] debug yosys version extraction

[core] debug

[core] now cache the cmake source dir

[core] debug

[core] debug kernel dependencies

[core] debug common include directories

[core] debug

[core] debug simlib_help.inc

[core] debug pmgen py path in cmake

[core] syntax

[core] debug flex source

[core] restore

[core] debug executable output as it now shows linking to .

[core] debug yosys-abc directory

[core] debug cmake share directory

[core] debug yosys abc

[core] restore shared directory location as yosys requires fixed location

[core] rework link target to yosys sub dir under build

[core] fixed the bug on yosys-config.install location for install

[core] cmake syntax

[core] correct the location for share directory

[core] debug

[core] debug

[core] debug

[core] enforce internal attributes; rename the YOSYS_ENABLE_UNIT_TESTS; use YOSYS_CMAKE_BINARY_DIR for all

[core] apply review comments

[core] rename

[core] change all the CMAKE_BINARY_DIR to YOSYS_CMAKE_BINARY_DIR

[core] replace CMAKE_SOURCE_DIR to YOSYS_CMAKE_SOURCE_DIR
2026-08-21 12:09:04 -07:00
Miodrag Milanovic 14f85ce38e log: updating review point 2026-08-21 13:25:47 +02:00
Miodrag Milanovic ec80d539e1 log: fix pyosys wrapper for added format 2026-08-21 09:54:41 +02:00
Miodrag Milanovic bd1c3942aa log: remove non-useful/non-used functionality 2026-08-20 15:19:36 +02:00
Miodrag Milanovic f63d90003e log: not needed anymore after using singleton 2026-08-20 09:16:28 +02:00
Miodrag Milanovic 2e113f5eff log: create LogManager singleton and move implementation 2026-08-19 15:59:46 +02:00
Miodrag Milanovic b17b5a19e0 log: fix some functionality and wrappers 2026-08-14 12:23:25 +02:00
Miodrag Milanovic 14afc00862 log: Refactor code a bit more 2026-08-13 09:22:01 +02:00
Michael Baier 1dbefdbd49 Modified pyosys generator.py to support constexpr 2026-07-09 16:32:01 +02:00
CatherineandMohamed Gaber 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 <[email protected]>
2026-06-03 09:03:23 +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 1ef6311e5b Update documentation and few more defines 2026-05-13 11:24:45 +02:00
Natalia b43c96b03d fix pyosys Design.run_pass binding to use Pass::call signature 2026-01-18 02:24:36 -08:00
Natalia cf511628b0 modify generator for pyosys/wrappers.cc instead of headers 2026-01-18 02:11:09 -08:00
Robert O'Callahan 46cb05c471 Pass IdString by value instead of by const reference.
When IdString refcounting was expensive, it made sense to pass it by const reference
instead of by value, to avoid refcount churn. Now that IdString is not refcounted,
it's slightly more efficient to pass it by value.
2025-12-22 01:52:59 +00:00
Robert O'Callahan b23dc345ae Make it safe to access .c_str() for autoidx IDs in a multithreaded context 2025-11-25 22:49:41 +00:00
Mohamed Gaber 58e831486d pyosys: __getitem__ for supported classes
- functions that have a const `[]` operator method now support `__getitem__` in Python
- fields of a pointer type now return a `reference_internal` instead of a `copy` because classes referenced to by pointers typically aren't copyable (e.g. RTLIL::Wire, RTLIL::Module, etc)
- removed duplicate of test_script.py
2025-11-19 18:09:41 +02:00
Miodrag Milanovic 10b49f3a91 Update generator to reflect IdString changes 2025-11-13 16:17:53 +01:00
Robert O'Callahan e95ed7bbab Make NEW_ID create IDs whose string allocation is delayed 2025-11-12 11:52:04 +01:00
Mohamed Gaber e29328ec99 hotfix: workaround for pyosys build failure
temporarily exclude `SigSpec::chunks` from the interface until nested structs/classes are supported
2025-11-11 13:48:35 +02:00
Mohamed Gaber d6b9158fa3 pyosys: fix regressions from 0.58
- consistently use value semantics for objects passed along FFI boundary
  (not ideal but matches previous behavior)
- add new overload of RTLIL::Module: addMemory that does not require a "donor" object
  - the idea is `Module`, `Memory`, `Wire`, `Cell` and `Process` cannot be directly constructed in Python and can only be added to the existing memory hierarchy in `Design` using the `add` methods - `Memory` requiring a donor object was the odd one out here
- fix superclass member wrapping only looking at direct superclass for inheritance instead of recursively checking superclasses
- fix superclass member wrapping not using superclass's denylists
- fix Design's `__str__` function not returning a string
- fix the generator crashing if there's any `std::function` in a header
- misc: add a crude `__repr__` based on `__str__`
2025-10-26 02:21:40 +03:00
Mohamed Gaber 80fcce64da pyosys: fix ref-only classes, implicit conversions
+ cleanup
2025-10-03 11:54:44 +03:00
Mohamed Gaber c8404bf86b pyosys/hashlib: equivalence operators 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 384f7431fd pyosys: rewrite wrapper generator
[skip ci]
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