3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-10-09 09:21:58 +00:00
yosys/kernel
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
..
binding.cc Generate an RTLIL representation of bind constructs 2021-08-13 17:11:35 -06:00
binding.h Generate an RTLIL representation of bind constructs 2021-08-13 17:11:35 -06:00
bitpattern.h bitpattern: comments 2025-08-18 19:57:45 +02:00
calc.cc Reduce comparisons of size_t and int 2024-11-29 12:53:29 +13:00
cellaigs.cc hashlib: hash_eat -> hash_into 2024-12-18 15:09:25 +01:00
cellaigs.h mark all hash_into methods nodiscard 2025-01-14 12:39:15 +01:00
celledges.cc celledges: use capped shift width 2025-04-26 18:34:21 +02:00
celledges.h Fixing old e-mail addresses and deadnames 2021-06-08 00:39:36 +02:00
celltypes.h Make CellTypes methods take IdString by reference to avoid refcount churn 2025-09-04 14:17:08 +02:00
compute_graph.h convert class FunctionalIR to a namespace Functional, rename functionalir.h to functional.h, rename functional.h to compute_graph.h 2024-08-21 11:04:08 +01:00
consteval.h consteval: Fix $bwmux handling 2025-08-12 10:57:58 +12:00
constids.inc Add windows workaround to constids.inc 2025-09-09 10:04:08 +12:00
cost.cc cost: Add $mem_v2, $macc_v2 estimates 2025-03-18 13:51:09 +01:00
cost.h cost: add model for techmapped cell count, keep_hierarchy pass with -min_cost parameter 2024-07-29 10:26:02 +02:00
driver.cc Remove .c_str() calls from log()/log_error() 2025-09-11 20:59:37 +00:00
drivertools.cc Remove log_str() functions and convert their log_signal() users to return std::string 2025-09-11 04:00:49 +00:00
drivertools.h Remove log_str() functions and convert their log_signal() users to return std::string 2025-09-11 04:00:49 +00:00
ff.cc rtlil: represent Const strings as std::string 2024-10-14 06:28:12 +02:00
ff.h ff: improve comments 2024-09-05 11:17:12 +02:00
ffinit.h Compute is_port in AbcPass without iterating through all cells and wires in the module every time we run ABC. 2025-08-14 22:29:45 +00:00
ffmerge.cc rtlil: represent Const strings as std::string 2024-10-14 06:28:12 +02:00
ffmerge.h Compute is_port in AbcPass without iterating through all cells and wires in the module every time we run ABC. 2025-08-14 22:29:45 +00:00
fmt.cc Merge pull request #4567 from kivikakk/cxxrtl-escape-trailing 2025-03-14 16:52:07 +13:00
fmt.h fmt,cxxrtl: add option to group digits in numbers. 2024-04-02 12:13:22 +02:00
fstdata.cc Remove .c_str() calls from log()/log_error() 2025-09-11 20:59:37 +00:00
fstdata.h sim.cc: Move cycle check 2025-05-12 12:48:01 +12:00
functional.cc Merge pull request #5211 from rocallahan/remove-log_str 2025-09-12 14:10:47 +02:00
functional.h Remove .c_str() calls from log()/log_error() 2025-09-11 20:59:37 +00:00
gzip.cc Remove .c_str() calls from log()/log_error() 2025-09-11 20:59:37 +00:00
gzip.h gzip: back to pointers 2025-03-19 13:43:44 +01:00
hashlib.h Merge pull request #5327 from YosysHQ/emil/do_insert-dont-build-new-hash 2025-09-09 21:53:39 +02:00
io.cc Remove .c_str() from stringf parameters 2025-09-01 23:34:42 +00:00
io.h Make log() use the FmtString infrastructure. 2025-09-09 15:41:03 +02:00
json.cc Support for BTOR witness to Yosys witness conversion 2023-01-11 18:07:16 +01:00
json.h Reapply "Add groups to command reference" 2025-08-06 13:52:12 +12:00
log.cc Merge pull request #5211 from rocallahan/remove-log_str 2025-09-12 14:10:47 +02:00
log.h Merge pull request #5211 from rocallahan/remove-log_str 2025-09-12 14:10:47 +02:00
log_compat.cc Maintain logging ABI compatiblity with YosysHQ Verific Extensions 2025-09-09 15:41:03 +02:00
log_help.cc Remove .c_str() calls from log()/log_error() 2025-09-11 20:59:37 +00:00
log_help.h log_help: Fix mem leaks 2025-08-06 13:52:12 +12:00
macc.h macc: Rename 'ports' to 'terms' throughout codebase 2025-03-18 13:25:10 +01:00
mem.cc Remove .c_str() from stringf parameters 2025-09-01 23:34:42 +00:00
mem.h rtlil: represent Const strings as std::string 2024-10-14 06:28:12 +02:00
modtools.h mark all hash_into methods nodiscard 2025-01-14 12:39:15 +01:00
qcsat.cc Add coarse-grain $buf buffer cell type 2024-09-17 10:46:20 +02:00
qcsat.h Refactor common parts of SAT-using optimizations into a helper. 2021-08-09 16:54:35 +02:00
register.cc Remove .c_str() calls from log()/log_error() 2025-09-11 20:59:37 +00:00
register.h kernel/register.h: whitespace 2025-08-06 21:34:37 +01:00
rtlil.cc Remove .c_str() calls from log()/log_error() 2025-09-11 20:59:37 +00:00
rtlil.h When looking up the IdString table, it can never be empty after we've called prepopulate, so remove some dead code. 2025-09-12 05:29:22 +00:00
satgen.cc Merge pull request #5025 from povik/fix-macc_v2-satgen 2025-04-22 08:55:28 +12:00
satgen.h Remove .c_str() from stringf parameters 2025-09-01 23:34:42 +00:00
scopeinfo.cc Add scopeinfo index/lookup utils 2024-02-06 18:01:26 +01:00
scopeinfo.h fix bugs in handling last id in hdlname to scopename conversion 2025-01-16 12:57:08 +01:00
sexpr.cc Remove .c_str() calls from log()/log_error() 2025-09-11 20:59:37 +00:00
sexpr.h factor out SExpr/SExprWriter classes out of smtlib backend, and also tidy them up/document them 2024-08-21 11:03:27 +01:00
sigtools.h Compute is_port in AbcPass without iterating through all cells and wires in the module every time we run ABC. 2025-08-14 22:29:45 +00:00
tclapi.cc Remove .c_str() calls from log()/log_error() 2025-09-11 20:59:37 +00:00
threading.cc Run ABCs in parallel. 2025-09-15 17:18:42 +02:00
threading.h Use a pool of ABC processes. 2025-09-15 17:22:15 +02:00
timinginfo.h mark all hash_into methods nodiscard 2025-01-14 12:39:15 +01:00
topo_scc.h functional backend: topological sort starts with the output and next states nodes, other nodes get deleted 2024-08-21 11:03:29 +01:00
utils.h io: refactor string and file work into new unit 2025-03-19 13:43:42 +01:00
yosys.cc Run ABCs in parallel. 2025-09-15 17:18:42 +02:00
yosys.h driver: allow --no-version still write things like Generated by Yosys 2025-05-07 11:34:23 +02:00
yosys_common.h Use well-known constants in ID macro and make the constant values known at compile time 2025-09-09 09:56:55 +12:00
yw.cc Remove .c_str() calls from log()/log_error() 2025-09-11 20:59:37 +00:00
yw.h mark all hash_into methods nodiscard 2025-01-14 12:39:15 +01:00