From e6d8d5a3547747c1fdf9b955e8713b36e81f2fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelina=20Ko=C5=9Bcielnicka?= Date: Mon, 3 Jul 2023 23:26:28 +0200 Subject: [PATCH] lib.io: allow 0-width `Pin` The main purpose of this change is migrating glasgow from the compat `TSTriple` (which allows 0 width) to `Pin`. This sort of change would normally require a RFC, but `Pin` is already slated for removal/replacement, so that was deemed to be unnecessary. --- amaranth/lib/io.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amaranth/lib/io.py b/amaranth/lib/io.py index b0fb305..c703213 100644 --- a/amaranth/lib/io.py +++ b/amaranth/lib/io.py @@ -12,8 +12,8 @@ def pin_layout(width, dir, xdr=0): See :class:`Pin` for details. """ - if not isinstance(width, int) or width < 1: - raise TypeError("Width must be a positive integer, not {!r}" + if not isinstance(width, int) or width < 0: + raise TypeError("Width must be a non-negative integer, not {!r}" .format(width)) if dir not in ("i", "o", "oe", "io"): raise TypeError("Direction must be one of \"i\", \"o\", \"io\", or \"oe\", not {!r}"""