Here I would like to present LED Blink Example for Spartan 6 XC6SLX9-TQG144 FPGA, that I have from 2012, may be its quiet oldie now, but I want to share all my experience here.

Here is this board I have 2 programmable LED and one 7 segment lcd, we gonna program LED for blinking ~1sec using VHDL. I have 50MHz clock source onboard.
LED_Blink.vhd
-- LED_Blink.vhd for Blinking onboard LED0
library IEEE;
use IEEE_STD_LOGIC_1164.all;
use IEEE.NUMERIC_STD.all;
entity LED_Blink is
port (
CLK : in STD_LOGIC; -- board clock 50MHz
LED : out STD_LOGIC; -- onboard LED0
);
end LED_Blink;
architecture Behavioral of LED_Blink is
signal counter : unsigned(24 downto 0) := (others => '0');
signal blink : STD_LOGIC := '0';
begin
process(CLK)
begin
if rising_edge(CLK) then
if counter = 25_000_000 -1 then
blink <= not blink;
counter <= (others => '0');
else
counter <= counter + 1;
end if;
end if;
end process;
LED <= blink;
end Behavioral;
pinout.ucf
# CLOCK source NET "CLK" LOC = "P55"; # LED0 pin NET "LED" LOC = "P127"; # LED0 pin

Leave a Reply