Giter Club home page Giter Club logo

quaigh's Introduction

Quaigh crate Quaigh documentation Build status

Quaigh

Logic simplification and analysis tools

This crate provides tools for logic optimization, synthesis, technology mapping and analysis. Our goal is to provide an easy-to-use library, and improve its quality over time to match industrial tools.

Usage and features

Quaigh provides a command line tool, that can be installed using Cargo: cargo install quaigh.

To show available commands:

quaigh help

The atpg command performs automatic test pattern generation, to create test vectors for a design.

quaigh atpg mydesign.bench -o atpg.test

The check-equivalence command performs bounded equivalence checking to confirm that a design's functionality is preserved after transformations.

quaigh equiv mydesign.bench optimized.bench

The optimize command performs logic optimization. At the moment, logic optimization is far from state of the art: for production designs, you should generally stick to the tools included in Yosys.

quaigh opt mydesign.bench -o optimized.bench

Quaigh supports a subset of the Blif file format, as well as the simple Bench file format used by ISCAS benchmarks. Benchmarks can be downloaded here. More features will be added over time, such as technology mapping, operator optimization, ... The complete documentation is available on docs.rs.

Development

The main datastructure, Network, is a typical Gate-Inverter-Graph representation of a logic circuit. Inverters are implicit, occupying just one bit in Signal. It supports many kinds of logic, and all can coexist in the same circuit:

  • Complex gates such as Xor, Mux and Maj3 are all first class citizens;
  • Flip-flops with enable and reset are represented directly.

In most logic optimization libraries (ABC, Mockturtle, ...), there are many different ways to represent logic, with separate datastructures: AIG, MIG, LUT, ... Depending on the circuit, one view or the other might be preferable. Taking advantage of them all may require splitting the circuit, making most operations much more complex. More generic netlists, like Yosys RTLIL, will allow all kind of logic gates in a single datastructure. Since they do not restrict the functions represented, they are difficult to work with directly for logic optimization.

Quaigh aims in-between. All algorithms share the same netlist representation, Network, but there are some limitations to make it easy to optimize:

  • all gates have a single output, representing a single binary value,
  • the gates are kept in topological order (a gate has an index higher than its inputs),
  • names and design hierarchy are not represented.

For example, here is a full adder circuit:

let mut net = Network::new();
let i0 = net.add_input();
let i1 = net.add_input();
let i2 = net.add_input();
let carry = net.add(Gate::maj(i0, i1, i2));
let out = net.add(Gate::xor3(i0, i1, i2));
net.add_output(carry);
net.add_output(out);

Apart from the core datastructure, Quaigh has algorithms for logic optimization, simulation (including fault simulation) and test pattern generation. For optimization and equivalence checking, Quaigh relies on other packages as much as possible:

quaigh's People

Contributors

coloquinte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

donn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.