Skip to main content

Netlist Carpentry

Netlist Carpentry is a Python library that allows you to access and modify a digital circuit in an accessible way. It covers the following use cases:

  • Navigate through your circuit and introduce custom checks
  • Implement new algorithms that do optimizations or modifications with your circuit
  • ...

It uses Yosys to get the circuit from a behavioral code and converts it into a pythonic structure along with a networkx graph. This allows for using standard graph algorithms on the circuit as well as pretty-printing facilities.

Once in Python, the structure can be examined and modified. Netlist carpentry internally tracks all the changes and lets you write out your modified circuit to Verilog. Back in verilog, the most simulation or synthesis tools can be used.

A simple example:

import netlist_carpentry

# Load your Circuit
circuit = netlist_carpentry.read("simpleAdder.v")
# Define your top module
circuit.set_top('simpleAdder')

print(f"The top module '{top_module.name}' has the following items:")
for instance_name, instance_object in top_module.instances.items():
    print(f"\tInstance '{instance_name}'.")

for port_name, port_object in top_module.ports.items():
    print(f"\tPort '{port_name}', which is an {port_object.direction} port and {port_object.width} bit wide!")

for wire_name, wire_object in top_module.wires.items():
    print(f"\tWire '{wire_name}', which is {wire_object.width} bit wide!")

Netlist Carpentry is designed for making the access to the circuit as easy as possible. The runtime-performance was not always in focus -- so don't expect it to work as fast as a custom-knitted C++ software. If you want to propose changes, please submit an issue or even a pull request.

Installation

Install the package via...

pip install netlist-carpentry

... and have fun!

The package requires at least Python 3.9 (recommended is 3.12).

Alternatively, you can clone this repository and install the package in editable mode.

Examples

Examples on how to use Netlist Carpentry (and how it can be integrated into design workflows) can be found in docs/src/user_guide along with the documentation. Most of them are Jupyter Notebooks, meaning they can be executed and modified to experiment with Netlist Carpentry. They can also be viewed in the online documentation.

Development Guide

A guide on how to expand or modify the tool is also given. Visit docs/src/dev_guide or the online development guide for more information.

Citation

If you use Netlist Carpentry in your research, please consider citing it:

DOI

Citations of individual versions are also possible using the version-specific DOIs on the Zenodo-Site. Please use the link of the DOI-badge for more information.

Acknowledgement

The DI-Meta-X project where this software has been developed is funded by the German Federal Ministry of Research, Technology and Space under the reference 16ME0976. Responsibility for the content of this publication lies with the author.

Download files

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

Source Distribution

netlist_carpentry-0.5.2.tar.gz (3.1 MB view details)

Uploaded Source

Built Distribution

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

netlist_carpentry-0.5.2-py3-none-any.whl (250.5 kB view details)

Uploaded Python 3

File details

Details for the file netlist_carpentry-0.5.2.tar.gz.

File metadata

  • Download URL: netlist_carpentry-0.5.2.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for netlist_carpentry-0.5.2.tar.gz
Algorithm Hash digest
SHA256 f13b7e73a5242da38298c675d350fe71f8a8a7f75fcabf4abc8f12da435aa127
MD5 7ffb3eaacd7f405ebfb97f844817f9a2
BLAKE2b-256 7c24acbf13b3135ff4b110b7c4dfc1c3769310c588d473a67153ed34d3952e39

See more details on using hashes here.

File details

Details for the file netlist_carpentry-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: netlist_carpentry-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 250.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for netlist_carpentry-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6514a93a2e6975a164d1a2c5e96553a43884464a4a89f37b1b4205d73b6575bf
MD5 f6e5f94886c12c18dcefd2feb9f4275f
BLAKE2b-256 1fdb4a589ea6d82ee6930c33d5b172d62624a56f64860f369ebaf7e3de4b69a0

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.0

2 files

This release

0.5.2 This release

2 files

0.5.1

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.8

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 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