Robert O'Callahan
290fb0556d
Prevent race on `num_active_worker_threads_`.
...
The core issue here is that we need to ensure `num_active_worker_threads_`
is read before incrementing `done_workers`. See the comments
added in this PR to explain why, and why the resulting code is
race-free.
2026-03-24 22:20:18 +00:00
Emil J
7b2ab9b245
Merge pull request #5763 from YosysHQ/emil/c-slow-init
...
genrtlil: fast memory initialization
2026-03-23 10:21:21 +00:00
nella
ee0461eb00
Change time log format.
2026-03-19 14:38:22 +01:00
nella
d6ab610622
Implement wall clock time meas.
2026-03-19 14:38:22 +01:00
Emil J. Tywoniak
ea11453cef
rtlil: faster remove2
2026-03-18 23:33:35 +01:00
Emil J
c8f715fed8
Merge pull request #5664 from rocallahan/parallel-opt-clean
...
Parallelize `opt_clean` pass
2026-03-16 09:52:34 +00:00
Drew Lewis
4251cd69ed
Fix missing return in NDEBUG case
...
Signed-off-by: Drew Lewis <cannada@google.com>
2026-03-13 19:51:49 +00:00
Emil J
2f1cdc2df9
Merge pull request #5728 from povik/tcl-set-result
...
Replace deprecated Tcl API to fix use-after-free
2026-03-06 13:36:48 +00:00
Martin Povišer
167c6c4585
Replace deprecated Tcl API to fix use-after-free
...
Under Tcl 9.0 the Tcl_SetResult utility is a macro:
#define Tcl_SetResult(interp, result, freeProc) \
do { \
const char *__result = result; \
Tcl_FreeProc *__freeProc = freeProc; \
Tcl_SetObjResult(interp, Tcl_NewStringObj(__result, -1)); \
if (__result != NULL && __freeProc != NULL && __freeProc != TCL_VOLATILE) { \
if (__freeProc == TCL_DYNAMIC) { \
Tcl_Free((char *)__result); \
} else { \
(*__freeProc)((char *)__result); \
} \
} \
} while(0)
Temporaries constructed as part of the 'result' expression will be
dropped before the 'result' pointer is used. What was safe when
Tcl_SetResult was a function isn't safe with the macro definition.
Transition away from deprecated SetResult to calling
SetObjResult/MewStringObj directly.
2026-03-06 11:52:17 +01:00
Robert O'Callahan
ac55935a68
Add unit-tests for `ParallelDispatchThread` and friends
2026-03-06 02:20:08 +00:00
Robert O'Callahan
b42bb05b63
Parallelize `Design::check()`
2026-03-06 02:03:21 +00:00
Robert O'Callahan
e2166c4684
Parallelize `collect_garbage()`
2026-03-06 02:03:21 +00:00
Robert O'Callahan
5ff7d344c9
Add `FfInitVals::set_parallel()` method
...
We'll use this later in the PR.
2026-03-06 02:03:21 +00:00
Robert O'Callahan
fe329a0e14
Add `MonotonicFlag`
...
We'll use this later in the PR.
2026-03-06 02:03:21 +00:00
Robert O'Callahan
e71da96314
Add `ConcurrentWorkQueue`
...
We'll use this later in the PR.
2026-03-06 02:03:21 +00:00
Robert O'Callahan
ab238c3145
Add `ShardedHashSet`
...
We'll use this later in the PR.
2026-03-06 02:03:21 +00:00
Robert O'Callahan
87521df534
Add `ShardedVector`
...
We'll use this later in the PR.
2026-03-06 02:03:21 +00:00
Robert O'Callahan
b079e5721c
Add `ParallelDispatchThreadPool`
...
We'll use this later in the PR.
2026-03-06 02:03:21 +00:00
Robert O'Callahan
898a288a99
Add `work_pool_size`, `IntRange`, `item_range_for_worker`, and `ThreadIndex`
...
We'll use these later in this PR.
2026-03-06 02:03:21 +00:00
Robert O'Callahan
bd7f2d9ba4
Make `log_error()` work in a `Multithreaded` context.
...
`log_error()` causes an exit so we don't have to try too hard here. The main
thing is to ensure that we normally are able to exit without causing a stack
overflow due to recursive asserts about not being in a `Multithreaded` context.
2026-03-06 02:03:21 +00:00
Robert O'Callahan
7af5dbae35
Add `IdString::unescape()` method
...
We've already talked about adding this as an alternative to `log_id()`, and we'll
need it later in this PR.
2026-03-06 02:03:21 +00:00
Emil J. Tywoniak
23eb38fe3f
celltypes: include newcelltypes to allow legacy code access to migrated yosys_celltypes
2026-03-05 11:59:20 +01:00
Emil J. Tywoniak
6485a13809
newcelltypes: mark header unstable
2026-03-04 15:17:26 +01:00
nella
04822c6660
Readd builtin_ff_cell_types for plugin parity.
2026-03-04 12:39:45 +01:00
nella
66bd4716cf
rtlil use newcelltypes.
2026-03-04 12:39:45 +01:00
Emil J. Tywoniak
0284595e9c
celltypes: fix absurd eval declarations
2026-03-04 12:39:45 +01:00
Emil J. Tywoniak
793a3513c6
newcelltypes: use unordered_map
2026-03-04 12:39:45 +01:00
Emil J. Tywoniak
661fcb24cb
newcelltypes: fix MSVC build
2026-03-04 12:39:45 +01:00
Emil J. Tywoniak
12412d1fa5
register: use newcelltypes
2026-03-04 12:39:45 +01:00
Emil J. Tywoniak
ecb8b20f62
yosys: use newcelltypes for yosys_celltypes users
2026-03-04 12:39:44 +01:00
Emil J. Tywoniak
5216d32d1b
yosys: use newcelltypes for yosys_celltypes
2026-03-04 12:22:47 +01:00
Emil J. Tywoniak
c3ed884bc4
drivertools: use newcelltypes
2026-03-04 12:22:14 +01:00
Emil J. Tywoniak
31b86ebc2e
newcelltypes: comment
2026-03-04 12:22:14 +01:00
Emil J. Tywoniak
8e17fb0266
consteval: use newcelltypes
2026-03-04 12:22:14 +01:00
Emil J. Tywoniak
a0f87dc2d1
modtools: use newcelltypes
2026-03-04 12:22:14 +01:00
Emil J. Tywoniak
a9463d1aee
newcelltypes: fix non-cells
2026-03-04 12:22:14 +01:00
Emil J. Tywoniak
e3f9911e33
newcelltypes: refactor
2026-03-04 12:22:14 +01:00
Emil J. Tywoniak
07ec8708e4
share: use newcelltypes
2026-03-04 12:22:14 +01:00
Emil J. Tywoniak
3212dfaf1f
newcelltypes: fix unit test
2026-03-04 12:22:14 +01:00
Emil J. Tywoniak
7e9e88c2ec
newcelltypes: bounds check
2026-03-04 12:22:14 +01:00
Emil J. Tywoniak
9e59f05c25
newcelltypes: wrap design celltypes support
2026-03-04 12:22:14 +01:00
Emil J. Tywoniak
35ccaa60d7
newcelltypes: TurboCellTypes -> StaticCellTypes
2026-03-04 12:22:14 +01:00
Emil J. Tywoniak
6adc08b0e5
opt_expr: use newcelltypes
2026-03-04 12:22:14 +01:00
Emil J. Tywoniak
a61455645d
newcelltypes: init
2026-03-04 12:22:14 +01:00
Emil J
5f8489d36d
Merge pull request #5666 from YosysHQ/emil/equiv_induct-missing-model-errors
...
equiv_induct: error on missing model
2026-02-25 15:39:31 +01:00
Emil J
74f7b0cf92
Merge pull request #5685 from chathhorn-galois/chathhorn/issue5684
...
Fix segfault from shift with 0-width signed arg.
2026-02-20 11:53:05 +01:00
Emil J
53509a9b2a
Merge pull request #5692 from YosysHQ/emil/modtools-fix-db-port-deletion
...
modtools: fix database sanity
2026-02-20 10:49:28 +01:00
Emil J. Tywoniak
abc7563a35
modtools: add ModIndex unit test
2026-02-18 22:15:44 +01:00
Emil J. Tywoniak
c75d80905a
modtools: fix database sanity on wire name swap
2026-02-18 21:23:21 +01:00
Gus Smith
29a270c4b6
Merge pull request #5675 from rowanG077/add-missing-celledges
...
kernel/celledges: cover more cell types
2026-02-18 07:50:41 -08:00
Emil J. Tywoniak
62f19cb3a9
modtools: fix port_del db erase
2026-02-18 12:20:36 +01:00
Emil J. Tywoniak
77f64de997
satgen: move report_missing_model here from equiv.h
2026-02-16 17:01:09 +01:00
Chris Hathhorn
1e852cef16
Fix segfault from shift with 0-width signed arg.
...
Fixes #5684 .
2026-02-12 22:03:42 -06:00
Gus Smith
8ab105ac28
Merge pull request #4303 from Coloquinte/sat_choice
...
Infrastructure to run a Sat solver as a command
2026-02-11 06:54:53 -08:00
Rowan Goemans
b8ee50d77f
kernel/celledges: cover more cell types
2026-02-09 14:13:40 +01:00
Gus Smith
1502e23371
Set solver from scratchpad or command line
2026-02-06 19:26:32 -08:00
Emil J
2aa0e1d009
Merge pull request #5629 from rocallahan/remove-zero-wires
...
Avoid scanning entire module in `Module::remove()` if there are no wires to remove
2026-02-04 17:44:24 +01:00
Emil J. Tywoniak
d199195785
satgen: cover $input_port
2026-02-03 18:10:29 +01:00
Emil J
59653da599
Merge pull request #5609 from nataliakokoromyti/upstream-design-run-pass
...
Add Design::run_pass()
2026-02-02 19:30:18 +01:00
nella
8f6c4d40e4
Merge pull request #5623 from YosysHQ/nella/opt-dff-rewrite
...
opt_dff restructure.
2026-01-28 14:41:40 +01:00
Krystine Sherwin
aaebce7adc
log_help: Don't reformat codeblocks
2026-01-28 08:07:44 +13:00
nella
9367090763
OptDff more accurate ctrl/pattern desc.
2026-01-26 22:19:36 +01:00
nella
5803461c24
opt_dff pattern extraction.
2026-01-26 22:10:10 +01:00
Robert O'Callahan
dcd7742d52
Avoid scanning entire module if there are no wires to remove
...
It's pretty common for `opt_clean` to find no wires to remove. In that case,
there is no point scanning the entire design, which can be significantly
expensive for huge designs.
2026-01-23 01:38:20 +00:00
Robert O'Callahan
2c0448a81b
Avoid spurious copy in `IdStringCollector::trace_named()`
2026-01-21 03:31:56 +00:00
Emil J. Tywoniak
befadf6d4d
consteval: describe
2026-01-19 12:00:18 +01:00
Natalia
cf511628b0
modify generator for pyosys/wrappers.cc instead of headers
2026-01-18 02:11:09 -08:00
Natalia
fb864e91ee
Add Design::run_pass() API for programmatic pass execution
...
This commit adds a new run_pass() method to the RTLIL::Design class,
providing a convenient API for executing Yosys passes programmatically.
This is particularly useful for PyYosys users who want to run passes
on a design object without needing to manually construct Pass::call()
invocations. The method wraps Pass::call() with appropriate logging
to maintain consistency with command-line pass execution.
Example usage (from Python):
design = ys.Design()
# ... build or load design ...
design.run_pass("hierarchy")
design.run_pass("proc")
design.run_pass("opt")
Changes:
- kernel/rtlil.h: Add run_pass() method declaration
- kernel/rtlil.cc: Implement run_pass() method
- tests/unit/kernel/test_design_run_pass.cc: Add unit tests
2026-01-14 17:35:45 -08:00
nella
763001885f
Merge pull request #5608 from YosysHQ/nella/rtlil-to-string
...
Add rtlil string getters
2026-01-14 19:00:47 +01:00
nella
210b733555
Add rtlil string getters
2026-01-14 15:37:18 +01:00
Emil J. Tywoniak
8e2038c419
Use digit separators for large decimal integers
2026-01-13 16:38:12 +01:00
Miodrag Milanovic
0e6973037d
Update year in banner and license
2026-01-13 14:23:51 +01:00
Robert O'Callahan
8da919587d
Parallelize `opt_merge`.
...
I'm not sure why but this is actually faster than existing `opt_merge` even with
YOSYS_MAX_THREADS=1, for the jpeg synthesis test. 16.0s before, 15.5s after for
end-to-end synthesis.
2026-01-08 04:21:39 +00:00
Emil J
0ab967b036
Merge pull request #5564 from rocallahan/pass-fuzz
...
Add support for fuzz-test comparison of two passes intended to give identical RTLIL results
2026-01-06 20:07:31 +01:00
Robert O'Callahan
a6d696ba2b
Give `IdString` a default move constructor and make it a POD type.
...
Now that we're not refcounting `IdString`, it can use the default move constructor.
This lets us make `IdString` a POD type so it can be passed in registers
in the standard C++ ABI.
2025-12-30 22:35:14 +00:00
Robert O'Callahan
48cdb499f2
Remove `IdString::id_string()`.
...
This was needed for the short time when `ID()` could return a value of `StaticIdString`.
That is no longer a problem.
2025-12-22 01:57:30 +00:00
Robert O'Callahan
46cb05c471
Pass IdString by value instead of by const reference.
...
When IdString refcounting was expensive, it made sense to pass it by const reference
instead of by value, to avoid refcount churn. Now that IdString is not refcounted,
it's slightly more efficient to pass it by value.
2025-12-22 01:52:59 +00:00
Robert O'Callahan
ddd6a16ee0
Add -legalize option to read_rtlil
2025-12-21 21:47:48 +00:00
Emil J
f003eca615
Merge pull request #5526 from YosysHQ/emil/fix-cellaigs-function-arg-eval-order
...
cellaigs: fix function argument evaluation order
2025-12-12 10:00:09 +01:00
Emil J
5594b817cd
Merge pull request #5524 from rocallahan/single-thread-log
...
Check that we don't use logging during multithreading
2025-12-10 13:54:09 +01:00
Emil J
e08e9119ee
Merge pull request #5516 from rocallahan/limit-threads
...
Limit thread usage in tests
2025-12-10 13:45:07 +01:00
Emil J. Tywoniak
99e873efc9
cellaigs: fix AOI and OAI ordering
2025-12-10 12:41:13 +01:00
Emil J. Tywoniak
d932ce7f47
cellaigs: formatting
2025-12-10 12:33:17 +01:00
Emil J. Tywoniak
882001cb01
cellaigs: fix adder function argument evaluation order
2025-12-10 12:33:17 +01:00
Emil J. Tywoniak
7f3ea41103
cellaigs: fix function argument evaluation order
2025-12-10 11:36:37 +01:00
Emil J
1cceaa2a80
Merge pull request #5538 from YosysHQ/emil/driver-git-hash
...
driver: add --git-hash
2025-12-09 15:00:36 +01:00
Emil J. Tywoniak
6acb79afa2
driver: add --git-hash
2025-12-09 11:58:57 +01:00
Emil J. Tywoniak
23e1b0656c
version: add git hash string
2025-12-09 11:58:43 +01:00
Robert O'Callahan
d274ff8627
Delete prefix strings on shutdown to avoid triggering leak warnings.
...
Fixes #5532
2025-12-05 09:45:47 +00:00
Robert O'Callahan
638e904f91
Remove cover() coverage tracking
2025-12-04 16:27:13 +01:00
Robert O'Callahan
7219ac94b3
Add YOSYS_MAX_THREADS
2025-12-04 12:09:04 +01:00
Robert O'Callahan
7e75200b2a
Check that we don't use logging during multithreading
2025-11-29 22:47:23 +00:00
Robert O'Callahan
b23dc345ae
Make it safe to access .c_str() for autoidx IDs in a multithreaded context
2025-11-25 22:49:41 +00:00
Robert O'Callahan
948001f39f
Merge the two autoidx hashtables into one
...
When something calls `IdString::c_str()` on an autoidx ID, we need to cache the
full string in a thread-safe way. If we need to allocate an entry in some data
structure to do that, it's difficult to do in a thread-safe no-performance-hazard way.
So instead, store the cached string pointer in the same hashtable as the prefix
pointer.
2025-11-25 21:57:46 +00:00
Robert O'Callahan
8f0ecce53f
Forbid creating IdStrings and incrementing autoidx during multithreaded phases, and add dynamic checks for that
...
We could make it safe to increment autoidx during multithreaded passes, but that's
actually undesirable because it would lead to nondeterminism. If/when we need new
IDs during parallel passes, we'll have to figure out how to allocate them in a
deterministic way, and that will depend on the details of what the pass does.
So don't try to tackle that now.
2025-11-25 21:57:46 +00:00
Robert O'Callahan
4c8b537d71
Remove YOSYS_NO_IDS_REFCNT
...
Refcounting is hardly used at all so this option is not that useful.
We might want to have a different option that disables GC if that becomes
a performance issue, but that should be a different option.
2025-11-25 21:57:46 +00:00
Robert O'Callahan
7f9de6e48f
Make coverage data thread-safe
2025-11-25 21:46:48 +00:00
Emil J
2eff366e8c
Merge branch 'main' into emil/sdc_expand
2025-11-19 16:29:37 +01:00
Emil J. Tywoniak
5a798b64ef
sdc: separate out
2025-11-19 15:25:22 +01:00
Emil Jiří Tywoniak
c281bac461
sdc: add initial stubbed demo
2025-11-19 15:25:03 +01:00