# ali-abdl/uart-verilog-cocotb architecture

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

- Interactive diagram: https://gitdiagram.com/ali-abdl/uart-verilog-cocotb
- Repository: https://github.com/ali-abdl/uart-verilog-cocotb

## Overview

This repository implements a parameterized, full-duplex UART and its verification environment. The runtime path is a controller request through the UART top level to the transmitter, with baud ticks supporting serial timing; incoming serial data is synchronized and decoded by the receiver. The repository also provides cocotb regression, scoreboard and functional coverage, plus bound SystemVerilog protocol assertions. The map reflects README-documented relationships; source excerpts did not include the RTL or individual testbenches, so their internal call wiring is not inferred.

Main entry points: [`tb`](https://github.com/ali-abdl/uart-verilog-cocotb/tree/main/tb) (Cocotb Test Suites), [`rtl/uart.v`](https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/rtl/uart.v) (UART Top), [`rtl/uart_tx.v`](https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/rtl/uart_tx.v) (Transmitter FSM), [`rtl/uart_rx.v`](https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/rtl/uart_rx.v) (Receiver FSM)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_design["UART Design"]
  node_uart["UART Top<br/>[uart.v]"]
  node_tx["Transmitter FSM<br/>[uart_tx.v]"]
  node_rx["Receiver FSM<br/>[uart_rx.v]"]
  node_baud["Baud Tick Generator<br/>[baud_gen.v]"]
end

subgraph group_cocotb["Cocotb Verification"]
  node_cocotb_tests["Cocotb Test Suites"]
  node_loopback["Loopback Harness<br/>[uart_loopback.v]"]
  node_scoreboard["Scoreboard<br/>[scoreboard.py]"]
  node_coverage["Functional Coverage<br/>[coverage.py]"]
end

subgraph group_assertions["Assertion Verification"]
  node_tx_sva["TX Assertions<br/>[uart_tx_sva.sv]"]
  node_rx_sva["RX Assertions<br/>[uart_rx_sva.sv]"]
  node_tx_sva_tb["TX Assertion Bench<br/>[tb_uart_tx_sva.sv]"]
  node_rx_sva_tb["RX Assertion Bench<br/>[tb_uart_rx_sva.sv]"]
end

node_controller(("Host Controller"))
node_serial_peer(("Serial Peer"))

node_controller -->|"requests transfer"| node_uart
node_uart -->|"routes transmit"| node_tx
node_uart -->|"routes receive"| node_rx
node_tx -->|"uses gated ticks"| node_baud
node_rx -->|"uses oversample ticks"| node_baud
node_serial_peer -->|"sends serial data"| node_rx
node_tx -->|"transmits serial data"| node_serial_peer
node_cocotb_tests -->|"exercises DUT"| node_uart
node_cocotb_tests -->|"uses harness"| node_loopback
node_cocotb_tests -.->|"checks results"| node_scoreboard
node_cocotb_tests -.->|"collects coverage"| node_coverage
node_tx_sva_tb -->|"drives assertions"| node_tx_sva
node_rx_sva_tb -->|"drives assertions"| node_rx_sva
node_tx_sva -->|"binds to FSM"| node_tx
node_rx_sva -->|"binds to FSM"| node_rx

click node_uart "https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/rtl/uart.v"
click node_tx "https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/rtl/uart_tx.v"
click node_rx "https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/rtl/uart_rx.v"
click node_baud "https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/rtl/baud_gen.v"
click node_cocotb_tests "https://github.com/ali-abdl/uart-verilog-cocotb/tree/main/tb"
click node_loopback "https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/tb/uart_loopback.v"
click node_scoreboard "https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/tb/scoreboard.py"
click node_coverage "https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/tb/coverage.py"
click node_tx_sva "https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/sva/uart_tx_sva.sv"
click node_rx_sva "https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/sva/uart_rx_sva.sv"
click node_tx_sva_tb "https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/sva/tb_uart_tx_sva.sv"
click node_rx_sva_tb "https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/sva/tb_uart_rx_sva.sv"

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_uart,node_tx,node_rx,node_baud toneBlue
class node_cocotb_tests,node_loopback,node_scoreboard,node_coverage toneAmber
class node_tx_sva,node_rx_sva,node_tx_sva_tb,node_rx_sva_tb toneMint
class node_controller,node_serial_peer toneIndigo
```

## Components

### UART Design

- [UART Top](https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/rtl/uart.v): `rtl/uart.v`
- [Transmitter FSM](https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/rtl/uart_tx.v): `rtl/uart_tx.v`
- [Receiver FSM](https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/rtl/uart_rx.v): `rtl/uart_rx.v`
- [Baud Tick Generator](https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/rtl/baud_gen.v): `rtl/baud_gen.v`

### Cocotb Verification

- [Cocotb Test Suites](https://github.com/ali-abdl/uart-verilog-cocotb/tree/main/tb): `tb`
- [Loopback Harness](https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/tb/uart_loopback.v): `tb/uart_loopback.v`
- [Scoreboard](https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/tb/scoreboard.py): `tb/scoreboard.py`
- [Functional Coverage](https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/tb/coverage.py): `tb/coverage.py`

### Assertion Verification

- [TX Assertions](https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/sva/uart_tx_sva.sv): `sva/uart_tx_sva.sv`
- [RX Assertions](https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/sva/uart_rx_sva.sv): `sva/uart_rx_sva.sv`
- [TX Assertion Bench](https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/sva/tb_uart_tx_sva.sv): `sva/tb_uart_tx_sva.sv`
- [RX Assertion Bench](https://github.com/ali-abdl/uart-verilog-cocotb/blob/main/sva/tb_uart_rx_sva.sv): `sva/tb_uart_rx_sva.sv`

### Other components

- **Host Controller**
- **Serial Peer**

## Connections

- Host Controller → UART Top: requests transfer (evidence: `README.md`)
- UART Top → Transmitter FSM: routes transmit (evidence: `README.md`)
- UART Top → Receiver FSM: routes receive (evidence: `README.md`)
- Transmitter FSM → Baud Tick Generator: uses gated ticks (evidence: `README.md`)
- Receiver FSM → Baud Tick Generator: uses oversample ticks (evidence: `README.md`)
- Serial Peer → Receiver FSM: sends serial data (evidence: `README.md`)
- Transmitter FSM → Serial Peer: transmits serial data (evidence: `README.md`)
- Cocotb Test Suites → UART Top: exercises DUT (evidence: `README.md`)
- Cocotb Test Suites → Loopback Harness: uses harness (evidence: `README.md`)
- Cocotb Test Suites → Scoreboard: checks results
- Cocotb Test Suites → Functional Coverage: collects coverage
- TX Assertion Bench → TX Assertions: drives assertions (evidence: `README.md`)
- RX Assertion Bench → RX Assertions: drives assertions (evidence: `README.md`)
- TX Assertions → Transmitter FSM: binds to FSM (evidence: `README.md`)
- RX Assertions → Receiver FSM: binds to FSM (evidence: `README.md`)
