3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-16 04:05:42 +00:00
Commit graph

5052 commits

Author SHA1 Message Date
Akash Levy
045e7a83c8 Bump abc for multi-threading 2025-09-15 11:17:04 -07:00
Robert O'Callahan
ae0ca7578a Use a pool of ABC processes.
Doing ABC runs in parallel can actually make things slower when every ABC run requires
spawning an ABC subprocess --- especially when using popen(), which on glibc does not
use vfork(). What seems to happen is that constant fork()ing keeps making the main
process data pages copy-on-write, so the main process code that is setting up each ABC
call takes a lot of minor page-faults, slowing it down.

The solution is pretty straightforward although a little tricky to implement.
We just reuse ABC subprocesses. Instead of passing the ABC script name on the command
line, we spawn an ABC REPL and pipe a command into it to source the script. When that's
done we echo an `ABC_DONE` token instead of exiting. Yosys then puts the ABC process
onto a stack which we can pull from the next time we do an ABC run.

For one of our large designs, this is an additional 5x speedup of the primary AbcPass.
It does 5155 ABC runs, all very small; runtime of the AbcPass goes from 760s to 149s
(not very scientific benchmarking but the effect size is large).
2025-09-15 17:22:15 +02: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
Robert O'Callahan
38f8165c80 Remove direct RTLIL access from gate_t 2025-09-15 17:10:20 +02:00
Robert O'Callahan
222f457a04 Only write out stdcells/lutcosts once for all ABC runs 2025-09-15 17:10:07 +02:00
Akash Levy
1f9013aad0
Merge branch 'YosysHQ:main' into main 2025-09-15 08:04:00 -07:00
Robert O'Callahan
13b3418a7f Split abc_module() into prepare_module() and run_abc()
`prepare_module()` will have to run on the main thread.
2025-09-15 17:01:25 +02:00
Claire Xen
a2fc7e4dd7
Merge pull request #4252 from zapta/master
Added to the Show command a -wireshape <graphviz-shape> flag.
2025-09-15 15:40:40 +02:00
Akash Levy
f5cb0c328f Bump Yosys to latest 2025-09-13 04:35:52 -07:00
Jannis Harder
dd9627ed05
Merge pull request #5336 from rocallahan/remove-log-cstr
Remove `.c_str()` calls from `log()`/`log_error()`
2025-09-12 14:09:48 +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
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
f39d78c69f Smallfixes 2025-09-11 05:02:58 -07:00
Akash Levy
b1f4d0d8aa Small adjustments 2025-09-11 04:47:28 -07:00
Akash Levy
b70aeea35c Fixups 2025-09-11 04:37:00 -07:00
Akash Levy
c1557950ef Support external fanout for addsub_c 2025-09-11 03:48:14 -07:00
Akash Levy
ccf3909982 Initial implementation of addsub_c with no intermediate fanout allowed 2025-09-11 03:28:50 -07:00
Akash Levy
a43de44f9d Merge upstream changes 2025-09-10 23:02:15 -07:00
Akash Levy
f2aa7cc65b Reduce verbosity of opt_balance_tree 2025-09-10 06:07:15 -07:00
Akash Levy
41dfe4fc61 Run toposort in both directions for better results 2025-09-09 07:45:25 -07:00
Akash Levy
2d5c16b798
Merge branch 'YosysHQ:main' into main 2025-09-09 06:51:28 -07:00
Robert O'Callahan
66d2c2af08 Make log_header() use variadic templates. 2025-09-09 15:41:03 +02:00
Robert O'Callahan
d34ac0c87d Make log() use the FmtString infrastructure.
Now `log()` supports `std::string`.

We have to fix a few places where the format parameter was not a compile time constant.
This is mostly trivial.
2025-09-09 15:41:03 +02:00
Akash Levy
1b3375d8df Merge upstream in 2025-09-09 05:50:48 -07:00
Akash Levy
eb4539f151 Smallfixes 2025-09-09 04:50:57 -07:00
Akash Levy
6fc38e15a1
Update passes/silimate/opt_balance_tree.cc
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2025-09-09 04:47:28 -07:00
Jannis Harder
61a00b9131 memory_libmap: Fix use of uninitialized value for async read ports
The code in memory_libmap expects `clk_en` to be initialized for all
`PortVariant`s but the parsing in memlib.cc didn't initialize it for
variants of kind `PortKind::Ar` (async read ports).

While this fixes the immediate CI failure, it would be best to refactor
the code so it becomes obvious if something isn't initialized.
2025-09-09 13:32:46 +02:00
Akash Levy
b7a4ce8b42 Fix opt balance tree and wreduce 2025-09-09 04:32:15 -07:00
Jannis Harder
b6db32873d Add IdString const &id_string() const to StaticIdString and IdString
The vast majority of ID(...) uses are in a context that is overloaded
for StaticIdString or will cause implicit conversion to an IdString
constant reference. For some sufficently overloaded contexts, implicit
conversion may fail, so it's useful to have a method to force obtaining
a `IdString const &` from an ID(...) use.

When turning all literal IdStrings of the codebase into StaticIdStrings
this was needed in exactly one place, for which this commit adds an
`id_string()` call.
2025-09-09 09:56:55 +12:00
Jannis Harder
3d14108a96
Merge pull request #5323 from rocallahan/IdString-references
Pass `IdString` by reference in more places
2025-09-08 20:40:24 +02:00
Jannis Harder
c468ee7add
Merge pull request #5304 from rocallahan/idstring-stringf
Support `IdString` parameters in `stringf()` and remove `.c_str()` in a lot of places
2025-09-08 20:29:20 +02:00
Emil J
80582e02b0
Merge pull request #5317 from donn/libparse_error_weak
libparse/filterlib: mark LibertyParser::error() as weak
2025-09-08 19:59:08 +02:00
Akash Levy
8204fd1d0b Update Yosys to latest 2025-09-06 16:49:39 -07:00
Mohamed Gaber
ae8c4e2ea6 libparse/filterlib: mark LibertyParser::error() as weak
When FILTERLIB is defined (attempts to compile libparse more or less standalone,) mark the `LibertyParser::error()` as weak so utilities using libparse as a library can override its behavior (the default behavior being exit(1)). As the code is quite performance-critical, I've elected to not modify it to raise an exception or have a callback or similar and simply allow for a link-time replacement.
2025-09-05 00:13:45 +02:00
Mike Inouye
6276464ea7
Increase muxtree glob eval attempts to 10M. 2025-09-04 10:52:37 -07:00
Robert O'Callahan
54a258f854 In hash_cell_inputs, avoid constructing an std::pair (which requires copying the port IdString) 2025-09-04 14:17:08 +02:00
Krystine Sherwin
d70f132792
wrapcell.cc: Avoid format name collision 2025-09-03 03:32:01 +12:00
Robert O'Callahan
c7df6954b9 Remove .c_str() from stringf parameters 2025-09-01 23:34:42 +00:00
Emil J
5aa71505fc
Merge pull request #5287 from Anhijkt/opt_dff-fix-5279
opt_dff: fix timeout issue
2025-09-01 11:20:35 +02: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
Akash Levy
dc52f6ca1c
Merge branch 'YosysHQ:main' into main 2025-08-27 11:10:13 -07:00
Emil J
c5d096b7b8
Merge pull request #5308 from YosysHQ/emil/opt_muxtree-refactor
opt_muxtree: refactor
2025-08-25 16:48:01 +02:00
Emil J. Tywoniak
b45e5854bf opt_muxtree: comment wording 2025-08-25 16:36:07 +02:00
Akash Levy
4029034ce3 Fix issue with $mux in abc 2025-08-22 08:35:10 -07:00
Akash Levy
e54fa487b8 Merge from upstream 2025-08-21 17:56:55 -07:00
Akash Levy
3ed5da8c9e Fix clock gate naming 2025-08-21 12:59:03 -07:00
Emil J. Tywoniak
4dea774171 opt_muxtree: refactor 2025-08-21 12:52:22 +02:00
Robert O'Callahan
8c04e5266c Use commutative hashing instead of expensive allocation and sorting
For one of our large circuits, this improves the `OptMergePass` runtime
from about 150s to about 130s. It's also simpler code.
2025-08-20 19:35:22 +00:00
Robert O'Callahan
7d0ea0d64f Refactor call to sorted_pmux_in to avoid copying the connection dictionary 2025-08-20 19:35:22 +00:00