Skip to content

Commit 3c6f467

Browse files
committed
lib.wiring: allow reset-less signals in interfaces.
This check was originally added out of abundance of caution, but since then it was observed that reset-less-ness is purely an implementation detail (see #1220), and furthermore it interferes with adaptation of `FIFOInterface`` signals (where `[rw]_data` are reset-less) for RFC 61.
1 parent 606ebcd commit 3c6f467

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

amaranth/lib/wiring.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -893,10 +893,6 @@ def check_attr_value(member, attr_value, *, path):
893893
f"the initial value {member.init!r}, but it has "
894894
f"the initial value {attr_value_cast.init!r}")
895895
return False
896-
if attr_value_cast.reset_less:
897-
if reasons is not None:
898-
reasons.append(f"{_format_path(path)} is expected to not be reset-less")
899-
return False
900896
return True
901897
if member.is_signature:
902898
return member.signature.is_compliant(attr_value, reasons=reasons, path=path)

docs/changes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Standard library changes
107107
* Added: :mod:`amaranth.lib.memory`. (`RFC 45`_)
108108
* Added: :class:`amaranth.lib.data.Const` class. (`RFC 51`_)
109109
* Changed: :meth:`amaranth.lib.data.Layout.const` returns a :class:`amaranth.lib.data.Const`, not a view (`RFC 51`_)
110+
* Changed: :meth:`amaranth.lib.wiring.Signature.is_compliant` no longer rejects reset-less signals.
110111
* Added: :class:`amaranth.lib.io.SingleEndedPort`, :class:`amaranth.lib.io.DifferentialPort`. (`RFC 55`_)
111112
* Added: :class:`amaranth.lib.io.Buffer`, :class:`amaranth.lib.io.FFBuffer`, :class:`amaranth.lib.io.DDRBuffer`. (`RFC 55`_)
112113
* Removed: (deprecated in 0.4) :mod:`amaranth.lib.scheduler`. (`RFC 19`_)

tests/test_lib_wiring.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,10 @@ def test_is_compliant(self):
453453
r"^'obj\.a' is expected to have the initial value 1, but it has the initial value 0$",
454454
sig=Signature({"a": In(1, init=1)}),
455455
obj=NS(a=Signal(1)))
456-
self.assertNotCompliant(
457-
r"^'obj\.a' is expected to not be reset-less$",
458-
sig=Signature({"a": In(1)}),
459-
obj=NS(a=Signal(1, reset_less=True)))
456+
self.assertTrue(
457+
Signature({"a": In(1)}).is_compliant(
458+
NS(signature=Signature({"a": In(1)}),
459+
a=Signal(1, reset_less=True))))
460460
self.assertNotCompliant(
461461
r"^'obj\.a' does not have an attribute 'b'$",
462462
sig=Signature({"a": Out(Signature({"b": In(1)}))}),

0 commit comments

Comments
 (0)