Module 10: Capstone Projects · Project 2: UART Sequential Flow

Project 2, Part 1: Setup and Clocking Strategy

Project 1 contained no clock distribution network, bypassing the physical design challenges most prone to failure. Project 2 implements the sequential UART controller (uart_top) from Module 10 of the Verilog course. The design includes transmitter and receiver modules with baud-rate generators. The sequential architecture contains physical flip-flops, an active clock port, and clock skew sensitivities.

This project evaluates a standalone UART implementation with independent timing and floorplan constraints. It uses a 100 MHz target clock and differs from the 250 MHz configuration with parity analyzed in Modules 5 through 9.

Design Architecture

The uart_top module provides independent physical ports for serial transmission (tx_line) and serial reception (rx_line):

module uart_top #(
    parameter CLK_FREQ  = 100_000_000,
    parameter BAUD_RATE = 115200
) (
    input  clk, rst_n,
    input  [7:0] tx_data_in,
    input        tx_start,
    output       tx_busy,
    output       tx_line,
    input        rx_line,
    output [7:0] rx_data_out,
    output       rx_valid,
    output       rx_framing_error
);

Parameters CLK_FREQ and BAUD_RATE determine the integer divide ratios for the baud clock generators, establishing counter register bit widths and comparison logic.

Target Clock Frequency

In the Verilog course, simulation verified this design at 50 MHz. In this physical design project, we target a 100 MHz system clock ($T_{clk} = 10\text{ ns}$):

$$ T_{clk} = \frac{1}{100\ \text{MHz}} = 10\ \text{ns} $$

OpenLane Flow Configuration

{
    "DESIGN_NAME": "uart_top",
    "VERILOG_FILES": "dir::src/uart_top.v",
    "CLOCK_PORT": "clk",
    "CLOCK_PERIOD": 10,
    "PNR_SDC_FILE": "dir::uart_top.sdc",
    "SIGNOFF_SDC_FILE": "dir::uart_top.sdc",
    "FP_SIZING": "relative",
    "FP_CORE_UTIL": 45,
    "PL_TARGET_DENSITY": 0.55,
    "RUN_POST_CTS_RESIZER_TIMING": false
}

Parameter CLOCK_PORT designates the physical clock input clk. We deliberately set RUN_POST_CTS_RESIZER_TIMING: false to disable automated post-CTS timing repair. This configuration exposes physical hold violations for manual inspection and repair in Part 2. In standard production flows, leave this setting enabled.

SDC Timing Constraints

create_clock -name clk -period 10 [get_ports clk]
set_clock_uncertainty 0.25 [get_clocks clk]
set_clock_transition 0.15 [get_clocks clk]

set_input_delay  1.5 -clock clk [get_ports {tx_data_in[*] tx_start rx_line}]
set_output_delay 1.5 -clock clk [get_ports {tx_busy tx_line rx_data_out[*] rx_valid rx_framing_error}]

set_driving_cell -lib_cell sky130_fd_sc_hd__buf_2 -pin X [all_inputs]
set_load 0.03 [all_outputs]

The constraint set_clock_uncertainty 0.25 budgets 250 ps for clock skew and jitter before clock tree synthesis. Following CTS, extracted network delays replace estimated skew, while uncertainty continues to protect against phase jitter and process margins.

Executing Logic Synthesis

openlane --flow Classic --run-tag uart_run1 --to Yosys.Synthesis designs/uart/config.json
=== uart_top ===

   Number of cells:                431
     sky130_fd_sc_hd__dfxtp_1       62
     sky130_fd_sc_hd__mux2_1        38
     sky130_fd_sc_hd__nand2_1       57
     sky130_fd_sc_hd__a21oi_1       29
     ...

   Chip area for module '\uart_top': 5391.4

Synthesis produces 431 standard cells, including 62 sequential flip-flops (dfxtp_1). Registers implement baud counters, transmit/receive shift registers, state machine registers, and status flags. Post-synthesis STA assuming an ideal clock reports +6.0 ns of setup slack. An ideal clock assumes zero clock skew. Real physical trees introduce non-uniform insertion delays that erode timing margins.

Initial Floorplanning

openlane --flow Classic --run-tag uart_run1 --from OpenROAD.Floorplan --to OpenROAD.Floorplan \
         designs/uart/config.json
Core area: 109.940 x 109.140 um
Number of rows: 40

Synthesized cell area ($5{,}391\ \mu\text{m}^2$) at 45% utilization yields a core of approximately $12{,}000\ \mu\text{m}^2$ (roughly 110 µm × 109 µm) across 40 rows. On small sequential blocks, floorplanning is straightforward. The primary engineering challenges emerge during clock tree synthesis and timing closure.

Practice Exercise

The baud generator divides the 100 MHz clock to generate a 115,200 baud tick using a counter and comparator. Given CLK_FREQ = 100_000_000 and BAUD_RATE = 115200, calculate the required integer divisor and the resulting baud rate percentage error.

Solution

Calculate the ideal division ratio: $$ N = \frac{100{,}000{,}000}{115{,}200} \approx 868.06 $$

Rounding to integer $N = 868$ produces an actual baud rate of: $$ \text{Baud} = \frac{100{,}000{,}000}{868} \approx 115{,}207.37\text{ baud} $$

$$ \text{Error} = \left|\frac{115{,}207.37 - 115{,}200}{115{,}200}\right| \times 100% \approx 0.0064% $$

This error is well within the standard 2% to 3% UART asynchronous tolerance. The 868 count requires a 10-bit register ($2^{10} = 1024$), establishing the comparator data path where hold-time violations emerge in the next article.

In the next article, we execute placement, clock tree synthesis, and routing, inspect a real post-CTS hold violation, and apply an ECO repair.

← Project 1, Part 3: Signoff and Retrospective Project 2, Part 2: CTS and Timing Closure →