3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-22 16:45:32 +00:00
Commit graph

1403 commits

Author SHA1 Message Date
Emil J
a5e8f52ce5
Merge pull request #4976 from Logikable/main
Support array ranges for identifiers in the Liberty parser.
2025-04-09 22:49:52 +02:00
Jannis Harder
0f13b55173 Liberty file caching with new libcache command
This adds optional in-memory caching of parsed liberty files to speed up
flows that repeatedly parse the same liberty files. To avoid increasing
the memory overhead by default, the caching is disabled by default. The
caching can be controlled globally or on a per path basis using the new
`libcache` command, which also allows purging cached data.
2025-04-03 13:39:35 +02:00
Sean Luchen
4610889d27 Fix two parsing bugs that were causing private regression tests to fail.
These were introduced by 0a6d9f4.
1) While in a paren "(", don't error on newline.
2) Don't parse an extra token when parsing vector ranges. Let the caller parse the next token as necessary.
2025-04-01 13:01:00 -07:00
Jannis Harder
bc01468c75 read_liberty: Faster std::string construction in the liberty lexer
This extends the `LibertyInputStream` added in the previous commit to
allow arbitrary lookahead. Then this uses the lookahead to find the
total length of the token within the input buffer, instead of consuming
the token byte by byte while appending to a std::string. Constructing
the std::string with the total length is known avoids any reallocations
from growing std::string's buffer.
2025-04-01 14:12:12 +02:00
Jannis Harder
119e998f12 read_liberty: Faster input handling for the liberty lexer
The lexer for liberty files was using istream's `get` and `unget` which
are notorious for bad performance and that showed up during profiling.

This replaces the direct `istream` use with a custom LibertyInputStream
that does its own buffering to provide `get` and `unget` that behave the
same way but are implemented with a fast path that is easy to inline and
optimize.
2025-04-01 14:12:12 +02:00
Sean Luchen
23f59e0196 Support array ranges for identifiers in the Liberty parser.
This change only handles the case `id : id[range] ;`.
2025-03-31 10:54:00 -07:00
Sean Luchen
ac1033ecd5 Factor parse_vector_range out into its own function.
This also fixes the parsing a bit. It was consuming 1 fewer token than
required.
2025-03-31 10:46:18 -07:00
Sean Luchen
0a6d9f4dc9 Factor report_unexpected_token out into its own function. 2025-03-31 10:44:23 -07:00
Emil J. Tywoniak
7aefd4b226 gzip: back to pointers 2025-03-19 13:43:44 +01:00
Emil J. Tywoniak
0877798e18 dfflibmap: allow gzipped liberty files 2025-03-19 13:43:44 +01:00
Emil J. Tywoniak
d00259081d gzip: simplify uncompressed interface 2025-03-19 13:43:44 +01:00
Emil J. Tywoniak
218ec3fc05 dfflibmap: allow gzipped liberty files 2025-03-19 13:43:44 +01:00
Martin Povišer
6da543a61a
Merge pull request #4818 from povik/macc_v2
Add `$macc_v2`
2025-03-12 22:55:40 +01:00
Martin Povišer
557047fe1e opt_clean, simplemap: Add $buf handling 2025-03-07 16:08:38 +01:00
Martin Povišer
fc88ea360e
Merge pull request #4876 from gadfort/segfault-lexer
liberty expression lexer check if characters are found and use size if not for `pin()`
2025-02-07 20:24:08 +01:00
Martin Povišer
772b9c0cfd
Merge pull request #4691 from hovind/experiments/extract-fa-fix
extract_fa: Fix `xor3`/`xnor3` inversion bug
2025-02-06 21:12:32 +01:00
Martin Povišer
b5752dfe16 alumacc: Fix missing signedness check 2025-02-04 13:05:53 +01:00
Adrian Parvin Ouano
23b3638c1e alumacc: alternative cmp unification implementation 2025-02-04 11:52:37 +01:00
Øystein Hovind
ed076bc168 extract_fa: Invert xor3/xnor3 output when inverting majority3 input 2025-01-30 18:45:07 +01:00
Peter Gadfort
9534f4ab80 check if characters are found and use size if not 2025-01-29 15:56:05 -05:00
Martin Povišer
6c76dcec3e macc_v2: Fix v2 omissions 2025-01-27 13:08:44 +01:00
Martin Povišer
61450e8b6e Update codebase for macc_v2 2025-01-24 12:38:03 +01:00
Martin Povišer
c5fd96ebb0 macc_v2: Start new cell 2025-01-24 12:38:03 +01:00
Peter Gadfort
f0860459ac add support for using scratchpad value for flatten.separator in flatten command 2025-01-18 10:45:19 -07:00
Emil J. Tywoniak
a58481e9b7 mark all hash_into methods nodiscard 2025-01-14 12:39:15 +01:00
mikesinouye
13b183c9c5
Add option for a custom flatten block separator char 2025-01-09 18:30:23 -08:00
Martin Povišer
652a1b9806 macc: Stop using the B port
The B port is for single-bit summands. These can just as well be
represented as an additional summand on the A port (which supports
summands of arbitrary width). An upcoming `$macc_v2` cell won't be
special-casing single-bit summands in any way.

In preparation, make the following changes:

 * remove the `bit_ports` field from the `Macc` helper (instead add any
   single-bit summands to `ports` next to other summands)

 * leave `B` empty on cells emitted from `Macc::to_cell`
2025-01-08 13:03:35 +01:00
Emil J. Tywoniak
b9b9515bb0 hashlib: hash_eat -> hash_into 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
c10b3f57e1 abc: sort stats 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
d071489ab1 hashlib: redo interface for flexibility 2024-12-18 14:49:25 +01:00
Martin Povišer
f7ad003a6f
Merge pull request #4802 from povik/abc9-box-repeat
Adjust `abc9_ops -prep_box` to allow repeated invocation
2024-12-10 20:08:17 +01:00
Martin Povišer
0bb139dc25 abc_new: Fix help crash 2024-12-10 14:27:55 +01:00
Martin Povišer
2a3f60bc06 abc_new: Support abc9_box mode on ordinary design hierarchy
Previously the `abc9_box` mode was reserved to modules with the
`blackbox` or `whitebox` attribute. Allow `abc9_box` on ordinary modules
when doing hierarchical synthesis.
2024-12-10 14:27:29 +01:00
Martin Povišer
285f24d764 abc_new: Support per-module script override 2024-12-10 14:27:29 +01:00
Martin Povišer
f3f8037328 abc9_ops: Allow no arcs on box w/o inputs or w/o outputs 2024-12-05 18:32:41 +01:00
Martin Povišer
481d596c43 abc9_ops -prep_box: Adjust for repeated invocation
`abc9_ops -prep_box` command interprets the `abc9_box` attribute and
prepares a .box file for ABC consumption. Previously this command was
removing the attribute as it was processing each module which prevented
repeated invocation of this command unless the box definitions were
refreshed from a source file.

Also the command was keeping existing `abc9_box_id` attributes instead
of overwriting them with values from a new number sequence.

Change both behaviors to allow repeated invocations of the command on
the same design.
2024-12-05 18:32:41 +01:00
Martin Povišer
14ee5ce800
Merge pull request #4787 from povik/booth-macc
booth: Map simple `$macc` instances too
2024-12-04 11:49:34 +01:00
Emil J
3b8e8ee012
Merge pull request #4797 from YosysHQ/emil/multiple-liberty
Allow multiple -liberty args in dfflibmap and clockgate
2024-12-04 11:18:52 +01:00
Martin Povišer
384c191192
Merge pull request #4775 from povik/dont_map
techmap: Add `-dont_map` for selective disabling of rules
2024-12-03 20:21:47 +01:00
Martin Povišer
1c7bb700c9 techmap: Rephrase help 2024-12-03 20:20:00 +01:00
Emil J. Tywoniak
6edf9c86cb libparse: add LibertyMergedCells, enable multiple -liberty args for dfflibmap and clockgate 2024-12-03 17:36:00 +01:00
Emil J. Tywoniak
60fb241cb3 clockgate: clean up argument parsing 2024-12-03 17:35:10 +01:00
KrystalDelusion
889894a6d2
Merge pull request #4790 from YosysHQ/emil/clockgate-warnings
clockgate: reduce build warnings
2024-12-03 13:25:52 +13:00
Lofty
fd05f73d50 dfflibmap: demote some warnings to debug 2024-12-02 14:17:51 +00:00
Emil J. Tywoniak
6b006e5f61 clockgate: reduce build warnings 2024-12-02 10:07:01 +01:00
Martin Povišer
1ded817beb booth: Map simple $macc instances too 2024-12-01 16:00:04 +01:00
Martin Povišer
2962f8fa88 techmap: Add -dont_map for selective disabling of rules 2024-11-27 15:54:37 +01:00
Emil J. Tywoniak
4d96cbec75 clockgate: reduce errors to warnings 2024-11-18 18:32:18 +01:00
Emil J. Tywoniak
983c54c75f clockgate: help string add -dont_use and -liberty 2024-11-18 13:57:49 +01:00