# yukesh116/uart architecture

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

- Interactive diagram: https://gitdiagram.com/yukesh116/uart
- Repository: https://github.com/yukesh116/uart

## Overview

#### Purpose and entry points

This is a compact Verilog UART design with separate transmit, receive, and baud-rate generation logic. The integration entry point is `uart_top.v`; simulation is driven by `uart_tb.v` and generated artifacts are placed under `sim/`.

#### Top-level integration

`uart_top.v` composes the UART subsystems and exposes the design-level interface: system clock/reset, serial RX/TX signals, and parallel transmit/receive-facing controls or data. It is the primary synthesis/integration boundary.

Paths:
- `uart_top.v`
- `uart_tx.v`
- `uart_rx.v`

#### Baud timing domain

`uart_baud.v` derives timing enables from the system clock for UART bit timing. TX and RX should consume this shared timing source rather than creating independent clock domains, keeping serial timing coordinated under the top-level clock.

Path:
- `uart_baud.v`

#### Transmit pipeline

`uart_tx.v` converts parallel transmit data into a serial UART frame. Its control flow is typically request/load → start bit → data-bit shifts → stop bit → completion/idle. It owns the serial TX output timing and must synchronize frame progression to the baud enable supplied through integration.

Paths:
- `uart_tx.v`
- `uart_baud.v`
- `uart_top.v`

#### Receive pipeline

`uart_rx.v` samples the asynchronous serial RX input, detects a start condition, captures serial data at baud-timed intervals, validates/completes the frame, and presents received parallel data/status to the top level. RX is the key asynchronous input boundary and requires sampling/synchronization behavior appropriate to the system clock.

Paths:
- `uart_rx.v`
- `uart_baud.v`
- `uart_top.v`

#### Primary data and control flow

Outbound flow: parallel data/control enters `uart_top.v`, is accepted by `uart_tx.v`, then emitted as serial TX bits according to `uart_baud.v` timing.

Inbound flow: serial RX enters `uart_top.v`, is processed by `uart_rx.v` using baud timing, and exits as parallel received data/status.

Shared control dependencies are reset, the system clock, and baud-rate timing. The architectural boundary is between synchronous internal logic and the external asynchronous serial wire interface.

#### Runtime and validation

The design runs as synthesizable Verilog hardware; no software runtime or external service is present. `uart_tb.v` is the simulation entry point for exercising top-level UART behavior, with simulation output or build artifacts expected in `sim/`.

Paths:
- `uart_tb.v`
- `sim/`

Main entry points: [`uart_top.v`](https://github.com/yukesh116/uart/blob/main/uart_top.v) (UART Top), [`uart_tx.v`](https://github.com/yukesh116/uart/blob/main/uart_tx.v) (Transmitter), [`uart_rx.v`](https://github.com/yukesh116/uart/blob/main/uart_rx.v) (Receiver), [`uart_baud.v`](https://github.com/yukesh116/uart/blob/main/uart_baud.v) (Baud Generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_design["Synthesizable UART"]
  node_uart_top["UART Top<br/>integration module<br/>[uart_top.v]"]
  node_baud["Baud Generator<br/>timing enable<br/>[uart_baud.v]"]
  node_tx["Transmitter<br/>UART TX FSM<br/>[uart_tx.v]"]
  node_rx["Receiver<br/>UART RX sampler<br/>[uart_rx.v]"]
  node_parallel_tx["Parallel TX Data &amp; Control<br/>external interface"]
  node_serial_tx["Serial TX Wire<br/>external serial output"]
  node_serial_rx["Serial RX Wire<br/>asynchronous serial input"]
  node_parallel_rx["Parallel RX Data &amp; Status<br/>external interface"]
  node_clock_reset["System Clock &amp; Reset<br/>shared control"]
end

subgraph group_simulation["Simulation"]
  node_tb["UART Testbench<br/>simulation entry point<br/>[uart_tb.v]"]
  node_sim_output["Simulation Artifacts<br/>generated output"]
end

node_parallel_tx -->|"TX data / request"| node_uart_top
node_uart_top -->|"parallel TX interface"| node_tx
node_tx -->|"serial frame"| node_uart_top
node_uart_top -->|"TX"| node_serial_tx
node_serial_rx -->|"RX"| node_uart_top
node_uart_top -->|"serial RX"| node_rx
node_rx -->|"received data / status"| node_uart_top
node_uart_top -->|"RX data / status"| node_parallel_rx
node_clock_reset -->|"clock / reset"| node_uart_top
node_uart_top -->|"system clock"| node_baud
node_baud -->|"baud enable"| node_tx
node_baud -->|"baud enable"| node_rx
node_clock_reset -->|"reset"| node_tx
node_clock_reset -->|"reset"| node_rx
node_tb -.->|"simulates"| node_uart_top
node_tb -->|"generates"| node_sim_output

click node_uart_top "https://github.com/yukesh116/uart/blob/main/uart_top.v"
click node_baud "https://github.com/yukesh116/uart/blob/main/uart_baud.v"
click node_tx "https://github.com/yukesh116/uart/blob/main/uart_tx.v"
click node_rx "https://github.com/yukesh116/uart/blob/main/uart_rx.v"
click node_tb "https://github.com/yukesh116/uart/blob/main/uart_tb.v"

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_top,node_baud,node_tx,node_rx,node_parallel_tx,node_serial_tx,node_serial_rx,node_parallel_rx,node_clock_reset toneBlue
class node_tb,node_sim_output toneAmber
```

## Components

### Synthesizable UART

Clocked UART hardware and external serial boundary.

- [UART Top](https://github.com/yukesh116/uart/blob/main/uart_top.v): integration module · Primary synthesis boundary and external interface. · `uart_top.v`
- [Baud Generator](https://github.com/yukesh116/uart/blob/main/uart_baud.v): timing enable · Derives shared UART bit-timing enables from the system clock. · `uart_baud.v`
- [Transmitter](https://github.com/yukesh116/uart/blob/main/uart_tx.v): UART TX FSM · Frames parallel data as start, data, and stop serial bits. · `uart_tx.v`
- [Receiver](https://github.com/yukesh116/uart/blob/main/uart_rx.v): UART RX sampler · Samples asynchronous RX and produces received data/status. · `uart_rx.v`
- **Parallel TX Data & Control**: external interface
- **Serial TX Wire**: external serial output
- **Serial RX Wire**: asynchronous serial input · External asynchronous input boundary.
- **Parallel RX Data & Status**: external interface
- **System Clock & Reset**: shared control

### Simulation

Top-level verification and generated outputs.

- [UART Testbench](https://github.com/yukesh116/uart/blob/main/uart_tb.v): simulation entry point · Exercises top-level UART behavior. · `uart_tb.v`
- **Simulation Artifacts**: generated output

## Connections

- Parallel TX Data & Control → UART Top: TX data / request
- UART Top → Transmitter: parallel TX interface
- Transmitter → UART Top: serial frame
- UART Top → Serial TX Wire: TX
- Serial RX Wire → UART Top: RX
- UART Top → Receiver: serial RX
- Receiver → UART Top: received data / status
- UART Top → Parallel RX Data & Status: RX data / status
- System Clock & Reset → UART Top: clock / reset
- UART Top → Baud Generator: system clock
- Baud Generator → Transmitter: baud enable
- Baud Generator → Receiver: baud enable
- System Clock & Reset → Transmitter: reset
- System Clock & Reset → Receiver: reset
- UART Testbench → UART Top: simulates
- UART Testbench → Simulation Artifacts: generates
