Metadata-Version: 2.4
Name: netlist-graph
Version: 0.1.0
Summary: Graph-based netlist analysis tool for SKY130 post-synthesis netlists
Project-URL: Homepage, https://github.com/gpu-eda/Jacquard
Project-URL: Repository, https://github.com/gpu-eda/Jacquard
Project-URL: Documentation, https://gpu-eda.github.io/Jacquard/signal-tracing.html
License-Expression: Apache-2.0
Keywords: eda,jacquard,netlist,synthesis,verilog
Requires-Python: >=3.11
Requires-Dist: click>=8.0
Requires-Dist: networkx>=3.0
Description-Content-Type: text/markdown

# netlist-graph

Graph-based netlist analysis tool for SKY130 post-synthesis netlists.

## Installation

```bash
cd scripts/netlist_graph
uv sync
```

## Usage

### Search for nets

```bash
uv run netlist-graph search <netlist.v> <pattern>
```

### Trace drivers (backwards)

```bash
uv run netlist-graph drivers <netlist.v> <net> [-d depth]
```

### Trace loads (forwards)

```bash
uv run netlist-graph loads <netlist.v> <net> [-d depth]
```

### Find path between nets

```bash
uv run netlist-graph path <netlist.v> <source> <target>
```

### Generate trace configuration

Generate signal type and driver information:

```bash
# Simple output
uv run netlist-graph trace <netlist.v> <signal1> <signal2> ...

# Generate JSON for programmatic use
uv run netlist-graph trace <netlist.v> ibus__cyc rst_n_sync.rst --json
```

### Generate watchlist file

Create a JSON watchlist for signal monitoring:

```bash
uv run netlist-graph watchlist <netlist.v> <output.json> <signal1> <signal2> ...
```

Example:
```bash
uv run netlist-graph watchlist design.v watch.json ibus__cyc rst_n_sync gpio_out
```

### Interactive mode

```bash
uv run netlist-graph interactive <netlist.v>
```

Commands in interactive mode:
- `d <net>` - find drivers
- `l <net>` - find loads
- `p <src> <tgt>` - find path
- `s <pattern>` - search nets
- `c <net>` - cone of influence
- `q` - quit

## Examples

```bash
# Find what drives the ibus_cyc signal
uv run netlist-graph drivers tests/timing_test/minimal_build/6_final.v "ibus__cyc" -d 8

# Trace reset synchronizer path
uv run netlist-graph drivers tests/timing_test/minimal_build/6_final.v "rst_n_sync.rst"

# Find path from reset input to CPU
uv run netlist-graph path tests/timing_test/minimal_build/6_final.v "gpio_in[40]" "ibus__cyc"

# Generate watchlist for debugging
uv run netlist-graph watchlist tests/timing_test/minimal_build/6_final.v watch.json \
    ibus__cyc rst_n_sync.rst gpio_out[0] gpio_out[1]
```

## Signal Types

The tool classifies signals based on their drivers:
- `reg` - Driven by a flip-flop (dfxtp, dfrtp, etc.)
- `mem` - Driven by SRAM
- `comb` - Combinational logic (gates, buffers)
