Skip to content

Commit f3dc981

Browse files
lansergerobtaylor
authored andcommitted
Updated PinSignature docs
1 parent 1099020 commit f3dc981

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

chipflow_lib/platforms/utils.py

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,16 @@ def as_json(self): # type: ignore
6666

6767

6868
class PinSignature(wiring.Signature):
69-
"""Amaranth Signtaure used to decorate wires that would
70-
usually be brought out onto a port on the package.
69+
"""Amaranth Signtaure used to decorate wires that would usually be brought out onto a port on the package.
70+
This class is generally not directly used.
71+
Instead, you would typically utilize the more specific
72+
:py:obj:`InputPinSignature`, :py:obj:`OutputPinSignature`, or :py:obj:`BidirPinSignature` for defining pin interfaces.
7173
7274
direction: Input, Output or Bidir
73-
width: width of port
74-
all_have_oe: For Bidir ports, should Output Enable be per wire or for the whole port
75+
width: width of port, default is 1
76+
all_have_oe: controls whether each output wire associated with an individual wire or
77+
single Output Enable signal will used for entire port,
78+
the default value is False, indicating that each output wire will have its own dedicated Output Enable signal.
7579
init: a :ref:`const-castable object <lang-constcasting>` for the initial values of the port
7680
"""
7781

@@ -131,14 +135,39 @@ def __repr__(self):
131135

132136

133137
def OutputPinSignature(width, **kwargs):
138+
"""This creates Amaranth Signtaure used to decorate package output wires
139+
that would be connected to the pads on the package.
140+
This creates an Amaranth Signature which is then used to decorate output signals
141+
intended for connection to the physical pads of the integrated circuit package.
142+
143+
:param width: specifies the number of individual output wires within this port, each of which will correspond to a separate physical pad on the integrated circuit package.
144+
:param init: a :ref:`const-castable object <lang-constcasting>` for the initial values of the port
145+
"""
134146
return PinSignature(io.Direction.Output, width=width, **kwargs)
135147

136148

137149
def InputPinSignature(width, **kwargs):
150+
"""This creates Amaranth Signtaure used to decorate package input wires
151+
that would be connected to the pads on the package.
152+
This creates an Amaranth Signature which is then used to decorate input signals
153+
intended for connection to the physical pads of the integrated circuit package.
154+
155+
:param width: specifies the number of individual input wires within this port, each of which will correspond to a separate physical pad on the integrated circuit package.
156+
:param init: a :ref:`const-castable object <lang-constcasting>` for the initial values of the port
157+
"""
138158
return PinSignature(io.Direction.Input, width=width, **kwargs)
139159

140160

141161
def BidirPinSignature(width, **kwargs):
162+
"""This creates Amaranth Signtaure used to decorate package bidirectional wires that would
163+
be connected to the pads on the package.
164+
This creates an Amaranth Signature which is then used to decorate bi-directional signals
165+
intended for connection to the physical pads of the integrated circuit package.
166+
167+
:param width: specifies the number of individual input/output wires within this port. Each pair of input/output wires will correspond to a separate physical pad on the integrated circuit package.
168+
:param all_have_oe: controls whether each output wire associated with an individual output enable wire or single Output Enable signal will be used for entire port, the default value is False, indicating that each output wire will have its own dedicated Output Enable signal.
169+
:param init: a :ref:`const-castable object <lang-constcasting>` for the initial values of the port
170+
"""
142171
return PinSignature(io.Direction.Bidir, width=width, **kwargs)
143172

144173

0 commit comments

Comments
 (0)