https://github.com/cornell-zhang/eqmap

Using e-graphs for logic synthesis

https://github.com/cornell-zhang/eqmap

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.8%) to scientific vocabulary

Keywords

compiler egg fpga rtl rust synthesis verilog yosys
Last synced: 5 months ago · JSON representation

Repository

Using e-graphs for logic synthesis

Basic Info
  • Host: GitHub
  • Owner: cornell-zhang
  • License: apache-2.0
  • Language: Rust
  • Default Branch: main
  • Homepage:
  • Size: 3.51 MB
Statistics
  • Stars: 13
  • Watchers: 2
  • Forks: 1
  • Open Issues: 4
  • Releases: 15
Topics
compiler egg fpga rtl rust synthesis verilog yosys
Created over 1 year ago · Last pushed 6 months ago
Metadata Files
Readme License

README.md

Docs

EqMap: FPGA LUT Technology Mapping w/ E-Graphs

EqMap is Verilog-to-Verilog tool that attempts to superoptimize FPGA technology mapping using E-Graphs. Our experiments show that equality saturation techniques can improve logic sut selection and ultimately produce smaller circuits than the commercial tools.

You can read the docs here.

Getting Started

Dependencies for Users

Dependencies For Developers

Building the Tools

First, check the prerequisites for building. For basic functionality, you will need the Rust toolchain and a Yosys 0.33 install. Linux is preferred, but MacOS and WSL should work without much trouble.

cargo build

cargo run --release -- tests/verilog/mux_reg.v # Sanity check

Bring Your Own RTL

You can also try to synthesize your own verilog module my_file.v as long as there are no multi-bit top-level ports:

source utils/setup.sh # Add eqmap script to PATH

eqmap my_file.v

Use --help to get an overview of all the options the compiler has:

``` $ eqmap --help Technology Mapping Optimization with E-Graphs

Usage: eqmap_fpga [OPTIONS] [INPUT] [OUTPUT]

Arguments: [INPUT] Verilog file to read from (or use stdin) [OUTPUT] Verilog file to output to (or use stdout)

Options: --report If provided, output a JSON file with result data -a, --assert-sat Return an error if the graph does not reach saturation -f, --no-verify Do not verify the functionality of the output -c, --no-canonicalize Do not canonicalize the input into LUTs -d, --decomp Find new decompositions at runtime --disassemble Comma separated list of cell types to decompose into -r, --no-retime Do not use register retiming -v, --verbose Print explanations (generates a proof and runs slower) --min-depth Extract for minimum circuit depth -k, --k Max fan in size allowed for extracted LUTs -w, --reg-weight Ratio of register cost to LUT cost -t, --timeout Build/extraction timeout in seconds -s, --node-limit Maximum number of nodes in graph -n, --iter-limit Maximum number of rewrite iterations -h, --help Print help -V, --version Print version ```

You will likely want to use the --report <file> flag to measure improvements in LUT count and circuit depth.

Features

The project has three conditionally compiled features:

  1. egraph_fold (deprecated)
  2. exactness (used for ILP exact synthesis, requires CBC)
  3. cut_analysis (on by default)
  4. graph_dumps (enables the serialization module and --dump-graph argument)

To build with any of these features enabled:

source utils/setup.sh <feature>

Docs

You can generate most of the documentation with cargo doc.

Owner

  • Name: Cornell Zhang Research Group
  • Login: cornell-zhang
  • Kind: organization

GitHub Events

Total
  • Release event: 1
  • Watch event: 8
  • Delete event: 2
  • Public event: 1
  • Push event: 14
  • Pull request event: 8
  • Create event: 4
Last Year
  • Release event: 1
  • Watch event: 8
  • Delete event: 2
  • Public event: 1
  • Push event: 14
  • Pull request event: 8
  • Create event: 4

Dependencies

.github/workflows/docs.yml actions
  • actions-rust-lang/setup-rust-toolchain v1 composite
  • actions/checkout v4 composite
  • actions/deploy-pages v4 composite
  • actions/upload-pages-artifact v3 composite
.github/workflows/rust.yml actions
  • actions-rust-lang/rustfmt v1 composite
  • actions-rust-lang/setup-rust-toolchain v1 composite
  • actions/checkout v4 composite
  • psf/black stable composite
  • taiki-e/install-action cargo-llvm-cov composite
  • ydah/mdformat-action main composite
Cargo.lock cargo
  • 119 dependencies
Cargo.toml cargo