1c1
< # Copyright (c) 2012 ARM Limited
---
> # Copyright (c) 2012-2013 ARM Limited
44,52c44,53
< # of a system's components and connectivity, they lack a birds-eye view.
< # The output generated by do_dot() is a DOT-based figure (pdf) and its
< # source dot code. Nodes are components, and edges represent
< # the memory hierarchy: the edges are directed, from a master to a slave.
< # Initially all nodes are generated, and then all edges are added.
< # do_dot should be called with the top-most SimObject (namely root
< # but not necessarily), the output folder and the output dot source
< # filename. From the given node, both processes (node and edge creation)
< # is performed recursivly, traversing all children of the given root.
---
> # of a system's components and connectivity, they lack a birds-eye
> # view. The output generated by do_dot() is a DOT-based figure (as a
> # pdf and an editable svg file) and its source dot code. Nodes are
> # components, and edges represent the memory hierarchy: the edges are
> # directed, from a master to slave. Initially all nodes are
> # generated, and then all edges are added. do_dot should be called
> # with the top-most SimObject (namely root but not necessarily), the
> # output folder and the output dot source filename. From the given
> # node, both processes (node and edge creation) is performed
> # recursivly, traversing all children of the given root.
72a74,75
> # add class name under the label
> label = "\"" + label + " \\n: " + simNode.__class__.__name__ + "\""
158d160
< # currently a simple grayscale. placeholder for aesthetic programmers.
159a162,164
> # start off with white
> base = (256, 256, 256)
> # scale the color based on the depth
161,162c166,168
< depth = 256 - depth * 16 * 3
< return dot_rgb_to_html(simNode, depth, depth, depth)
---
> # slightly arbitrary, but assume that the depth is less than six
> # levels
> r, g, b = map(lambda x: x * max(1 - depth / 6.0, 0.3), base)
164c170,172
< def dot_rgb_to_html(simNode, r, g, b):
---
> return dot_rgb_to_html(r, g, b)
>
> def dot_rgb_to_html(r, g, b):
170c178,182
< callgraph = pydot.Dot(graph_type='digraph')
---
> # * use ranksep > 1.0 for for vertical separation between nodes
> # especially useful if you need to annotate edges using e.g. visio
> # which accepts svg format
> # * no need for hoizontal separation as nothing moves horizonally
> callgraph = pydot.Dot(graph_type='digraph', ranksep='1.3')
177a190
> callgraph.write_svg(dot_filename + ".svg")