# ginnela-sairam/telugu-16-v4 architecture

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

- Interactive diagram: https://gitdiagram.com/ginnela-sairam/telugu-16-v4
- Repository: https://github.com/ginnela-sairam/telugu-16-v4

## Overview

TELUGU-16 is a synthesizable 16-bit SoC with a memory-mapped P-bit, timer, and GPIO. The principal user workflow is to assemble a program, optionally bake its machine code into ROM for silicon, then run it on the SoC. Separate branches cover the TinyTapeout wrapper and SPICE experiments. The hardware relationships below follow the README; detailed RTL call wiring was not sampled, so internal edges are limited to documented architecture.

Main entry points: [`rtl/t16_soc.v`](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_soc.v) (T-16 SoC), [`spice/run_experiments.py`](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/spice/run_experiments.py) (SPICE experiments), [`sw`](https://github.com/ginnela-sairam/telugu-16-v4/tree/main/sw) (Assembly programs), [`tools/t16asm.py`](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/tools/t16asm.py) (T-16 assembler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_software["Program authoring"]
  node_assembly["Assembly programs"]
  node_assembler["T-16 assembler<br/>[t16asm.py]"]
  node_hex["Machine-code image"]
  node_rom_baker["ROM baker<br/>[bake_rom.py]"]
end

subgraph group_hardware["SoC hardware"]
  node_rom["Program ROM<br/>[t16_rom.v]"]
  node_soc["T-16 SoC<br/>[t16_soc.v]"]
  node_cpu["16-bit CPU<br/>[t16_cpu.v]"]
  node_ram["Data RAM<br/>[t16_ram.v]"]
  node_gpio["GPIO peripheral<br/>[t16_gpio.v]"]
  node_ro["Ring oscillator<br/>[t16_ro.v]"]
  node_timer["Timer and prescaler<br/>[t16_soc.v]"]
  node_pbit["P-bit interface<br/>[t16_soc.v]"]
end

subgraph group_physics["P-bit physics"]
  node_spice_runner["SPICE experiments<br/>[run_experiments.py]"]
  node_spice_models["Sky130 device models"]
end

subgraph group_silicon["Silicon interface"]
  node_top["Silicon top<br/>[t16_top_silicon.v]"]
  node_wrapper["TinyTapeout wrapper<br/>[tt_um_telugu_t16.v]"]
end

node_programmer(("Programmer"))
node_ngspice["ngspice"]

node_programmer -->|"writes"| node_assembly
node_assembly -->|"assembles with"| node_assembler
node_assembler -->|"produces"| node_hex
node_hex -->|"bakes from"| node_rom_baker
node_rom_baker -->|"writes program"| node_rom
node_rom -.->|"program storage"| node_soc
node_soc -->|"integrates"| node_cpu
node_soc -->|"integrates"| node_ram
node_soc -->|"integrates"| node_gpio
node_soc -->|"integrates"| node_timer
node_soc -->|"memory maps"| node_pbit
node_ro -->|"generates entropy"| node_pbit
node_soc -.->|"uses clock source"| node_ro
node_soc -->|"silicon configuration"| node_top
node_top -.->|"exposes interface"| node_wrapper
node_spice_runner -->|"runs simulations"| node_ngspice
node_spice_runner -->|"loads models"| node_spice_models

click node_assembly "https://github.com/ginnela-sairam/telugu-16-v4/tree/main/sw"
click node_assembler "https://github.com/ginnela-sairam/telugu-16-v4/blob/main/tools/t16asm.py"
click node_hex "https://github.com/ginnela-sairam/telugu-16-v4/tree/main/sw"
click node_rom_baker "https://github.com/ginnela-sairam/telugu-16-v4/blob/main/tools/bake_rom.py"
click node_rom "https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_rom.v"
click node_soc "https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_soc.v"
click node_cpu "https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_cpu.v"
click node_ram "https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_ram.v"
click node_gpio "https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_gpio.v"
click node_ro "https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_ro.v"
click node_timer "https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_soc.v"
click node_pbit "https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_soc.v"
click node_top "https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_top_silicon.v"
click node_wrapper "https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/tt_um_telugu_t16.v"
click node_spice_runner "https://github.com/ginnela-sairam/telugu-16-v4/blob/main/spice/run_experiments.py"
click node_spice_models "https://github.com/ginnela-sairam/telugu-16-v4/tree/main/spice/sky130_models"

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_assembly,node_assembler,node_hex,node_rom_baker toneBlue
class node_rom,node_soc,node_cpu,node_ram,node_gpio,node_ro,node_timer,node_pbit toneAmber
class node_spice_runner,node_spice_models toneMint
class node_top,node_wrapper toneRose
class node_programmer,node_ngspice toneIndigo
```

## Components

### Program authoring

- [Assembly programs](https://github.com/ginnela-sairam/telugu-16-v4/tree/main/sw): `sw`
- [T-16 assembler](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/tools/t16asm.py): `tools/t16asm.py`
- [Machine-code image](https://github.com/ginnela-sairam/telugu-16-v4/tree/main/sw): `sw`
- [ROM baker](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/tools/bake_rom.py): `tools/bake_rom.py`

### SoC hardware

- [Program ROM](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_rom.v): `rtl/t16_rom.v`
- [T-16 SoC](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_soc.v): `rtl/t16_soc.v`
- [16-bit CPU](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_cpu.v): `rtl/t16_cpu.v`
- [Data RAM](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_ram.v): `rtl/t16_ram.v`
- [GPIO peripheral](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_gpio.v): `rtl/t16_gpio.v`
- [Ring oscillator](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_ro.v): `rtl/t16_ro.v`
- [Timer and prescaler](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_soc.v): `rtl/t16_soc.v`
- [P-bit interface](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_soc.v): `rtl/t16_soc.v`

### P-bit physics

- [SPICE experiments](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/spice/run_experiments.py): `spice/run_experiments.py`
- [Sky130 device models](https://github.com/ginnela-sairam/telugu-16-v4/tree/main/spice/sky130_models): `spice/sky130_models`

### Silicon interface

- [Silicon top](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/t16_top_silicon.v): `rtl/t16_top_silicon.v`
- [TinyTapeout wrapper](https://github.com/ginnela-sairam/telugu-16-v4/blob/main/rtl/tt_um_telugu_t16.v): `rtl/tt_um_telugu_t16.v`

### Other components

- **Programmer**
- **ngspice**

## Connections

- Programmer → Assembly programs: writes (evidence: `README.md`)
- Assembly programs → T-16 assembler: assembles with (evidence: `README.md`)
- T-16 assembler → Machine-code image: produces (evidence: `README.md`)
- Machine-code image → ROM baker: bakes from (evidence: `README.md`)
- ROM baker → Program ROM: writes program (evidence: `tools/bake_rom.py`)
- Program ROM → T-16 SoC: program storage
- T-16 SoC → 16-bit CPU: integrates (evidence: `README.md`)
- T-16 SoC → Data RAM: integrates (evidence: `README.md`)
- T-16 SoC → GPIO peripheral: integrates (evidence: `README.md`)
- T-16 SoC → Timer and prescaler: integrates (evidence: `README.md`)
- T-16 SoC → P-bit interface: memory maps (evidence: `README.md`)
- Ring oscillator → P-bit interface: generates entropy (evidence: `README.md`)
- T-16 SoC → Ring oscillator: uses clock source
- T-16 SoC → Silicon top: silicon configuration
- Silicon top → TinyTapeout wrapper: exposes interface
- SPICE experiments → ngspice: runs simulations (evidence: `spice/run_experiments.py`)
- SPICE experiments → Sky130 device models: loads models (evidence: `spice/run_experiments.py`)
