Skip to main content

LEAP-Backend

Gitpod Ready-to-Code PyTest

LEAP (Logic nEtwork-Aware Pipelining) is a framework for exploiting logic synthesis and technology mapping to improve the performance of high-level synthesis (HLS) tools. LEAP is implemented in Python and is open-source under the MIT license.

This is the backend for the LEAP project. It contains the folloinwg necessary algorithms to process the subject graph.

  • blif handles the read/write of BLIF files and provides interface to manipulate the logic network.
  • cute is a packge for cut enumeration.
  • map is the LUT mapping algorithm with Boolean simulation.
  • milp contains several MILP models for timing regulation whose optimization is powered by Gurobi.

Installation

  1. (recommended) Download backend as a submodule of the main project.

  2. Install and use it elsewhere.

pip install -e .

Getting Started

The example can be executed using python examples/mapbuf.py. This example:

  1. Takes the BLIF file examples/add2/add2.blif as input (synthesized from examples/add2/add2.v).
  2. Reads the schedulability constraints from examples/add2/add2.json.
  3. Maps the logic network to a LUT-based FPGA with maxLeaves=3 and clockPeriod=1ns (1 LUT level is 0.7ns).
  4. Writes the optimized BLIF file to examples/add2/add2_opt.blif.
if __name__ == "__main__":
    from backend import *
    
    input_file = "examples/add2/add2.blif"
    input_sched_constr = "examples/add2/add2.json"
    output_file = "examples/add2/add2_opt.blif"

    graph = read_blif(input_file)
    model = MapBufModel(graph, json.load(open(input_sched_constr)), 1, {"maxLeaves": 3})
    model.solve()
    model.dumpGraph(output_file)

    import subprocess

    # CEC check works if no buffer is inserted
    # subprocess.run(f"abc -c 'cec {input_file} {output_file}'", shell=True)
    subprocess.run(f"abc -c 'read {output_file}; print_stats'", shell=True)

An advanced example can be found in examples/mem. Where:

  1. The DIP specifies mem_addr and mem_rd_en has the same label.
  2. The CIP specifies the mem_data arrives at least 1 cycle after mem_addr and mem_rd_en.

Metadata

Release files for leap-backend 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for leap-backend 0.1.0
File Size Uploaded
leap_backend-0.1.0.tar.gz 33.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for leap-backend 0.1.0
File Interpreter ABI Platform
leap_backend-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 59.5 kB

Release files / leap_backend-0.1.0.tar.gz

Download URL leap_backend-0.1.0.tar.gz
Size 33.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a2d178d49e0bdb70cf1c23b15363b3352a06b4a3d81f6ea04a61593fd709b531
BLAKE2b-256 checksum
How to use checksums
224fa14929b926035a8f0a47d0a626139a21b922dea898586f3118488c21329b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / leap_backend-0.1.0-py3-none-any.whl

Download URL leap_backend-0.1.0-py3-none-any.whl
Size 26.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f13e212754a1baae28ffce7f83df55e78255dbad6d83270afe94e130dbe050ec
BLAKE2b-256 checksum
How to use checksums
fd8b7dfca27b48a42da078d4614eaa03ef59fdaf12b20ed99f1daec3ff5f1cb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page