Skip to content
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

Merged
merged 68 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
a6641da
Docs: Initial version of cell_ref autogen
KrystalDelusion Apr 9, 2024
6bbe763
Docs: Put cell library help strings into a struct
KrystalDelusion Apr 9, 2024
600149a
Docs: Add back message for empty help
KrystalDelusion Apr 9, 2024
4662476
Docs: Test $alu with v2 help format
KrystalDelusion Apr 9, 2024
1e5a50f
Docs: Convert write_cell_rst to use SimHelper
KrystalDelusion Apr 9, 2024
7842926
cellhelp: Rename short_desc to title
KrystalDelusion Apr 10, 2024
a2b2904
cellhelp: Add source line to help
KrystalDelusion Apr 12, 2024
57cd8d2
cellhelp: Add default format parse for simcells
KrystalDelusion Apr 12, 2024
1a4ada4
Docs: Add cell gen to makefile
KrystalDelusion Apr 14, 2024
d629aa6
cellhelp: Split gate-level and word-level cells
KrystalDelusion May 2, 2024
c98d134
cellhelp: Extra newline
KrystalDelusion May 2, 2024
f9b4e04
Docs: Add cell reference
KrystalDelusion May 2, 2024
c0f9828
Docs: Add autoref role
KrystalDelusion May 3, 2024
e4ec371
Docs: Update internal cells to autoref
KrystalDelusion May 3, 2024
829e02e
Docs: Shorten cmd:ref
KrystalDelusion May 3, 2024
40ba92e
Docs: Reflow line length
KrystalDelusion May 3, 2024
21747c4
Docs: Improve cell_help usage
KrystalDelusion May 15, 2024
4c9c4c1
celltypes.h: Add extra properties
KrystalDelusion May 16, 2024
063a6bc
register.cc: Include properties in docs
KrystalDelusion May 16, 2024
06e5e18
simlib.v: Autolink referenced cells in alu
KrystalDelusion May 16, 2024
e5f54dd
Docs: Cell reference as a custom documenter
KrystalDelusion May 17, 2024
a66e94c
Docs: Switch to furo-ys
KrystalDelusion May 20, 2024
1b0d863
Docs: Add root to ToC
KrystalDelusion May 20, 2024
ccd3bac
Docs: Add cells loc config value
KrystalDelusion May 20, 2024
84f2968
cellref: Better name checking
KrystalDelusion May 20, 2024
7eb33f1
Docs: Testing autocell
KrystalDelusion May 20, 2024
7c5b10f
cellref: Add json dump
KrystalDelusion May 21, 2024
a119d41
Docs: Move appendix toc to main toc
KrystalDelusion May 21, 2024
9533cf2
Makefile: Use dump-cells-json for docs
KrystalDelusion May 21, 2024
37573a6
Docs: Use json for cellref
KrystalDelusion May 21, 2024
6572320
Docs: Delete unused cell_ref.rst
KrystalDelusion May 21, 2024
5a4a419
Docs: Update conf.py for cellref
KrystalDelusion May 21, 2024
b127ac0
Docs: Preliminary autocellgroup usage
KrystalDelusion May 21, 2024
c662529
Docs: Move binary operators to cell appendix
KrystalDelusion May 27, 2024
04b0ae5
cellref: Move default help message to register.cc
KrystalDelusion May 27, 2024
1374fc2
cellref: Deprecate cell_library.rst
KrystalDelusion May 27, 2024
46580ce
Docs: Move rtlil_text (back) to appendix
KrystalDelusion May 27, 2024
2b4a4cb
Docs: Fix fsm.rst
KrystalDelusion May 27, 2024
be5572c
Docs: Less leading backslashes
KrystalDelusion May 27, 2024
6aceb6a
cmdref.py: Support autoref for 'help <cmd>'
KrystalDelusion May 27, 2024
e78841b
Docs: Fix invalid autorefs
KrystalDelusion May 27, 2024
11d2cbc
Docs: Don't delete source/cell on make clean
KrystalDelusion May 27, 2024
c6414e0
Docs: Switch to furo-ys for YoscryptLexer
KrystalDelusion Jun 8, 2024
78b9dbd
Docs: Assign remaining word cells to groups
KrystalDelusion Aug 26, 2024
596d914
simcells: Apply group tags
KrystalDelusion Aug 28, 2024
b0bc29e
Docs: Add todo for $check
KrystalDelusion Aug 28, 2024
5473b60
Docs: Split gate-level cells into subpages
KrystalDelusion Aug 28, 2024
0005083
Docs: Add gate_other page
KrystalDelusion Sep 3, 2024
217c2a1
Docs: Add todos from JF
KrystalDelusion Sep 3, 2024
5c4f7b4
Docs: $eqx aka case equality
KrystalDelusion Sep 5, 2024
f70a66f
Docs: Assert cell has group
KrystalDelusion Sep 5, 2024
9ce6952
Docs: TODOs block, todos don't
KrystalDelusion Sep 5, 2024
b1025db
cellhelp.py: Cells can have tags
KrystalDelusion Sep 5, 2024
ed92374
simlib.v: Update case equality operators to v2
KrystalDelusion Sep 5, 2024
1a24018
Docs: Add cell title TODO
KrystalDelusion Sep 5, 2024
e3d939b
Docs: Drop fifo.out and fifo.stat
KrystalDelusion Sep 5, 2024
ce6a7fe
docs/util: Cells now have properties
KrystalDelusion Sep 6, 2024
4d84d7e
simlib.v: Add x-output tag
KrystalDelusion Sep 6, 2024
e40134c
Docs: Update for properties
KrystalDelusion Sep 6, 2024
9d808ca
Docs: Add note on $check
KrystalDelusion Sep 16, 2024
7216f07
Docs: Define is_evaluable
KrystalDelusion Sep 16, 2024
927dc44
Docs: Render cell titles
KrystalDelusion Sep 16, 2024
dfe803b
Docs: Comments from @jix
KrystalDelusion Sep 16, 2024
1513366
Docs: Adding mux cell descriptions
KrystalDelusion Oct 14, 2024
27b8b4e
Docs: Fix missing groups
KrystalDelusion Oct 14, 2024
c93fd54
ci: Install docs/reqs (namely, furo-ys)
KrystalDelusion Oct 14, 2024
bc77575
Docs: Fix word_logic.rst
KrystalDelusion Oct 14, 2024
e9d9e92
Docs: Make code_examples/extensions parallel safe
KrystalDelusion Oct 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/prepare-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ jobs:
docs/source/_images
docs/source/code_examples

- name: Install doc prereqs
shell: bash
run: |
make docs/reqs

- name: Test build docs
shell: bash
run: |
Expand Down
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -981,8 +981,20 @@ endif

# also others, but so long as it doesn't fail this is enough to know we tried
docs/source/cmd/abc.rst: $(TARGETS) $(EXTRA_TARGETS)
mkdir -p docs/source/cmd
./$(PROGRAM_PREFIX)yosys -p 'help -write-rst-command-reference-manual'
$(Q) mkdir -p docs/source/cmd
$(Q) mkdir -p temp/docs/source/cmd
$(Q) cd temp && ./../$(PROGRAM_PREFIX)yosys -p 'help -write-rst-command-reference-manual'
$(Q) rsync -rc temp/docs/source/cmd docs/source
$(Q) rm -rf temp
docs/source/cell/word_add.rst: $(TARGETS) $(EXTRA_TARGETS)
$(Q) mkdir -p docs/source/cell
$(Q) mkdir -p temp/docs/source/cell
$(Q) cd temp && ./../$(PROGRAM_PREFIX)yosys -p 'help -write-rst-cells-manual'
$(Q) rsync -rc temp/docs/source/cell docs/source
$(Q) rm -rf temp

docs/source/generated/cells.json: docs/source/generated $(TARGETS) $(EXTRA_TARGETS)
$(Q) ./$(PROGRAM_PREFIX)yosys -p 'help -dump-cells-json $@'

PHONY: docs/gen_examples docs/gen_images docs/guidelines docs/usage docs/reqs
docs/gen_examples: $(TARGETS)
Expand Down Expand Up @@ -1025,7 +1037,7 @@ docs/reqs:
$(Q) $(MAKE) -C docs reqs

.PHONY: docs/prep
docs/prep: docs/source/cmd/abc.rst docs/gen_examples docs/gen_images docs/guidelines docs/usage
docs/prep: docs/source/cmd/abc.rst docs/source/generated/cells.json docs/gen_examples docs/gen_images docs/guidelines docs/usage

DOC_TARGET ?= html
docs: docs/prep
Expand Down
Binary file removed docs/source/_static/favico.png
Binary file not shown.
40 changes: 0 additions & 40 deletions docs/source/_static/yosyshq.css

This file was deleted.

44 changes: 0 additions & 44 deletions docs/source/_templates/page.html

This file was deleted.

18 changes: 0 additions & 18 deletions docs/source/appendix.rst

This file was deleted.

14 changes: 7 additions & 7 deletions docs/source/appendix/auxlibs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@ ezSAT

The files in ``libs/ezsat`` provide a library for simplifying generating CNF
formulas for SAT solvers. It also contains bindings of MiniSAT. The ezSAT
library is written by C. Wolf. It is used by the :cmd:ref:`sat` pass (see
library is written by C. Wolf. It is used by the `sat` pass (see
:doc:`/cmd/sat`).

fst
---

``libfst`` files from `gtkwave`_ are included in ``libs/fst`` to support
reading/writing signal traces from/to the GTKWave developed FST format. This is
primarily used in the :cmd:ref:`sim` command.
primarily used in the `sim` command.

.. _gtkwave: https://github.com/gtkwave/gtkwave

json11
------

For reading/writing designs from/to JSON, :cmd:ref:`read_json` and
:cmd:ref:`write_json` should be used. For everything else there is the `json11
For reading/writing designs from/to JSON, `read_json` and
`write_json` should be used. For everything else there is the `json11
library`_:

json11 is a tiny JSON library for C++11, providing JSON parsing and
serialization.

This library is used for outputting machine-readable statistics (:cmd:ref:`stat`
with ``-json`` flag), using the RPC frontend (:cmd:ref:`connect_rpc`), and the
This library is used for outputting machine-readable statistics (`stat`
with ``-json`` flag), using the RPC frontend (`connect_rpc`), and the
yosys-witness ``yw`` format.

.. _json11 library: https://github.com/dropbox/json11
Expand All @@ -61,7 +61,7 @@ MiniSAT
-------

The files in ``libs/minisat`` provide a high-performance SAT solver, used by the
:cmd:ref:`sat` command.
`sat` command.

SHA1
----
Expand Down
2 changes: 1 addition & 1 deletion docs/source/appendix/env_vars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Yosys environment variables

``HOME``
Yosys command history is stored in :file:`$HOME/.yosys_history`. Graphics
(from :cmd:ref:`show` and :cmd:ref:`viz` commands) will output to this
(from `show` and `viz` commands) will output to this
directory by default. This environment variable is also used in some cases
for resolving filenames with :file:`~`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ Cells
Declares a cell, with zero or more attributes, with the given identifier and
type in the enclosing module.

Cells perform functions on input signals. See
:doc:`/yosys_internals/formats/cell_library` for a detailed list of cell types.
Cells perform functions on input signals. See :doc:`/cell_index` for a detailed
list of cell types.

.. code:: BNF

Expand Down
53 changes: 53 additions & 0 deletions docs/source/cell/gate_comb_combined.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
.. role:: verilog(code)
:language: Verilog

Combinatorial cells (combined)
------------------------------

These cells combine two or more combinatorial cells (simple) into a single cell.

.. table:: Cell types for gate level combinatorial cells (combined)

======================================= =============
Verilog Cell Type
======================================= =============
:verilog:`Y = A & ~B` `$_ANDNOT_`
:verilog:`Y = A | ~B` `$_ORNOT_`
:verilog:`Y = ~((A & B) | C)` `$_AOI3_`
:verilog:`Y = ~((A | B) & C)` `$_OAI3_`
:verilog:`Y = ~((A & B) | (C & D))` `$_AOI4_`
:verilog:`Y = ~((A | B) & (C | D))` `$_OAI4_`
:verilog:`Y = ~(S ? B : A)` `$_NMUX_`
(see below) `$_MUX4_`
(see below) `$_MUX8_`
(see below) `$_MUX16_`
======================================= =============

The `$_MUX4_`, `$_MUX8_` and `$_MUX16_` cells are used to model wide muxes, and
correspond to the following Verilog code:

.. code-block:: verilog
:force:

// $_MUX4_
assign Y = T ? (S ? D : C) :
(S ? B : A);
// $_MUX8_
assign Y = U ? T ? (S ? H : G) :
(S ? F : E) :
T ? (S ? D : C) :
(S ? B : A);
// $_MUX16_
assign Y = V ? U ? T ? (S ? P : O) :
(S ? N : M) :
T ? (S ? L : K) :
(S ? J : I) :
U ? T ? (S ? H : G) :
(S ? F : E) :
T ? (S ? D : C) :
(S ? B : A);

.. autocellgroup:: comb_combined
:members:
:source:
:linenos:
26 changes: 26 additions & 0 deletions docs/source/cell/gate_comb_simple.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. role:: verilog(code)
:language: Verilog

Combinatorial cells (simple)
----------------------------

.. table:: Cell types for gate level combinatorial cells (simple)

======================================= =============
Verilog Cell Type
======================================= =============
:verilog:`Y = A` `$_BUF_`
:verilog:`Y = ~A` `$_NOT_`
:verilog:`Y = A & B` `$_AND_`
:verilog:`Y = ~(A & B)` `$_NAND_`
:verilog:`Y = A | B` `$_OR_`
:verilog:`Y = ~(A | B)` `$_NOR_`
:verilog:`Y = A ^ B` `$_XOR_`
:verilog:`Y = ~(A ^ B)` `$_XNOR_`
:verilog:`Y = S ? B : A` `$_MUX_`
======================================= =============

.. autocellgroup:: comb_simple
:members:
:source:
:linenos:
8 changes: 8 additions & 0 deletions docs/source/cell/gate_other.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Other gate-level cells
----------------------

.. autocellgroup:: gate_other
:caption: Other gate-level cells
:members:
:source:
:linenos:
Loading
Loading