Skip to main content

The backend of the LEAP framework

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leap_backend-0.1.0.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

leap_backend-0.1.0-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file leap_backend-0.1.0.tar.gz.

File metadata

  • Download URL: leap_backend-0.1.0.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for leap_backend-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a2d178d49e0bdb70cf1c23b15363b3352a06b4a3d81f6ea04a61593fd709b531
MD5 64cd7b2b4b990cd674cb736cbdd207be
BLAKE2b-256 224fa14929b926035a8f0a47d0a626139a21b922dea898586f3118488c21329b

See more details on using hashes here.

File details

Details for the file leap_backend-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: leap_backend-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for leap_backend-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f13e212754a1baae28ffce7f83df55e78255dbad6d83270afe94e130dbe050ec
MD5 b12055d702e4d7ece0e974bfea9075cb
BLAKE2b-256 fd8b7dfca27b48a42da078d4614eaa03ef59fdaf12b20ed99f1daec3ff5f1cb6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page