From d8a9951a334e93169ba2e2bcd70f545980d84081 Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Wed, 9 Oct 2024 16:57:58 +0000 Subject: [PATCH 1/4] Drop support for Python 3.8. --- .github/workflows/main.yaml | 2 -- docs/install.rst | 6 +++--- pyproject.toml | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fc5229146..af45b7042 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,12 +11,10 @@ jobs: strategy: matrix: python-version: - - '3.8' - '3.9' - '3.10' - '3.11' - '3.12' - - 'pypy-3.8' - 'pypy-3.9' - 'pypy-3.10' allow-failure: diff --git a/docs/install.rst b/docs/install.rst index d92368084..25b4fb002 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -6,7 +6,7 @@ System requirements .. |yosys-version| replace:: 0.35 (or newer) -Amaranth HDL requires Python 3.8; it works on CPython_ 3.8 (or newer), and works faster on PyPy3.8_ 7.3.7 (or newer). Installation requires pip_ 23.0 (or newer). +Amaranth HDL requires Python 3.9; it works on CPython_ 3.9 (or newer), and works faster on PyPy3.9_ 7.3.7 (or newer). Installation requires pip_ 23.0 (or newer). For most workflows, Amaranth requires Yosys_ |yosys-version|. A compatible version of Yosys is distributed via PyPI_ for most popular platforms. @@ -17,8 +17,8 @@ Synthesizing, placing and routing an Amaranth design for an FPGA requires the FP .. TODO: Link to FPGA family docs here .. _CPython: https://www.python.org/ -.. _PyPy3.8: https://www.pypy.org/ -.. _pip: https://pip.pypa.io/ +.. _PyPy3.9: https://www.pypy.org/ +.. _pip: https://pip.pypa.io/en/stable/ .. _Yosys: https://yosyshq.net/yosys/ .. _PyPI: https://pypi.org/ .. _GTKWave: http://gtkwave.sourceforge.net/ diff --git a/pyproject.toml b/pyproject.toml index de17f1aff..1ee9f1c87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,9 +12,8 @@ readme = "README.md" authors = [{name = "Amaranth HDL contributors"}] license = {file = "LICENSE.txt"} -requires-python = "~=3.8" +requires-python = "~=3.9" dependencies = [ - "importlib_resources; python_version<'3.9'", # for amaranth._toolchain.yosys "pyvcd>=0.2.2,<0.5", # for amaranth.sim.pysim "Jinja2~=3.0", # for amaranth.build ] From f85d2d1e843d1dad841addf6981931d62d9a2376 Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Wed, 16 Apr 2025 13:29:37 +0200 Subject: [PATCH 2/4] backends: s/ilang/rtlil as a result of YosysHQ/yosys#4704 Backported from https://github.com/amaranth-lang/amaranth/commit/590cba1d6c00dffba7abb5f399680ac50e252adf --- amaranth/back/cxxrtl.py | 4 ++-- amaranth/back/verilog.py | 2 +- amaranth/vendor/_gowin.py | 4 ++-- amaranth/vendor/_intel.py | 6 +++--- amaranth/vendor/_lattice_ecp5.py | 6 +++--- amaranth/vendor/_lattice_ice40.py | 6 +++--- tests/utils.py | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/amaranth/back/cxxrtl.py b/amaranth/back/cxxrtl.py index 0fa657b0a..725bda48a 100644 --- a/amaranth/back/cxxrtl.py +++ b/amaranth/back/cxxrtl.py @@ -23,8 +23,8 @@ def _convert_rtlil_text(rtlil_text, black_boxes, *, src_loc_at=0): script = [] if black_boxes is not None: for box_name, box_source in black_boxes.items(): - script.append(f"read_ilang <= (0, 38)) script = [] - script.append(f"read_ilang < Date: Wed, 16 Apr 2025 15:36:13 +0200 Subject: [PATCH 3/4] Bump sphinx-rtd-theme --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1ee9f1c87..ecc787eb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ test = [ docs = [ "sphinx~=7.1", "sphinxcontrib-platformpicker~=1.3", - "sphinx-rtd-theme~=1.2", + "sphinx-rtd-theme~=2.0", "sphinx-autobuild", ] examples = [ From 266dd4b9e4c6d93c380e45fc8a13cb066e368a01 Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Wed, 16 Apr 2025 15:51:42 +0200 Subject: [PATCH 4/4] docs: lang: fix build with PYTHONWARNINGS=error after Sphinx update. Backported from 556faea --- docs/lang.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/lang.rst b/docs/lang.rst index bde2509bb..f24cf3c94 100644 --- a/docs/lang.rst +++ b/docs/lang.rst @@ -172,6 +172,14 @@ Specifying a shape with a range is convenient for counters, indexes, and all oth Python ranges are *exclusive* or *half-open*, meaning they do not contain their ``.stop`` element. Because of this, values with shapes cast from a ``range(stop)`` where ``stop`` is a power of 2 are not wide enough to represent ``stop`` itself: + .. doctest:: + :hide: + + >>> import warnings + >>> _warning_filters_backup = warnings.catch_warnings() + >>> _warning_filters_backup.__enter__() # have to do this horrific hack to make it work with `PYTHONWARNINGS=error` :( + >>> warnings.simplefilter("default", amaranth.hdl.dsl.SyntaxWarning) + .. doctest:: >>> fencepost = C(256, range(256)) @@ -182,6 +190,11 @@ Specifying a shape with a range is convenient for counters, indexes, and all oth >>> fencepost.value 0 + .. doctest:: + :hide: + + >>> _warning_filters_backup.__exit__() + Amaranth detects uses of :class:`Const` and :class:`Signal` that invoke such an off-by-one error, and emits a diagnostic message. .. note::