{"id":13398937,"url":"https://github.com/cristian-mattarei/CoSA","last_synced_at":"2025-03-14T03:30:58.566Z","repository":{"id":43409773,"uuid":"122120403","full_name":"cristian-mattarei/CoSA","owner":"cristian-mattarei","description":"CoreIR Symbolic Analyzer","archived":false,"fork":false,"pushed_at":"2020-10-27T02:37:08.000Z","size":8365,"stargazers_count":60,"open_issues_count":5,"forks_count":15,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-26T12:04:19.540Z","etag":null,"topics":["formal-methods","formal-verification","hardware-verification","model-checking","satisfiability-modulo-theories","systemverilog","verilog"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cristian-mattarei.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-19T21:04:18.000Z","updated_at":"2024-03-25T10:14:41.000Z","dependencies_parsed_at":"2022-07-08T21:47:48.134Z","dependency_job_id":null,"html_url":"https://github.com/cristian-mattarei/CoSA","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristian-mattarei%2FCoSA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristian-mattarei%2FCoSA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristian-mattarei%2FCoSA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristian-mattarei%2FCoSA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cristian-mattarei","download_url":"https://codeload.github.com/cristian-mattarei/CoSA/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":212890017,"owners_count":15506667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["formal-methods","formal-verification","hardware-verification","model-checking","satisfiability-modulo-theories","systemverilog","verilog"],"created_at":"2024-07-30T19:00:32.839Z","updated_at":"2024-07-30T19:03:28.400Z","avatar_url":"https://github.com/cristian-mattarei.png","language":"Python","funding_links":[],"categories":["Projects (sorted by year)"],"sub_categories":["2018"],"readme":".. figure:: http://www.mattarei.eu/cristian/images/CoSA-logo_small.png\n   :align: center\n   \nCoSA: CoreIR Symbolic Analyzer\n========================\n\n...an SMT-based symbolic model checker for hardware design. \n\n========================\nOverview\n========================\n\nCoSA supports a variety of input formats:\n\n- `CoreIR`_\n- `BTOR2`_\n- Verilog (with Yosys)\n- SystemVerilog (with Verific)\n- Symbolic Transition System (`STS`_)\n- Explicit states Transition System (`ETS`_)\n\nand verifications:\n\n- Invariant Properties\n- Linear Temporal Logic (LTL) Properties\n- Proving capabilities\n- Equivalence Checking\n- Parametric (Invariant) Model Checking\n- Fault Analysis\n- Automated Lemma Extraction\n\n========================\nInstallation\n========================\n\n1) ``pip3 install cosa`` to install CoSA, and its dependencies i.e., `PySMT`_, `PyCoreIR`_, and `PyVerilog`_\n\n2) ``pysmt-install --msat`` to install `MathSAT5`_ solver (it provides interpolation support), or ``pysmt-install --cvc4`` for `CVC4`_ and ``pysmt-install --z3`` for `Z3`_ and ``pysmt-install --btor`` for `Boolector`_\n\n3) ``pysmt-install --env`` to show the environment variables that need to be exported\n\nSoftware requirements:\n\n- `Python3`_ -- Full support requires Python3.6 or higher, however running without the `CoreIR`_ inputs should work on older Python 3 versions\n- `Pip3`_: package manager -- easiest way to install CoSA. On Debian: `apt-get update; apt-get install python3-pip`.\n- `Cmake`_ and a standard C++ compiler for `CoreIR`_ / `PyCoreIR`_\n- `Yosys`_ needs to be installed in order to support Verilog as an input format\n- `Verific`_ binaries or Yosys built with Verific library in order to support SystemVerilog as an input format [Commercial Tool]\n\n.. _BTOR2: https://github.com/Boolector/btor2tools\n.. _Boolector: https://github.com/Boolector/boolector\n.. _Cmake: https://cmake.org/\n.. _CoreIR: https://github.com/rdaly525/coreir\n.. _CVC4: http://cvc4.cs.stanford.edu/web/\n.. _ETS: https://github.com/cristian-mattarei/CoSA/blob/master/doc/ets.rst\n.. _Git: https://www.atlassian.com/git/tutorials/install-git\n.. _Icarus Verilog: https://github.com/steveicarus/iverilog\n.. _MathSAT5: http://mathsat.fbk.eu\n.. _Pip3: https://pypi.org/project/pip/\n.. _PyCoreIR: https://github.com/leonardt/pycoreir\n.. _PySMT: https://github.com/pysmt/pysmt\n.. _Python3: https://www.python.org/downloads/\n.. _PyVerilog: https://github.com/PyHDI/Pyverilog\n.. _STS: https://github.com/cristian-mattarei/CoSA/blob/master/doc/sts.rst\n.. _Verific: http://www.verific.com/\n.. _Yosys: https://github.com/YosysHQ/yosys\n.. _Z3: https://github.com/Z3Prover/z3\n\n\n========================\nInstallation from Source\n========================\n- Install `Git`_\n- ``git clone https://github.com/cristian-mattarei/CoSA.git``\n- ``cd CoSA``\n- ``pip3 install -e .``\n\nPip will automatically install the Python dependencies. To install Yosys for Verilog support, follow the instructions `here\n\u003chttps://github.com/YosysHQ/yosys/blob/master/README.md\u003e`_.\n\nNote: If running in a Python virtualenv, pip will install the ``CoSA`` script in ``~/.local/bin``, so be sure it's added to your ``PATH`` with ``export PATH=~/.local/bin:$PATH``.\n\nTo run tests (tests include Veriog models and thus require Yosys):\n\n- ``nosetests tests``\n\n========================\nUsage\n========================\n\nTo start playing with the tool, you can run:\n\n0) ``CoSA -h`` shows the helper with command options\n\n1) ``CoSA -i examples/counters/counters.json --verification simulation -k 7`` generates a system execution with depth 7\n\n2) ``CoSA -i examples/counters/counters.json --safety -p \"!(count0.a.out = 5_16)\" -k 7`` performs reachability model checking with property count0.a.out != 5 as a 16-bit Bitvector\n\n3) ``CoSA --problem examples/counter/problem.txt --prefix trace`` performs liveness (GF) and finally (F) checking on the counter.json model using the problem definition\n\n4) ``CoSA --problem examples/fold-constants/problem.txt`` performs equivalence checking using lemmas\n\n\nFor more information, please refer to the `CoSA user manual`_.\n\n.. _CoSA user manual: https://github.com/cristian-mattarei/CoSA/blob/master/doc/manual/CoSA-manual.pdf\n\n========================\nDocker\n========================\n\n1) install Docker with your package manager e.g., ``sudo apt-get install docker``\n\n2) build the Docker image: ``cd docker/ubuntu_1604 \u0026\u0026 docker build -t ubuntu-cosa .``\n\n3) run the Docker image: ``docker run -i -t ubuntu-cosa /bin/bash``\n\n========================\nLicense\n========================\n\nCoSA is released under the modified BSD (3-clause BSD) License.\n\nIf you use CoSA in your work, please consider citing the following publication:\n\n.. code::\n\n   @inproceedings{DBLP:conf/fmcad/MattareiMBDHH18,\n     author    = {Cristian Mattarei and\n                 Makai Mann and\n                 Clark Barrett and\n                 Ross G. Daly and\n                 Dillon Huff and\n                 Pat Hanrahan},\n    title     = {{CoSA: Integrated Verification for Agile Hardware Design}},\n    booktitle = {Formal Methods in Computer-Aided Design, {FMCAD} 2018, Austin, Texas,\n                 USA, October 30 - November 2, 2018.},\n    publisher = {{IEEE}},\n    year      = {2018}\n  }\n\n========================\nBuild Status\n========================\n\n.. image:: https://travis-ci.org/cristian-mattarei/CoSA.svg?branch=master\n    :target: https://travis-ci.org/cristian-mattarei/CoSA\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristian-mattarei%2FCoSA","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcristian-mattarei%2FCoSA","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristian-mattarei%2FCoSA/lists"}