The UART Controller IP is a complete serial communication solution designed for embedded systems and SoC integration. It provides a configurable UART interface with APB slave connectivity, FIFO buffering, and interrupt capabilities.
┌─────────────────────────────────────────────────────────────┐
│ UART Controller Architecture │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ APB │ │ Control │ │ UART │ │
│ │ Slave │◀──▶│ Registers │◀──▶│ Interface │ │
│ │ Interface │ │ │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ TX │ │ RX │ │ Interrupt │ │
│ │ FIFO │ │ FIFO │ │ Controller │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ UART │ │ UART │ │ Error │ │
│ │ Transmitter │ │ Receiver │ │ Detection │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ │ │ |
│ └───────────────────┴──────────────────────┘ |
│ │ |
│ ┌─────────────┐ |
│ │ UART │ │
│ │ TX/RX │ │
│ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘
- APB Slave Interface: Handles register access and APB protocol compliance
- Control Registers: Configuration and status registers
- TX/RX FIFOs: Buffering for transmit and receive data
- UART Transmitter: Serial data transmission with configurable parameters
- UART Receiver: Serial data reception with error detection
- Interrupt Controller: Interrupt generation and management
- Error Detection: Parity, framing, and overrun error handling
The APB slave interface follows the AMBA APB protocol specification:
- PCLK_i: APB clock (50 MHz)
- PRESETn_i: Active-low reset
- PSEL_i: Slave select
- PENABLE_i: Enable signal
- PWRITE_i: Write enable
- PADDR_i[7:0]: Address bus
- PWDATA_i[31:0]: Write data
- PRDATA_o[31:0]: Read data
- PREADY_o: Ready signal
- PSLVERR_o: Slave error
- UART_TX_o: Transmit output
- UART_RX_i: Receive input
- IRQ_TX_EMPTY_o: Transmit FIFO empty interrupt
- IRQ_RX_FULL_o: Receive FIFO full interrupt
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ │ │ │PAR_T│PAR_E│ RX_E│ TX_E│ EN │
└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
- Bit 0 (EN): Enable controller
- Bit 1 (TX_E): Enable transmitter
- Bit 2 (RX_E): Enable receiver
- Bit 3 (PAR_E): Enable parity
- Bit 4 (PAR_T): Parity type (0=Even, 1=Odd)
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ │OVR_E│FRM_E│PAR_E│RX_E │TX_F │RX_B │TX_B │
└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
- Bit 0 (TX_B): TX busy
- Bit 1 (RX_B): RX busy
- Bit 2 (TX_F): TX FIFO full
- Bit 3 (RX_E): RX FIFO empty
- Bit 4 (PAR_E): Parity error
- Bit 5 (FRM_E): Frame error
- Bit 6 (OVR_E): Overrun error
- TXDATA (0x08): Write-only transmit data register
- RXDATA (0x0C): Read-only receive data register
- BAUD (0x10): Baud rate configuration
- FIFO (0x14): FIFO configuration
- INT (0x18): Interrupt configuration
- Configurable depth (4-64 entries)
- Synchronous write from APB interface
- Asynchronous read by UART transmitter
- Full/empty status detection
- Overflow protection
- Configurable depth (4-64 entries)
- Asynchronous write from UART receiver
- Synchronous read from APB interface
- Full/empty status detection
- Overrun protection
- Gray code pointers for reliable status detection
- Single clock domain operation
- Automatic full/empty flag generation
┌─────────┬─────────┬─────────┬─────────┬─────────┐
│ Start │ Data │ Parity │ Stop │ Stop │
│ Bit │ Bits │ Bit │ Bit 1 │ Bit 2 │
│ (0) │ (5-8) │ (0/1) │ (1) │ (0/1) │
└─────────┴─────────┴─────────┴─────────┴─────────┘
- Configurable baud rate (9600-921600 bps)
- 16x oversampling for reliable reception
- Middle-of-bit sampling for noise immunity
- Automatic baud rate generation
- Parity Error: Mismatch between received and expected parity
- Frame Error: Invalid stop bit detection
- Overrun Error: RX FIFO full when new data arrives
- TX FIFO Empty: Triggered when TX FIFO becomes empty
- RX FIFO Full: Triggered when RX FIFO becomes full
- Individual enable/disable for each interrupt source
- Pending status bits for interrupt state
- Automatic clearing on read/write operations
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ │ │ │ │RX_P │TX_P │RX_E │TX_E │
└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
- Bit 0 (TX_E): TX empty interrupt enable
- Bit 1 (RX_E): RX full interrupt enable
- Bit 2 (TX_P): TX empty interrupt pending
- Bit 3 (RX_P): RX full interrupt pending
- Automatic clock gating when UART is idle
- Configurable sleep mode with wake-up on RX activity
- Power domain isolation for low-power operation
- Active: Full functionality enabled
- Idle: Clock gated, wake-up on activity
- Sleep: Minimal power consumption
- Maximum Frequency: 50 MHz
- APB Access Latency: < 10 clock cycles
- UART Transmission: Full baud rate support
- Interrupt Latency: < 5 clock cycles
- Area: < 0.1mm² (Sky130 PDK)
- Dynamic Power: < 5mW at 50MHz, 1.8V
- Leakage Power: < 1μW in sleep mode
- Fault Tolerance: Single bit error detection
- Error Recovery: Automatic retransmission on framing errors
- Watchdog: Configurable timeout for stuck conditions
- Clock Domain: Single clock domain (PCLK)
- Reset: Asynchronous reset with proper synchronization
- Interrupts: Level-sensitive interrupt signals
- APB Interface: Standard APB3 slave protocol
- APB pins on left side
- UART pins on right side
- Interrupt pins on top
- Clock/reset pins on bottom
- Aspect ratio: 1:1 to 2:1 (width:height)
- Core utilization: < 80%
- I/O ring: Standard cell I/O with ESD protection
- Functional Coverage: 95% minimum
- Code Coverage: 90% minimum
- Toggle Coverage: 100% for all data signals
- FSM Coverage: 100% state and transition coverage
- Basic Functionality: TX/RX at all supported baud rates
- FIFO Operations: Full/empty conditions, overflow/underflow
- Interrupt Testing: All interrupt conditions and clearing
- Error Conditions: Parity, framing, overrun error injection
- Performance Testing: Maximum throughput and latency measurement
- Power Testing: Clock gating and sleep mode validation
- SystemVerilog: Primary testbench language
- Cocotb: Python-based verification for advanced scenarios
- Verilator: Fast simulation for regression testing
- Coverage Analysis: Automated coverage reporting
- DMA Support: Direct memory access for high-throughput applications
- Multi-UART Support: Multiple UART channels in single IP
- Advanced Error Correction: Forward error correction (FEC)
- Flow Control: Hardware flow control (RTS/CTS)
- Wake-up Patterns: Configurable wake-up pattern detection
- Parameterizable: All key parameters configurable
- Modular Design: Easy to extend and modify
- Standard Interfaces: Compatible with industry standards
- Documentation: Comprehensive documentation and examples