3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-10-09 09:21:58 +00:00
Commit graph

5 commits

Author SHA1 Message Date
Mohamed Gaber
93fae3c606
docs: write small guide for using pyosys 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
Martin Povišer
44c72e5223 python: Fix import in plugin example
When a plugin is being loaded from Python source, the binding will be
available under

    import libyosys

That is unfortunately different from how a self-standing Python program
would import the Yosys interface, which is

    from pyosys import libyosys

Until that is made consistent, at least fix the example to have it
working as is.
2023-12-07 14:32:29 +01:00
Benedikt Tutzer
539a7f3fbc Added cell_stats example 2019-04-03 11:24:50 +02:00
Benedikt Tutzer
c151bb31eb Added sample code for python-api 2018-12-11 08:13:42 +01:00