dot_writer.py (13714:35636064b7a1) dot_writer.py (13870:2536e3a4b58d)
1# Copyright (c) 2012-2013 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 112 unchanged lines hidden (view full) ---

121 else:
122 for p in port.elements:
123 dot_add_edge(simNode, callgraph, full_port_name, p)
124
125 # recurse to children
126 for child in simnode_children(simNode):
127 dot_create_edges(child, callgraph)
128
1# Copyright (c) 2012-2013 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 112 unchanged lines hidden (view full) ---

121 else:
122 for p in port.elements:
123 dot_add_edge(simNode, callgraph, full_port_name, p)
124
125 # recurse to children
126 for child in simnode_children(simNode):
127 dot_create_edges(child, callgraph)
128
129def dot_add_edge(simNode, callgraph, full_port_name, peerPort):
130 if peerPort.role == "MASTER":
131 peer_port_name = re.sub('\.', '_', peerPort.peer.simobj.path() \
132 + "." + peerPort.peer.name)
133 callgraph.add_edge(pydot.Edge(full_port_name, peer_port_name))
129def dot_add_edge(simNode, callgraph, full_port_name, port):
130 peer = port.peer
131 full_peer_path = re.sub('\.', '_', peer.simobj.path())
132 full_peer_port_name = full_peer_path + "_" + peer.name
134
133
134 # Each edge is encountered twice, once for each peer. We only want one
135 # edge, so we'll arbitrarily chose which peer "wins" based on their names.
136 if full_peer_port_name < full_port_name:
137 dir_type = {
138 (False, False) : 'both',
139 (True, False) : 'forward',
140 (False, True) : 'back',
141 (True, True) : 'none'
142 }[ (port.is_source,
143 peer.is_source) ]
144 edge = pydot.Edge(full_port_name, full_peer_port_name, dir=dir_type)
145 callgraph.add_edge(edge)
146
135def dot_create_cluster(simNode, full_path, label):
136 # get the parameter values of the node and use them as a tooltip
137 ini_strings = []
138 for param in sorted(simNode._params.keys()):
139 value = simNode._values.get(param)
140 if value != None:
141 # parameter name = value in HTML friendly format
142 ini_strings.append(str(param) + "&#61;" +

--- 229 unchanged lines hidden ---
147def dot_create_cluster(simNode, full_path, label):
148 # get the parameter values of the node and use them as a tooltip
149 ini_strings = []
150 for param in sorted(simNode._params.keys()):
151 value = simNode._values.get(param)
152 if value != None:
153 # parameter name = value in HTML friendly format
154 ini_strings.append(str(param) + "&#61;" +

--- 229 unchanged lines hidden ---