Add "skip" options (smtbmc only)
authorClifford Wolf <clifford@clifford.at>
Wed, 12 Sep 2018 11:12:24 +0000 (13:12 +0200)
committerClifford Wolf <clifford@clifford.at>
Wed, 12 Sep 2018 11:23:34 +0000 (13:23 +0200)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
docs/source/reference.rst
sbysrc/sby_core.py
sbysrc/sby_engine_smtbmc.py

index 9d2871cf36f0ae1929e3eef422b9069c52eba327..5143fd86028af8a5ef423a8000f7eea5d18abefc 100644 (file)
@@ -159,6 +159,10 @@ options are:
 |                  |            | engine. Other engines ignore this option in ``prove``   |
 |                  |            | mode. Default: ``20``                                   |
 +------------------+------------+---------------------------------------------------------+
+| ``skip``         | ``bmc``,   | Skip the specified number of time steps. Only valid     |
+|                  | ``cover``  | with smtbmc engine. All other engines are disabled when |
+|                  |            | this option is used. Default: None                      |
++------------------+------------+---------------------------------------------------------+
 | ``append``       | ``bmc``,   | When generating a counter-example trace, add the        |
 |                  | ``prove``, | specified number of cycles at the end of the trace.     |
 |                  | ``cover``  | Default: ``0``                                          |
index 16462a4fef423c38f507b77f362193c56c64336f..f2792ada26631901ef74fb8d626fb9c61812c149 100644 (file)
@@ -497,6 +497,7 @@ class SbyJob:
         self.handle_int_option("timeout", None)
 
         self.handle_str_option("smtc", None)
+        self.handle_int_option("skip", None)
         self.handle_str_option("tbtop", None)
 
         if self.opt_smtc is not None:
@@ -504,6 +505,14 @@ class SbyJob:
                 if engine[0] != "smtbmc":
                     self.error("Option smtc is only valid for smtbmc engine.")
 
+        if self.opt_skip is not None:
+            if self.opt_skip == 0:
+                self.opt_skip = None
+            else:
+                for engine in self.engines:
+                    if engine[0] != "smtbmc":
+                        self.error("Option skip is only valid for smtbmc engine.")
+
         self.copy_src()
 
         if self.opt_mode == "bmc":
index bea112341eabcb6e244b75da4200c0a18b69bd7a..ec83c2791584c7ad2e04faa907338d944e3f0e77 100644 (file)
@@ -121,9 +121,15 @@ def run(mode, job, engine_idx, engine):
     if not progress:
         smtbmc_opts.append("--noprogress")
 
+
+    if job.opt_skip is not None:
+        t_opt = "%d:%d" % (job.opt_skip, job.opt_depth)
+    else:
+        t_opt = "%d" % job.opt_depth
+
     task = SbyTask(job, taskname, job.model(model_name),
-            "cd %s; %s %s -t %d --append %d --dump-vcd %s.vcd --dump-vlogtb %s_tb.v --dump-smtc %s.smtc model/design_%s.smt2" %
-                    (job.workdir, job.exe_paths["smtbmc"], " ".join(smtbmc_opts), job.opt_depth, job.opt_append, trace_prefix, trace_prefix, trace_prefix, model_name),
+            "cd %s; %s %s -t %s --append %d --dump-vcd %s.vcd --dump-vlogtb %s_tb.v --dump-smtc %s.smtc model/design_%s.smt2" %
+                    (job.workdir, job.exe_paths["smtbmc"], " ".join(smtbmc_opts), t_opt, job.opt_append, trace_prefix, trace_prefix, trace_prefix, model_name),
             logfile=open(logfile_prefix + ".txt", "w"), logstderr=(not progress))
 
     if mode == "prove_basecase":