Commit Graph

130 Commits

Author SHA1 Message Date
Akash Levy 58192ad8a6
Merge branch 'YosysHQ:main' into main 2026-01-12 22:52:03 -08: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
Akash Levy f620360782
Merge branch 'YosysHQ:main' into main 2025-10-29 17:36:24 -04:00
Robert O'Callahan a27b1a83ae Don't recompute hash using moved-out-of value 2025-10-28 07:41:10 +00:00
Mohamed Gaber dec28f65ae
Merge remote-tracking branch 'donn/pyosys_bugfixes' into merge_pybind11 2025-10-26 02:39:43 +03:00
Robert O'Callahan 2f81c55389 Make `mfp` const methods thread-safe.
In particular, we make the parent links relaxed atomics so concurrent
`ifind()` calls are safe.

This may appear to cause a tiny performance regression but as discussed
in https://yosyshq.discourse.group/t/parallel-optmergepass-implementation/87/16
this is probably just noise.
2025-10-06 22:44:01 +00:00
Akash Levy c26f38faeb
Merge branch 'YosysHQ:main' into main 2025-09-30 11:14:33 -07:00
Emil J 7719beb4ae
Merge pull request #5349 from rocallahan/cleanup-hashops
Reduce hashops verbiage in `OptMergePass`
2025-09-30 19:34:44 +02:00
Akash Levy d16ca47549
Merge branch 'YosysHQ:main' into main 2025-09-22 17:47:23 -07:00
Akash Levy 60d969530b Bump to latest 2025-09-21 01:10:04 -07:00
Robert O'Callahan 4fe21dd652 Reduce hashops verbiage in OptMergePass 2025-09-19 03:31:46 +00:00
Emil J. Tywoniak d6d1f16c43 hashlib: add insertion order const iterator 2025-09-16 15:39:13 +02:00
Robert O'Callahan f61e3377a9 Hash strings 8 bytes at a time 2025-09-16 03:17:24 +00:00
Akash Levy a43de44f9d Merge upstream changes 2025-09-10 23:02:15 -07:00
Emil J 201c40072c
Merge pull request #5327 from YosysHQ/emil/do_insert-dont-build-new-hash
hashlib: don't build an unused hash for expired value in do_insert
2025-09-09 21:53:39 +02:00
Akash Levy 1b3375d8df Merge upstream in 2025-09-09 05:50:48 -07:00
Emil J. Tywoniak ccf140f2ef hashlib: don't build an unused hash for expired value in do_insert 2025-09-04 14:47:45 +02: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
Akash Levy dc52f6ca1c
Merge branch 'YosysHQ:main' into main 2025-08-27 11:10:13 -07:00
Robert O'Callahan b5aa3ab9f7 hash_ops should take all parameters by reference instead of requiring copies of vectors, tuples etc 2025-08-25 03:09:04 +00:00
Akash Levy e54fa487b8 Merge from upstream 2025-08-21 17:56:55 -07:00
Robert O'Callahan 3a5742ffd2 Improve commutative hashing.
The simple XOR `commutative_eat()` implementation produces a lot of collisions.
https://www.preprints.org/manuscript/201710.0192/v1/download is a useful reference on this topic.

Running the included `hashTest.cc` without the hashlib changes, I get 49,580,349 collisions.
The 49,995,000 (i,j) pairs (0 <= i < 10000, i < j < 10000) hash into only 414,651 unique hash values.
We get simple collisions like (0,1) colliding with (2,3).

With the hashlib changes, we get only 707,099 collisions and 49,287,901 unique hash values.
Much better! The `commutative_hash` implementation corresponds to `Sum(4)` in the paper
mentioned above.
2025-08-19 21:45:52 +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
Akash Levy 77be4d7be7 Bump Yosys to latest 2025-08-07 17:22:25 -07:00
Robert O'Callahan 4bf7c23e2b Make `pool` const lookup methods take a lookup path that never rehashes the table.
This avoids the need to cast away `const` and makes these methods thread-compatible.
2025-07-17 23:40:35 +00:00
Robert O'Callahan cf9720ecab Make const lookup methods take a lookup path that never rehashes the table.
This avoids the need to cast away `const` and makes these methods
thread-compatible.
2025-07-17 23:40:26 +00:00
Akash Levy aeed1ddb74 Update from upstream 2025-05-11 15:16:52 -07:00
mikesinouye 93780bb869
Add <optional> to haslib.h which uses std::optional 2025-05-06 09:57:03 -07:00
Akash Levy 8117ab228e Use set for strpool_attribute to maintain ordering, but keep some backwards compatibility 2025-03-05 03:28:19 -08:00
Akash Levy bd439fc524 Reapply "Merge upstream"
This reverts commit e73d51dbf0.
2025-01-23 13:40:32 -08:00
Akash Levy e73d51dbf0 Revert "Merge upstream"
This reverts commit c58a50f880, reversing
changes made to a1c3c98773.
2025-01-21 05:28:36 -08:00
Emil J. Tywoniak aa01ef3312 hashlib: simplify loopback. NFC 2025-01-20 16:15:48 +01:00
Emil J. Tywoniak 901935fbce hashlib: merge hash_ops with hash_top_ops for plugin compat 2025-01-14 21:41:33 +01:00
Emil J. Tywoniak a58481e9b7 mark all hash_into methods nodiscard 2025-01-14 12:39:15 +01:00
Emil J. Tywoniak a2805b15c9 hashlib: fix hash_obj_ops discarding hash value 2025-01-14 12:36:24 +01:00
mikesinouye de9cb5a60c
Remove spurious prime 2025-01-02 11:05:30 -08:00
mikesinouye 1ae0d8432f
Approximately double the max hash table size 2025-01-02 08:59:11 -08:00
Emil J. Tywoniak 026e9dae9d hashlib: fixes from jix 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak ed70038aa1 hashlib: fixes from jix 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak b9b9515bb0 hashlib: hash_eat -> hash_into 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak 0a525f38c2 hashlib: declare YS_HASHING_VERSION = 1 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak 1df8a3e64b hashlib: legacy mkhash_add -> djb2_add 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak 4e29ec1854 hashlib: acc -> eat 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak 79acc141d5 hashlib: add deprecated mkhash function to prevent plugin breakage 2024-12-18 14:58:53 +01:00
Emil J. Tywoniak ad0dc17711 docs: document the ideas behind the hashing interface 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak 0dafe06cd4 hashlib: run_hash uses hash_top_ops, not hash_ops 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak 02a578365a hashlib: remove is_new from HasherDJB32, implement hash_top for IdString 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak 52b0fc03b7 hash: solo hashing interface, override for SigBit 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak 4d14399749 hashlib: allow forcing Hasher state, use it for IdString trivial hashing 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak c1af19fabc hashlib: don't xorshift in between upper and lower word 2024-12-18 14:58:31 +01:00