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:
|
class SbyConfig:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.options = dict()
|
self.options = dict()
|
||||||
# Define a default case for the engine block
|
self.engines = dict()
|
||||||
self.engines = { None: list() }
|
|
||||||
self.setup = dict()
|
self.setup = dict()
|
||||||
self.stage = dict()
|
self.stage = dict()
|
||||||
self.script = list()
|
self.script = list()
|
||||||
|
@ -263,7 +262,7 @@ class SbyConfig:
|
||||||
|
|
||||||
for line in f:
|
for line in f:
|
||||||
raw_line = line
|
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)
|
line = re.sub(r"\s*(\s#.*)?$", "", line)
|
||||||
if line == "" or line[0] == "#":
|
if line == "" or line[0] == "#":
|
||||||
continue
|
continue
|
||||||
|
@ -404,6 +403,8 @@ class SbyConfig:
|
||||||
|
|
||||||
if mode == "engines":
|
if mode == "engines":
|
||||||
args = line.strip().split()
|
args = line.strip().split()
|
||||||
|
if engine_mode not in self.engines:
|
||||||
|
self.engines[engine_mode] = list()
|
||||||
self.engines[engine_mode].append(args)
|
self.engines[engine_mode].append(args)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
|
@ -29,14 +29,13 @@ def run(task):
|
||||||
engine = engine_section
|
engine = engine_section
|
||||||
engine_name = None
|
engine_name = None
|
||||||
else:
|
else:
|
||||||
|
assert len(engine_section[1]) > 0
|
||||||
engine = engine_section[1][0]
|
engine = engine_section[1][0]
|
||||||
engine_name = engine_section[0]
|
engine_name = engine_section[0]
|
||||||
|
|
||||||
if engine_name is None:
|
if engine_name is None:
|
||||||
engine_name = engine_idx
|
engine_name = engine_idx
|
||||||
|
|
||||||
assert len(engine) > 0
|
|
||||||
|
|
||||||
|
|
||||||
task.log(f"""engine_{engine_name}: {" ".join(engine)}""")
|
task.log(f"""engine_{engine_name}: {" ".join(engine)}""")
|
||||||
task.makedirs(f"{task.workdir}/engine_{engine_idx}")
|
task.makedirs(f"{task.workdir}/engine_{engine_idx}")
|
||||||
|
|
|
@ -28,15 +28,13 @@ def run(task):
|
||||||
engine = engine_section
|
engine = engine_section
|
||||||
engine_name = None
|
engine_name = None
|
||||||
else:
|
else:
|
||||||
|
assert len(engine_section[1]) > 0
|
||||||
engine = engine_section[1][0]
|
engine = engine_section[1][0]
|
||||||
engine_name = engine_section[0]
|
engine_name = engine_section[0]
|
||||||
|
|
||||||
if engine_name is None:
|
if engine_name is None:
|
||||||
engine_name = engine_idx
|
engine_name = engine_idx
|
||||||
|
|
||||||
|
|
||||||
assert len(engine) > 0
|
|
||||||
|
|
||||||
task.log(f"""engine_{engine_name}: {" ".join(engine)}""")
|
task.log(f"""engine_{engine_name}: {" ".join(engine)}""")
|
||||||
task.makedirs(f"{task.workdir}/engine_{engine_idx}")
|
task.makedirs(f"{task.workdir}/engine_{engine_idx}")
|
||||||
|
|
||||||
|
|
|
@ -29,14 +29,13 @@ def run(task):
|
||||||
engine = engine_section
|
engine = engine_section
|
||||||
engine_name = None
|
engine_name = None
|
||||||
else:
|
else:
|
||||||
|
assert len(engine_section[1]) > 0
|
||||||
engine = engine_section[1][0]
|
engine = engine_section[1][0]
|
||||||
engine_name = engine_section[0]
|
engine_name = engine_section[0]
|
||||||
|
|
||||||
if engine_name is None:
|
if engine_name is None:
|
||||||
engine_name = engine_idx
|
engine_name = engine_idx
|
||||||
|
|
||||||
assert len(engine) > 0
|
|
||||||
|
|
||||||
task.log(f"""engine_{engine_name}: {" ".join(engine)}""")
|
task.log(f"""engine_{engine_name}: {" ".join(engine)}""")
|
||||||
task.makedirs(f"{task.workdir}/engine_{engine_idx}")
|
task.makedirs(f"{task.workdir}/engine_{engine_idx}")
|
||||||
|
|
||||||
|
|
|
@ -36,14 +36,13 @@ def run(task):
|
||||||
engine = engine_section
|
engine = engine_section
|
||||||
engine_name = None
|
engine_name = None
|
||||||
else:
|
else:
|
||||||
|
assert len(engine_section[1]) > 0
|
||||||
engine = engine_section[1][0]
|
engine = engine_section[1][0]
|
||||||
engine_name = engine_section[0]
|
engine_name = engine_section[0]
|
||||||
|
|
||||||
if engine_name is None:
|
if engine_name is None:
|
||||||
engine_name = engine_idx
|
engine_name = engine_idx
|
||||||
|
|
||||||
assert len(engine) > 0
|
|
||||||
|
|
||||||
task.log(f"""engine_{engine_name}: {" ".join(engine)}""")
|
task.log(f"""engine_{engine_name}: {" ".join(engine)}""")
|
||||||
task.makedirs(f"{task.workdir}/engine_{engine_idx}")
|
task.makedirs(f"{task.workdir}/engine_{engine_idx}")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue