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):
|
||||
nets = []
|
||||
for name in names_list:
|
||||
try:
|
||||
i = self.nets.index(name)
|
||||
nets.append(self.nets[i])
|
||||
except ValueError:
|
||||
net = net_spice(name)
|
||||
self.nets.append(net)
|
||||
# setdefault adds to the dict if it doesn't find the net in it already
|
||||
# then it returns the net it found or created, a net_spice object
|
||||
net = self.nets.setdefault(name, net_spice(name))
|
||||
nets.append(net)
|
||||
return nets
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue