mirror of
https://github.com/YosysHQ/sby.git
synced 2025-04-05 14:04:07 +00:00
sby: fixed issue where engine index would be out of range
This commit is contained in:
parent
8f5508142d
commit
41b4ce5a7e
|
@ -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
|
||||
|
||||
|
|
|
@ -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}")
|
||||
|
|
|
@ -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}")
|
||||
|
||||
|
|
|
@ -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}")
|
||||
|
||||
|
|
|
@ -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}")
|
||||
|
||||
|
|
Loading…
Reference in a new issue