From: Jean-François Nguyen Date: Wed, 24 Apr 2019 21:58:01 +0000 (+0200) Subject: lib.io: add a name argument to the Pin constructor. X-Git-Tag: locally_working~257 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a77122c2ed422ac7e7e96d9d4ba58c6b37fa8bc;p=nmigen.git lib.io: add a name argument to the Pin constructor. --- diff --git a/nmigen/lib/io.py b/nmigen/lib/io.py index e8f67f1..f77dde6 100644 --- a/nmigen/lib/io.py +++ b/nmigen/lib/io.py @@ -65,6 +65,8 @@ class Pin(Record): are present instead, where ``N in range(0, N)``. For example, if ``xdr=2``, the I/O buffer is DDR; the signal ``i0`` reflects the value at the rising edge, and the signal ``i1`` reflects the value at the falling edge. + name : str + Name of the underlying record. Attributes ---------- @@ -84,9 +86,9 @@ class Pin(Record): I/O buffer output enable. Present if ``dir="io"``. Buffers generally cannot change direction more than once per cycle, so at most one output enable signal is present. """ - def __init__(self, width, dir, xdr=1): + def __init__(self, width, dir, xdr=1, name=None): self.width = width self.dir = dir self.xdr = xdr - super().__init__(pin_layout(self.width, self.dir, self.xdr)) + super().__init__(pin_layout(self.width, self.dir, self.xdr), name=name)