mirror of
https://github.com/YosysHQ/sby.git
synced 2025-04-05 14:04:07 +00:00
sby: core: minor update to the stage parsing
This commit is contained in:
parent
ed82c78acc
commit
0ab158eea1
|
@ -399,38 +399,38 @@ class SbyConfig:
|
||||||
name = kvp[1][1:]
|
name = kvp[1][1:]
|
||||||
self.setup['define'][name] = kvp[2:]
|
self.setup['define'][name] = kvp[2:]
|
||||||
else:
|
else:
|
||||||
self.setup[key] = kvp[1:]
|
self.setup[stmt] = kvp[1:]
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if mode == "stage":
|
if mode == "stage":
|
||||||
self.error("[stage] section not yet supported")
|
self.error("[stage] section not yet supported")
|
||||||
kvp = line.split()
|
kvp = line.split()
|
||||||
if key is None or key == '':
|
if key is None or key == '':
|
||||||
self.error(f"sby file syntax error: in stage mode but unknown key")
|
self.error(f"sby file syntax error: in stage mode but unknown key")
|
||||||
|
|
||||||
if len(kvp) == 0:
|
if len(kvp) == 0:
|
||||||
continue
|
|
||||||
|
|
||||||
if kvp[0] not in ("mode", "depth", "timeout", "expect", "engine",
|
|
||||||
"cutpoint", "enable", "disable", "assume", "skip",
|
|
||||||
"check", "prove", "abstract", "setsel") or len(kvp) < 2:
|
|
||||||
self.error(f"sby file syntax error: {line}")
|
|
||||||
else:
|
|
||||||
stmt = kvp[0]
|
|
||||||
if stmt == 'setsel':
|
|
||||||
if len(kvp[1:]) < 2:
|
|
||||||
self.error(f"sby file syntax error: {line}")
|
|
||||||
elif kvp[1][0] != '@':
|
|
||||||
self.error(f"sby file syntax error: {line}")
|
|
||||||
else:
|
|
||||||
name = kvp[1][1:]
|
|
||||||
self.stage[key][stmt] = {
|
|
||||||
'name': name, 'pattern': kvp[2:]
|
|
||||||
}
|
|
||||||
else:
|
|
||||||
self.stage[key][stmt] = kvp[1:]
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if kvp[0] not in ("mode", "depth", "timeout", "expect", "engine",
|
||||||
|
"cutpoint", "enable", "disable", "assume", "skip",
|
||||||
|
"check", "prove", "abstract", "setsel") or len(kvp) < 2:
|
||||||
|
self.error(f"sby file syntax error: {line}")
|
||||||
|
else:
|
||||||
|
stmt = kvp[0]
|
||||||
|
if stmt == 'setsel':
|
||||||
|
if len(kvp[1:]) < 2:
|
||||||
|
self.error(f"sby file syntax error: {line}")
|
||||||
|
elif kvp[1][0] != '@':
|
||||||
|
self.error(f"sby file syntax error: {line}")
|
||||||
|
else:
|
||||||
|
name = kvp[1][1:]
|
||||||
|
self.stage[key][stmt] = {
|
||||||
|
'name': name, 'pattern': kvp[2:]
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
self.stage[key][stmt] = kvp[1:]
|
||||||
|
continue
|
||||||
|
|
||||||
if mode == "script":
|
if mode == "script":
|
||||||
self.script.append(line)
|
self.script.append(line)
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue