Skip to content

Commit 9e42313

Browse files
committed
Improve type annotations and documentation in corecircuits.py. Also:
* Add a `demux` example. * In `barrel_shifter`, replace ("down", "up") with ("right", "left") and define a `Direction` `IntEnum` to improve readability. * Remove a bunch of unnecessary directives from Sphinx `.rst` files.
1 parent 9d1ac75 commit 9e42313

File tree

8 files changed

+411
-303
lines changed

8 files changed

+411
-303
lines changed

docs/analysis.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ Estimation
1313

1414
.. automodule:: pyrtl.analysis
1515
:members:
16-
:special-members:
17-
:undoc-members:
18-
:exclude-members: __dict__,__weakref__,__module__
16+
:special-members: __init__
1917

2018
Optimization
2119
------------

docs/basic.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,3 @@ Conditionals
6161

6262
.. automodule:: pyrtl.conditional
6363
:members:
64-
:show-inheritance:
65-
:special-members:
66-
:undoc-members:
67-
:exclude-members: __dict__,__weakref__,__module__

docs/helpers.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ Coercion to WireVector
2525
----------------------
2626

2727
In PyRTL there is only one function in charge of coercing values into
28-
:class:`WireVectors<.WireVector>`, and that is :func:`.as_wires`. This
29-
function is called in almost all helper functions and classes to manage the
30-
mixture of constants and WireVectors that naturally occur in hardware
31-
development.
28+
:class:`WireVectors<.WireVector>`, and that is :func:`.as_wires`. This function
29+
is called in almost all helper functions and classes to manage the mixture of
30+
constants and :class:`WireVectors<.WireVector>` that naturally occur in
31+
hardware development. See :ref:`wirevector_coercion` for examples and more
32+
details.
3233

3334
.. autofunction:: pyrtl.corecircuits.as_wires
3435

@@ -115,4 +116,3 @@ Encoders and Decoders
115116

116117
.. autofunction:: pyrtl.helperfuncs.one_hot_to_binary
117118
.. autofunction:: pyrtl.helperfuncs.binary_to_one_hot
118-

docs/rtllib.rst

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,67 +13,49 @@ Adders
1313

1414
.. automodule:: pyrtl.rtllib.adders
1515
:members:
16-
:special-members:
1716
:undoc-members:
18-
:exclude-members: __dict__,__weakref__,__module__
1917

2018
AES-128
2119
-------
2220

2321
.. automodule:: pyrtl.rtllib.aes
2422
:members:
2523
:undoc-members:
26-
:exclude-members: __dict__,__weakref__,__module__
2724

2825
Barrel
2926
------
3027

3128
.. automodule:: pyrtl.rtllib.barrel
3229
:members:
33-
:special-members:
3430
:undoc-members:
35-
:exclude-members: __dict__,__weakref__,__module__
3631

3732
Library Utilities
3833
-----------------
3934

4035
.. automodule:: pyrtl.rtllib.libutils
4136
:members:
42-
:special-members:
43-
:undoc-members:
44-
:exclude-members: __dict__,__weakref__,__module__
4537

4638
Multipliers
4739
-----------
4840

4941
.. automodule:: pyrtl.rtllib.multipliers
5042
:members:
51-
:special-members:
52-
:undoc-members:
53-
:exclude-members: __dict__,__weakref__,__module__
5443

5544
Muxes
5645
-----
5746

5847
.. automodule:: pyrtl.rtllib.muxes
5948
:members:
60-
:special-members:
61-
:undoc-members:
62-
:exclude-members: __dict__,__weakref__,__module__,__exit__
6349

6450
Matrix
6551
------
6652

6753
.. automodule:: pyrtl.rtllib.matrix
6854
:members:
6955
:special-members: __init__
70-
:undoc-members:
71-
:exclude-members: __dict__,__weakref__,__module__
7256

7357
Testing Utilities
7458
-----------------
7559

7660
.. automodule:: pyrtl.rtllib.testingutils
7761
:members:
78-
:special-members:
79-
:exclude-members: __dict__,__weakref__,__module__

0 commit comments

Comments
 (0)