Skip to content

Commit 5892a25

Browse files
committed
small fixes to docs
1 parent 3276eb6 commit 5892a25

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

pyrtl/helperfuncs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ def match_bitpattern(w, bitpattern, field_map=None):
183183
:param w: The wirevector to be compared to the bitpattern
184184
:param bitpattern: A string holding the pattern (of bits and wildcards) to match
185185
:param field_map: (optional) A map from single-character field name in the bitpattern
186-
to the desired name of field in the returned namedtuple. If given, all non-"1"/"0"/"?"
187-
characters in the bitpattern must be present in the map.
186+
to the desired name of field in the returned namedtuple. If given, all non-"1"/"0"/"?"
187+
characters in the bitpattern must be present in the map.
188188
:return: A tuple of 1-bit wirevector carrying the result of the comparison, followed
189-
by a named tuple containing the matched fields, if any.
189+
by a named tuple containing the matched fields, if any.
190190
191191
This function will compare a multi-bit wirevector to a specified pattern of bits, where some
192192
of the pattern can be "wildcard" bits. If any of the "1" or "0" values specified in the

pyrtl/rtllib/aes.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
"""
2-
A class for building a PyRTL AES circuit.
1+
""" A class for building a PyRTL AES circuit.
32
43
Currently this class only supports 128 bit AES encryption/decryption
54
6-
``Example``::
5+
Example::
76
87
aes = AES()
98
plaintext = pyrtl.Input(bitwidth=128, name='aes_plaintext')

pyrtl/rtllib/muxes.py

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33

44
def prioritized_mux(selects, vals):
5-
"""
6-
Returns the value in the first wire for which its select bit is 1
5+
""" Returns the value in the first wire for which its select bit is 1
76
87
:param [WireVector] selects: a list of WireVectors signaling whether
98
a wire should be chosen
@@ -36,8 +35,7 @@ def _is_equivalent(w1, w2):
3635

3736

3837
def sparse_mux(sel, vals):
39-
"""
40-
Mux that avoids instantiating unnecessary mux_2s when possible.
38+
""" Mux that avoids instantiating unnecessary mux_2s when possible.
4139
4240
:param WireVector sel: Select wire, determines what is selected on a given cycle
4341
:param dictionary vals: dictionary of values at mux inputs (of type `{int:WireVector}`)
@@ -68,8 +66,7 @@ def sparse_mux(sel, vals):
6866

6967

7068
def _sparse_mux(sel, vals):
71-
"""
72-
Mux that avoids instantiating unnecessary mux_2s when possible.
69+
""" Mux that avoids instantiating unnecessary mux_2s when possible.
7370
7471
:param WireVector sel: Select wire, determines what is selected on a given cycle
7572
:param {int: WireVector} vals: dictionary to store the values that are
@@ -109,8 +106,7 @@ def _sparse_mux(sel, vals):
109106

110107

111108
class MultiSelector(object):
112-
"""
113-
The MultiSelector allows you to specify multiple wire value results
109+
""" The MultiSelector allows you to specify multiple wire value results
114110
for a single select wire.
115111
116112
Useful for processors, finite state machines and other places where the
@@ -119,9 +115,9 @@ class MultiSelector(object):
119115
120116
Example::
121117
122-
with muxes.MultiSelector(select, res0, res1, res2, ...) as ms:
123-
ms.option(val1, data0, data1, data2, ...)
124-
ms.option(val2, data0_2, data1_2, data2_2, ...)
118+
with muxes.MultiSelector(select, res0, res1, res2, ...) as ms:
119+
ms.option(val1, data0, data1, data2, ...)
120+
ms.option(val2, data0_2, data1_2, data2_2, ...)
125121
126122
This means that when the select wire equals the val1 wire
127123
the results will have the values in the coresponding data wires
@@ -135,8 +131,7 @@ def __init__(self, signal_wire, *dest_wires):
135131
self.dest_instrs_info = {dest_w: [] for dest_w in dest_wires}
136132

137133
def __enter__(self):
138-
"""
139-
For compatibility with `with` statements, which is the recommended
134+
""" For compatibility with `with` statements, which is the recommended
140135
method of using a MultiSelector
141136
"""
142137
return self
@@ -176,8 +171,7 @@ def _add_signal(self, data_signals):
176171
self.dest_instrs_info[dw].append(data_signal)
177172

178173
def finalize(self):
179-
"""
180-
Connects the wires.
174+
""" Connects the wires.
181175
"""
182176
self._check_finalized()
183177
self._final = True
@@ -188,8 +182,7 @@ def finalize(self):
188182

189183

190184
def demux(select):
191-
"""
192-
Demultiplexes a wire of arbitrary bitwidth
185+
""" Demultiplexes a wire of arbitrary bitwidth
193186
194187
:param WireVector select: indicates which wire to set on
195188
:return (WireVector, ...): a tuple of wires corresponding to each demultiplexed wire

0 commit comments

Comments
 (0)