Altera_Forum
Honored Contributor
7 years agoConstraining LEDs/Switches to VHDL onDE1-SoC
Hello, I am trying to write some basic VHDL that "slide" an on led down the 10 leds on the DE1-SoC board. I have loaded the .sof onto the board but nothing is lighting up. I think the VHDL is good because I have compiled and loaded it onto a Xilinx board. I am guessing the issue is with the .sdc or .qsf files which I am given to understand constrain the code to the on-board hardware. I will post the VHDL, the .sdc, and the .qsf.
led_slide.vhd
library ieee;use ieee.std_logic_1164.all;
entity led_slide is
port(
clk: in std_logic;
sel: in std_logic;
z: out std_logic_vector(9 downto 0)
);
end led_slide;
architecture Behavioral of led_slide is
type my_state is (
s0,
s1,
s2,
s3,
s4,
s5,
s6,
s7,
s8,
s9
);
signal n_s: my_state;
signal clk_div: std_logic;
begin
process(clk_div)
begin
if clk_div='1' and clk_div'event then
case n_s is
when s0 =>
z <= "1000000000";
if sel='1' then
n_s <= s1;
else
n_s <= s9;
end if;
when s1 =>
z <= "0100000000";
if sel='1' then
n_s <= s2;
else
n_s <= s1;
end if;
when s2 =>
z <= "0010000000";
if sel='1' then
n_s <= s3;
else
n_s <= s1;
end if;
when s3 =>
z <= "0001000000";
if sel='1' then
n_s <= s4;
else
n_s <= s2;
end if;
when s4 =>
z <= "0000100000";
if sel='1' then
n_s <= s5;
else
n_s <= s3;
end if;
when s5 =>
z <= "0000010000";
if sel='1' then
n_s <= s6;
else
n_s <= s4;
end if;
when s6 =>
z <= "0000001000";
if sel='1' then
n_s <= s7;
else
n_s <= s5;
end if;
when s7 =>
z <= "0000000100";
if sel='1' then
n_s <= s8;
else
n_s <= s6;
end if;
when s8 =>
z <= "0000000010";
if sel='1' then
n_s <= s9;
else
n_s <= s7;
end if;
when s9 =>
z <= "0000000001";
if sel='1' then
n_s <= s0;
else
n_s <= s8;
end if;
end case;
end if;
end process;
process(clk)
variable count: integer;
begin
if clk='1' and clk'event then
if count=99999 then
clk_div <= not clk_div;
count := 0;
else
count := count + 1;
end if;
end if;
end process;
end Behavioral;
de1soc_master.qsf
set_global_assignment -name FAMILY "Cyclone V"
set_global_assignment -name DEVICE 5CSEMA5F31C6
set_global_assignment -name TOP_LEVEL_ENTITY "DE1_SoC"
set_global_assignment -name DEVICE_FILTER_PACKAGE FBGA
set_global_assignment -name CYCLONEII_RESERVE_NCEO_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name SDC_FILE led_slide.sdc
# #============================================================# # LEDR# #============================================================
set_location_assignment PIN_V16 -to z
set_location_assignment PIN_W16 -to z
set_location_assignment PIN_V17 -to z
set_location_assignment PIN_V18 -to z
set_location_assignment PIN_W17 -to z
set_location_assignment PIN_W19 -to z
set_location_assignment PIN_Y19 -to z
set_location_assignment PIN_W20 -to z
set_location_assignment PIN_W21 -to z
set_location_assignment PIN_Y21 -to z
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to z
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to z
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to z
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to z
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to z
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to z
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to z
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to z
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to z
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to z#
led_slide.sdc # **************************************************************# Altera DE1-SoC SDC settings# Users are recommended to modify this file to match users logic.# **************************************************************
# **************************************************************# Create Clock# **************************************************************
create_clock -period 20
create_clock -period 20
create_clock -period 20
create_clock -period 20
create_clock -period "27 MHz" -name tv_27m
# VGA : 640x480@60Hz
create_clock -period "25.18 MHz" -name clk_vga
# **************************************************************# Create Generated Clock# **************************************************************
derive_pll_clocks
# **************************************************************# Set Clock Uncertainty# **************************************************************
derive_clock_uncertainty
# **************************************************************# Set Input Delay# **************************************************************# Board Delay (Data) + Propagation Delay - Board Delay (Clock)
set_input_delay -max -clock clk_dram -0.048
set_input_delay -min -clock clk_dram -0.057
set_input_delay -max -clock tv_27m 3.692
set_input_delay -min -clock tv_27m 2.492
set_input_delay -max -clock tv_27m 3.654
set_input_delay -min -clock tv_27m 2.454
set_input_delay -max -clock tv_27m 3.656
set_input_delay -min -clock tv_27m 2.456
# **************************************************************# Set Output Delay# **************************************************************# max : Board Delay (Data) - Board Delay (Clock) + tsu (External Device)# min : Board Delay (Data) - Board Delay (Clock) - th (External Device)
set_output_delay -max -clock clk_dram 1.452
set_output_delay -min -clock clk_dram -0.857
set_output_delay -max -clock clk_dram 1.531
set_output_delay -min -clock clk_dram -0.805
set_output_delay -max -clock clk_dram 1.533
set_output_delay -min -clock clk_dram -0.805
set_output_delay -max -clock clk_dram 1.510
set_output_delay -min -clock clk_dram -0.800
set_output_delay -max -clock clk_dram 1.520
set_output_delay -min -clock clk_dram -0.780
set_output_delay -max -clock clk_dram 1.5000
set_output_delay -min -clock clk_dram -0.800
set_output_delay -max -clock clk_dram 1.545
set_output_delay -min -clock clk_dram -0.755
set_output_delay -max -clock clk_dram 1.496
set_output_delay -min -clock clk_dram -0.804
set_output_delay -max -clock clk_dram 1.508
set_output_delay -min -clock clk_dram -0.792
set_output_delay -max -clock clk_vga 0.220
set_output_delay -min -clock clk_vga -1.506
set_output_delay -max -clock clk_vga 0.212
set_output_delay -min -clock clk_vga -1.519
set_output_delay -max -clock clk_vga 0.264
set_output_delay -min -clock clk_vga -1.519
set_output_delay -max -clock clk_vga 0.215
set_output_delay -min -clock clk_vga -1.485