back.verilog: make Yosys version check compatible with Verific.

This commit is contained in:
Teguh Hofstee 2020-04-22 05:23:14 -07:00 committed by GitHub
parent 0e18429fb7
commit 875579ea50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,8 @@ class YosysError(Exception):
def _yosys_version(): def _yosys_version():
yosys_path = require_tool("yosys") yosys_path = require_tool("yosys")
version = subprocess.check_output([yosys_path, "-V"], encoding="utf-8") 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 tag, offset = m[1], m[2] or 0
return tuple(map(int, tag.split("."))), offset return tuple(map(int, tag.split("."))), offset