3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-02-14 21:01:50 +00:00
Commit graph

10 commits

Author SHA1 Message Date
Robert O'Callahan
f34c6fec19 Add unit-tests for ParallelDispatchThread and friends 2026-02-08 22:52:17 +00:00
Robert O'Callahan
d5950a6c03 Add MonotonicFlag
We'll use this later in the PR.
2026-02-05 21:22:29 +00:00
Robert O'Callahan
b18ca8710e Add ConcurrentWorkQueue
We'll use this later in the PR.
2026-02-05 21:22:29 +00:00
Robert O'Callahan
d0276169d3 Add ShardedHashSet
We'll use this later in the PR.
2026-02-05 21:22:29 +00:00
Robert O'Callahan
b06e903906 Add ShardedVector
We'll use this later in the PR.
2026-02-05 18:58:17 +00:00
Robert O'Callahan
0004708177 Add ParallelDispatchThreadPool
We'll use this later in the PR.
2026-02-05 18:58:17 +00:00
Robert O'Callahan
fb24763a15 Add work_pool_size, IntRange, item_range_for_worker, and ThreadIndex
We'll use these later in this PR.
2026-02-05 18:58:17 +00:00
Robert O'Callahan
7219ac94b3 Add YOSYS_MAX_THREADS 2025-12-04 12:09:04 +01: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