Skip to main content

Micro-Framework for FPGA / VLSI Design Flow in Python

Project description

PyDesignFlow

A technology- and tool-agnostic micro-framework for building FPGA / VLSI design flows in Python.

License ORDeC on PyPI Read the Docs

Quick Example

from pydesignflow import Block, Flow, task, Result

class SynthesisBlock(Block):
    @task()
    def synthesize(self, cwd):
        # [Call synthesis tool here]
        result = Result()
        result.timing_met = True
        result.netlist = cwd / "netlist.v"
        return result

    @task(requires={'syn': '.synthesize'})
    def place_and_route(self, cwd, syn):
        if not syn.timing_met:
            raise RuntimeError("Synthesis timing not met, cannot proceed with P&R")
        print(f"Using netlist: {syn.netlist}")
        # [Call place & route tool here]
        result = Result()
        result.bitstream = cwd / "design.bit"
        result.utilization = 0.75
        return result

flow = Flow()
flow['fpga'] = SynthesisBlock()

if __name__ == '__main__':
    flow.cli_main()

Save this as flow.py (or flow/__init__.py as basis for a multi-file design flow), then run targets from the command line:

flow fpga.place_and_route

Key Concepts

  • Flow: Central object managing all design blocks, accessible via command line
  • Block: Encapsulates a design component (hardware block, testbench, etc.). Define by subclassing Block.
  • Task: Methods decorated with @task() that perform design steps. A task of a specific block instance is called a Target.
  • Result: Data returned by tasks, serialized to JSON. At most one result per target.
  • Dependencies: Tasks can depend on results from other tasks. Missing dependencies are built automatically.

Design Principles

  • No source file tracking: Unlike Make, PyDesignFlow doesn't track source changes. The designer decides when to rebuild, avoiding unnecessary long tool runtimes while maintaining simplicity.
  • Encapsulation: Each task gets its own output directory and should only write there.
  • Flexibility: Blocks support parameters through instantiation. Single or multi-block hierarchical designs are supported.

Example Projects

  • RISC-V Lab: An FPGA-based RISC-V design platform and flow for teaching SoC development, using PyDesignFlow to manage hardware synthesis, simulation, and software builds.

Related Tools

  • NoTcl: Python library for automating Tcl-based FPGA/VLSI tools without Tcl scripting, complementing PyDesignFlow by providing Python interfaces to design tools.

Documentation

Full documentation: https://pydesignflow.readthedocs.io

License

Copyright 2022 - 2026 Tobias Kaiser

SPDX-License-Identifier: Apache-2.0

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

pydesignflow-0.5.1.tar.gz (37.8 kB view details)

Uploaded Source

Built Distribution

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

pydesignflow-0.5.1-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file pydesignflow-0.5.1.tar.gz.

File metadata

  • Download URL: pydesignflow-0.5.1.tar.gz
  • Upload date:
  • Size: 37.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pydesignflow-0.5.1.tar.gz
Algorithm Hash digest
SHA256 fc1ec5e41d6dc74261ab6fab4e7a2bfcc2e320fdb8748543d2dae0422eed5b4c
MD5 76976265386f6d35487d517525b19d59
BLAKE2b-256 fb4ec12bd321593f868dcc46b012a508905ca9c18b5d707e54b6aff6d97c0ae2

See more details on using hashes here.

File details

Details for the file pydesignflow-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: pydesignflow-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pydesignflow-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 436185c7ead91a53e892cb5419edaf0d3af3c9e9f4435a43ea85388df8b9640d
MD5 f1f8d4c9a14c107c2a6fa55457bc64cc
BLAKE2b-256 9dda6511bc2467fe268d8aceb6e5dfcb006ae72e4eee301f259b92a3f383c9f8

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