Coder Social home page Coder Social logo

aig2qasm's Introduction

aig2qasm

Convert a logic circuit described by an AIGER file (And-Inverter Graph) to an OpenQASM 2.0 circuit.

This tool is based on the EPFL Logic Synthesis Libraries, and in particular caterpillar

Usage

The first step is generating an AIGER file. There are many ways to do this, but one possibility is to use the open-source Yosys synthesis tools to convert a Verilog module to an AIG representation. Obviously this will only work for combinatorial circuits! A particularly convenient way to install these is to use the YoWASP project.

A basic yosys script to convert an input verilog file to an and-inverter graph is:

read_verilog my_module.v
hierarchy -check -top my_module
proc; opt;
techmap; abc; opt;
aigmap; opt;
write_aiger my_module.aig

aig2qasm can then be invoked on the resulting file.

Unfortunately for now any naming information for module inputs and outputs is lost in translation, and input/output registers and ancillas may not be arranged in a straightforward way. For now, the mapping is indicated in a comment header block at the top of the OpenQASM file.

Building

From the root directory

mkdir build; cd build
cmake ..
make all

To do's

Currently SAT solver provided by MiniSAT; it should be possible to use Z3 but caterpillar needs to be updated to use the latest versions of Z3.

Possibly related to the above, the synthesis algorithm tends to choke for circuits with O(1000) nodes in the AIG graph.

Add XAG graph strategy.

aig2qasm's People

Contributors

gribeill avatar

Stargazers

 avatar

Watchers

 avatar

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.