Skip to content

Commit

Permalink
sby: core: Started on the initial stages setup script generation
Browse files Browse the repository at this point in the history
  • Loading branch information
lethalbit committed Sep 19, 2022
1 parent 83a1aa2 commit 609303e
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion sbysrc/sby_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def parse_config(self, f):

if mode == "setup":
_valid_options = (
"cutpoint", "disable", "enable", "assume", "define"
"cutpoint", "disable", "enable", "assume", "define", "invoke"
)

args = line.strip().split(maxsplit = 1)
Expand Down Expand Up @@ -530,6 +530,41 @@ def parse_config(self, f):
def error(self, logmessage):
raise SbyAbort(logmessage)

def gen_setup_script(self):
script = '# Autogenerated by SBY stage setup\n'

def cutpoint(v):
return f"cutpoint {v}"

def disable(v):
return f"select -del {v}"

def enable(v):
return f"select -add {v}"

def assume(v):
return f"chformal -assert2assume {v}"

def define(v):
return f"select -set {v}"

def invoke(v):
return f"{v}"

for k, v in self.setup.items():
script += {
'cutpoint': cutpoint(v),
'disable': disable(v),
'enable': enable(v),
'assume': assume(v),
'define': define(v),
'invoke': invoke(v)
}.get(k, '') + '\n'

# TODO: Invert selection, then `chformal -assert -remove`

return script


class SbyTaskloop:
def __init__(self, jobclient=None):
Expand Down

0 comments on commit 609303e

Please sign in to comment.