From: Teguh Hofstee <5227572+hofstee@users.noreply.github.com> Date: Wed, 22 Apr 2020 12:23:14 +0000 (-0700) Subject: back.verilog: make Yosys version check compatible with Verific. X-Git-Tag: working2~38 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=875579ea50fdc6d5ae0adc1beff6e6c9df1bdd8b;p=nmigen.git back.verilog: make Yosys version check compatible with Verific. --- diff --git a/nmigen/back/verilog.py b/nmigen/back/verilog.py index eb98a34..6e2185a 100644 --- a/nmigen/back/verilog.py +++ b/nmigen/back/verilog.py @@ -16,7 +16,8 @@ class YosysError(Exception): def _yosys_version(): yosys_path = require_tool("yosys") version = subprocess.check_output([yosys_path, "-V"], encoding="utf-8") - m = re.match(r"^Yosys ([\d.]+)(?:\+(\d+))?", version) + # If Yosys is built with Verific, then Verific license information is printed first. + m = re.search(r"^Yosys ([\d.]+)(?:\+(\d+))?", version, flags=re.M) tag, offset = m[1], m[2] or 0 return tuple(map(int, tag.split("."))), offset