Skip to content

Commit 7fe62f8

Browse files
wanda-phiwhitequark
authored andcommitted
Implement RFC 63: Remove amaranth.lib.coding
1 parent 8c02d3e commit 7fe62f8

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

amaranth/lib/coding.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
import warnings
2+
3+
warnings.warn("the `amaranth.lib.coding` module will be removed without a replacement; "
4+
"copy the module into your project to continue using it",
5+
DeprecationWarning, stacklevel=2)
6+
7+
18
from .. import *
29

310

docs/changes.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Apply the following changes to code written against Amaranth 0.4 to migrate it t
4141
* Remove any usage of ``name=`` with assertions, possibly replacing them with custom messages
4242
* Ensure all elaboratables are subclasses of :class:`Elaboratable`
4343
* Ensure clock domains aren't used outside the module that defines them, or its submodules; move clock domain definitions upwards in the hierarchy as necessary
44+
* Remove uses of ``amaranth.lib.coding.*`` by inlining or copying the implementation of the modules.
4445

4546

4647
Implemented RFCs
@@ -59,6 +60,7 @@ Implemented RFCs
5960
.. _RFC 58: https://amaranth-lang.org/rfcs/0058-valuecastable-format.html
6061
.. _RFC 59: https://amaranth-lang.org/rfcs/0059-no-domain-upwards-propagation.html
6162
.. _RFC 62: https://amaranth-lang.org/rfcs/0062-memory-data.html
63+
.. _RFC 63: https://amaranth-lang.org/rfcs/0063-remove-lib-coding.html
6264

6365
* `RFC 17`_: Remove ``log2_int``
6466
* `RFC 27`_: Testbench processes for the simulator
@@ -71,7 +73,8 @@ Implemented RFCs
7173
* `RFC 53`_: Low-level I/O primitives
7274
* `RFC 58`_: Core support for ``ValueCastable`` formatting
7375
* `RFC 59`_: Get rid of upwards propagation of clock domains
74-
* `RFC 62`_: The `MemoryData`` class
76+
* `RFC 62`_: The ``MemoryData`` class
77+
* `RFC 63`_: Remove ``amaranth.lib.coding``
7578

7679

7780
Language changes
@@ -115,6 +118,7 @@ Standard library changes
115118
* Changed: :meth:`amaranth.lib.wiring.Signature.is_compliant` no longer rejects reset-less signals.
116119
* Added: :class:`amaranth.lib.io.SingleEndedPort`, :class:`amaranth.lib.io.DifferentialPort`. (`RFC 55`_)
117120
* Added: :class:`amaranth.lib.io.Buffer`, :class:`amaranth.lib.io.FFBuffer`, :class:`amaranth.lib.io.DDRBuffer`. (`RFC 55`_)
121+
* Deprecated: :mod:`amaranth.lib.coding`. (`RFC 63`_)
118122
* Removed: (deprecated in 0.4) :mod:`amaranth.lib.scheduler`. (`RFC 19`_)
119123
* Removed: (deprecated in 0.4) :class:`amaranth.lib.fifo.FIFOInterface` with ``fwft=False``. (`RFC 20`_)
120124
* Removed: (deprecated in 0.4) :class:`amaranth.lib.fifo.SyncFIFO` with ``fwft=False``. (`RFC 20`_)

tests/test_lib_coding.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
import warnings
2+
13
from amaranth.hdl import *
24
from amaranth.sim import *
3-
from amaranth.lib.coding import *
5+
with warnings.catch_warnings():
6+
warnings.filterwarnings(action="ignore", category=DeprecationWarning)
7+
from amaranth.lib.coding import *
48

59
from .utils import *
610

0 commit comments

Comments
 (0)