Skip to content

Commit 203e0d6

Browse files
committed
Fix up docs generation
1 parent 002a6b8 commit 203e0d6

File tree

5 files changed

+155
-45
lines changed

5 files changed

+155
-45
lines changed

chipflow_lib/platforms/utils.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ class _IOModelOptions(TypedDict):
8989
class IOModel(_IOModelOptions):
9090
"""
9191
Options for IO Ports
92+
9293
Attributes:
93-
direction: Input, Output or Bidir
94+
direction: `io.Direction.Input`, `io.Direction.Output` or `io.Direction.Bidir`
9495
width: width of port, default is 1
9596
all_have_oe: controls whether each output wire is associated with an individual Output Enable bit
9697
or a single OE bit will be used for entire port, the default value is False, indicating that a
@@ -1047,10 +1048,18 @@ def heartbeat(self) -> Dict[int, Pin]:
10471048
}
10481049

10491050
class Process(Enum):
1051+
"""
1052+
IC manufacturing process
1053+
"""
1054+
#: Skywater foundry open-source 130nm process
10501055
SKY130 = "sky130"
1056+
#: GlobalFoundries open-source 130nm process
10511057
GF180 = "gf180"
1058+
#: Pragmatic Semiconductor FlexIC process (old)
10521059
HELVELLYN2 = "helvellyn2"
1060+
#: GlobalFoundries 130nm BCD process
10531061
GF130BCD = "gf130bcd"
1062+
#: IHP open source 130nm SiGe Bi-CMOS process
10541063
IHP_SG13G2 = "ihp_sg13g2"
10551064

10561065
def __str__(self):

docs/chipflow-toml-guide.rst

Lines changed: 53 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,58 @@ Let's start with a typical example:
1414
# Assert that example-chipflow.toml matches the current config schema. If
1515
# this test fails, then its likely that the content in this file will need
1616
# to be updated.
17-
from chipflow_lib import _parse_config_file
17+
from chipflow_lib.config import _parse_config_file
1818
_parse_config_file("docs/example-chipflow.toml")
1919

20-
``[chipflow]``
21-
--------------
20+
``[chipflow]`` table
21+
--------------------
22+
23+
|required|
24+
25+
The top level configuration for inputs to the ChipFlow tools.
26+
27+
28+
project_name
29+
============
30+
31+
|required|
32+
33+
The ``project_name`` is a human-readable identifier for this project. If not set, the tool and library will use the project name configured in ``pyproject.toml``.
2234

2335
.. code-block:: TOML
2436
2537
[chipflow]
26-
project_name = "my_project"
38+
project_name = 'my_project'
2739
40+
clock_domains
41+
=============
2842

29-
The ``project_name`` is a human-readable identifier for this project. If not set, the tool and library will use the project name configured in ``pyproject.toml``.
43+
|optional|
3044

31-
``[chipflow.top]``
32-
------------------
45+
A list of top-level clock domains for your design. If omitted, defaults to the `Amaranth` default ``sync``, and sync is always assumed to be the name of the core clock for bringup.
3346

3447
.. code-block:: TOML
3548
36-
[chipflow.top]
37-
soc = "my_design.design:MySoC"
49+
[chipflow]
50+
clock_domains = ['sync', 'peripheral']
51+
52+
53+
``[chipflow.top]`` table
54+
------------------------
55+
56+
|required|
3857

3958
This section outlines the design modules that need to be instantiated.
4059
A new top module will be automatically generated, incorporating all specified modules along with their interfaces.
4160
Each entry follows the format `<instance name> = <module class path>`.
4261

4362
The instance name is the name the python object will be given in your design, and the :term:`module class path`
4463

64+
.. code-block:: TOML
65+
66+
[chipflow.top]
67+
soc = "my_design.design:MySoC"
68+
4569
.. glossary::
4670

4771
module class path
@@ -50,8 +74,10 @@ The instance name is the name the python object will be given in your design, an
5074

5175
.. _chipflow-toml-steps:
5276

53-
``[chipflow.steps]``
54-
--------------------
77+
``[chipflow.steps]`` table
78+
--------------------------
79+
80+
|optional|
5581

5682
The ``steps`` section allows overriding or addition to the standard steps available from `chipflow_lib`.
5783

@@ -69,27 +95,15 @@ You probably won't need to change these if you're starting from an example repos
6995
.. _chipflow_lib: https://github.com/ChipFlow/chipflow-lib
7096

7197

72-
Clock Definitions
73-
-----------------
74-
75-
The clock pins to be allocation on the package are determined from the top level clock domains exposed by components in `[chipflow.top]`.
76-
77-
78-
79-
``[chipflow.resets]``
80-
---------------------
98+
``[chipflow.silicon]``
99+
----------------------
81100

82-
.. code-block:: TOML
101+
|required|
83102

84-
[chipflow.resets]
85-
default = 'sys_rst_n'
103+
The ``silicon`` section sets the Foundry ``process`` (i.e. PDK) that we are targeting for manufacturing, and the physical ``package`` (including pad ring) we want to place our design inside.
86104

87-
This section identifies the input pads designated for reset functionality.
88-
These pads need to be specified in the `[silicon.pads]`_ section with the :term:`type` set to :term:`reset`.
89-
The logic that synchronizes the reset signal with the clock will be generated automatically.
105+
You'll choose the ``process`` and ``package`` based in the requirements of your design.
90106

91-
``[chipflow.silicon]``
92-
----------------------
93107

94108
.. code-block:: TOML
95109
@@ -98,12 +112,12 @@ The logic that synchronizes the reset signal with the clock will be generated au
98112
package = "pga144"
99113
100114
101-
The ``silicon`` section sets the Foundry ``process`` (i.e. PDK) that we are targeting for manufacturing, and the physical ``package`` (including pad ring) we want to place our design inside.
115+
process
116+
=======
102117

103-
You'll choose the ``process`` and ``package`` based in the requirements of your design.
118+
|required|
104119

105-
Available processes
106-
-------------------
120+
Foundry process to use
107121

108122
+------------+------------+---------------------------+
109123
|| Process || Supported || Notes |
@@ -118,8 +132,13 @@ Available processes
118132
| ihp_sg13g2 | pga144 | IHP SG13G2 130nm SiGe |
119133
+------------+------------+---------------------------+
120134

121-
Available Package Definitions
122-
-----------------------------
135+
136+
package
137+
=======
138+
139+
|required|
140+
141+
The form of IC packaging to use
123142

124143
+----------+-----------+--------------------+------------------------------------+
125144
| Pad ring | Pad count | Pad locations | Notes |

docs/conf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
'sphinx.ext.intersphinx',
3535
'sphinx.ext.napoleon',
3636
'autoapi.extension',
37+
'sphinxcontrib.autoprogram',
38+
'sphinxcontrib.autodoc_pydantic',
39+
'sphinx_design',
3740
]
3841

3942
html_theme = 'furo'
@@ -98,5 +101,10 @@
98101
:language: python
99102
"""
100103

104+
rst_epilog = """
105+
.. |required| replace:: :bdg-primary-line:`Required`
106+
.. |optional| replace:: :bdg-secondary-line:`Optional`
107+
"""
108+
101109
# -- Options for EPUB output
102110
epub_show_urls = 'footnote'

pdm.lock

Lines changed: 80 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ include = [
6363
select = ["E4", "E7", "E9", "F", "W291", "W293"]
6464
ignore = ['F403', 'F405']
6565

66-
67-
68-
69-
7066
[tool.pdm.version]
7167
source = "scm"
7268

@@ -92,6 +88,10 @@ dev = [
9288
"tomli-w>=1.2.0",
9389
"pyright>=1.1.392",
9490
"amaranth-stubs>=0.1.1",
91+
"sphinxcontrib-autoprogram>=0.1.9",
92+
"sphinx-autodoc-typehints>=2.3.0",
93+
"autodoc-pydantic>=2.2.0",
94+
"sphinx-design>=0.6.1",
9595
]
9696

9797
[tool.pytest.ini_options]

0 commit comments

Comments
 (0)