Safety Net: A Memory-Safe Netlist Data Structure via Reference Counting
Description
A Rust library for compiling and mutating netlists in a memory-safe way
You can read the docs here.
Getting Started
Below is a minimal example to get you started:
use ;
This code is included in the crate and you can run it with cargo run --example simple. Of course, you should generate the documentation with cargo doc and give it a review.
Exporting to MultiDiGraph with the petgraph Crate
The API provides the basic iterators needed to implement graph algorithms like static timing analysis:
iter()(The circuit nodes)connections()(The edges)dfs()(Depth-first search)
However, you may want to use another library that leverages a denser representation and already has all the classic algorithms implemented. This crate provides integration with petgraph. Here is a ripple-carry adder example which converts the netlist to a petgraph which is then converted to a dot graph:
cargo run --features graph --example connections | dot -Tsvg > adder.svg
Then, open it up and take a look: