3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-13 12:28:44 +00:00
Commit graph

14828 commits

Author SHA1 Message Date
Krystine Sherwin add5eba9b2
Design::selection_stack should never be empty
Add a `log_assert` for it in `Design::check()`.
Remove unneeded checks in other places.
2025-03-14 14:08:16 +13:00
Krystine Sherwin 7eaf33e4da
abc9: Use techmap -autoproc
Fixes quicklogic/pp3 problem with `dffepc` including processes.
Also means the preceding `proc` is safe to remove (and may result in some small speedup by doing so).
2025-03-14 14:08:16 +13:00
Krystine Sherwin 38293d3bdf
select.cc: Fix %i when rhs is empty 2025-03-14 14:08:16 +13:00
Krystine Sherwin 2dec493054
abc9.cc: Call select =*
Or rather, say we're calling `select =*`, but actually bypass the select command to avoid the warning that can pop up if there is nothing to select.
2025-03-14 14:08:15 +13:00
Krystine Sherwin cacea737bc
select.cc: Re-add '=' to empty selection warning 2025-03-14 14:08:15 +13:00
Krystine Sherwin 824f7146aa
Selecting a blackbox sets selects_boxes 2025-03-14 14:08:15 +13:00
Krystine Sherwin a30bacfcb1
Add Selection::complete_selection
Used to select all modules including boxes, set when both `full` and `boxes` are true in the constructor, pulling down `full_selection`.
Add `Selection::selects_all()` method as short hand for `full_selection || complete_selection`.
Update selection operations to account for complete selections.
Add static methods to `Selection` for creating a new empty/full/complete selection to make it clearer to users when doing so.
Use said static methods to replace most instances of the `Selection` constructor.
Update `Selection::optimize` to use
2025-03-14 14:08:15 +13:00
Krystine Sherwin 9a9cd05f6c
tests: Fixes for boxes
cxxrtl `test_unconnected_output` and simple_abc9 `abc9.v` both expect boxed modules in the outputs, so make sure they work as expected.
2025-03-14 14:08:15 +13:00
Krystine Sherwin b296a970d2
abc9: Use push_empty_selection() 2025-03-14 14:08:14 +13:00
Krystine Sherwin f15cd73419
Fix select_op_random ignoring boxes 2025-03-14 14:08:14 +13:00
Krystine Sherwin 59802584b0
Fix describe_selection_for_assert
If the current selection is not the provided selection, push the provided selection.
2025-03-14 14:08:14 +13:00
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
github-actions[bot] e44d1d404a Bump version 2025-03-13 00:22:18 +00: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
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
github-actions[bot] 6462cd2167 Bump version 2025-03-11 00:22:03 +00:00
Emil J 7677a76fed
Merge pull request #4757 from YosysHQ/emil/yosys-config-version
Makefile: add YOSYS_VER and friends to CXXFLAGS for plugin compat che…
2025-03-10 17:43:55 +01:00
N. Engelhardt c74df780b7
Merge pull request #4884 from YosysHQ/docs-preview-functional_tutorial
Docs: More on FunctionalIR
2025-03-10 15:05:55 +00:00
Emil J. Tywoniak ecd8e4303d Makefile: add YOSYS_VER and friends to CXXFLAGS for plugin compat check fallback 2025-03-10 15:15:34 +01:00
Martin Povišer d8a4991289
Merge pull request #4931 from povik/buf-clean
opt_clean, simplemap: Add `$buf` handling
2025-03-10 15:10:17 +01:00
Emil J 8bb24badf2
Merge pull request #4895 from YosysHQ/emil/fix-share-portbit-infinite-loop
share: fix infinite loop in find_terminal_bits on $mux loop
2025-03-08 13:14:11 +01:00
Martin Povišer 9f7cdd4bd4
Merge pull request #4262 from RoaLogic/master
MAX10 updates
2025-03-07 19:59:55 +01:00
Martin Povišer 557047fe1e opt_clean, simplemap: Add $buf handling 2025-03-07 16:08:38 +01:00
Krystine Sherwin c9785584da
docs/rosette: Fix tenses 2025-03-07 08:39:21 +13:00
KrystalDelusion 176131b50e
Merge pull request #4855 from YosysHQ/contributing_md
Initial version of CONTRIBUTING.md
2025-03-04 15:57:33 +13:00
Emil J 39aacc95df
Merge pull request #4907 from YosysHQ/emil/fix-clear-preset-latch
liberty: fix clear and preset latches
2025-03-03 18:53:12 +01:00
N. Engelhardt 0dfd9e9395
Merge pull request #4868 from david-sawatzke/improve_tcl_output_docs
tcl: Update help message to clarify usage of `result.string`
2025-03-03 15:16:42 +00:00
N. Engelhardt 268a034b21
Merge pull request #4866 from YosysHQ/ql_ioff
add IOFF inference for qlf_k6n10f
2025-03-03 14:12:09 +00:00
Krystine Sherwin b56e3ec6e4
docs/functional: Minimal backend paragraphs
I was thinking about compiling the dummy example and including a simple example usage, but it turns out functional.h isn't (currently) available for extensions.
2025-03-01 16:15:54 +13:00
KrystalDelusion 9106d6b3bd
Merge pull request #4881 from YosysHQ/pmgen-pass-restructure
Move passes out of the passes/pmgen folder
2025-03-01 10:22:54 +13:00
Krystine Sherwin 3c493d2bef
docs/rosette: Reword
Acknowledge the minimal functional backend, highlighting what's new/different for our SExpr targets.
Add and use the reference `minimal backend`.
Use `note` directives to point out missing code sections (highlighting that the included diffs are not complete).
Racket *is* still strongly-typed, it's just dynamic instead of static.  Adjust phrasing to reflect that.
Adjust some of the literal includes, adding a new section from the `Functional::AbstractVisitor`, splitting the `Module::write_eval()` in twain and adding a `smtlib.cc` literal include for the node iteration, as well as for the `FunctionalSmtBackend` to compare against the minimal backend.
Move `Backend` description up to minimal functional backend section.
2025-02-28 16:33:57 +13:00
Krystine Sherwin e01a413722
docs/rosette: List major changes in overview
Also a little paragraph on why SMT-LIB is used as the base.
2025-02-28 14:57:41 +13:00
Krystine Sherwin 560b5fe6bd
docs/functional: Add dummy toy example
Add `dummy.cc`, loosely based on `backends/functional/test_generic.cc` but as an actualy backend and without the memory testing.
Skeleton section for minimal functional backend, describing the aforementioned `dummy.cc`.
2025-02-27 16:14:59 +13:00
Krystine Sherwin db823a6acb
docs/rosette: Fix inline code 2025-02-27 16:11:44 +13:00
github-actions[bot] 78960292d0 Bump version 2025-02-27 00:21:40 +00:00