Commit Graph

14628 Commits

Author SHA1 Message Date
Krystine Sherwin ca4d985700
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-01-18 13:04:02 +13:00
Krystine Sherwin b2da92c95f
log_help: Add manual group support
Sets `chformal` group to "formal" for testing purposes
2025-01-18 12:59:53 +13:00
Krystine Sherwin 7ca32684e9
Move source_location to register.h
Revert `PrettyHelp::get_current()` for no args since we can use `Pass::location` instead.
2025-01-18 12:59:07 +13:00
Krystine Sherwin 6b078a8f0c
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-01-18 12:55:09 +13:00
Krystine Sherwin 0cc53bc202
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-01-18 11:05:48 +13:00
Krystine Sherwin 26e3eec845
WIP docs: Dump all cmds 2025-01-18 11:02:14 +13:00
Krystine Sherwin 314b42da55
docs: Working cmdref groups
Also adds note on source location if available.
2025-01-17 17:44:49 +13:00
Krystine Sherwin 1cce392a7c
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-01-17 15:59:52 +13:00
Krystine Sherwin a8988a41d7
Makefile: Drop cmds rst from docs/prep 2025-01-17 15:32:57 +13:00
Krystine Sherwin 137f3ed858
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-01-16 07:44:38 +13:00
Krystine Sherwin 68dfcd7afb
WIP docs: Remove extra chformal 2025-01-15 09:27:39 +13:00
Krystine Sherwin cae109fc97
Docs: Update cmdref domain
Compatible with `dump_cmds_json`.
2025-01-15 09:27:18 +13:00
Krystine Sherwin 41dd409862
Docs: Fix dump_cmds_json for PrettyHelp 2025-01-15 09:26:09 +13:00
Krystine Sherwin e447713921
log_help: {add,push,pop}_content helpers 2025-01-15 09:25:38 +13:00
Krystine Sherwin 40d22adb36
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-01-15 07:04:53 +13:00
Krystine Sherwin 36e5d4c3d5
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-01-14 16:27:51 +13:00
Krystine Sherwin 724d71e4a4
log_help: Options can have content
Refactor `PrettyHelp::endgroup()` -> `PrettyHelp::close(int levels = 1)`.
2025-01-14 15:56:22 +13:00
Krystine Sherwin 9cbb17061d
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-01-14 14:10:10 +13:00
Krystine Sherwin 4f0abe4924
WIP docs: Testing autocmd 2025-01-13 15:27:07 +13:00
Krystine Sherwin c07eaee645
WIP docs: Skip most commands in dump_cmds_json
Easier to test
2025-01-13 15:26:36 +13:00
Krystine Sherwin 68bbc2a34e
Makefile: Add cmds.json to docs/prep 2025-01-13 15:22:01 +13:00
Krystine Sherwin 60ecdab852
WIP docs: chformal help text in 3 flavours 2025-01-13 15:21:24 +13:00
Krystine Sherwin 0df5507791
Docs: Improve autoref
Fix `help $cell` type references, as well as actually implement the fallback to yoscrypt.
2025-01-13 15:20:37 +13:00
Krystine Sherwin 2b35c4dccf
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-01-13 15:19:10 +13:00
Krystine Sherwin 023a1e3c03
fixup! Docs: WIP dump_cmds_json 2025-01-10 07:23:43 +13:00
Krystine Sherwin 16ee093dd9
Docs: Test new pass help with chformal 2025-01-10 06:08:58 +13:00
Krystine Sherwin 679b9455bc
Docs: WIP dump_cmds_json 2025-01-10 06:08:42 +13:00
Krystine Sherwin e75e244000
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-01-10 06:03:47 +13:00
Krystine Sherwin cab7f1554c
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-01-10 05:59:47 +13:00
Krystine Sherwin 133232f659
Docs: Remove unused write_cell_rst function
The `help -write-rst-cells-manual` approach was made redundant by `help -dump-cells-json`.
2025-01-07 11:17:32 +13:00
N. Engelhardt ad698f4397
Merge pull request #4833 from YosysHQ/docs-preview-norestructure
Docs: Remove restructure note
2025-01-06 15:38:38 +00:00
Martin Povišer 41e4aa8f0a
Merge pull request #4819 from povik/wreduce-resign
wreduce: Optimize signedness when possible
2025-01-06 15:27:55 +01:00
KrystalDelusion 9e039095e9
Docs: Remove restructure note
It's been almost a year since the restructure, so it's not recent anymore and doesn't need to link back to the old version.
2025-01-06 11:08:00 +13:00
github-actions[bot] 17a53b8385 Bump version 2025-01-04 00:20:29 +00:00
Martin Povišer be351886a5 wreduce: Adjust naming and comments 2025-01-03 12:54:34 +01:00
Martin Povišer 45e31f06b4
Merge pull request #4831 from mikesinouye/hashlib
Approximately double the max hash table size
2025-01-03 10:32:56 +01:00
mikesinouye de9cb5a60c
Remove spurious prime 2025-01-02 11:05:30 -08:00
mikesinouye 1ae0d8432f
Approximately double the max hash table size 2025-01-02 08:59:11 -08:00
github-actions[bot] cbb95cb517 Bump version 2024-12-26 00:20:44 +00:00
Catherine 1ef4c7f565
yosys-smtbmc: add cvc5 to help text. 2024-12-25 04:59:02 +00:00
github-actions[bot] 8acc77c1e0 Bump version 2024-12-20 00:21:02 +00:00
Emil J 8fd40942e9
Merge pull request #4825 from YosysHQ/emil/fix-gcc-error-directive
yosys_common: fix gcc warning in #error directive
2024-12-19 16:29:03 +01:00
Emil J. Tywoniak cea5326229 yosys_common: fix gcc warning in #error directive 2024-12-19 15:55:51 +01:00
Emil J 301d9677b0
Merge pull request #4824 from YosysHQ/emil/fix-witness-stack-overflow
yw: fix unintensional recursion in hash_into
2024-12-19 15:30:57 +01:00
Emil J. Tywoniak a6bd8ff3e5 yw: fix unintensional recursion in hash_into 2024-12-19 11:47:34 +01:00
github-actions[bot] 281e474d45 Bump version 2024-12-19 00:22:04 +00:00
Emil J 6ab5be4a0e
Merge pull request #4814 from YosysHQ/emil/make-test-fasterer
test: every test everywhere all at once
2024-12-18 19:02:39 +01:00
Emil J f6e435fdfb
Merge pull request #4524 from YosysHQ/emil/hashlib-interface
Neater hashing interface
2024-12-18 18:50:53 +01:00
Emil J. Tywoniak 026e9dae9d hashlib: fixes from jix 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak ed70038aa1 hashlib: fixes from jix 2024-12-18 15:09:25 +01:00