Commit Graph

1616 Commits

Author SHA1 Message Date
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 c07eaee645
WIP docs: Skip most commands in dump_cmds_json
Easier to test
2025-01-13 15:26:36 +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 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
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
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. Tywoniak a6bd8ff3e5 yw: fix unintensional recursion in hash_into 2024-12-19 11:47:34 +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
Emil J. Tywoniak b9b9515bb0 hashlib: hash_eat -> hash_into 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak 0a525f38c2 hashlib: declare YS_HASHING_VERSION = 1 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak 1df8a3e64b hashlib: legacy mkhash_add -> djb2_add 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak 4e29ec1854 hashlib: acc -> eat 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak 79acc141d5 hashlib: add deprecated mkhash function to prevent plugin breakage 2024-12-18 14:58:53 +01:00
Emil J. Tywoniak ad0dc17711 docs: document the ideas behind the hashing interface 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak 0dafe06cd4 hashlib: run_hash uses hash_top_ops, not hash_ops 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak 02a578365a hashlib: remove is_new from HasherDJB32, implement hash_top for IdString 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak 704a58ab21 hashlib: restore hash_obj_ops for pointers to indexed types 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak 52b0fc03b7 hash: solo hashing interface, override for SigBit 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak b7991ed1f5 hashlib: prevent naive hashing of IdString when hashing SigBit 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak 4d14399749 hashlib: allow forcing Hasher state, use it for IdString trivial hashing 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak c1af19fabc hashlib: don't xorshift in between upper and lower word 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak 209ab6fb72 hashlib: fudge always 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak 582259f770 hashlib: hash_t can be set to 64-bit 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak b8738e2bd7 hashlib: use hash_t across the board 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak c73c88033d hashlib: only include in one place 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak db04788c18 hashlib: fix pyosys 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak 953508f6d2 driver: add --hash-seed 2024-12-18 14:58:29 +01:00
Emil J. Tywoniak d071489ab1 hashlib: redo interface for flexibility 2024-12-18 14:49:25 +01:00
Martin Povišer 1f718e3ab6 kernel: Remove global `tcl.h` include
In commit ac988cf we made sure to undefine the CONST/VOID macros left
defined by `tcl.h`, but this in turn makes it an issue to include
additional Tcl headers later on (see issue #4808).

One way out is to avoid a global `tcl.h` include. In the process we drop
support for Tcl-enabled MXE builds, which were likely broken anyway due
to the additional Tcl APIs used from `tclapi.cc`.
2024-12-10 13:49:08 +01:00
Martin Povišer b0708a38bf
Merge pull request #4678 from povik/tcl-rtlil-api
Start Tcl design inspection methods
2024-12-09 15:44:58 +01:00
N. Engelhardt 2a744b4b82 add hash method to scopeindex cursor 2024-12-06 11:18:39 +01:00
Krystine Sherwin 9925b27432
Goodbye guidelines (except GettingStarted)
Drop the parts that are being dropped.
Move the things that are being moved.
Also move the verilog stuff out of README and into the docs.
GettingStarted is less cut and dry, so hold off on that one.
2024-12-05 09:21:12 +13:00
Krystine Sherwin f0da1cc67f
Start removing guidelines folder
Disable the export to docs and remove any references to the guidelines folder.
2024-12-05 09:18:56 +13:00
KrystalDelusion c61b2bc1bc
Merge pull request #4794 from YosysHQ/krys/cygwin_compat
Fix Cygwin compatibility
2024-12-05 09:16:18 +13:00
KrystalDelusion c96d02b204
Merge pull request #4784 from YosysHQ/krys/reduce_warnings
Reduce number of warnings
2024-12-05 09:16:06 +13:00
Emil J d78086480f
Merge pull request #4770 from YosysHQ/emil/autoidx-option
driver: add --autoidx
2024-12-04 16:43:40 +01:00
Jannis Harder 81de54f436 tclapi: Remove unused -bool flag from get_param and document -[su]int 2024-12-03 18:59:52 +01:00
Jannis Harder cac6dd9bcb tclapi: Use older bignum API and handle external tommath for mac os 2024-12-03 18:49:38 +01:00
Krystine Sherwin 7d8140ddea
kernel/mem: Fix Cygwin compat
Avoid error:
```
kernel/mem.cc:1683:7: error: conflicting declaration ‘using addr_t = using addr_t = uint32_t’
 1683 | using addr_t = MemContents::addr_t;
      |       ^~~~~~
In file included from /usr/include/sys/types.h:222,
                 from /usr/include/pthread.h:11,
                 from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/x86_64-pc-cygwin/bits/gthr-default.h:35,
                 from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/x86_64-pc-cygwin/bits/gthr.h:148,
                 from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/ext/atomicity.h:35,
                 from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/bits/cow_string.h:37,
                 from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/bits/basic_string.h:51,
                 from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/string:53,
                 from ./kernel/yosys_common.h:27,
                 from ./kernel/yosys.h:42,
                 from ./kernel/mem.h:23,
                 from kernel/mem.cc:20:
/usr/include/machine/types.h:63:15: note: previous declaration as ‘typedef char* addr_t’
   63 | typedef char *addr_t;
```

According to IntelliSense, only the return types need to be prefixed with `MemContents::`, the rest are automagically using the class definition and highlight as `using Yosys::MemContents::addr_t = uint32_t`.
2024-12-03 13:15:33 +13:00