This project implements a Finite State Machine (FSM) based Traffic Light Controller using Verilog HDL. The system controls traffic signals for two roads using sequential state transitions and timing-based signal control.
The project also includes behavioral simulation, waveform verification, VCD generation, Python-based visualization, and GitHub Actions CI workflow integration.
- FSM-based Traffic Light Control
- Verilog HDL RTL Design
- Clock Divider Integration
- Behavioral Simulation & Verification
- VCD Waveform Generation
- Python Tkinter Visualization
- Basys 3 FPGA Support
- GitHub Actions CI Workflow
S0 → S1 → S2 → S3 → S0
| State | Road A | Road B |
|---|---|---|
| S0 | Green | Red |
| S1 | Yellow | Red |
| S2 | Red | Green |
| S3 | Red | Yellow |
Traffic-Light-Controller-FSM/
│
├── rtl/
│ ├── traffic_light_controller.v
│ └── clock_divider.v
│
├── tb/
│ └── traffic_light_tb.v
│
├── constraints/
│ └── basys3.xdc
│
├── waveform/
│ └── fsm_full_cycle_waveform.png
│
├── verification/
│ └── verification_notes.md
│
├── visualization/
│ ├── traffic_visualizer.py
│ ├── traffic.vcd
│ └── traffic_visualizer_output.png
│
├── .github/
│ └── workflows/
│ └── verilog-ci.yml
│
└── README.md
- Verilog HDL
- Xilinx Vivado
- Basys 3 FPGA
- Vivado Simulator
- Python
- Tkinter
- VCDVCD
- GitHub Actions
Behavioral simulation was performed in Vivado to verify FSM transitions and traffic signal sequencing.
A Python Tkinter-based visualizer was developed to demonstrate FSM traffic signal behavior using Verilog simulation outputs.
- Real-time Traffic Light Animation
- FSM State Demonstration
- Traffic Signal Sequencing
- Verilog-linked Visualization Flow
Automated CI workflow was implemented using GitHub Actions.
- Automatic Verilog Compilation
- Behavioral Simulation Validation
- Python Script Verification
- Continuous Integration Support
S0 → S1 → S2 → S3 → S0
- FSM State Transition Validation
- Waveform Analysis
- Output Signal Verification
- Clock Divider Validation
- VCD Generation & Parsing
- Python Visualization Validation
The design includes Basys 3 FPGA constraint support for future hardware implementation and real-time traffic light demonstration.
- Smart Traffic Density Detection
- Pedestrian Crossing Control
- Emergency Vehicle Override
- Real-time FPGA Hardware Demonstration
- Advanced Verification using SystemVerilog Assertions
- RTL Design
- FSM Implementation
- FPGA Constraint Integration
- Verification & Simulation
- Waveform Validation
- Python Visualization
- Documentation & CI Workflow
This project demonstrates the complete workflow of digital system design including RTL development, FSM implementation, simulation, verification, waveform analysis, Python-based visualization, and CI automation using GitHub Actions.

