Skip to content

Commit cd4ea96

Browse files
committed
Implement RFC 19: Remove amaranth.lib.scheduler
1 parent b172d63 commit cd4ea96

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

amaranth/lib/scheduler.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.scheduler` 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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Apply the following changes to code written against Amaranth 0.3 to migrate it t
2828
* Update imports of the form ``from amaranth.vendor.some_vendor import SomeVendorPlatform`` to ``from amaranth.vendor import SomeVendorPlatform``. This change will reduce future churn.
2929
* Replace uses of ``Const.normalize(value, shape)`` with ``Const(value, shape).value``.
3030
* Replace uses of ``Repl(value, count)`` with ``value.replicate(count)``.
31+
* Remove uses of ``amaranth.lib.scheduler.RoundRobin`` by inlining or copying the implementation of that class.
3132

3233
While code that uses the features listed as deprecated below will work in Amaranth 0.4, they will be removed in the next version.
3334

@@ -44,6 +45,7 @@ Implemented RFCs
4445
.. _RFC 10: https://amaranth-lang.org/rfcs/0010-move-repl-to-value.html
4546
.. _RFC 15: https://amaranth-lang.org/rfcs/0015-lifting-shape-castables.html
4647
.. _RFC 18: https://amaranth-lang.org/rfcs/0018-reorganize-vendor-platforms.html
48+
.. _RFC 19: https://amaranth-lang.org/rfcs/0019-remove-scheduler.html
4749
.. _RFC 22: https://amaranth-lang.org/rfcs/0022-valuecastable-shape.html
4850

4951
* `RFC 1`_: Aggregate data structure library
@@ -55,6 +57,7 @@ Implemented RFCs
5557
* `RFC 9`_: Constant initialization for shape-castable objects
5658
* `RFC 10`_: Move ``Repl`` to ``Value.replicate``
5759
* `RFC 18`_: Reorganize vendor platforms
60+
* `RFC 19`_: Remove ``amaranth.lib.scheduler``
5861
* `RFC 15`_: Lifting shape-castable objects
5962
* `RFC 22`_: Define ``ValueCastable.shape()``
6063

@@ -89,6 +92,7 @@ Standard library changes
8992
* Added: :mod:`amaranth.lib.enum`. (`RFC 3`_)
9093
* Added: :mod:`amaranth.lib.data`. (`RFC 1`_)
9194
* Added: :mod:`amaranth.lib.crc`. (`RFC 6`_)
95+
* Deprecated: :mod:`amaranth.lib.scheduler`. (`RFC 19`_)
9296

9397

9498
Toolchain changes

tests/test_lib_scheduler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# amaranth: UnusedElaboratable=no
22

33
import unittest
4+
import warnings
45

56
from amaranth.hdl import *
67
from amaranth.asserts import *
78
from amaranth.sim import *
8-
from amaranth.lib.scheduler import *
9+
with warnings.catch_warnings():
10+
warnings.filterwarnings(action="ignore", category=DeprecationWarning)
11+
from amaranth.lib.scheduler import *
912

1013
from .utils import *
1114

0 commit comments

Comments
 (0)