A parameterized traffic light controller written in Verilog HDL and verified through behavioral simulation in Xilinx Vivado.
The design uses a finite-state machine to implement the following sequence:
RED -> YELLOW -> GREEN -> YELLOW -> RED
- Three-block FSM architecture
- Configurable red, yellow, and green durations
- Optional yellow-state bypass
- Configurable reset color
- Synchronous active-high reset
- Automated testbench with duration and mid-cycle reset checks
| Signal | Direction | Description |
|---|---|---|
clk_i |
Input | System clock |
rst_i |
Input | Active-high synchronous reset |
light_o[1:0] |
Output | Encoded light state: red 00, yellow 01, green 10 |
| Parameter | Default | Description |
|---|---|---|
RED_DURATION |
5 |
Number of clock cycles in the red state |
YELLOW_DURATION |
2 |
Number of clock cycles in each yellow state |
GREEN_DURATION |
4 |
Number of clock cycles in the green state |
RESET_COLOR |
2'b00 |
Light state selected by reset |
ENABLE_YELLOW |
1 |
Enables or bypasses the yellow states |
src/
traffic_light_controller.v
sim/
tb_traffic_light.v
docs/
project-report.pdf
- Create a Vivado RTL project.
- Add
src/traffic_light_controller.vas a design source. - Add
sim/tb_traffic_light.vas a simulation source. - Set
tb_traffic_lightas the simulation top. - Run behavioral simulation and review the console checks and waveform.
- Verilog HDL
- Xilinx Vivado
- Kintex-7 FPGA coursework target
Andaç Ünal