# yosyshq/yosys architecture

> Architecture diagram of the GitHub repository yosyshq/yosys, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yosyshq/yosys
- Repository: https://github.com/yosyshq/yosys

## Overview

Yosys is an RTL synthesis framework: users read and elaborate hardware descriptions into RTLIL, select hierarchy, lower processes, optimize and map logic, then emit a netlist. Its pass-based design also supports target-specific synthesis, simulation and formal-oriented workflows. The graph combines documented command sequences with major source-tree subsystems; several frontend, backend and verification relationships are not established by the supplied excerpts, so those branches are shown without speculative wiring.

Main entry points: [`frontends/verilog/verilog_frontend.cc`](https://github.com/yosyshq/yosys/blob/main/frontends/verilog/verilog_frontend.cc) (Verilog frontend), [`frontends/slang`](https://github.com/yosyshq/yosys/tree/main/frontends/slang) (SystemVerilog frontend), [`kernel/rtlil.cc`](https://github.com/yosyshq/yosys/blob/main/kernel/rtlil.cc) (RTLIL design model), [`frontends/ast/ast.h`](https://github.com/yosyshq/yosys/blob/main/frontends/ast/ast.h) (AST elaboration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontends["Design frontends"]
  node_verilog["Verilog frontend"]
  node_ast["AST elaboration<br/>[ast.h]"]
  node_sv["SystemVerilog frontend"]
  node_other_frontends["Other frontends"]
end

subgraph group_kernel["Design kernel"]
  node_rtlil["RTLIL design model<br/>[rtlil.cc]"]
  node_celltypes["Cell type model<br/>[celltypes.h]"]
  node_ff_mem["FF and memory models<br/>[ff.h]"]
  node_register["Pass registry<br/>[register.h]"]
end

subgraph group_synthesis["Synthesis passes"]
  node_hierarchy["Hierarchy handling<br/>[hierarchy.cc]"]
  node_processes["Process lowering"]
  node_optimization["Optimization"]
  node_fsm_memory["FSM and memory"]
  node_techmap["Technology mapping<br/>[techmap.cc]"]
  node_synth_scripts["Synthesis flows<br/>[synth.cc]"]
end

subgraph group_targets["Targets and output"]
  node_device_flows["Device synthesis flows"]
  node_netlist_outputs["Netlist backends<br/>[verilog_backend.cc]"]
  node_other_outputs["Other output formats"]
end

subgraph group_analysis["Simulation and formal"]
  node_simulation["RTL simulation<br/>[sim.cc]"]
  node_formal["SMT bounded checking<br/>[smtbmc.py]"]
end

node_engineer(("RTL engineer"))

node_engineer -->|"reads RTL"| node_verilog
node_verilog -->|"elaborates design"| node_rtlil
node_engineer -->|"selects top"| node_hierarchy
node_engineer -->|"runs passes"| node_processes
node_engineer -->|"runs passes"| node_optimization
node_engineer -->|"runs mapping"| node_techmap
node_engineer -->|"writes netlist"| node_netlist_outputs
node_engineer -->|"runs synthesis"| node_synth_scripts
node_engineer -.->|"targets device"| node_device_flows
node_engineer -.->|"runs simulation"| node_simulation
node_engineer -.->|"checks properties"| node_formal
node_engineer -.->|"reads designs"| node_other_frontends
node_engineer -.->|"exports design"| node_other_outputs
node_engineer -->|"reads SystemVerilog"| node_sv
node_sv -.->|"elaborates design"| node_rtlil
node_engineer -->|"runs passes"| node_fsm_memory
node_engineer -.->|"uses cell model"| node_celltypes
node_engineer -.->|"uses state models"| node_ff_mem
node_engineer -.->|"invokes commands"| node_register
node_engineer -.->|"elaborates RTL"| node_ast

click node_verilog "https://github.com/yosyshq/yosys/blob/main/frontends/verilog/verilog_frontend.cc"
click node_ast "https://github.com/yosyshq/yosys/blob/main/frontends/ast/ast.h"
click node_sv "https://github.com/yosyshq/yosys/tree/main/frontends/slang"
click node_other_frontends "https://github.com/yosyshq/yosys/tree/main/frontends"
click node_rtlil "https://github.com/yosyshq/yosys/blob/main/kernel/rtlil.cc"
click node_celltypes "https://github.com/yosyshq/yosys/blob/main/kernel/celltypes.h"
click node_ff_mem "https://github.com/yosyshq/yosys/blob/main/kernel/ff.h"
click node_register "https://github.com/yosyshq/yosys/blob/main/kernel/register.h"
click node_hierarchy "https://github.com/yosyshq/yosys/blob/main/passes/hierarchy/hierarchy.cc"
click node_processes "https://github.com/yosyshq/yosys/tree/main/passes/proc"
click node_optimization "https://github.com/yosyshq/yosys/tree/main/passes/opt"
click node_fsm_memory "https://github.com/yosyshq/yosys/tree/main/passes/fsm"
click node_techmap "https://github.com/yosyshq/yosys/blob/main/passes/techmap/techmap.cc"
click node_synth_scripts "https://github.com/yosyshq/yosys/blob/main/techlibs/common/synth.cc"
click node_device_flows "https://github.com/yosyshq/yosys/tree/main/techlibs"
click node_netlist_outputs "https://github.com/yosyshq/yosys/blob/main/backends/verilog/verilog_backend.cc"
click node_other_outputs "https://github.com/yosyshq/yosys/tree/main/backends"
click node_simulation "https://github.com/yosyshq/yosys/blob/main/passes/sat/sim.cc"
click node_formal "https://github.com/yosyshq/yosys/blob/main/backends/smt2/smtbmc.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_verilog,node_ast,node_sv,node_other_frontends toneBlue
class node_rtlil,node_celltypes,node_ff_mem,node_register toneAmber
class node_hierarchy,node_processes,node_optimization,node_fsm_memory,node_techmap,node_synth_scripts toneMint
class node_device_flows,node_netlist_outputs,node_other_outputs toneRose
class node_simulation,node_formal,node_engineer toneIndigo
```

## Components

### Design frontends

- [Verilog frontend](https://github.com/yosyshq/yosys/blob/main/frontends/verilog/verilog_frontend.cc): `frontends/verilog/verilog_frontend.cc`
- [AST elaboration](https://github.com/yosyshq/yosys/blob/main/frontends/ast/ast.h): `frontends/ast/ast.h`
- [SystemVerilog frontend](https://github.com/yosyshq/yosys/tree/main/frontends/slang): `frontends/slang`
- [Other frontends](https://github.com/yosyshq/yosys/tree/main/frontends): `frontends`

### Design kernel

- [RTLIL design model](https://github.com/yosyshq/yosys/blob/main/kernel/rtlil.cc): `kernel/rtlil.cc`
- [Cell type model](https://github.com/yosyshq/yosys/blob/main/kernel/celltypes.h): `kernel/celltypes.h`
- [FF and memory models](https://github.com/yosyshq/yosys/blob/main/kernel/ff.h): `kernel/ff.h`
- [Pass registry](https://github.com/yosyshq/yosys/blob/main/kernel/register.h): `kernel/register.h`

### Synthesis passes

- [Hierarchy handling](https://github.com/yosyshq/yosys/blob/main/passes/hierarchy/hierarchy.cc): `passes/hierarchy/hierarchy.cc`
- [Process lowering](https://github.com/yosyshq/yosys/tree/main/passes/proc): `passes/proc`
- [Optimization](https://github.com/yosyshq/yosys/tree/main/passes/opt): `passes/opt`
- [FSM and memory](https://github.com/yosyshq/yosys/tree/main/passes/fsm): `passes/fsm`
- [Technology mapping](https://github.com/yosyshq/yosys/blob/main/passes/techmap/techmap.cc): `passes/techmap/techmap.cc`
- [Synthesis flows](https://github.com/yosyshq/yosys/blob/main/techlibs/common/synth.cc): `techlibs/common/synth.cc`

### Targets and output

- [Device synthesis flows](https://github.com/yosyshq/yosys/tree/main/techlibs): `techlibs`
- [Netlist backends](https://github.com/yosyshq/yosys/blob/main/backends/verilog/verilog_backend.cc): `backends/verilog/verilog_backend.cc`
- [Other output formats](https://github.com/yosyshq/yosys/tree/main/backends): `backends`

### Simulation and formal

- [RTL simulation](https://github.com/yosyshq/yosys/blob/main/passes/sat/sim.cc): `passes/sat/sim.cc`
- [SMT bounded checking](https://github.com/yosyshq/yosys/blob/main/backends/smt2/smtbmc.py): `backends/smt2/smtbmc.py`

### Other components

- **RTL engineer**

## Connections

- RTL engineer → Verilog frontend: reads RTL
- Verilog frontend → RTLIL design model: elaborates design
- RTL engineer → Hierarchy handling: selects top
- RTL engineer → Process lowering: runs passes
- RTL engineer → Optimization: runs passes
- RTL engineer → Technology mapping: runs mapping
- RTL engineer → Netlist backends: writes netlist
- RTL engineer → Synthesis flows: runs synthesis
- RTL engineer → Device synthesis flows: targets device
- RTL engineer → RTL simulation: runs simulation
- RTL engineer → SMT bounded checking: checks properties
- RTL engineer → Other frontends: reads designs
- RTL engineer → Other output formats: exports design
- RTL engineer → SystemVerilog frontend: reads SystemVerilog
- SystemVerilog frontend → RTLIL design model: elaborates design
- RTL engineer → FSM and memory: runs passes
- RTL engineer → Cell type model: uses cell model
- RTL engineer → FF and memory models: uses state models
- RTL engineer → Pass registry: invokes commands
- RTL engineer → AST elaboration: elaborates RTL
