-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmisc.py
More file actions
95 lines (86 loc) · 3.81 KB
/
misc.py
File metadata and controls
95 lines (86 loc) · 3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import pandas as pd
# import seaborn as sns
import subcircuit
import networkx as nx
def print_subckt_ng(subckt):
# ===========================================================================
# Creates Networkx Node Graph and Include Nodes
# ===========================================================================
G = nx.Graph() # Creates an graph called G
color_map = [] # list that will define node colors
node_size = [] # list that will define node sizes
# -----------------------------------------
# Searches Nodes and Color them
# -----------------------------------------
for vddpin in subckt.get_vdd_pins():
G.add_node(vddpin) # create vdd node
color_map.append('green')
node_size.append(2000)
for gndpin in subckt.get_vss_pins():
G.add_node(gndpin) # create gnd node
color_map.append('green')
node_size.append(2000)
for outpin in subckt.get_o_pins():
G.add_node(outpin)
color_map.append('magenta')
node_size.append(1000)
for n in subckt.get_PUN():
G.add_node(n.get_name())
color_map.append('red')
node_size.append(500)
for n in subckt.get_PDN():
G.add_node(n.get_name())
color_map.append('blue')
node_size.append(500)
for n in subckt.get_PUN():
G.add_edge(n.get_name(), n.get_source())
color_map.append('yellow')
node_size.append(100)
G.add_edge(n.get_name(), n.get_drain())
color_map.append('yellow')
node_size.append(100)
for n in subckt.get_PDN():
G.add_edge(n.get_name(), n.get_source())
color_map.append('yellow')
node_size.append(100)
G.add_edge(n.get_name(), n.get_drain())
color_map.append('yellow')
node_size.append(100)
nx.draw(G, node_size=node_size, node_color=color_map, with_labels=True)
plt.show()
def print_net(net):
# ===========================================================================
# Creates Networkx Node Graph and Include Nodes
# ===========================================================================
G = nx.Graph() # Creates an graph called G
color_map = [] # list that will define node colors
node_size = [] # list that will define node sizes
# -----------------------------------------
# Searches Nodes and Color them
# -----------------------------------------
for n in net:
G.add_node(n.get_name())
color_map.append('red')
node_size.append(500)
for n in net:
G.add_edge(n.get_name(), n.get_source())
color_map.append('yellow')
node_size.append(100)
G.add_edge(n.get_name(), n.get_drain())
color_map.append('yellow')
node_size.append(100)
nx.draw(G)
plt.show()
def print_gmelogo():
print("================================")
print("\033[37;41m██████╗ ██╗ ██╗██╗ ███████╗██╗ ██╗\033[0m")
print("\033[37;41m██╔══██╗╚██╗ ██╔╝██║ ██╔════╝╚██╗██╔╝\033[0m")
print("\033[37;41m██████╔╝ ╚████╔╝ ██║ █████╗ ╚███╔╝ \033[0m")
print("\033[37;41m██╔═══╝ ╚██╔╝ ██║ ██╔══╝ ██╔██╗ \033[0m")
print("\033[37;41m██║ ██║ ███████╗███████╗██╔╝ ██╗\033[0m")
print("\033[37;41m╚═╝ ╚═╝ ╚══════╝╚══════╝╚═╝ ╚═╝\033[0m")
print("================================")
print("LOGICAL EXTRACTOR")
print("================================")