Skip to content

Commit af2eee4

Browse files
committed
Improve type annotations and documentation in core.py. Also:
* Upgrade `namedtuple`s to `NamedTuple`s for documented field names and types. * Rearrange `blocks.rst` to feature `Block` first, as it's more likely to be useful to readers. Move `working_block` related functions to a new subsection. * Simplify the `get_memblock_by_name` example. * Remove more unneeded Sphinx directives.
1 parent 9e42313 commit af2eee4

6 files changed

Lines changed: 249 additions & 245 deletions

File tree

docs/analysis.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
.. PyRTL analysis master file
22
3-
.. default-domain:: pyrtl.rtllib
4-
53
=========================
64
Analysis and Optimization
75
=========================
@@ -27,6 +25,7 @@ Synthesis
2725

2826
.. autoclass:: pyrtl.core.PostSynthBlock
2927
:show-inheritance:
28+
:members:
3029

3130
Individual Passes
3231
-----------------

docs/blocks.rst

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
Logic Nets and Blocks
1+
Block and Logic Nets
22
=====================
33

4-
LogicNets
5-
---------
6-
7-
.. autoclass:: pyrtl.core.LogicNet
8-
9-
104
Blocks
115
------
126

137
.. autoclass:: pyrtl.core.Block
8+
:members:
9+
:exclude-members: sanity_check_memblock, sanity_check_memory_sync, sanity_check_net, sanity_check_wirevector
10+
11+
12+
``working_block``
13+
^^^^^^^^^^^^^^^^^
14+
15+
Most PyRTL operations operate on the global ``working_block`` by default. PyRTL
16+
provides several functions to inspect and manipulate the ``working_block``:
1417

1518
.. autofunction:: pyrtl.core.working_block
1619

@@ -20,20 +23,9 @@ Blocks
2023

2124
.. autofunction:: pyrtl.core.temp_working_block
2225

23-
.. autofunction:: pyrtl.core.Block.add_wirevector
24-
25-
.. autofunction:: pyrtl.core.Block.remove_wirevector
26-
27-
.. autofunction:: pyrtl.core.Block.add_net
28-
29-
.. autofunction:: pyrtl.core.Block.get_memblock_by_name
30-
31-
.. autofunction:: pyrtl.core.Block.wirevector_subset
32-
33-
.. autofunction:: pyrtl.core.Block.logic_subset
34-
35-
.. autofunction:: pyrtl.core.Block.get_wirevector_by_name
36-
37-
.. autofunction:: pyrtl.core.Block.net_connections
26+
LogicNets
27+
---------
3828

39-
.. autofunction:: pyrtl.core.Block.sanity_check
29+
.. autoclass:: pyrtl.core.LogicNet
30+
:members:
31+
:undoc-members:

docs/helpers.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Control Flow Hardware
4242
.. autofunction:: pyrtl.corecircuits.bitfield_update
4343
.. autofunction:: pyrtl.corecircuits.bitfield_update_set
4444
.. autoclass:: pyrtl.helperfuncs.MatchedFields
45+
:members:
46+
:undoc-members:
4547
.. autofunction:: pyrtl.helperfuncs.match_bitpattern
4648

4749
Creating Lists of WireVectors

docs/rtllib.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
.. PyRTL rtllib master file
22
3-
.. default-domain:: pyrtl.rtllib
4-
53
===========
64
RTL Library
75
===========

0 commit comments

Comments
 (0)