Back to features

Circuit Diagrams

Multi-level circuit visualization in SVG, PNG, and DOT formats. See your hardware at any abstraction level, from high-level block diagrams to individual gates.

SVG PNG DOT Graphviz

Output Formats

FormatTypeBest ForScalability
SVGVectorDocumentation, web embedding, zoom-friendly viewingUnlimited resolution
PNGRasterQuick previews, presentations, reportsFixed resolution
DOTGraph descriptionCustom rendering with Graphviz, CI pipelinesText-based, any renderer

Abstraction Levels

CIRCT generates diagrams at three abstraction levels. Choose the right level for your needs.

Hierarchical view shows component boundaries and interconnections as labeled blocks with port connections.

hierarchical.rb
cpu = CPU6502.new

cpu.diagram(
  level: :hierarchical,
  format: :svg,
  output: "cpu_blocks.svg"
)

RTL view shows registers, multiplexers, and arithmetic operators matching the source abstraction.

rtl_view.rb
alu = SimpleALU.new

alu.diagram(
  level: :rtl,
  format: :svg,
  output: "alu_rtl.svg"
)

Usage Examples

Generate diagrams in all formats at once, or target a specific abstraction level with custom options.

diagram_examples.rb
counter = Counter.new

# Generate all three formats
counter.diagram(format: :svg, output: "counter.svg")
counter.diagram(format: :png, output: "counter.png")
counter.diagram(format: :dot, output: "counter.dot")

# Gate-level view after synthesis
netlist = counter.synthesize(target: :gates)
netlist.diagram(
  format: :svg,
  output: "counter_gates.svg",
  show_labels: true,
  color_by: :gate_type
)