# alexforencich/verilog-i2c architecture

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

- Interactive diagram: https://gitdiagram.com/alexforencich/verilog-i2c
- Repository: https://github.com/alexforencich/verilog-i2c

## Overview

This repository provides Verilog I²C interface components. The principal workflows are peripheral initialization and I²C master or slave communication through stream, AXI Lite, or Wishbone interfaces. The README documents these capabilities but does not establish calls between the RTL modules, so the graph shows interface relationships without inventing an internal pipeline. Testbench endpoint and bus-model utilities are included as a separate support branch; their use by individual tests is not shown in the excerpts.

Main entry points: [`rtl/i2c_master.v`](https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_master.v) (I²C Master), [`rtl/i2c_slave.v`](https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_slave.v) (I²C Slave), [`rtl/i2c_init.v`](https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_init.v) (Peripheral Init), [`rtl/i2c_master_axil.v`](https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_master_axil.v) (Master AXI Lite)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_i2c["I²C Core"]
  node_init["Peripheral Init<br/>[i2c_init.v]"]
  node_master_core["I²C Master<br/>[i2c_master.v]"]
  node_single_reg["Single Register<br/>[i2c_single_reg.v]"]
  node_axis_fifo["AXI Stream FIFO<br/>[axis_fifo.v]"]
  node_slave_core["I²C Slave<br/>[i2c_slave.v]"]
end

subgraph group_master["Master Interfaces"]
  node_master_axil["Master AXI Lite<br/>[i2c_master_axil.v]"]
  node_master_wbs8["Master WB 8-bit<br/>[i2c_master_wbs_8.v]"]
  node_master_wbs16["Master WB 16-bit"]
end

subgraph group_slave["Slave Interfaces"]
  node_slave_axil["Slave AXI Lite"]
  node_slave_wbm["Slave Wishbone<br/>[i2c_slave_wbm.v]"]
end

subgraph group_tb["Testbench Utilities"]
  node_tb_axil["AXI Lite BFM<br/>[axil.py]"]
  node_tb_axis["AXI Stream Endpoints<br/>[axis_ep.py]"]
  node_tb_i2c["I²C Bus Models<br/>[i2c.py]"]
  node_tb_wb["Wishbone BFM<br/>[wb.py]"]
end

node_actor(("Control Logic"))
node_i2c_bus(("I²C Bus"))

node_actor -->|"initializes via"| node_init
node_actor -->|"controls via"| node_master_core
node_master_core -->|"drives"| node_i2c_bus
node_actor -->|"controls via"| node_master_axil
node_actor -->|"controls via"| node_master_wbs8
node_actor -->|"controls via"| node_master_wbs16
node_slave_core -->|"communicates on"| node_i2c_bus
node_actor -->|"controls via"| node_slave_core
node_actor -->|"interfaces via"| node_slave_axil
node_actor -->|"interfaces via"| node_slave_wbm

click node_init "https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_init.v"
click node_master_core "https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_master.v"
click node_single_reg "https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_single_reg.v"
click node_axis_fifo "https://github.com/alexforencich/verilog-i2c/blob/master/rtl/axis_fifo.v"
click node_master_axil "https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_master_axil.v"
click node_master_wbs8 "https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_master_wbs_8.v"
click node_master_wbs16 "https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_master_wbs_16.v"
click node_slave_core "https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_slave.v"
click node_slave_axil "https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_slave_axil_master.v"
click node_slave_wbm "https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_slave_wbm.v"
click node_tb_axil "https://github.com/alexforencich/verilog-i2c/blob/master/tb/axil.py"
click node_tb_axis "https://github.com/alexforencich/verilog-i2c/blob/master/tb/axis_ep.py"
click node_tb_i2c "https://github.com/alexforencich/verilog-i2c/blob/master/tb/i2c.py"
click node_tb_wb "https://github.com/alexforencich/verilog-i2c/blob/master/tb/wb.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_init,node_master_core,node_single_reg,node_axis_fifo,node_slave_core toneBlue
class node_master_axil,node_master_wbs8,node_master_wbs16 toneAmber
class node_slave_axil,node_slave_wbm toneMint
class node_tb_axil,node_tb_axis,node_tb_i2c,node_tb_wb toneRose
class node_actor,node_i2c_bus toneIndigo
```

## Components

### I²C Core

- [Peripheral Init](https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_init.v): `rtl/i2c_init.v`
- [I²C Master](https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_master.v): `rtl/i2c_master.v`
- [Single Register](https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_single_reg.v): `rtl/i2c_single_reg.v`
- [AXI Stream FIFO](https://github.com/alexforencich/verilog-i2c/blob/master/rtl/axis_fifo.v): `rtl/axis_fifo.v`
- [I²C Slave](https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_slave.v): `rtl/i2c_slave.v`

### Master Interfaces

- [Master AXI Lite](https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_master_axil.v): `rtl/i2c_master_axil.v`
- [Master WB 8-bit](https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_master_wbs_8.v): `rtl/i2c_master_wbs_8.v`
- [Master WB 16-bit](https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_master_wbs_16.v): `rtl/i2c_master_wbs_16.v`

### Slave Interfaces

- [Slave AXI Lite](https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_slave_axil_master.v): `rtl/i2c_slave_axil_master.v`
- [Slave Wishbone](https://github.com/alexforencich/verilog-i2c/blob/master/rtl/i2c_slave_wbm.v): `rtl/i2c_slave_wbm.v`

### Testbench Utilities

- [AXI Lite BFM](https://github.com/alexforencich/verilog-i2c/blob/master/tb/axil.py): `tb/axil.py`
- [AXI Stream Endpoints](https://github.com/alexforencich/verilog-i2c/blob/master/tb/axis_ep.py): `tb/axis_ep.py`
- [I²C Bus Models](https://github.com/alexforencich/verilog-i2c/blob/master/tb/i2c.py): `tb/i2c.py`
- [Wishbone BFM](https://github.com/alexforencich/verilog-i2c/blob/master/tb/wb.py): `tb/wb.py`

### Other components

- **Control Logic**
- **I²C Bus**

## Connections

- Control Logic → Peripheral Init: initializes via (evidence: `README`)
- Control Logic → I²C Master: controls via (evidence: `README`)
- I²C Master → I²C Bus: drives (evidence: `README`)
- Control Logic → Master AXI Lite: controls via (evidence: `README`)
- Control Logic → Master WB 8-bit: controls via (evidence: `README`)
- Control Logic → Master WB 16-bit: controls via (evidence: `README`)
- I²C Slave → I²C Bus: communicates on (evidence: `README`)
- Control Logic → I²C Slave: controls via (evidence: `README`)
- Control Logic → Slave AXI Lite: interfaces via (evidence: `README`)
- Control Logic → Slave Wishbone: interfaces via (evidence: `README`)
