python: Make the dot writer handle unconnected Port vector elements.
authorGabe Black <gabeblack@google.com>
Fri, 6 Sep 2019 22:14:49 +0000 (15:14 -0700)
committerGabe Black <gabeblack@google.com>
Sat, 7 Sep 2019 01:58:40 +0000 (01:58 +0000)
Change-Id: I5234013716cdcce5fc39e239dc3d92cd1f2b7799
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20699
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/python/m5/util/dot_writer.py

index d1fe946538e5075654878187f97b7f6e316dabca..bc5544a22998cfbba983d716fa52e55fecad25f9 100644 (file)
@@ -117,10 +117,12 @@ def dot_create_edges(simNode, callgraph):
             port_node = dot_create_node(simNode, full_port_name, port_name)
             # create edges
             if isinstance(port, PortRef):
-                dot_add_edge(simNode, callgraph, full_port_name, port)
+                if port.peer:
+                    dot_add_edge(simNode, callgraph, full_port_name, port)
             else:
                 for p in port.elements:
-                    dot_add_edge(simNode, callgraph, full_port_name, p)
+                    if p.peer:
+                        dot_add_edge(simNode, callgraph, full_port_name, p)
 
     # recurse to children
     for child in simnode_children(simNode):