3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-23 07:32:32 +00:00
Commit graph

16849 commits

Author SHA1 Message Date
Krystine Sherwin
d09ae42951
Fixing selections 2025-03-14 14:08:14 +13:00
Krystine Sherwin
091e9488fe
rtlil: Design::top_module() can be const
Since it doesn't change anything and is just a lookup.
2025-03-14 14:08:14 +13:00
Krystine Sherwin
dac2bb7d4d
Use selection helpers
Catch more uses of selection constructor without assigning a design.
2025-03-14 14:08:13 +13:00
Krystine Sherwin
a67b57bd64
rtlil: Add selection helpers
New methods on Design to push/pop selection instead of accessing the selection stack directly. Includes methods for pushing a full/complete/empty selection.
Also helper methods on modules to check `is_selected` and `is_selected_whole`.
2025-03-14 14:05:40 +13:00
Krystine Sherwin
3b1b09baf6
Can clean boxed modules
If a selection contains a boxed module, but does not select boxes, it should be removed from the selection.
2025-03-14 14:05:40 +13:00
Krystine Sherwin
2f907e8be4
Unify Design::selected_modules variants
Now uses two enums, one to control whether or not to include partially selected
modules (and what to do if they are encountered), and one to control whether or
not to include boxed modules (and what to do if they are encountered).

Mark Design::selected{modules, whole_modules}() deprecated and make them
provide warnings on boxes. There are a lot of places that use them and I can't
always tell which ones support boxed modules and which don't.
2025-03-14 14:05:40 +13:00
Krystine Sherwin
061c234559
tests/select: Add tests for selections with boxes 2025-03-14 14:05:40 +13:00
Krystine Sherwin
398afd102e
Refactor full_selection
The `Design::selected_*()` methods no longer unconditionally skip boxed modules.  Instead, selections are now box and design aware.
The selection constructor now optionally takes a design pointer, and has a new `selects_boxes` flag.  If the selection has an assigned design, then `Selection::selected_*()` will only return true for boxed modules if the selects_boxes flag is set.  A warning is raised if a selection is checked and no design is set.  Selections can change design via the `Selection::optimize()` method.
Most places that iterate over `Design::modules()` and check `Selection::selected_module()` should instead use `Design::selected_modules()`.
Since boxed modules should only ever be selected explicitly, and `full_selection` (now) refers to all non-boxed modules, `Selection::optimize()` will clear the `full_selection` flag if the `selects_boxes` flag is enabled, and instead explicitly selects all modules (including boxed modules).  This also means that `full_selection` will only get automatically applied to a design without any boxed modules.

These changes necessitated a number of changes to `select.cc` in order to support this functionality when operating on selections, in particular when combining selections (e.g. by union or difference).
To minimize redundancy, a number of places that previously iterated over `design->modules()` now push the current selection to the design, use `design->selected_modules()`, and then pop the selection when done.

Introduce `RTLIL::NamedObject`, to allow for iterating over all members of a module with a single iterator instead of needing to iterate over wires, cells, memories, and processes separately.
Also implement `Module::selected_{memories, processes, members}()` to match wires and cells methods.  The `selected_members()` method combines each of the other `selected_*()` methods into a single list.
2025-03-14 14:05:39 +13:00
Alain Dargelas
03ec7aab16 test branch protection 2025-03-13 16:35:00 -07:00
Alain Dargelas
517ea659b7 test branch protection 2025-03-13 16:33:25 -07:00
Alain Dargelas
355714ea66 test branch protection 2025-03-13 16:29:59 -07:00
alaindargelas
c835b95e61
Merge pull request #66 from alaindargelas/fix_peephole_sub_neg
Actually re-enable peephole_sub_neg pass
2025-03-13 14:51:56 -07:00
Alain Dargelas
6b6c5c2c19 Actually re-enable pass 2025-03-13 14:48:14 -07:00
alaindargelas
f79f402dbd
Merge pull request #64 from alaindargelas/remove_try_catch_masking_stack_trace
Remove try/catch block that prevents proper stack trace unrolling
2025-03-13 14:25:55 -07:00
alaindargelas
bf6f7d1380
Merge pull request #65 from alaindargelas/fix_peephole_sub_neg
Fix Yosys test failures
2025-03-13 14:25:46 -07:00
Alain Dargelas
68312d046a Fix Yosys test failures 2025-03-13 14:15:13 -07:00
Akash Levy
6f818af110 Ignore test collateral 2025-03-13 01:55:22 -07:00
Akash Levy
0a68eb32b3 Disable sub-neg peepopt 2025-03-13 01:55:14 -07:00
Akash Levy
e6da1a2d69 Fix unused warning in annotate_cell_fanout 2025-03-12 20:54:03 -07:00
Akash Levy
e4066b784d Merge remote-tracking branch 'upstream/main' 2025-03-12 19:21:32 -07:00
Akash Levy
9ac5369a5e Bump abc to latest 2025-03-12 19:16:17 -07:00
Akash Levy
1e9adbe4b0 Add warning statements around the getParam issue 2025-03-12 19:16:10 -07:00
github-actions[bot]
e44d1d404a Bump version 2025-03-13 00:22:18 +00:00
Akash Levy
6fc727139b
Merge pull request #63 from alaindargelas/memory_size_check
Memory size check
2025-03-12 16:41:41 -07:00
Alain Dargelas
3a16a369c5 Remove try/catch block that prevents proper stack trace unrolling 2025-03-12 16:35:50 -07:00
Alain Dargelas
88211310fa code review 2025-03-12 16:32:42 -07:00
Alain Dargelas
dcce15207e Memory size check 2025-03-12 16:21:18 -07:00
Martin Povišer
6da543a61a
Merge pull request #4818 from povik/macc_v2
Add `$macc_v2`
2025-03-12 22:55:40 +01:00
KrystalDelusion
65748b8387
Merge pull request #4898 from Anhijkt/fix-xaiger-segfault
write_xaiger: Detect and error on combinatorial loops
2025-03-13 10:49:48 +13:00
KrystalDelusion
bf96ed322d
Merge pull request #4827 from aerkiaga/main
Update ALU MULT mode in gowin to match nextpnr
2025-03-13 10:49:37 +13:00
Miodrag Milanovic
1b07d204bb Next dev cycle 2025-03-12 09:11:41 +01:00
Miodrag Milanovic
c4b5190229 Release version 0.51 2025-03-12 08:31:37 +01:00
Miodrag Milanovic
81639073a3 Update ABC to fix mingw build issue 2025-03-12 07:34:33 +01:00
github-actions[bot]
d1222c57af Bump version 2025-03-12 00:21:49 +00:00
Jason Xu
a5f34d04f8 Address comments 2025-03-11 18:50:44 -04:00
Akash Levy
a3a9e79263 Update abc 2025-03-11 15:32:22 -07:00
Martin Povišer
a7267f4f7b
Merge pull request #4933 from povik/bump-abc2
Bump ABC
2025-03-11 22:37:15 +01:00
Martin Povišer
1ed0719a0a Revert CaDiCaL addition 2025-03-11 20:19:03 +01:00
Martin Povišer
f82a26e7e8 Bump ABC 2025-03-11 19:31:38 +01:00
Akash Levy
b20d916c41
Merge pull request #62 from alaindargelas/ungrouping_fixes
Fixes to enable keep_hierarchy
2025-03-11 10:30:11 -07:00
Alain Dargelas
8b928a8274 Fixes to enable keep_hierarchy 2025-03-11 10:26:02 -07:00
Emil J. Tywoniak
6c9857403c share: use share.pattern_limit from scratchpad 2025-03-11 14:57:00 +01:00
github-actions[bot]
6462cd2167 Bump version 2025-03-11 00:22:03 +00:00
Akash Levy
4d4e574ebb
Merge pull request #60 from alaindargelas/peepopt_neg_sub
neg-sub peepopt pass
2025-03-10 15:48:49 -07:00
Alain Dargelas
e1671b45b6 Code review 2025-03-10 14:44:14 -07:00
Akash Levy
e360511339
Merge branch 'YosysHQ:main' into main 2025-03-10 14:21:49 -07:00
Akash Levy
9797e2dda1
Merge pull request #59 from alaindargelas/src_attr_only
write_verilog -srcattronly option
2025-03-10 14:06:38 -07:00
Akash Levy
ef1658b4b1
Merge pull request #61 from alaindargelas/wheel_no_strip
Comment out strip
2025-03-10 14:05:37 -07:00
Alain Dargelas
811e0daeac Comment out strip 2025-03-10 14:01:07 -07:00
Akash Levy
3da52326dd Undo muxpack change that causes test failures 2025-03-10 13:50:54 -07:00