self.create_pins()
- find = self.get_net_connections(['add_o(1)', 'sub_o(1)', 'o(1)'],
+ find = self.get_net_connections(['o(15)'],
['clk', 'rst', 'op'])
print (find)
sys.exit(0)
self.save()
return result
- def get_net_connections(self, find, already_found):
- res = set()
- search_more = []
- for inst in self.cell.getInstances():
- if (inst.getPlacementStatus() !=
- Instance.PlacementStatus.UNPLACED):
- continue
- print ("instance", inst)
- for plug in inst.getConnectedPlugs():
- netname = plug.getNet().getName()
- if netname in already_found:
- continue
- if plug.getNet().getName() in find:
- print ("plug", plug, plug.getNet().getName())
- for p in plug.getNet().getPlugs():
- c = p.getInstance()
- if (c.getPlacementStatus() !=
- Instance.PlacementStatus.UNPLACED):
- continue
- print ("notplaced", c)
- for pc in c.getConnectedPlugs():
- print ("plug", pc)
- pn = pc.getNet().getName()
- if pn not in find and pn not in already_found:
- search_more.append(pn)
- res.add(c)
- print()
- if search_more:
- print("more", search_more)
- new_found = find + already_found
- more = self.get_net_connections(search_more, new_found)
- res.update(more)
- return res
-
def scriptMain(editor=None, **kwargs):
coriolis_setup()
raise NotImplementedError('You need to implement the `build` method.')
+ def get_net_connections(self, to_find, already_found):
+ inst = self.cell.getInstances()
+ return get_net_connections(inst, to_find, already_found)
+
class Config:
if self._priority is not None:
Cfg.Configuration.popDefaultPriority()
+
+def get_net_connections(instances, find, already_found):
+ res = set()
+ new = set()
+ search_more = []
+ for inst in instances:
+ if (inst.getPlacementStatus() !=
+ Instance.PlacementStatus.UNPLACED):
+ continue
+ #print ("instance", inst)
+ for plug in inst.getConnectedPlugs():
+ netname = plug.getNet().getName()
+ if netname in already_found:
+ continue
+ if plug.getNet().getName() in find:
+ #print ("plug", plug, plug.getNet().getName())
+ for p in plug.getNet().getPlugs():
+ c = p.getInstance()
+ if (c.getPlacementStatus() !=
+ Instance.PlacementStatus.UNPLACED):
+ continue
+ #print ("notplaced", c)
+ for pc in c.getConnectedPlugs():
+ #print ("plug", pc)
+ pn = pc.getNet().getName()
+ if pn not in find and pn not in already_found:
+ search_more.append(pn)
+ new.add(c)
+ res.update(new)
+ if search_more:
+ print("more", search_more)
+ new_found = find + already_found
+ more = get_net_connections(new, search_more, new_found)
+ res.update(more)
+
+ return res