# hkust-zhiyao/rtllm architecture

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

- Interactive diagram: https://gitdiagram.com/hkust-zhiyao/rtllm
- Repository: https://github.com/hkust-zhiyao/rtllm

## Overview

RTLLM is a dataset and benchmark for generating RTL from natural-language design specifications and evaluating the results. Its documented workflow has three stages: generate candidate RTL, test functionality, then synthesize and compare design quality against reference RTL. The repository organizes 50 designs into four categories. The graph reflects those documented stages and categories; source excerpts were limited to the evaluation script, so internal RTL-to-RTL dependencies are not inferred.

Main entry points: [`Arithmetic`](https://github.com/hkust-zhiyao/rtllm/tree/main/Arithmetic) (Natural-language specs), [`Memory`](https://github.com/hkust-zhiyao/rtllm/tree/main/Memory) (Memory modules), [`Control`](https://github.com/hkust-zhiyao/rtllm/tree/main/Control) (Control modules), [`Miscellaneous`](https://github.com/hkust-zhiyao/rtllm/tree/main/Miscellaneous) (Miscellaneous modules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_arith["Arithmetic designs"]
  node_arithmetic["Arithmetic modules"]
end

subgraph group_memory["Memory designs"]
  node_memory_designs["Memory modules"]
end

subgraph group_control["Control designs"]
  node_control_designs["Control modules"]
end

subgraph group_misc["Miscellaneous designs"]
  node_misc_designs["Miscellaneous modules"]
end

subgraph group_evaluation["Benchmark workflow"]
  node_specs["Natural-language specs"]
  node_candidate["Generated RTL"]
  node_testbench["Functional testbenches"]
  node_functionality["Functionality results"]
  node_synthesis["RTL synthesis"]
  node_reference["Reference RTL"]
  node_quality["PPA comparison"]
end

node_user(("Benchmark user"))
node_llm(("Target LLM"))

node_user -->|"selects designs"| node_specs
node_specs -->|"prompts with"| node_llm
node_llm -->|"generates RTL"| node_candidate
node_arithmetic -->|"documents designs"| node_specs
node_memory_designs -->|"documents designs"| node_specs
node_control_designs -->|"documents designs"| node_specs
node_misc_designs -->|"documents designs"| node_specs
node_candidate -->|"tested against"| node_testbench
node_testbench -->|"checks behavior"| node_functionality
node_candidate -->|"synthesized into"| node_synthesis
node_synthesis -->|"measures PPA"| node_quality
node_reference -->|"quality baseline"| node_quality

click node_specs "https://github.com/hkust-zhiyao/rtllm/tree/main/Arithmetic"
click node_arithmetic "https://github.com/hkust-zhiyao/rtllm/tree/main/Arithmetic"
click node_memory_designs "https://github.com/hkust-zhiyao/rtllm/tree/main/Memory"
click node_control_designs "https://github.com/hkust-zhiyao/rtllm/tree/main/Control"
click node_misc_designs "https://github.com/hkust-zhiyao/rtllm/tree/main/Miscellaneous"
click node_testbench "https://github.com/hkust-zhiyao/rtllm/tree/main/Arithmetic"
click node_reference "https://github.com/hkust-zhiyao/rtllm/tree/main/Arithmetic"

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_arithmetic,node_user toneBlue
class node_memory_designs toneAmber
class node_control_designs toneMint
class node_misc_designs toneRose
class node_specs,node_candidate,node_testbench,node_functionality,node_synthesis,node_reference,node_quality,node_llm toneIndigo
```

## Components

### Arithmetic designs

- [Arithmetic modules](https://github.com/hkust-zhiyao/rtllm/tree/main/Arithmetic): `Arithmetic`

### Memory designs

- [Memory modules](https://github.com/hkust-zhiyao/rtllm/tree/main/Memory): `Memory`

### Control designs

- [Control modules](https://github.com/hkust-zhiyao/rtllm/tree/main/Control): `Control`

### Miscellaneous designs

- [Miscellaneous modules](https://github.com/hkust-zhiyao/rtllm/tree/main/Miscellaneous): `Miscellaneous`

### Benchmark workflow

- [Natural-language specs](https://github.com/hkust-zhiyao/rtllm/tree/main/Arithmetic): `Arithmetic`
- **Generated RTL**
- [Functional testbenches](https://github.com/hkust-zhiyao/rtllm/tree/main/Arithmetic): `Arithmetic`
- **Functionality results**
- **RTL synthesis**
- [Reference RTL](https://github.com/hkust-zhiyao/rtllm/tree/main/Arithmetic): `Arithmetic`
- **PPA comparison**

### Other components

- **Benchmark user**
- **Target LLM**

## Connections

- Benchmark user → Natural-language specs: selects designs (evidence: `README.md`)
- Natural-language specs → Target LLM: prompts with (evidence: `README.md`)
- Target LLM → Generated RTL: generates RTL (evidence: `README.md`)
- Arithmetic modules → Natural-language specs: documents designs (evidence: `README.md`)
- Memory modules → Natural-language specs: documents designs (evidence: `README.md`)
- Control modules → Natural-language specs: documents designs (evidence: `README.md`)
- Miscellaneous modules → Natural-language specs: documents designs (evidence: `README.md`)
- Generated RTL → Functional testbenches: tested against (evidence: `README.md`)
- Functional testbenches → Functionality results: checks behavior (evidence: `README.md`)
- Generated RTL → RTL synthesis: synthesized into (evidence: `README.md`)
- RTL synthesis → PPA comparison: measures PPA (evidence: `README.md`)
- Reference RTL → PPA comparison: quality baseline (evidence: `README.md`)
