Skip to main content

BLIF2GRAPH

Generates a graph from a BLIF (SIS) file.

Description

This library uses argparse to parse arguments:

If the --fsm flag is passed to the program the blifparser library parses the input file and blif2graph generates an FSM graph using graphviz.

You can also pass other arguments together with the --fsm flag:

  • --input: BLIF input file path (required)
  • --style: INI style config file path (you can use graphviz styles)
  • --output: Output file path (no extension)
  • --format: Set output graph format (default: svg)
  • --view_graph: View output graph (default: False)
  • --debug: View debug message (default: False)

The --lgate flag exists to be used to support logic gate graphs in the future: IT IS NOT CURRENTLY IMPLEMENTED

If you'd like to contribute with a Pull Request, please do!

Requirements

Installation

Install using pip:

pip install blif2graph

Usage

You can use it from the command line:

# generates an FSM graph, fsm.blif input, fsmgraph.pdf output, view result using the default PDF viewer software at the end
python3 blif2graph.py --fsm --input fsm.blif --output fsmgraph --format pdf --view_graph
# generates an FSM graph, myfsm.blif input, default fsm.svg output, custom graphviz style, view result using the default SVG viewer software at the end
python3 blif2graph.py --fsm --input myfsm.blif --style mystyles.ini --view_graph

Example of an FSM custom style file:

[graph]
fontsize = 16
fontcolor = black
fontname = Times-Roman
rankdir = TB             # TB: top to bottom (inverse: BT), LR: left to right (inverse: RL)
splines = true
overlap = false
size = 8,5
bgcolor = transparent  
center = true
charset = UTF-8
colorscheme = 
concentrate = false   # true: concentrate arrows together in one line until a certain point
dpi = 96.0

[edges]
fontsize = 16
arrowsize = .5
arrowhead = normal
arrowtail = normal
color = gray31
fillcolor = black
fontcolor = black
fontname = Times-Roman
colorscheme = 
constraint = true
decorate = true
dir = forward
penwidth = 1.0

[nodes]
fontsize = 16
colorscheme = 
color = black
fillcolor = black
fontcolor = black
fontname = Times-Roman
penwidth = 2.0

You can also import the script and call the main() function passing a list of arguments:

import blif2graph
params = "   --fsm  --input    ..\\myfsm.blif --format  pdf  --view_graph   "
params = [param for param in params.split(" ") if param.strip() != ""]
blif2graph.main(params)

Changelog

2021-09-10 1.0.0:
First commit

Author

Stefano Zenaro (mario33881)

Release files for blif2graph 1.0.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 blif2graph 1.0.0
File Size Uploaded
blif2graph-1.0.0.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for blif2graph 1.0.0
File Interpreter ABI Platform
blif2graph-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.0 kB

Release files / blif2graph-1.0.0.tar.gz

Download URL blif2graph-1.0.0.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b64a278c33971a219abbf2446373097191dbf6771379d00b4bb47d27432934ed
BLAKE2b-256 checksum
How to use checksums
bc28705c24a518c61390c8d4447faf5eca8fec7237ee03c9eae924c89b230c9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.26.0 setuptools/58.0.4 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

Release files / blif2graph-1.0.0-py3-none-any.whl

Download URL blif2graph-1.0.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5bcbada2f7806ad98a84eabbbd5441eea72ddef78ea4a2243e9774f5f5bec845
BLAKE2b-256 checksum
How to use checksums
912475e022ab3aab7f018391a0ee08f71638602760e8455c2f0ef9cf0c7d716a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.26.0 setuptools/58.0.4 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

1.0.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