-
Notifications
You must be signed in to change notification settings - Fork 891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs generation from cells help output #4332
Conversation
4b6286b
to
9295daa
Compare
a42e127
to
de6cbb6
Compare
A few things I noticed, including some nits that might not need to be addressed:
|
The |
Allows for more expressive code when constructing help messages for cells. Will also move extra logic in parsing help strings into the initial python parse instead of doing it in the C++ at export time.
Include Source file and line number in SimHelper struct, and use it for verilog code caption in rst dump. Also reformat python string conversion to iterate over a list of fields instead of repeating code for each.
Since `simcells.v` uses consistent formatting we can handle it specifically to help tidy up sphinx warnings about the truth tables, and instead chuck them in a code block which when printing to rst. Also has the side effect that rst code blocks can be added manually with `//- ::` followed by a blank line.
Generate in a temp directory and use `rsync -rc` to only update rst files that have changed. This prevents sphinx from having to re-generate every cmd/cell page any time the git sha changes. Also change cmd gen to match.
Fix `$macc` page.
Subclass the command reference code in order to support smart references to the internal cells.
Use new `autoref` role when using single backticks. Allows automatic mapping to a cmd ref or a cell ref.
- Drop `cell_code` and instead map code lookups to the `cell_help` dict. - Add helper functions to struct for checking and getting the right cell. - Add `CellType` for cell to `write_cell_rst` function declaration in preparation for use in future. - Iterate over `yosys_celltypes.cell_types` when exporting cell rst files, reporting errors for any cells defined in `cell_types` but not `cell_help_messages`.
Use autodocs to perform cell reference docs generation instead of generating rst files directly. e.g. ``` .. autocell:: simlib.v:$alu :source: :linenos: ```
Drop word_other block since it raises a warning, which will cause the RTDs build to fail.
Explicitly assign $_TBUF_ to `gate_other` and remove catch if a cell has no group.
Tags are added to the list of properties when exporting to `cells.json`.
Also tag as x-aware cells and add titles.
These two files can now be safely .gitignore'd.
Properties are both an option: ``` .. cell:def:: $add :properties: is_evaluable ``` and a field: ``` .. cell:def:: $eqx :property x-aware: :property is_evaluable: ``` Properties as an option appear in the property index: linking a given property to all cells with that property; while properties as a field display with the cell.
Also a few extra cell help texts.
Add properties page, move cell_gate and cell_word under a singular cell_index along with properties. Fix links accordingly. Also drop x-aware and x-output todos since they are resolved.
Also put property lists *after* cell description.
- Unswap shift/shiftx - Add brief overview to cell lib - Clarify $div cell B input - Clarify unary operators - What is $modfloor
Also making ver2 cell descriptions consistently spaced.
$lut and $sop were missed in the rebase, and $buf is new to main since the last rebase.
It somehow got lost in the rebase.
340259b
to
bc77575
Compare
This also added unused CellType members, which is a bit risky to expose before implementing. I discovered it because I was looking at adding for (auto type : unary_ops)
setup_type(type, {ID::A}, {ID::Y}, true, symmetrical_ops.count(type)); |
@widlarizer it was more a proof of concept because I don't actually know which cells have those properties, just that they were useful properties to report 😅 Feel free to change it by adding others or commenting out the unused ones or whatever, just make sure that kernel/register.cc write_cell_rst is updated to match 😄 |
Generate rst files for the cells library, similar to how the command reference is generated. Python pre-parse allows for a bit more flexibility.
ReadtheDocs preview available at https://yosyshq.readthedocs.io/projects/yosys/en/docs-preview-cellhelp/