From 65d77f03fe7a75182b4263cd11cc1251b393dad7 Mon Sep 17 00:00:00 2001 From: Catherine Date: Tue, 23 Jan 2024 03:33:36 +0000 Subject: [PATCH] back.verilog: forbid Yosys version range with dangling else bug. Fixes #1049. --- amaranth/back/verilog.py | 4 +++- pyproject.toml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/amaranth/back/verilog.py b/amaranth/back/verilog.py index 2ff487f..ff688eb 100644 --- a/amaranth/back/verilog.py +++ b/amaranth/back/verilog.py @@ -9,7 +9,9 @@ __all__ = ["YosysError", "convert", "convert_fragment"] def _convert_rtlil_text(rtlil_text, *, strip_internal_attrs=False, write_verilog_opts=()): # this version requirement needs to be synchronized with the one in pyproject.toml! - yosys = find_yosys(lambda ver: ver >= (0, 35)) + # Yosys 0.37 has a critical miscompilation in Verilog backend: + # https://github.com/amaranth-lang/amaranth/issues/1049 + yosys = find_yosys(lambda ver: ver >= (0, 35) and not (0, 36, 79) <= ver <= (0, 37, 29)) script = [] script.append(f"read_ilang <=0.35"] +builtin-yosys = ["amaranth-yosys>=0.35,!=0.37.0.*"] remote-build = ["paramiko~=2.7"] [project.scripts] @@ -49,7 +49,7 @@ includes = ["amaranth/"] [tool.pdm.dev-dependencies] test = [ - "yowasp-yosys", + "yowasp-yosys!=0.37.0.*", "coverage", ] docs = [