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

sby: fixed issue where engine index would be out of range

This commit is contained in:
Aki Van Ness 2022-08-18 05:51:03 -04:00
parent 8f5508142d
commit 41b4ce5a7e
No known key found for this signature in database
GPG key ID: C629E8EC06327BEE
5 changed files with 8 additions and 12 deletions

View file

@ -246,8 +246,7 @@ class SbyAbort(BaseException):
class SbyConfig:
def __init__(self):
self.options = dict()
# Define a default case for the engine block
self.engines = { None: list() }
self.engines = dict()
self.setup = dict()
self.stage = dict()
self.script = list()
@ -263,7 +262,7 @@ class SbyConfig:
for line in f:
raw_line = line
if mode in ["options", "engines", "files", "autotune"]:
if mode in ["options", "engines", "files", "autotune", "setup", "stage"]:
line = re.sub(r"\s*(\s#.*)?$", "", line)
if line == "" or line[0] == "#":
continue
@ -404,6 +403,8 @@ class SbyConfig:
if mode == "engines":
args = line.strip().split()
if engine_mode not in self.engines:
self.engines[engine_mode] = list()
self.engines[engine_mode].append(args)
continue

View file

@ -29,14 +29,13 @@ def run(task):
engine = engine_section
engine_name = None
else:
assert len(engine_section[1]) > 0
engine = engine_section[1][0]
engine_name = engine_section[0]
if engine_name is None:
engine_name = engine_idx
assert len(engine) > 0
task.log(f"""engine_{engine_name}: {" ".join(engine)}""")
task.makedirs(f"{task.workdir}/engine_{engine_idx}")

View file

@ -28,15 +28,13 @@ def run(task):
engine = engine_section
engine_name = None
else:
assert len(engine_section[1]) > 0
engine = engine_section[1][0]
engine_name = engine_section[0]
if engine_name is None:
engine_name = engine_idx
assert len(engine) > 0
task.log(f"""engine_{engine_name}: {" ".join(engine)}""")
task.makedirs(f"{task.workdir}/engine_{engine_idx}")

View file

@ -29,14 +29,13 @@ def run(task):
engine = engine_section
engine_name = None
else:
assert len(engine_section[1]) > 0
engine = engine_section[1][0]
engine_name = engine_section[0]
if engine_name is None:
engine_name = engine_idx
assert len(engine) > 0
task.log(f"""engine_{engine_name}: {" ".join(engine)}""")
task.makedirs(f"{task.workdir}/engine_{engine_idx}")

View file

@ -36,14 +36,13 @@ def run(task):
engine = engine_section
engine_name = None
else:
assert len(engine_section[1]) > 0
engine = engine_section[1][0]
engine_name = engine_section[0]
if engine_name is None:
engine_name = engine_idx
assert len(engine) > 0
task.log(f"""engine_{engine_name}: {" ".join(engine)}""")
task.makedirs(f"{task.workdir}/engine_{engine_idx}")