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

151 commits

Author SHA1 Message Date
Akash Levy
d704eba595 Fix traceability by reverting to old abc 2025-09-25 10:16:22 -07:00
Akash Levy
cd37b064f9 Minor cleanup 2025-09-23 01:07:41 -07:00
Akash Levy
a3542ae405 Fixup 2025-09-23 00:38:43 -07:00
Akash Levy
5f7361e66b Try fixing ThreadPool issue 2025-09-22 18:50:22 -07:00
Akash Levy
d16ca47549
Merge branch 'YosysHQ:main' into main 2025-09-22 17:47:23 -07:00
Robert O'Callahan
7f6fae1f66 Extract ABC results in the order of assigned_cells.
Currently the order of extraction can vary based on which ABC runs finish first. That's
nondeterministic, therefore bad. Instead, force the processing to happen in the same order
as `assigned_cells`, i.e. the same order we use when not using parallelism. This should
make everything deterministic.

Note that we still allow ABC runs to complete out of order. Out-of-order results are
just not extracted until all the previous runs have completed and their results
extracted.
2025-09-22 05:07:03 +00:00
Akash Levy
60d969530b Bump to latest 2025-09-21 01:10:04 -07:00
Emil J
73e47ac3fe
Merge pull request #5357 from rocallahan/builtin-ff
Instead of using `builtin_ff_cell_types()` directly, go through a method `Cell::is_builtin_ff()`
2025-09-17 11:37:16 +02:00
Robert O'Callahan
d24488d3a5 Instead of using builtin_ff_cell_types() directly, go through a method Cell::is_builtin_ff() 2025-09-17 03:24:19 +00:00
Robert O'Callahan
5ac6858f26 Remove .c_str() from log_cmd_error() and log_file_error() parameters 2025-09-16 22:59:08 +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
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
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
Akash Levy
f5cb0c328f Bump Yosys to latest 2025-09-13 04:35:52 -07: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
1b3375d8df Merge upstream in 2025-09-09 05:50:48 -07:00
Robert O'Callahan
c7df6954b9 Remove .c_str() from stringf parameters 2025-09-01 23:34:42 +00: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
Robert O'Callahan
62c441107d Build FfInitVals for the entire module once and use it for every ABC run. 2025-08-14 22:29:51 +00:00
Robert O'Callahan
2654bd5355 Compute is_port in AbcPass without iterating through all cells and wires in the module every time we run ABC.
This does not scale when we run ABC thousands of times in a single AbcPass.
2025-08-14 22:29:45 +00:00
Robert O'Callahan
ac8259b02e Preserve assign_map across ABC invocations.
Currently `assign_map` is rebuilt from the module from scratch every time we invoke ABC.
That doesn't scale when we do thousands of ABC runs over large modules. Instead,
create it once and then maintain incrementally it as we update the module.
2025-08-14 22:27:04 +00:00
Robert O'Callahan
4de3ee093e Mark kept FF output wires as ports directly instead of via the 'keep' attribute 2025-08-14 22:26:38 +00:00
Robert O'Callahan
ccb23ffc1a Fix indentation 2025-08-13 05:44:52 +00:00
Robert O'Callahan
885bb744e3 Make module a parameter of the function so we can change its constness in context 2025-08-13 05:44:52 +00:00
Robert O'Callahan
53c72c0d39 Move code in abc_module() that modifies the design into a new function extract()
Splits up the big `abc_module()` function and isolates the code that modifies the design
after running ABC.
2025-08-13 05:44:52 +00:00
Robert O'Callahan
ceedcecfae Move the input parameters to abc_module that are identical across modules to an AbcConfig struct. 2025-08-13 05:44:52 +00:00
Robert O'Callahan
4ba42c4752 Move ABC pass state to a struct instead of storing it in global variables. 2025-08-13 05:44:52 +00:00
Neil Deo
093bf7ed7e Fix getPort issue to pass yosys tests 2025-06-05 14:38:38 -07:00
Akash Levy
d308ecdbcf Fix warnings with block curly braces 2025-05-13 20:42:28 -07:00
Akash Levy
769aaa113c Get boolopt src attribution working for dress 2025-05-13 20:05:16 -07:00
Akash Levy
13e053fb11 Fixups 2025-05-12 14:49:37 -07:00
Akash Levy
8171f04cbf Add preliminary boolopt src attribution support 2025-05-12 02:30:36 -07:00
Akash Levy
a1cc22aa0e Add abc word mode, which uses word-level cells where possible 2025-05-11 15:07:23 -07:00
Akash Levy
1dcf75d175 Sync 2024-12-19 21:40:30 -08:00
Emil J. Tywoniak
c10b3f57e1 abc: sort stats 2024-12-18 14:58:31 +01:00
Alain Dargelas
e8e25b4cea Selective boolopt 2024-11-25 15:18:22 -08:00
Alain Dargelas
10bad88bdb Selective boolopt 2024-11-25 15:15:35 -08:00
Alain Dargelas
13915dee96 Selective boolopt 2024-11-25 15:14:14 -08:00
Alain Dargelas
c32d0a412c Selective boolopt 2024-11-25 15:08:42 -08:00
Akash Levy
894c9816d3 Improve naming: big fix 2024-11-11 17:06:11 -08:00
Krystine Sherwin
7b47f645d7
Address warnings
- Setting default values
- Fixing mismatched types
- Guarding unused var
2024-08-16 04:30:31 +12:00
Peter Gadfort
a48825a604 add support for using ABCs library merging when providing multiple liberty files 2024-04-12 13:57:29 -04:00
Miodrag Milanović
88ce47e4f0
Merge pull request #3892 from QuantamHD/dont_use
abc: Exposes dont_use flag in ABC
2023-09-12 14:58:44 +02:00
Martin Povišer
e995dddeaa abc: Warn about replacing undef bits 2023-09-05 10:45:30 +02:00
Ethan Mahintorabi
d525a41497
abc: Exposes dont_use flag in ABC
ABC's read_lib command has a dont_use
cell list that is configurable by the user.

This PR exposes that option to Yosys.

See
5405d4787a/src/map/scl/scl.c (L285)
for documentation on this option.

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
2023-08-15 20:03:46 +00:00