Commit Graph

103 Commits

Author SHA1 Message Date
Akash Levy 77be4d7be7 Bump Yosys to latest 2025-08-07 17:22:25 -07:00
KrystalDelusion 4230c2712f
Merge pull request #5269 from georgerennie/george/pyosys_source_location
pyosys: support trailing defaulted source_location arguments
2025-08-07 11:50:06 +12:00
Lofty 2298a2aa86
Merge pull request #4750 from georgerennie/george/pyosys_dereference
pyosys: dereference cpp objects when constructing a tuple
2025-08-06 22:03:03 +01:00
George Rennie 46a711d566 py_wrap_generator.py: support srd::source_location as trailing default argument 2025-08-06 21:38:03 +01:00
George Rennie b610afbc1b py_wrap_generator.py: whitespace 2025-08-06 21:37:28 +01:00
Akash Levy ba921e35ab Fix NamedObject issue 2025-04-10 15:04:02 -07:00
Akash Levy de375d6542 Accommodate reversion and fix wreduce naming 2025-04-07 07:35:39 -07:00
Akash Levy 5a6b7e1e91 Add NamedObject to py_wrap_generator 2025-04-06 22:54:14 -07:00
Akash Levy f86204b8ba Fix pyosys for NamedObject 2025-04-06 22:52:59 -07:00
Akash Levy 439d859bba
Merge branch 'YosysHQ:main' into main 2025-04-03 10:48:42 -07:00
Miodrag Milanovic 66d7ffb2c5 yosys-config: redirect to stderr/stdout depending of exit code 2025-04-01 08:39:11 +02:00
Miodrag Milanovic 58a515d57f yosys-config: Propagate exit code for help command 2025-03-31 16:19:45 +02:00
Akash Levy 1dcf75d175 Sync 2024-12-19 21:40:30 -08:00
Emil J. Tywoniak db04788c18 hashlib: fix pyosys 2024-12-18 14:58:31 +01:00
Akash Levy f855b39dbb
Merge branch 'YosysHQ:main' into main 2024-11-21 00:34:49 -08:00
George Rennie 18b616578a pyosys: catch boost::python::error_already_set
* This catches exceptions from internal passes, printing them in a
  readable manner where the user would otherwise see an unspecified
  boost exception
2024-11-20 17:54:11 +01:00
Emil J da8c8b4fd0
Merge pull request #4701 from georgerennie/george/pyosys_noreturn_attrs
pyosys generator: ignore attributes
2024-11-20 13:33:33 +01:00
George Rennie 583eb1addb pyosys: dereference cpp objects when constructing a tuple
* This fixes a bug where when converting a tuple from python to c++,
  get_cpp_obj() was called (returning a pointer) without dereferencing
  the pointer to get the underlying object
2024-11-15 15:18:18 +01:00
Akash Levy ea76abdaee Merge 2024-11-11 11:47:58 -08:00
George Rennie 84ee345071 pyosys: support ObjRange
* this adds support for cells(), modules() and wires() that all return
  ObjRanges, converting them into lists for python
2024-11-04 16:00:01 +01:00
George Rennie de728c9824 pyosys generator: ignore attributes
* this allows log_error, log_file_error and log_cmd_error which are all
  marked [[noreturn]] to be supported
2024-11-04 14:08:57 +01:00
Akash Levy 79507ce4ad
Merge branch 'YosysHQ:main' into main 2024-10-23 10:57:46 -07:00
Emil J d1695ad998
Merge pull request #4666 from thorpej/dev/pkgsrc-patch-NetBSD-2
misc/yosys-config.in: don't use the non-portable '==' operator with test(1)
2024-10-22 13:10:52 +02:00
Akash Levy 0ddf964554
Merge branch 'YosysHQ:main' into main 2024-10-18 05:33:40 -07:00
Emil J. Tywoniak d5aadeae3b py_wrap: remove some debug statements 2024-10-18 11:18:34 +02:00
Emil J. Tywoniak f219bb357f py_wrap: kinda fixed 2024-10-16 23:12:41 +02:00
Emil J. Tywoniak 86630bba08 py_wrap: nested classes 2024-10-16 22:55:17 +02:00
Emil J. Tywoniak 4b9c135098 py_wrap: refactor nesting_delta 2024-10-16 22:46:23 +02:00
Akash Levy ab05f03b70 Hacky pyosys workaround til Yosys fixes the issue 2024-10-15 03:20:15 -07:00
Jason Thorpe f75b1e838c misc/yosys-config.in: don't use the non-portable '==' operator with
test(1).
2024-10-14 16:06:34 -07:00
Akash Levy 0ac341acf2 Merge latest and update yosys-slang dep 2024-10-09 15:34:02 -07: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
Akash Levy 8c43571fea
Merge branch 'YosysHQ:main' into master 2024-07-09 17:57:51 -07:00
Miodrag Milanovic 130dee6e56 Use alternate location for VS build required files 2024-07-09 14:19:33 +02:00
Akash Levy 0596766cbd Merge upstream yosys changes 2024-07-01 18:33:38 -07:00
Akash Levy fee4caafb7 Don't display on stdout in py_wrap_generator when using log_to_stream 2024-07-01 02:29:49 -07:00
Miodrag Milanovic 2bbf3112d9 Update VS build to C++17 build 2024-06-17 17:29:20 +02:00
akash 19dbde2891 Merge commit 2024-03-29 19:30:48 -07:00
Rui Chen b57a803f60
chore: fix master branch refs
Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-03-24 00:41:54 -04:00
Roland Coeurjoly 5fa609b6bf Fix help of yosys-config.in and provide backward compatibility 2024-02-25 18:48:21 +01:00
Roland Coeurjoly cf7b6c66f0 Changes in misc/yosys-config.in. LDLIBS -> LIBS. LDFLAGS -> LINKFLAGS. 2024-02-25 18:35:43 +01:00
Martin Povišer 57db87c99f py_wrap_generator: Handle const-qualified callbacks 2024-02-05 17:25:55 +01:00
Martin Povišer bd06338172 py_wrap_generator: Fix handling of method name collisions
If two methods have the same signature but for qualifiers the Python
binding doesn't care about ('const'), do not generate a mangled name for
the method.

Fixes

    .def<Wire (Module::*)(const IdString* )>("wire__YOSYS_NAMESPACE_RTLIL_IdString", &Module::wire__YOSYS_NAMESPACE_RTLIL_IdString)
    .def<Cell (Module::*)(const IdString* )>("cell__YOSYS_NAMESPACE_RTLIL_IdString", &Module::cell__YOSYS_NAMESPACE_RTLIL_IdString)

in the output after the previous change.
2023-04-05 13:36:44 +02:00
Martin Povišer f94f544b50 Fix the python generator for a bunch of const cases
Makes the below show up in the binding.

    .def<const char * (IdString::*)(void)>("c_str", &IdString::c_str)

    .def<boost::python::list (SigSpec::*)(void)>("chunks", &SigSpec::chunks)
    .def<boost::python::list (SigSpec::*)(void)>("bits", &SigSpec::bits)
    .def<SigBit (SigSpec::*)(int, const SigBit* )>("at", &SigSpec::at)

    .def<SigSpec (Cell::*)(const IdString* )>("getPort", &Cell::getPort)
    .def<boost::python::dict (Cell::*)(void)>("connections", &Cell::connections)
    .def<Const (Cell::*)(const IdString* )>("getParam", &Cell::getParam)

    .def<boost::python::list (Module::*)(void)>("connections", &Module::connections)

    def<const char * (*)(const SigSpec* )>("log_signal", YOSYS_PYTHON::log_signal);
    def<const char * (*)(const SigSpec* , bool)>("log_signal", YOSYS_PYTHON::log_signal);
    def<const char * (*)(const Const* )>("log_const", YOSYS_PYTHON::log_const);
    def<const char * (*)(const Const* , bool)>("log_const", YOSYS_PYTHON::log_const);
    def<const char * (*)(const IdString* )>("log_id", YOSYS_PYTHON::log_id);
2023-04-05 13:36:44 +02:00
Aki Van Ness 7a73133c9f
backends: protobuf: removed protobuf backend 2022-10-10 10:41:11 -04:00
Henner Zeller f09bf58b6e Fix hard-coded path to /bin/bash -> /usr/bin/env bash
On Posix systems, the path /bin/bash is not guaranteed to
exist and it is more portable to use /usr/bin/env instead.

Fixing this for yosys-config with is the most important for
a functioning installation.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2022-09-24 22:52:42 -07:00
Aki Van Ness e3074c044a
misc: Added JNY schema definition 2022-08-02 07:23:45 -04:00
Miodrag Milanović 63c9c9be5c
Merge pull request #3011 from DanielHuisman/pr-1
Update WaveDrom script URLs in YosysJS demo
2022-05-25 17:34:19 +02:00
Miodrag Milanović 62b89bb0d4
Update URL to zlib 2022-03-28 11:05:30 +02:00
Miodrag Milanovic 4a30c9cb94 Fix Visual Studio build 2022-02-02 11:46:06 +01:00