3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-27 06:27:57 +00:00
Commit graph

15345 commits

Author SHA1 Message Date
Krystine Sherwin
726a30fe37
cmd_documenter: Fix option_spec
Need to copy parent class `option_spec` to retain default options (e.g. `:noindex:`).
2025-07-21 10:35:57 +12:00
Krystine Sherwin
2e5b029ba5
Docs: Option lists have yoscrypt highlights 2025-07-21 10:35:56 +12:00
Krystine Sherwin
92ab125113
cmdref: Assigning cmds to formal group
Give formal index a proper title.
Use `Pass::formatted_help()` to assign the group, but still return `false` because the help text still comes from `Pass::help()`.
Tidy up some of the affected files' includes to make use of the shared `yosys.h` includes.
2025-07-21 10:35:56 +12:00
Krystine Sherwin
37782cb92b
Docs: Grouping changes
Keep techlibs folder hierarchy.
techlibs/* and passes/* groups are now nested under index_techlibs and index_passes respectively, with most (all?) of the passes/* pages getting proper headings, as well as backends/frontends/kernel.  `index_passes_techmap` also references `index_techlibs`.
Split command reference toc in twain, one with maxdepth=2 and one with maxdepth=3, since passes and techlibs now have an extra level of nesting.
Move the `cmd_ref` link to the command reference, instead of top of the page.
Remove `index_internal` and `index_other` from the toc, and mark the pages as orphan. Internal commands get a note callout after the command reference toc (although this doesn't work for the pdf build), while other commands are linked in the warning for missing `source_location` (since that *should* be the only time when there are any commands in the "unknown" group).
Update autodoc extension versions, and mark the directives extension as not `parallel_read_safe` (it might be, but I'm not sure about how the xref lookups work if it is parallel so better to be safe).
2025-07-21 10:35:56 +12:00
Krystine Sherwin
0ec336ba23
Docs: Add :cmd:title: directive
Calling :cmd:title:`<cmd>` will generate a cross reference to `<cmd>`, but unlike :cmd:ref: which displays a literal block and puts the title (short_help) in the hovertext (the title field of an a-ref), :cmd:title: will display "<cmd> - <short_help>" as plain text.
Thus replacing the previous use case of referring to :doc:`cmd/<cmd>`.
Also refactor util py scripts to have more descriptive names.
2025-07-21 10:35:19 +12:00
Krystine Sherwin
14fdc9e76c
cmdref: Export internal_flag to json
Commands flagged as internal will display a warning, just like experimental commands.
Drop `passes/tests` group in favour of `internal` group, which is automatically assigned for any command without an assigned group which is flagged as internal.
2025-07-21 10:35:19 +12:00
Krystine Sherwin
d62a110dc8
register.h: Add internal_flag to Pass
Update experimental pass warnings to use a shared function.  Reduces repetition, and also allows all of the warning flags to be combined (which at present is just experimental and the new internal).
Update `test_*` passes to call `internal()` in their constructors.
2025-07-21 10:35:19 +12:00
Krystine Sherwin
1529d991fd
log_help: Refactor help content adding
Content is now added to the `ContentListing` rather than the `PrettyHelp`.
`open_*` methods return the `ContentListing` that was added instead of leaving a hanging continuation.
This allows for (e.g.) options to be added directly to optiongroups, instead of requiring that groups be closed before continuation.
This also means that all `PrettyHelp`s are a listing, with the actual log being called by the default `Pass::help()`; making the mode field redundant.
Added `PrettyHelp::log_help()` which replaces the `PrettyHelp::Mode::LOG` logic.
Added `ContentListing::back()` which just returns the last element of the underlying content vector.
Some of the content tracking was made redundant and removed, in particular `PrettyHelp::_current_listing` and `ContentListing::parent`.

Converted `ContentListing` to a class instead of a struct, adjusting constructors to match.
Added `ContentListing` constructor that accepts a `source_location`.

Update `HelpPass::dump_cmds_json()` for new log_help.
2025-07-21 10:35:18 +12:00
Krystine Sherwin
c97b0084b7
Docs: Show warning on experimental cmds 2025-07-21 10:34:55 +12:00
Krystine Sherwin
33be999488
cmdref: Add cmd titles
Display subheadings for each command.
Remove now redundant toc entry for `yosys> help <cmd>` line.
2025-07-21 10:34:55 +12:00
Krystine Sherwin
605f12c2ae
Rename help_v2 to formatted_help
Also add comments to `help()` and `formatted_help()` to clarify usage.
2025-07-21 10:34:54 +12:00
Krystine Sherwin
23a066f71f
source_location: Try use __has_include 2025-07-21 10:34:54 +12:00
Krystine Sherwin
041f390a24
register: Remove <filesystem>
Use `string::find_last_of()` instead.
Not sure how this works on windows, but it was already using '/' so at least it's not any worse.
2025-07-21 10:34:54 +12:00
Krystine Sherwin
534163cf4b
source_location: Auto detect library
Drop `ENABLE_SOURCE_LOCATION` flag.
2025-07-21 10:34:54 +12:00
Krystine Sherwin
4722b07485
Docs: docs/source/cmd is source only
i.e. we don't need to clean it, and we don't need to include it in the docs artifact
2025-07-21 10:34:54 +12:00
Krystine Sherwin
7647d2c741
Docs: Fix warnings
Changes a bunch of :doc:`/cmd/*` to :cmd:ref:`*` with the intention of changing it later to something that replicates the previous effect of displaying the commands `short_help`.
2025-07-21 10:34:32 +12:00
Krystine Sherwin
6f0ee43152
Docs: Downgrade missing cmdgroup warning
Log an info message, and put a warning for the content instead.
2025-07-21 10:34:32 +12:00
Krystine Sherwin
7b625591c8
dump_cmds_json: Output groups
Also output `pass->location.{file_name,line,function_name}()`.
If no group is given (i.e. it is "unknown"), attempt to automatically apply a group.
If we have source locations, this is based on path to the source file.
If we do not have source locations, try to match on the pass name instead.
2025-07-21 10:34:32 +12:00
Krystine Sherwin
1c627f4a1b
log_help: Add manual group support
Sets `chformal` group to "formal" for testing purposes
2025-07-21 10:34:31 +12:00
Krystine Sherwin
6fdefee35b
Move source_location to register.h
Revert `PrettyHelp::get_current()` for no args since we can use `Pass::location` instead.
2025-07-21 10:34:31 +12:00
Krystine Sherwin
929c437b26
Docs: Group commands
Removes group parsing from command ref domain, instead relying on a 'groups' object in the cmds.json file.
`docs/source/cmd` is no longer ignored or cleaned.
2025-07-21 10:34:13 +12:00
Krystine Sherwin
8d1b9b1c1f
dump_cmds_json: Fix auto formatting
- Command list for script passes
- Check buffer after loop
- Close options properly
- Ignore mismatched sigs e.g. `fsm_detect` on `fsm`
- Require double blank line before new signature
2025-07-21 10:34:13 +12:00
Krystine Sherwin
00b6d96aee
docs: Working cmdref groups
Also adds note on source location if available.
2025-07-21 10:34:13 +12:00
Krystine Sherwin
3691bb674c
log_help: Better location tracking
Assign root location in call to `PrettyHelp::get_current()`.
Set default `source_file` to `"unknown"`, since that appears to be the default value rather than `nullptr`.
2025-07-21 10:34:13 +12:00
Krystine Sherwin
bab867f347
Makefile: Drop cmds rst from docs/prep 2025-07-21 10:34:13 +12:00
Krystine Sherwin
cb502e7505
cmdref: Combine consecutive code blocks
Formatting is nicer when there is only one code block instead of multiple in a row, especially in pdf.
2025-07-21 10:34:12 +12:00
Krystine Sherwin
a19f0103ff
Docs: Update cmdref domain
Compatible with `dump_cmds_json`.
2025-07-21 10:34:12 +12:00
Krystine Sherwin
fe2be07bc8
Docs: Fix dump_cmds_json for PrettyHelp 2025-07-21 10:34:12 +12:00
Krystine Sherwin
7d0bcd8b48
log_help: {add,push,pop}_content helpers 2025-07-21 10:34:12 +12:00
Krystine Sherwin
d4498acea7
log_help: Json dumpable
Current modes are `LOG` and `LISTING`, which `log()` and store for conversion to json respectively.
Add `ContentListing` listing struct to (recursively) contain help data for conversion to a json object to be exported and used elsewhere (e.g. the docs).
Rather than formatting as rst we can just export with type information and do the conversion at the destination (i.e. in the python code which loads the domain for autodoc).
Implement `PrettyHelp::has_content()`.
Provide `PrettyHelp::get_content()` which returns a read-only list of the current content.
`PrettyHelp` constructor takes optional `Mode` enum to define format of help content.
Updates `PrettyHelp` methods to use a switch case for checking current mode, calling `log_abort()` in the default case (i.e. unsupported mode).
2025-07-21 10:34:12 +12:00
Krystine Sherwin
ae3514adfd
log_help: Include source_location
Use `std::experimental::source_location` because clang support is `??`
Add `ENABLE_SOURCE_LOCATION` make variable and corresponding `YOSYS_ENABLE_SOURCE_LOCATION` define.
Dummy out the struct if disabled and check for null instead of using `#ifdef` blocks everywhere.
2025-07-21 10:34:12 +12:00
Krystine Sherwin
10fea26fa9
log_help: Options can have content
Refactor `PrettyHelp::endgroup()` -> `PrettyHelp::close(int levels = 1)`.
2025-07-21 10:34:11 +12:00
Krystine Sherwin
3bef122a3f
WIP docs: Proto log_help
Define `PrettyHelp` class with methods for declaring different parts of help message.
Currently able to produce standard help messages as expected.
Updates chformal to use (only) the new help_v2.
Currently makes use of a global static to track the current help context, allowing register.h to live in blissful ignorance and instead rely on help_v2 implementations calling `auto *help = PrettyHelp::get_current();` and `return true;` to minimise impact on rebuilds (i.e. not requiring every source file to be recompiled).
2025-07-21 10:34:11 +12:00
Krystine Sherwin
3718f916f3
Makefile: Add cmds.json to docs/prep 2025-07-21 10:33:31 +12:00
Krystine Sherwin
f5ace20bf6
Docs: Improve autoref
Fix `help $cell` type references, as well as actually implement the fallback to yoscrypt.
2025-07-21 10:33:31 +12:00
Krystine Sherwin
714790c70b
Docs: Proto doc_string approach for cmd help
Add `doc_string` field to `Pass` constructor
Add `docs/util/newcmdref.py` to contain command domain
Update `docs/util/cmdref.py` with `cmd:usage` and `cmd:optiongroup` for describing commands.
Functional, but WIP.
2025-07-21 10:33:31 +12:00
Krystine Sherwin
5ce097ed3d
Docs: Test new pass help with chformal 2025-07-21 10:33:31 +12:00
Krystine Sherwin
804e18e0c6
Docs: WIP dump_cmds_json 2025-07-21 10:32:51 +12:00
Krystine Sherwin
28ecb91052
register: Add pass_usages and default help
Experimental new formatting for describing passes that can be rendered into the standard help format, as well as being more amenable to smarter formatting for web documentation.
2025-07-21 10:32:51 +12:00
Krystine Sherwin
2c79aeb7ad
json.h: Fix array template
Using `{begin|end}_object` inserts curly braces instead of square brackets, which can result in reordering (and may be syntactically incorrect?).
2025-07-21 10:32:09 +12:00
Krystine Sherwin
fe3adfd960
Docs: Remove unused write_cell_rst function
The `help -write-rst-cells-manual` approach was made redundant by `help -dump-cells-json`.
2025-07-21 10:32:09 +12:00
github-actions[bot]
aa1daa7023 Bump version 2025-07-18 00:25:48 +00:00
Martin Povišer
9ab1946799
Merge pull request #5209 from povik/hieropt
Start `opt_hier` to enable hierarchical optimization
2025-07-17 14:12:18 +02:00
Martin Povišer
415b7d3f65 Drop experimental label off synth -hieropt 2025-07-17 12:02:44 +02:00
N. Engelhardt
d009bcc9b6
Merge pull request #5198 from YosysHQ/nak/lcov 2025-07-17 11:57:58 +02:00
N. Engelhardt
beb71a6c47 update short help 2025-07-16 17:11:19 +02:00
N. Engelhardt
fb6974dcd7 print summary of line coverage to log 2025-07-16 13:40:07 +02:00
github-actions[bot]
af0b263557 Bump version 2025-07-16 00:25:58 +00:00
George Rennie
0f40bb3076
Merge pull request #5232 from georgerennie/george/firrtl_name_cache
write_firrtl: clear used names cache each invocation
2025-07-15 16:49:52 +01:00
Emil J
0f784fd084
Merge pull request #5219 from YosysHQ/emil/fix-liberty-expr-space
dfflibmap: fix dffe inference when spaces used for ANDs in liberty next_state
2025-07-15 16:39:26 +02:00