{"id":23451412,"url":"https://github.com/coloquinte/quaigh","last_synced_at":"2025-04-07T16:17:58.099Z","repository":{"id":210281566,"uuid":"650184169","full_name":"Coloquinte/quaigh","owner":"Coloquinte","description":"Logic circuit analysis and optimization","archived":false,"fork":false,"pushed_at":"2024-10-20T14:06:04.000Z","size":293,"stargazers_count":35,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T16:14:04.313Z","etag":null,"topics":["atpg","equivalence-checking","logic-optimization"],"latest_commit_sha":null,"homepage":"https://docs.rs/quaigh/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Coloquinte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-06T14:19:16.000Z","updated_at":"2025-03-24T15:02:26.000Z","dependencies_parsed_at":"2024-01-15T12:31:08.521Z","dependency_job_id":"5a43028c-9bfb-4bdc-a8aa-ed19b329e91b","html_url":"https://github.com/Coloquinte/quaigh","commit_stats":null,"previous_names":["coloquinte/quaigh"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coloquinte%2Fquaigh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coloquinte%2Fquaigh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coloquinte%2Fquaigh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coloquinte%2Fquaigh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Coloquinte","download_url":"https://codeload.github.com/Coloquinte/quaigh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685628,"owners_count":20979085,"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":["atpg","equivalence-checking","logic-optimization"],"created_at":"2024-12-24T00:25:57.821Z","updated_at":"2025-04-07T16:17:58.077Z","avatar_url":"https://github.com/Coloquinte.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Quaigh crate](https://img.shields.io/crates/v/quaigh.svg)](https://crates.io/crates/quaigh)\n[![Quaigh documentation](https://docs.rs/quaigh/badge.svg)](https://docs.rs/quaigh)\n[![Build status](https://github.com/Coloquinte/quaigh/actions/workflows/build.yml/badge.svg)](https://github.com/Coloquinte/quaigh/actions/workflows/build.yml)\n\n# Quaigh\n\n\u003c!-- cargo-rdme start --\u003e\n\nLogic simplification and analysis tools\n\nThis crate provides tools for logic optimization, synthesis, technology mapping and analysis.\nOur goal is to provide an easy-to-use library, and improve its quality over time to match industrial tools.\n\n## Usage and features\n\nQuaigh provides a command line tool, that can be installed using\n[Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html):\n`cargo install quaigh`.\n\nTo show available commands:\n```bash\nquaigh help\n```\n\nThe `atpg` command performs [automatic test pattern generation](https://en.wikipedia.org/wiki/Automatic_test_pattern_generation),\nto create test vectors for a design.\n```bash\nquaigh atpg mydesign.bench -o atpg.test\n```\n\nThe `check-equivalence` command performs bounded [equivalence checking](https://en.wikipedia.org/wiki/Formal_equivalence_checking)\nto confirm that a design's functionality is preserved after transformations.\n```bash\nquaigh equiv mydesign.bench optimized.bench\n```\n\nThe `optimize` command performs [logic optimization](https://en.wikipedia.org/wiki/Logic_optimization).\nAt the moment, logic optimization is far from state of the art: for production designs, you should\ngenerally stick to the tools included in [Yosys](https://github.com/YosysHQ/yosys).\n```bash\nquaigh opt mydesign.bench -o optimized.bench\n```\n\nQuaigh supports a subset of the [Blif](https://course.ece.cmu.edu/~ee760/760docs/blif.pdf) file format, as well\nas the simple Bench file format used by ISCAS benchmarks. Benchmarks can be downloaded\n[here](https://github.com/Coloquinte/moosic-yosys-plugin/releases/download/iscas_benchmarks/benchmarks.tar.xz).\nMore features will be added over time, such as technology mapping, operator optimization, ...\nThe complete documentation is available on [docs.rs](https://docs.rs/crate/quaigh/latest).\n\n## Development\n\nThe main datastructure, [`Network`](https://docs.rs/quaigh/latest/quaigh/network/struct.Network.html), is a typical Gate-Inverter-Graph representation of a logic circuit.\nInverters are implicit, occupying just one bit in [`Signal`](https://docs.rs/quaigh/latest/quaigh/network/struct.Signal.html).\nIt supports many kinds of logic, and all can coexist in the same circuit:\n*   Complex gates such as Xor, Mux and Maj3 are all first class citizens;\n*   Flip-flops with enable and reset are represented directly.\n\nIn most logic optimization libraries ([ABC](https://github.com/berkeley-abc/abc), [Mockturtle](https://github.com/lsils/mockturtle), ...),\nthere are many different ways to represent logic, with separate datastructures: AIG, MIG, LUT, ...\nDepending on the circuit, one view or the other might be preferable.\nTaking advantage of them all may require [splitting the circuit](https://github.com/lnis-uofu/LSOracle), making most operations much more complex.\nMore generic netlists, like [Yosys RTLIL](https://yosyshq.readthedocs.io/projects/yosys/en/latest/CHAPTER_Overview.html#the-rtl-intermediate-language-rtlil),\nwill allow all kind of logic gates in a single datastructure.\nSince they do not restrict the functions represented, they are difficult to work with directly for logic optimization.\n\nQuaigh aims in-between. All algorithms share the same netlist representation, [`Network`](https://docs.rs/quaigh/latest/quaigh/network/struct.Network.html),\nbut there are some limitations to make it easy to optimize:\n*   all gates have a single output, representing a single binary value,\n*   the gates are kept in topological order (a gate has an index higher than its inputs),\n*   names and design hierarchy are not represented.\n\nFor example, here is a full adder circuit:\n```rust\nlet mut net = Network::new();\nlet i0 = net.add_input();\nlet i1 = net.add_input();\nlet i2 = net.add_input();\nlet carry = net.add(Gate::maj(i0, i1, i2));\nlet out = net.add(Gate::xor3(i0, i1, i2));\nnet.add_output(carry);\nnet.add_output(out);\n```\n\nApart from the core datastructure, Quaigh has algorithms for [logic optimization](https://docs.rs/quaigh/latest/quaigh/optim/index.html),\n[simulation](https://docs.rs/quaigh/latest/quaigh/sim/index.html) (including fault simulation) and\n[test pattern generation](https://docs.rs/quaigh/latest/quaigh/atpg/index.html).\nFor optimization and equivalence checking, Quaigh relies on other packages as much as possible:\n*   [Kissat](https://github.com/arminbiere/kissat) (using [rustsat](https://docs.rs/rustsat/)) as a Sat solver,\n*   [Highs](https://github.com/ERGO-Code/HiGHS) (using [good_lp](https://docs.rs/good_lp/)) as an optimization solver.\n\n\u003c!-- cargo-rdme end --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoloquinte%2Fquaigh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoloquinte%2Fquaigh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoloquinte%2Fquaigh/lists"}