3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-22 19:17:55 +00:00
Commit graph

104 commits

Author SHA1 Message Date
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
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
mikesinouye
93780bb869
Add <optional> to haslib.h which uses std::optional 2025-05-06 09:57:03 -07: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
Emil J. Tywoniak
209ab6fb72 hashlib: fudge always 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
582259f770 hashlib: hash_t can be set to 64-bit 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
b8738e2bd7 hashlib: use hash_t across the board 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
c73c88033d hashlib: only include in one place 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
db04788c18 hashlib: fix pyosys 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
953508f6d2 driver: add --hash-seed 2024-12-18 14:58:29 +01:00
Emil J. Tywoniak
d071489ab1 hashlib: redo interface for flexibility 2024-12-18 14:49:25 +01:00
Mike Inouye
1e3973c5cb Explictly #include <variant> for std::variant usage.
Signed-off-by: Mike Inouye <mikeinouye@google.com>
2024-10-07 21:57:30 +00:00
Emily Schmidt
fbee31080e add optional header and hashlib implementation for optional 2024-08-21 11:04:11 +01:00
Emily Schmidt
248d5f72d4 add support for std::variant to hashlib 2024-08-21 11:01:09 +01:00
Emil J
051d83205d
Merge pull request #4471 from georgerennie/hashlib_primes
hashlib: Add some more primes
2024-07-29 15:10:22 +02:00
Emil J. Tywoniak
583db7b15e sigmap: comments 2024-07-18 16:02:11 +02:00
George Rennie
339d4e8932 hashlib: Correct prime sequence 2024-07-02 08:10:18 +01:00
George Rennie
78ae4ed9ac hashlib: Add some more primes
* Add some primes as suggested in #4458. This allows larger hashtables
  to be allocated for very big designs
2024-07-01 12:37:41 +01:00
Martin Povišer
66479a2232 hashlib: Add missing stdint.h include
We use `uint32_t` `uint64_t` etc. so add an explicit include.
2024-02-08 14:27:12 +00:00
Claire Xenia Wolf
fb72dc1a40 Add constexpr hashlib default constructors
Signed-off-by: Claire Xenia Wolf <claire@clairexen.net>
2023-12-29 19:20:44 +01:00
Martin Povišer
189064b8da rtlil, hashlib: Remove deprecated std::iterator usage
`std::iterator` has been deprecated in C++17. Yosys is being compiled
against the C++11 standard but plugins can opt to compile against a
newer one. To silence some deprecation warnings when those plugins are
being compiled, replace the `std::iterator` inheritance with the
equivalent type declarations.
2023-12-09 19:01:39 +01:00
Rasmus Munk Larsen
8e0308b5e7 Revert changes to celltypes.h. Use dict instead of std::unordered_map and most hash function for uint64_t to hashlib.h to support this. 2023-10-03 14:25:59 -07:00
Wanda
c172fef01a hashlib: Use a better hash for pool. 2023-09-26 18:55:06 +01:00
gatecat
52c8c28d2c Add recover_names pass to recover names post-mapping 2023-05-25 10:55:07 +02:00
Aki Van Ness
6717e02023
kernel: hashlib: cleaned up message about table size in cases where sizeof(int) == 4, (closes #3440) 2022-08-25 11:08:51 -04:00
Claire Xenia Wolf
72787f52fc Fixing old e-mail addresses and deadnames
s/((Claire|Xen|Xenia|Clifford)\s+)+(Wolf|Xen)\s+<(claire|clifford)@(symbioticeda.com|clifford.at|yosyshq.com)>/Claire Xenia Wolf <claire@yosyshq.com>/gi;
s/((Nina|Nak|N\.)\s+)+Engelhardt\s+<nak@(symbioticeda.com|yosyshq.com)>/N. Engelhardt <nak@yosyshq.com>/gi;
s/((David)\s+)+Shah\s+<(dave|david)@(symbioticeda.com|yosyshq.com|ds0.me)>/David Shah <dave@ds0.me>/gi;
s/((Miodrag)\s+)+Milanovic\s+<(miodrag|micko)@(symbioticeda.com|yosyshq.com)>/Miodrag Milanovic <micko@yosyshq.com>/gi;
s,https?://www.clifford.at/yosys/,http://yosyshq.net/yosys/,g;
2021-06-08 00:39:36 +02:00
Marcelina Kościelnicka
dbfd0b61e3 hashlib: Add a hash for bool. 2021-05-24 22:02:15 +02:00
Alberto Gonzalez
d71a9badda
dict: Remove guard for past-the-end iterators that might mask problems in static analysis.
Co-Authored-By: whitequark <whitequark@whitequark.org>
2020-06-19 21:04:29 +00:00
Alberto Gonzalez
e5a2d17b5d
hashlib, rtlil: Add operator+=() to dict<>::iterator and dict<>::const_iterator and add operator+() and operator+=() to ObjIterator. 2020-06-19 17:44:29 +00:00
Alberto Gonzalez
6eea4b3d79
kernel: Try an order-independent approach to hashing dict.
Co-Authored-By: David Shah <dave@ds0.me>
Co-Authored-By: Eddie Hung <eddie@fpgeh.com>
2020-05-19 23:32:53 +00:00