From 9a718367ff4a1d29a6f0a521891986893011920a Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 26 Feb 2017 13:03:59 +0100 Subject: [PATCH] Improve super_prove integration --- docs/source/index.rst | 2 +- docs/source/quickstart.rst | 76 +++++++++++++++++++++++++++++++++----- sbysrc/sby.py | 7 +++- sbysrc/sby_core.py | 2 +- 4 files changed, 75 insertions(+), 12 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index b6de19a..b697dbe 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -16,7 +16,7 @@ formal tasks: at the moment.) .. toctree:: - :maxdepth: 2 + :maxdepth: 3 quickstart.rst reference.rst diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index c7c7232..9fb6a94 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -8,19 +8,77 @@ The example files used in this chapter can be downloaded from `here Installing ---------- -TBD +Follow the instructions below to install SymbiYosys and its dependencies. +Yosys, SymbiYosys, and Z3 are non-optional. The other packages are only +required for some engine configurations. -Until I find the time to write this section this links must suffice: +Prerequisites +~~~~~~~~~~~~~ + +Installing prerequisites (this command is for Ubuntu 16.04): + +.. code-block:: text + + sudo apt-get install build-essential clang bison flex libreadline-dev \ + gawk tcl-dev libffi-dev git mercurial graphviz \ + xdot pkg-config python python3 libftdi-dev + +Yosys, Yosys-SMTBMC and ABC +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Next install Yosys, Yosys-SMTBMC and ABC (``yosys-abc``): + +.. code-block:: text + + git clone https://github.com/cliffordwolf/yosys.git yosys + cd yosys + make -j$(nproc) + sudo make install + +SymbiYosys +~~~~~~~~~~ + +.. code-block:: text + + git clone https://github.com/cliffordwolf/SymbiYosys.git SymbiYosys + cd SymbiYosys + sudo make install + +Z3 +~~ + +.. code-block:: text + + git clone https://github.com/Z3Prover/z3.git z3 + cd z3 + python scripts/mk_make.py + cd build + make -j$(nproc) + sudo make install + +super_prove +~~~~~~~~~~~ + +Download the right binary .tar.gz for your system from http://downloads.bvsrc.org/super_prove/ +and extract it to ``/usr/local/super_prove``. + +Then create a wrapper script ``/usr/local/bin/suprove`` with the following contents: + +.. code-block:: text + + #!/bin/bash + tool=super_prove; if [ "$1" != "${1#+}" ]; then tool="${1#+}"; shift; fi + exec /usr/local/super_prove/bin/${tool}.sh "$@" + +Other packages +~~~~~~~~~~~~~~ + +Until I find the time to write install guides for this packages, the following links must suffice: - * Yosys: http://www.clifford.at/yosys/ - * SymbiYosys: https://github.com/cliffordwolf/SymbiYosys - * Z3: https://github.com/Z3Prover/z3 * Yices2: http://yices.csl.sri.com/ * Boolector: http://fmv.jku.at/boolector/ - * super_prove: http://downloads.bvsrc.org/super_prove/ - -(Yosys, SymbiYosys, and Z3 are non-optional. The other packages are only -required for some engine configurations.) + * Avy: https://arieg.bitbucket.io/avy/ + * AIGER: http://fmv.jku.at/aiger/ First step: A simple BMC example -------------------------------- diff --git a/sbysrc/sby.py b/sbysrc/sby.py index e960240..922513b 100644 --- a/sbysrc/sby.py +++ b/sbysrc/sby.py @@ -44,6 +44,7 @@ sby [options] .sby --abc --smtbmc --suprove + --aigbmc --avy configure which executable to use for the respective tool """) @@ -51,7 +52,7 @@ sby [options] .sby try: opts, args = getopt.getopt(sys.argv[1:], "d:bf", ["yosys=", - "abc=", "smtbmc=", "suprove="]) + "abc=", "smtbmc=", "suprove=", "aigbmc=", "avy="]) except: usage() @@ -70,6 +71,10 @@ for o, a in opts: exe_paths["smtbmc"] = a elif o == "--suprove": exe_paths["suprove"] = a + elif o == "--aigbmc": + exe_paths["aigbmc"] = a + elif o == "--avy": + exe_paths["avy"] = a else: usage() diff --git a/sbysrc/sby_core.py b/sbysrc/sby_core.py index c32bf73..ad7aa2e 100644 --- a/sbysrc/sby_core.py +++ b/sbysrc/sby_core.py @@ -140,7 +140,7 @@ class SbyJob: "yosys": "yosys", "abc": "yosys-abc", "smtbmc": "yosys-smtbmc", - "suprove": "super_prove", + "suprove": "suprove", "aigbmc": "aigbmc", "avy": "avy", } -- 2.30.2