3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-09-23 18:01:29 +00:00
Commit graph

4597 commits

Author SHA1 Message Date
Jannis Harder
b95549b469
Merge pull request #5348 from rocallahan/remove-string_buf
Remove `string_buf` by making `log_signal()` and `log_const()` return `std::string`
2025-09-16 20:20:56 +02:00
Robert O'Callahan
7f247fb125 Update passes/hierarchy to avoid bits() 2025-09-16 03:17:23 +00:00
Robert O'Callahan
159ca3ba56 Update passes/tests to avoid bits() 2025-09-16 03:17:23 +00:00
Robert O'Callahan
8cc86b2643 Update passes/techmap to avoid bits() 2025-09-16 03:17:23 +00:00
Robert O'Callahan
d1642bf510 Update passes/sat to avoid bits() 2025-09-16 03:17:23 +00:00
Robert O'Callahan
2d5ce8c363 Update passes/proc to avoid bits() 2025-09-16 03:17:23 +00:00
Robert O'Callahan
5600eb2e5b Update passes/opt to avoid bits() 2025-09-16 03:17:23 +00:00
Robert O'Callahan
23f196a3b8 Update passes/memory to avoid bits() 2025-09-16 03:17:23 +00:00
Robert O'Callahan
e1d0c010ef Update passes/fsm to avoid bits() 2025-09-16 03:17:23 +00:00
Robert O'Callahan
1b589b065d Update passes/cmds to avoid bits() 2025-09-16 03:17:23 +00:00
Robert O'Callahan
8492c49f6c Remove string_buf by making log_signal() and log_const() return std::string
We only have to fix one caller in-tree so this probably has very low impact on out-of-tree plugins.

Resolves #5215
2025-09-16 03:06:17 +00: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
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
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
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
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
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
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
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
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
Emil J
025d7a5641
Merge pull request #5290 from rocallahan/opt-mux-perf
Make `OptMuxtreePass` int-indexed vectors into hashtables
2025-08-20 20:00:26 +02:00
Jannis Harder
c9ad7b7ad0
Merge pull request #5284 from jix/fix_5282
check: Limit detailed cell edge checking for $pmux and $bmux
2025-08-20 14:27:19 +02:00
Krystine Sherwin
3ca2b7951f
memlib: Fix ubsan 2025-08-19 17:05:51 +12:00
Jannis Harder
7c409e2d5a
Merge pull request #5285 from jix/abstract_initstates
abstract: Add -initstates option
2025-08-18 15:39:09 +02:00
Emil J
f0ccc65820
Merge pull request #5297 from rocallahan/redundant-assignmap
Remove redundant construction of `assign_map`.
2025-08-18 10:43:44 +02:00
Robert O'Callahan
3f2c4f6f83 Remove redundant construction of assign_map.
We call 'assign_map.set()' below which wipes the `SigMap` and reconstructs it.

This operation is expensive because it scans the whole module. I think it's
better to make heavyweight operations more visible so I'm removing
the less obvious operation.
2025-08-17 23:34:11 +00:00
KrystalDelusion
6d55ca204b
Merge pull request #5281 from suisseWalter/add_parameterised_cells_stat
STAT: Add parameterised cells
2025-08-18 09:21:45 +12:00
clemens
4e45b5e1bb permit trailing comma 2025-08-16 09:40:03 +02:00
clemens
8b1f77ebd2 cleanup. printf to errors or warnings 2025-08-16 09:40:03 +02:00
clemens
50fe9dd7f2 clean parsing code 2025-08-16 09:40:03 +02:00