Commit Graph

14384 Commits

Author SHA1 Message Date
Krystine Sherwin d84c3a9eac
Backends: More consistent usage of selections
Drop use_selection flag from Json and Jny Writers, instead they always operate on selections and if the write_* pass is called without -selected then it pushes the complete selection.
rtlil_backend prints differently if it is dumping a portion or whole design, so push the complete selection inside of the dump if needed.
Also update `Design::selected_modules()` error message for partially selected modules to match the existing error messages that it replaces.
2024-11-22 07:02:16 +13:00
Krystine Sherwin 24e54d942a
abc9: Use push_empty_selection() 2024-11-20 11:45:14 +13:00
Krystine Sherwin 453e9f0a23
Fix select_op_random ignoring boxes 2024-11-20 11:03:52 +13:00
Krystine Sherwin 06f2d1e0fc
Fix describe_selection_for_assert
If the current selection is not the provided selection, push the provided selection.
2024-11-20 11:01:42 +13:00
Krystine Sherwin 06427efb83
Fixing selections 2024-11-20 10:38:23 +13:00
Krystine Sherwin d1e6de35c3
backends/jny: Fix help text
Text now matches functionality.
2024-11-20 09:42:47 +13:00
Krystine Sherwin ed3ed25ae0
rtlil: Design::top_module() can be const
Since it doesn't change anything and is just a lookup.
2024-11-20 09:40:12 +13:00
Krystine Sherwin 9484d169c8
Use selection helpers
Catch more uses of selection constructor without assigning a design.
2024-11-20 09:38:33 +13:00
Krystine Sherwin 25bbc6effc
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`.
2024-11-20 09:27:35 +13:00
Krystine Sherwin c70fd0a617
Can clean boxed modules
If a selection contains a boxed module, but does not select boxes, it should be removed from the selection.
2024-11-20 09:22:44 +13:00
Krystine Sherwin 39090affcd
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.
2024-11-20 09:10:57 +13:00
Krystine Sherwin 5767da92d5
tests/select: Add tests for selections with boxes 2024-11-19 08:44:50 +13:00
Krystine Sherwin 7ea06990e7
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.
2024-11-19 08:44:45 +13:00
KrystalDelusion dcff8b0666
Merge pull request #4719 from AdamLee7/main
add select option for write_json
2024-11-19 08:42:38 +13:00
KrystalDelusion 22e214ec6d
Merge pull request #4705 from YosysHQ/docs-preview-lintonly
Emphasise that read_verilog doesn't lint
2024-11-19 03:57:01 +13:00
Martin Povišer 270846a49a
Merge pull request #4723 from povik/memv2-nordports
rtlil: Adjust internal check for `$mem_v2` cells
2024-11-18 15:44:39 +01:00
Martin Povišer 1cb5fd08b7
Merge pull request #4682 from povik/read_liberty-extensions
read_liberty extensions
2024-11-18 14:42:18 +01:00
Miodrag Milanović bd40805d54
Merge pull request #4754 from akashlevy/editline-fixes
Fix `editline` Makefile
2024-11-18 09:20:45 +01:00
Akash Levy 47a2a09e89 Enforce mutual exclusion on readline/editline 2024-11-17 23:23:37 -08:00
github-actions[bot] 532d5992fd Bump version 2024-11-18 00:22:55 +00:00
Martin Povišer 020dd0a9e7
Merge pull request #4753 from akashlevy/write_verilog_port_dump_fix
`write_verilog`: Fix `O(N^2)` port dumping to `O(N)`
2024-11-17 23:42:23 +01:00
Akash Levy ace558e90c Simplify using module->ports, which is apparently sorted 2024-11-17 11:36:30 -08:00
Akash Levy 56f841d132 Fix editline 2024-11-17 10:44:05 -08:00
Akash Levy 3a32729373 Remove keep_running variable (unused) 2024-11-17 10:40:04 -08:00
Akash Levy 8f9a0b680a Fix O(N^2) port dump down to O(N) 2024-11-16 22:56:41 -08:00
github-actions[bot] 81011ad926 Bump version 2024-11-16 00:21:32 +00:00
Miodrag Milanović 9fa9a2b57b
Merge pull request #4746 from pu-cc/gatemate-mux-fix
synth_gatemate: Ensure proper mapping of multiplexers
2024-11-15 16:30:41 +01:00
Patrick Urban 77e1f748a5 gatemate: run `simplemap` after `muxcover` to prevent unmapped multiplexers 2024-11-15 09:49:49 +01:00
Martin Povišer bbb6bbd12a
Merge pull request #4734 from mikesinouye/verific
Fix bug when setting Verific runtime string  flags.
2024-11-14 19:39:47 +01:00
github-actions[bot] a22ff47d62 Bump version 2024-11-14 00:20:42 +00:00
Lofty d9ef388fcc
Merge pull request #4698 from YosysHQ/lofty/dfflibmap-enable
dfflibmap: enable inference
2024-11-13 17:50:17 +00:00
Lofty 6694d1c4c5
Merge pull request #4736 from povik/portarcs
portarcs: New command to derive propagation arcs
2024-11-13 16:56:16 +00:00
Lofty 4f40187759 dfflibmap: move expression code into libparse 2024-11-13 16:06:57 +00:00
Lofty 08ed2c765e dfflibmap: enable inference 2024-11-13 15:57:45 +00:00
Martin Povišer 2dba345049 portarcs: New command to derive propagation arcs 2024-11-13 16:20:35 +01:00
Martin Povišer 4ce8c7a0d3
Merge pull request #4709 from YosysHQ/emil/idstring-in-fold
functional, glift: use fold overload of IdString::in instead of pool …
2024-11-13 15:17:33 +01:00
Martin Povišer 9da7341003
Merge pull request #4727 from georgerennie/george/bufnorm_constants2
bufnorm: preserve constant bits when mapping back to connections
2024-11-13 14:32:15 +01:00
github-actions[bot] 8d0bf3f35e Bump version 2024-11-13 00:20:36 +00:00
Mike Inouye 06e3ac4415 Fix bug when setting Verific runtime string flags.
Signed-off-by: Mike Inouye <mikeinouye@google.com>
2024-11-12 18:46:26 +00:00
Robin Ole Heinemann 6d4f056a35 cxxrtl: use debug attrs of alias not aliasee 2024-11-12 13:07:33 +00:00
Martin Povišer 0d5c412807 read_liberty: s/busses/buses/ 2024-11-12 13:33:41 +01:00
Martin Povišer 56a9202a97 Add read_liberty tests of new options 2024-11-12 13:29:16 +01:00
Martin Povišer 5a0cb5d453 Check in filtered samples of IHP's Liberty data for tests 2024-11-12 13:28:15 +01:00
Martin Povišer 28aa7b00ee read_liberty: Start an `-ignore_busses` option 2024-11-12 13:26:38 +01:00
Martin Povišer 0e96e477a2 read_liberty: Defer handling of re-definitions
Postpone handling re-definitions to after we have established the cell
is not supposed to be ignored on the grounds of one of the user-provided
flags.
2024-11-12 13:26:38 +01:00
Martin Povišer c7e8d41600 read_liberty: Set `area` `capacitance` attributes 2024-11-12 13:26:38 +01:00
Martin Povišer 915df16c84
Merge pull request #4728 from YosysHQ/emil/fix-filterlib-roundtrip
filterlib: preserve value quotes
2024-11-12 10:54:35 +01:00
Krystine Sherwin d0e5677760
Docs: Less exaggeration 2024-11-12 16:33:47 +13:00
Emil J. Tywoniak 49e1597ea4 filterlib: preserve value quotes 2024-11-12 01:21:07 +01:00
github-actions[bot] 3afb7725f1 Bump version 2024-11-12 00:20:17 +00:00