3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-04-05 14:04:07 +00:00

sby: core: fixed up the engines section parser

This commit is contained in:
Aki Van Ness 2022-08-04 06:32:32 -04:00
parent 2f841e5d55
commit ad4f506d2a
No known key found for this signature in database
GPG key ID: C629E8EC06327BEE

View file

@ -293,18 +293,22 @@ class SbyConfig:
# [engines (MODE)]
if section == "engines":
mode = "engines"
if len(entries) > 2:
self.error(f"sby file syntax error: [engine] sections expects at most 1 argument, got more '{line}'")
if len(entries) == 2 and entries[1] not in ("bmc", "prove", "cover", "live"):
self.error(f"sby file syntax error: Expected one of 'bmc, prove, cover, live' not '{entries[1]}'")
elif len(entries) == 2:
pass
# if entries[1] not in self.engines:
# self.engines[entries[1]] = list()
# engine_mode = entries[1]
# else:
# self.error(f"Already defined engine block for mode '{entries[1]}'")
if args is not None:
section_args = args.split()
if len(section_args) > 1:
self.error(f"sby file syntax error: '[engine]' sections expects at most 1 argument, got '{len(section_args)}'")
if section_args[0] not in ("bmc", "prove", "cover", "live"):
self.error(f"sby file syntax error: Expected one of 'bmc, prove, cover, live' as '[engine]` argument, not '{section_args[0]}'")
if section_args[0] in self.engines:
self.error(f"Already defined engine block for mode '{section_args[0]}'")
else:
self.engines[section_args[0]] = list()
engine_mode = section_args[0]
continue
# [setup]
if section == "setup":