Traffic Light Controller

A two-way intersection controller written in SystemVerilog and running on a Digilent Arty A7-100T FPGA.

Overview

A hardware design for a two-way intersection, built from simulation through to a bitstream running on a real board. Each direction's light is shown on an on-board RGB LED, with blue standing in for yellow, and the duration of each color is configurable.

I wrote it to get hands-on with the full FPGA flow: describing logic in HDL, verifying it in simulation, closing timing, and checking the result on hardware.

Resources

How it works

Verification and results

MetricResult
Target clock100 MHz
LUTs22
Flip-flops45
Worst setup slack5.950 ns
Worst hold slack0.176 ns

Building it

  1. Create a Vivado RTL project for the part xc7a100tcsg324-1.
  2. Add src/top.sv and src/traffic_controller.sv as design sources, with top.sv as the top module.
  3. Add constraints/arty.xdc, and set sim/tb_traffic.sv as the simulation top.
  4. Run a behavioral simulation, then synthesize, implement, and generate the bitstream.
  5. Connect the board over micro-USB and program it from the Hardware Manager.
← Back to portfolio