cristian-mattarei / Cosa

Licence: other
CoreIR Symbolic Analyzer

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Cosa

plutus-experimental-smart-contracts
Experimental Smart Contracts In Plutus.
Stars: ✭ 34 (-2.86%)
Mutual labels:  model-checking, formal-methods
Vscode Tlaplus
TLA+ language support for Visual Studio Code
Stars: ✭ 152 (+334.29%)
Mutual labels:  formal-methods, model-checking
Software Quality Wiki
Software Quality Wiki
Stars: ✭ 1,991 (+5588.57%)
Mutual labels:  formal-methods, model-checking
klever
Read-only mirror of the Klever Git repository
Stars: ✭ 18 (-48.57%)
Mutual labels:  model-checking, formal-methods
avr
Reads a state transition system and performs property checking
Stars: ✭ 41 (+17.14%)
Mutual labels:  verilog, model-checking
vscode-tlaplus
TLA+ language support for Visual Studio Code
Stars: ✭ 213 (+508.57%)
Mutual labels:  model-checking, formal-methods
intrepid
Intrepyd Model Checker
Stars: ✭ 14 (-60%)
Mutual labels:  model-checking, formal-methods
Tool lists
Links to tools by subject
Stars: ✭ 270 (+671.43%)
Mutual labels:  formal-methods, model-checking
99tsp
The 99 Traveling Salespeople Project
Stars: ✭ 21 (-40%)
Mutual labels:  verilog
Clash Compiler
Haskell to VHDL/Verilog/SystemVerilog compiler
Stars: ✭ 958 (+2637.14%)
Mutual labels:  verilog
Can
CAN Protocol Controller
Stars: ✭ 20 (-42.86%)
Mutual labels:  verilog
Pdfparser
Stars: ✭ 21 (-40%)
Mutual labels:  verilog
Image Processing
Image Processing Toolbox in Verilog using Basys3 FPGA
Stars: ✭ 31 (-11.43%)
Mutual labels:  verilog
Verilog Osx
Barerbones OSX based Verilog simulation toolchain.
Stars: ✭ 21 (-40%)
Mutual labels:  verilog
Comparchitecture
Verilog and MIPS simple programs
Stars: ✭ 35 (+0%)
Mutual labels:  verilog
Cs231n Project
CNN accelerator
Stars: ✭ 15 (-57.14%)
Mutual labels:  verilog
Pitchshifter
Change the pitch of your voice in real-time!
Stars: ✭ 15 (-57.14%)
Mutual labels:  verilog
Higan Verilog
This is a higan/Verilator co-simulation example/framework
Stars: ✭ 35 (+0%)
Mutual labels:  verilog
Verilog Utils
native Verilog pcap, littletoe, bcd, xml and hash modules, with Icarus testbenches
Stars: ✭ 33 (-5.71%)
Mutual labels:  verilog
Iroha
Intermediate Representation Of Hardware Abstraction (LLVM-ish for HLS)
Stars: ✭ 30 (-14.29%)
Mutual labels:  verilog

.. figure:: http://www.mattarei.eu/cristian/images/CoSA-logo_small.png :align: center

CoSA: CoreIR Symbolic Analyzer

...an SMT-based symbolic model checker for hardware design.

======================== Overview

CoSA supports a variety of input formats:

  • CoreIR_
  • BTOR2_
  • Verilog (with Yosys)
  • SystemVerilog (with Verific)
  • Symbolic Transition System (STS_)
  • Explicit states Transition System (ETS_)

and verifications:

  • Invariant Properties
  • Linear Temporal Logic (LTL) Properties
  • Proving capabilities
  • Equivalence Checking
  • Parametric (Invariant) Model Checking
  • Fault Analysis
  • Automated Lemma Extraction

======================== Installation

  1. pip3 install cosa to install CoSA, and its dependencies i.e., PySMT, PyCoreIR, and PyVerilog_

  2. 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_

  3. pysmt-install --env to show the environment variables that need to be exported

Software requirements:

  • Python3_ -- Full support requires Python3.6 or higher, however running without the CoreIR_ inputs should work on older Python 3 versions
  • Pip3_: package manager -- easiest way to install CoSA. On Debian: apt-get update; apt-get install python3-pip.
  • Cmake_ and a standard C++ compiler for CoreIR_ / PyCoreIR_
  • Yosys_ needs to be installed in order to support Verilog as an input format
  • Verific_ binaries or Yosys built with Verific library in order to support SystemVerilog as an input format [Commercial Tool]

.. _BTOR2: https://github.com/Boolector/btor2tools .. _Boolector: https://github.com/Boolector/boolector .. _Cmake: https://cmake.org/ .. _CoreIR: https://github.com/rdaly525/coreir .. _CVC4: http://cvc4.cs.stanford.edu/web/ .. _ETS: https://github.com/cristian-mattarei/CoSA/blob/master/doc/ets.rst .. _Git: https://www.atlassian.com/git/tutorials/install-git .. _Icarus Verilog: https://github.com/steveicarus/iverilog .. _MathSAT5: http://mathsat.fbk.eu .. _Pip3: https://pypi.org/project/pip/ .. _PyCoreIR: https://github.com/leonardt/pycoreir .. _PySMT: https://github.com/pysmt/pysmt .. _Python3: https://www.python.org/downloads/ .. _PyVerilog: https://github.com/PyHDI/Pyverilog .. _STS: https://github.com/cristian-mattarei/CoSA/blob/master/doc/sts.rst .. _Verific: http://www.verific.com/ .. _Yosys: https://github.com/YosysHQ/yosys .. _Z3: https://github.com/Z3Prover/z3

======================== Installation from Source

  • Install Git_
  • git clone https://github.com/cristian-mattarei/CoSA.git
  • cd CoSA
  • pip3 install -e .

Pip will automatically install the Python dependencies. To install Yosys for Verilog support, follow the instructions here <https://github.com/YosysHQ/yosys/blob/master/README.md>_.

Note: 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.

To run tests (tests include Veriog models and thus require Yosys):

  • nosetests tests

======================== Usage

To start playing with the tool, you can run:

  1. CoSA -h shows the helper with command options

  2. CoSA -i examples/counters/counters.json --verification simulation -k 7 generates a system execution with depth 7

  3. 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

  4. CoSA --problem examples/counter/problem.txt --prefix trace performs liveness (GF) and finally (F) checking on the counter.json model using the problem definition

  5. CoSA --problem examples/fold-constants/problem.txt performs equivalence checking using lemmas

For more information, please refer to the CoSA user manual_.

.. _CoSA user manual: https://github.com/cristian-mattarei/CoSA/blob/master/doc/manual/CoSA-manual.pdf

======================== Docker

  1. install Docker with your package manager e.g., sudo apt-get install docker

  2. build the Docker image: cd docker/ubuntu_1604 && docker build -t ubuntu-cosa .

  3. run the Docker image: docker run -i -t ubuntu-cosa /bin/bash

======================== License

CoSA is released under the modified BSD (3-clause BSD) License.

If you use CoSA in your work, please consider citing the following publication:

.. code::

@inproceedings{DBLP:conf/fmcad/MattareiMBDHH18, author = {Cristian Mattarei and Makai Mann and Clark Barrett and Ross G. Daly and Dillon Huff and Pat Hanrahan}, title = {{CoSA: Integrated Verification for Agile Hardware Design}}, booktitle = {Formal Methods in Computer-Aided Design, {FMCAD} 2018, Austin, Texas, USA, October 30 - November 2, 2018.}, publisher = {{IEEE}}, year = {2018} }

======================== Build Status

.. image:: https://travis-ci.org/cristian-mattarei/CoSA.svg?branch=master :target: https://travis-ci.org/cristian-mattarei/CoSA

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].