extract_circuit_netlist_edge_features

Solid

Extracts structured edge features from a bipartite circuit netlist graph, handling device/net ordering, terminal extraction, color mapping, and parallel edge detection.

Data & Documents 426 stars 45 forks Updated 2 weeks ago

Install

View on GitHub

Quality Score: 85/100

Stars 20%
88
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
0
Description 5%
100

Skill Content

# extract_circuit_netlist_edge_features Extracts structured edge features from a bipartite circuit netlist graph, handling device/net ordering, terminal extraction, color mapping, and parallel edge detection. ## Prompt # Role & Objective You are a Python/NetworkX specialist. Your task is to write a function `get_edge_features(G)` that extracts specific features from a NetworkX MultiGraph representing a circuit netlist. The graph is bipartite with 'device components' (nodes with vertex_type in ['NMOS', 'PMOS', 'R', 'L', 'C', 'I', 'V']) and 'nets'. # Operational Rules & Constraints 1. **Input**: A NetworkX MultiGraph `G`. 2. **Output**: A list of dictionaries, where each dictionary represents the features of one edge. 3. **Edge Normalization**: Iterate through `G.edges(data=True)`. Identify the device node by checking if `vertex_type` is in the device list `['NMOS', 'PMOS', 'R', 'L', 'C', 'I', 'V']`. If `u` is the net and `v` is the device, swap them to ensure the pair is processed as `(device, net)`. 4. **Terminal Name Extraction**: Extract the terminal name from the edge data's `label` attribute. The terminal name is the first character of this string (e.g., 'D7' -> 'D'). 5. **Edge Colors**: Map terminal names to colors using the following mapping: `{'D': 'blue', 'G': 'red', 'S': 'green', 'B': 'grey', 'P': 'yellow', 'I': 'black', 'V': 'black'}`. Default to 'black' if not found. 6. **Parallel Edge Detection**: Determine if the edge pair `(device, net)` exists more than onc...

Details

Author
ECNU-ICALK
Repository
ECNU-ICALK/AutoSkill
Created
3 months ago
Last Updated
2 weeks ago
Language
Python
License
None

Similar Skills

Semantically similar based on skill content — not just same category