CircuitGraph

CircuitGraph: A Python package for Boolean circuits - Published in JOSS (2020)

https://github.com/circuitgraph/circuitgraph

Science Score: 95.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
    Found 2 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    2 of 6 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

boolean-circuits eda graphs netlist python satisfiability
Last synced: 4 months ago · JSON representation

Repository

Tools for working with circuits as graphs in python

Basic Info
Statistics
  • Stars: 123
  • Watchers: 2
  • Forks: 13
  • Open Issues: 13
  • Releases: 8
Topics
boolean-circuits eda graphs netlist python satisfiability
Created over 5 years ago · Last pushed about 2 years ago
Metadata Files
Readme Changelog License

README.md

CircuitGraph

Python package codecov Code style: black pre-commit

CircuitGraph is a library for working with hardware designs as graphs. CircuitGraph provides an interface to do this built on NetworkX, along with integrations with other useful tools such as sat solvers and the Yosys synthesis tool, and input/output to verilog.

Overview

The Circuit class is at the core of the library and it is essentially a wrapper around a NetworkX graph object. This graph is accessable through the graph member variable of Circuit and can be used as an entrypoint to the robust NetworkX API.

Here's a simple example of reading in a verilog file, adding a node to the graph, and writing back to a new file.

```python import circuitgraph as cg

c = cg.from_file('/path/to/circuit.v')

Add an AND gate to the circuit that takes as input nets o0, o1, o2, o3

c.add('g', 'and', fanin=[f'o{i}' for i in range(4)]) cg.to_file(c, '/path/to/output/circuit.v') ```

The documentation can be found here.

Installation

CircuitGraph requires Python3.7 or greater The easiest way to install is via PyPi: shell pip install circuitgraph To install from the release, download and: shell pip install circuitgraph-<release>.tar.gz

Finally, to install in-place with the source, use: shell cd <install location> git clone https://github.com/circuitgraph/circuitgraph.git cd circuitgraph pip install -r requirements.txt pip install -e .

Optional Packages

In addition to the packages enumerated in requirements.txt, there are a few tools you can install to enable additional functionality.

If you would like to use the satisfiability functionality, install PySAT.

Open source synthesis can be perofmred by installing Yosys and adding it to your path. Alternatively, Genus or DesignCompiler can be used by providing the path to a generic library to use by setting the CIRCUITGRAPH_GENUS_LIBRARY_PATH and CIRCUITGRAPH_DC_LIBRARY_PATH environment variables.

Contributing

If you have ideas on how to improve this library we'd love to hear your suggestions. Please open an issue. If you want to develop the improvement yourself, please consider the information below.

Coverage is computed using Codecov. If you would like to generate coverage information locally, install coverage and codecov. shell pip install coverage codecov make coverage

Documentation is built using pdoc3. shell pip install pdoc3 make doc

Tests are run using the builtin unittest framework. Some basic linting is performed using flake8. shell pip instsall flake8 make test

Code should be formatted using black. Pre-commit is used to automatically run black on commit. shell pip install black pre-commit pre-commit install Pre-commit also runs a few other hooks, including a docstring formatter and linter. Docs follow the numpy documentation convention.

Citation

If you use this software for your research, we ask you cite this publication: https://joss.theoj.org/papers/10.21105/joss.02646

@article{sweeney2020circuitgraph, title={CircuitGraph: A Python package for Boolean circuits}, author={Sweeney, Joseph and Purdy, Ruben and Blanton, Ronald D and Pileggi, Lawrence}, journal={Journal of Open Source Software}, volume={5}, number={56}, pages={2646}, year={2020} }

Acknowledgements

Circuitgraph icon designed by ncasti.

Owner

  • Name: circuitgraph
  • Login: circuitgraph
  • Kind: organization

JOSS Publication

CircuitGraph: A Python package for Boolean circuits
Published
December 04, 2020
Volume 5, Issue 56, Page 2646
Authors
Joseph Sweeney
Department of Electrical and Computer Engineering, Carnegie Mellon University, Pittsburgh, PA 15213
Ruben Purdy
Department of Electrical and Computer Engineering, Carnegie Mellon University, Pittsburgh, PA 15213
Ronald D. Blanton
Department of Electrical and Computer Engineering, Carnegie Mellon University, Pittsburgh, PA 15213
Lawrence Pileggi
Department of Electrical and Computer Engineering, Carnegie Mellon University, Pittsburgh, PA 15213
Editor
Daniel S. Katz ORCID
Tags
Boolean circuits satisfiability graph electronic design automation

GitHub Events

Total
  • Watch event: 14
Last Year
  • Watch event: 14

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 227
  • Total Committers: 6
  • Avg Commits per committer: 37.833
  • Development Distribution Score (DDS): 0.374
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Ruben Purdy r****y@a****u 142
Joe Sweeney j****y@g****m 79
Daniel S. Katz d****z@i****g 2
Ruben Purdy r****y@R****l 2
Natalia Castillejo n****c@m****m 1
Joe Sweeney j****y@j****n 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 26
  • Total pull requests: 11
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 12 hours
  • Total issue authors: 8
  • Total pull request authors: 6
  • Average comments per issue: 1.04
  • Average comments per pull request: 0.0
  • Merged pull requests: 9
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jpsety (10)
  • rbnprdy (7)
  • prw99r (4)
  • jenila19 (1)
  • zyk101177 (1)
  • erblum (1)
  • Flians (1)
  • roy-pstr (1)
Pull Request Authors
  • rbnprdy (4)
  • jpsety (2)
  • danielskatz (2)
  • tamood (1)
  • ncasti (1)
  • gsburmaster (1)
Top Labels
Issue Labels
enhancement (6)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 328 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 2
    (may contain duplicates)
  • Total versions: 16
  • Total maintainers: 2
proxy.golang.org: github.com/circuitgraph/circuitgraph
  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.6%
Average: 5.8%
Dependent repos count: 6.0%
Last synced: 4 months ago
pypi.org: circuitgraph

Tools for working with boolean circuits as graphs.

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 2
  • Downloads: 328 Last month
Rankings
Stargazers count: 7.8%
Dependent packages count: 10.1%
Forks count: 10.2%
Average: 11.2%
Dependent repos count: 11.5%
Downloads: 16.3%
Maintainers (2)
Last synced: 4 months ago

Dependencies

setup.py pypi
  • lark *
.github/workflows/python-package.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite