comparison python/ppci/codegen/interferencegraph.py @ 314:38f5f298ce0e

Add log for interference graph
author Windel Bouwman
date Wed, 18 Dec 2013 20:22:20 +0100
parents 04cf4d26a3bc
children b00219172a42
comparison
equal deleted inserted replaced
313:04cf4d26a3bc 314:38f5f298ce0e
53 self.addEdge(n1, n2) 53 self.addEdge(n1, n2)
54 54
55 def to_dot(self, f): 55 def to_dot(self, f):
56 """ Generate graphviz dot representation """ 56 """ Generate graphviz dot representation """
57 for n in self.nodes: 57 for n in self.nodes:
58 print('{} [label="{}" shape=box3d];'.format(id(n), n), file=f) 58 print(' {} [label="{}" shape=box3d];'.format(id(n), n), file=f)
59 for n, m in self.edges: 59 for n, m in self.edges:
60 print('{} -> {};'.format(id(n), id(m)), file=f) 60 print(' {} -> {};'.format(id(n), id(m)), file=f)
61 61
62 def to_txt(self): 62 def to_txt(self):
63 for node in self.nodes: 63 for node in self.nodes:
64 print('{} interferes: {}'.format(node, node.Adjecent)) 64 print('{} interferes: {}'.format(node, node.Adjecent))
65 65