Skip to content

Commit 9913ec9

Browse files
committed
Support setting arbitrary SBY options for the SBY strategy
1 parent b3e5464 commit 9913ec9

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

docs/source/strategies.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ Strategy Options
8383
``xprop`` pass, but may prevent proving partitions equivalent when they
8484
contain uninitialized state or don't-care values. (default value: on)
8585

86+
``option <option_name> <option_value>``
87+
Set arbitrary option in the generated ``.sby`` files. Can be used multiple
88+
times.
89+
8690
Example Configurations
8791
......................
8892

src/eqy.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,12 @@ def string_opt_parser(self, name, value):
816816
return "expected option value"
817817
setattr(self.scfg, name, value)
818818

819+
def multi_string_opt_parser(self, name, value):
820+
if name not in self.options_seen:
821+
self.options_seen.add(name)
822+
setattr(self.scfg, name, [])
823+
getattr(self.scfg, name).append(value)
824+
819825
def bool_opt_parser(self, name, value):
820826
if name in self.options_seen:
821827
return "repeated option"
@@ -894,6 +900,7 @@ class EqySbyStrategy(EqyStrategy):
894900
parse_opt_depth = EqyStrategy.int_opt_parser
895901
parse_opt_xprop = EqyStrategy.bool_opt_parser
896902
parse_opt_timeout = EqyStrategy.int_opt_parser
903+
parse_opt_option = EqyStrategy.multi_string_opt_parser
897904

898905
def write(self, job, partition):
899906
with open(self.path(partition.name, f"{partition.name}.sby"), "w") as sby_f:
@@ -907,6 +914,9 @@ def write(self, job, partition):
907914
if self.scfg.timeout:
908915
print(f"timeout {self.scfg.timeout}", file=sby_f)
909916

917+
for option in self.scfg.option or []:
918+
print(option, file=sby_f)
919+
910920
print(textwrap.dedent(f"""
911921
912922
[engines]

0 commit comments

Comments
 (0)