mirror of https://github.com/VLSIDA/OpenRAM.git
change nets list to dictionary
This commit is contained in:
parent
7581df2255
commit
e15feb2361
|
|
@ -214,12 +214,9 @@ class spice():
|
||||||
def create_nets(self, names_list):
|
def create_nets(self, names_list):
|
||||||
nets = []
|
nets = []
|
||||||
for name in names_list:
|
for name in names_list:
|
||||||
try:
|
# setdefault adds to the dict if it doesn't find the net in it already
|
||||||
i = self.nets.index(name)
|
# then it returns the net it found or created, a net_spice object
|
||||||
nets.append(self.nets[i])
|
net = self.nets.setdefault(name, net_spice(name))
|
||||||
except ValueError:
|
|
||||||
net = net_spice(name)
|
|
||||||
self.nets.append(net)
|
|
||||||
nets.append(net)
|
nets.append(net)
|
||||||
return nets
|
return nets
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue