Exporting Graphs¶
Graphs can be exported and displayed visually, for which a method is included into the Plotting class.
Execute the cell below to read the design file as usual and set up the graph so that it can be exported afterwards.
In [ ]:
Copied!
import netlist_carpentry
FILE_PATH = "../files/decentral_mux.v"
circuit = netlist_carpentry.read(FILE_PATH, top="decentral_mux")
circuit.top.optimize()
GRAPH = circuit.top.graph()
import netlist_carpentry
FILE_PATH = "../files/decentral_mux.v"
circuit = netlist_carpentry.read(FILE_PATH, top="decentral_mux")
circuit.top.optimize()
GRAPH = circuit.top.graph()
Plotting.export_graphml exports the graph into the graphml format and writes it to a file so that it can be represented by external software, e.g. Gephi.
Execute the cell below so that a graphml file is created and saved in the output directory, which contains the module graph of the decentral mux to be viewed in graph displaying software.
In [ ]:
Copied!
from netlist_carpentry.core.graph.visualization import Plotting
plot = Plotting(GRAPH)
plot.export_graphml('../output/decentral_mux.graphml')
from netlist_carpentry.core.graph.visualization import Plotting
plot = Plotting(GRAPH)
plot.export_graphml('../output/decentral_mux.graphml')