6#include "slang/text/FormatBuffer.h"
14 buffer.append(
"digraph {\n");
15 buffer.append(
" node [shape=record];\n");
19 auto &portNode = node->as<
Port>();
20 buffer.format(
" N{} [label=\"{} port {}\"]\n", node->ID,
21 toString(portNode.direction), portNode.name);
25 auto &varNode = node->as<
Variable>();
26 buffer.format(
" N{} [label=\"Variable {}\"]\n", node->ID,
31 buffer.format(
" N{} [label=\"Assignment\"]\n", node->ID);
35 buffer.format(
" N{} [label=\"Case\"]\n", node->ID);
39 buffer.format(
" N{} [label=\"Conditional\"]\n", node->ID);
43 buffer.format(
" N{} [label=\"Merge\"]\n", node->ID);
47 auto &state = node->as<
State>();
48 buffer.format(
" N{} [label=\"{} {}\"]\n", node->ID, state.name,
49 toString(state.bounds));
53 auto &constNode = node->as<
Constant>();
54 buffer.format(
" N{} [label=\"Const {}\"]\n", node->ID,
55 constNode.value.toString());
62 for (
auto const &node :
netlist) {
63 for (
auto const &edge : node->getOutEdges()) {
67 if (edge->symbol !=
nullptr && !edge->symbol->empty()) {
68 buffer.format(
" N{} -> N{} [label=\"{}{}\"]\n", node->ID,
69 edge->getTargetNode().ID, edge->symbol->name,
70 toString(edge->bounds));
72 buffer.format(
" N{} -> N{}\n", node->ID, edge->getTargetNode().ID);
Definition NetlistNode.hpp:227
Represent the netlist connectivity of an elaborated design.
Definition NetlistGraph.hpp:33
Definition NetlistNode.hpp:71
Definition NetlistNode.hpp:138
Definition NetlistNode.hpp:108
Definition Utilities.hpp:16
@ Case
Definition NetlistNode.hpp:25
@ State
Definition NetlistNode.hpp:27
@ Variable
Definition NetlistNode.hpp:22
@ Port
Definition NetlistNode.hpp:21
@ Merge
Definition NetlistNode.hpp:26
@ Conditional
Definition NetlistNode.hpp:24
@ Constant
Definition NetlistNode.hpp:28
@ Assignment
Definition NetlistNode.hpp:23
A utility class for rendering a netlist graph in DOT format.
Definition NetlistDot.hpp:11
static auto render(NetlistGraph const &netlist, FormatBuffer &buffer)
Definition NetlistDot.hpp:13