alarm working, LED needs fix later on
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -29,3 +29,5 @@
|
|||||||
# Windows specific
|
# Windows specific
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
Desktop.ini
|
Desktop.ini
|
||||||
|
|
||||||
|
project_7/hx.exe
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ set_property -dict { PACKAGE_PIN W16 IOSTANDARD LVCMOS33 } [get_ports {SW_MODE
|
|||||||
#set_property -dict { PACKAGE_PIN W13 IOSTANDARD LVCMOS33 } [get_ports {sw[7]}]
|
#set_property -dict { PACKAGE_PIN W13 IOSTANDARD LVCMOS33 } [get_ports {sw[7]}]
|
||||||
#set_property -dict { PACKAGE_PIN V2 IOSTANDARD LVCMOS33 } [get_ports {sw[8]}]
|
#set_property -dict { PACKAGE_PIN V2 IOSTANDARD LVCMOS33 } [get_ports {sw[8]}]
|
||||||
#set_property -dict { PACKAGE_PIN T3 IOSTANDARD LVCMOS33 } [get_ports {sw[9]}]
|
#set_property -dict { PACKAGE_PIN T3 IOSTANDARD LVCMOS33 } [get_ports {sw[9]}]
|
||||||
#set_property -dict { PACKAGE_PIN T2 IOSTANDARD LVCMOS33 } [get_ports {sw[10]}]
|
set_property -dict { PACKAGE_PIN T2 IOSTANDARD LVCMOS33 } [get_ports {RST_B}]
|
||||||
# Budik
|
# Budik
|
||||||
set_property -dict { PACKAGE_PIN R3 IOSTANDARD LVCMOS33 } [get_ports {SW_ALARM_SET}]
|
set_property -dict { PACKAGE_PIN R3 IOSTANDARD LVCMOS33 } [get_ports {SW_ALARM_SET}]
|
||||||
set_property -dict { PACKAGE_PIN W2 IOSTANDARD LVCMOS33 } [get_ports {SW_DIN[0]}]
|
set_property -dict { PACKAGE_PIN W2 IOSTANDARD LVCMOS33 } [get_ports {SW_DIN[0]}]
|
||||||
@@ -30,7 +30,7 @@ set_property -dict { PACKAGE_PIN R2 IOSTANDARD LVCMOS33 } [get_ports {SW_DIN[
|
|||||||
|
|
||||||
|
|
||||||
## LEDs
|
## LEDs
|
||||||
#set_property -dict { PACKAGE_PIN U16 IOSTANDARD LVCMOS33 } [get_ports {led[0]}]
|
set_property -dict { PACKAGE_PIN U16 IOSTANDARD LVCMOS33 } [get_ports {ALARM_LED}]
|
||||||
#set_property -dict { PACKAGE_PIN E19 IOSTANDARD LVCMOS33 } [get_ports {led[1]}]
|
#set_property -dict { PACKAGE_PIN E19 IOSTANDARD LVCMOS33 } [get_ports {led[1]}]
|
||||||
#set_property -dict { PACKAGE_PIN U19 IOSTANDARD LVCMOS33 } [get_ports {led[2]}]
|
#set_property -dict { PACKAGE_PIN U19 IOSTANDARD LVCMOS33 } [get_ports {led[2]}]
|
||||||
#set_property -dict { PACKAGE_PIN V19 IOSTANDARD LVCMOS33 } [get_ports {led[3]}]
|
#set_property -dict { PACKAGE_PIN V19 IOSTANDARD LVCMOS33 } [get_ports {led[3]}]
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ entity top_modul is
|
|||||||
SW_ALARM_SET : in STD_LOGIC; -- '0' = Display Clock, '1' = Set Alarm
|
SW_ALARM_SET : in STD_LOGIC; -- '0' = Display Clock, '1' = Set Alarm
|
||||||
SW_DIN : in STD_LOGIC_VECTOR (3 downto 0); -- Value to set
|
SW_DIN : in STD_LOGIC_VECTOR (3 downto 0); -- Value to set
|
||||||
BTN_LOAD : in STD_LOGIC_VECTOR (3 downto 0); -- Which digit to set
|
BTN_LOAD : in STD_LOGIC_VECTOR (3 downto 0); -- Which digit to set
|
||||||
|
RST_B : in STD_LOGIC;
|
||||||
SEGMENTS : out STD_LOGIC_VECTOR (7 downto 0);
|
SEGMENTS : out STD_LOGIC_VECTOR (7 downto 0);
|
||||||
ANODS : out STD_LOGIC_VECTOR (3 downto 0);
|
ANODS : out STD_LOGIC_VECTOR (3 downto 0);
|
||||||
ALARM_LED : out STD_LOGIC -- LED lights up when alarm triggers
|
ALARM_LED : out STD_LOGIC -- LED lights up when alarm triggers
|
||||||
@@ -101,20 +102,19 @@ begin
|
|||||||
);
|
);
|
||||||
|
|
||||||
-- Comparator Logic for alarm LED to be ON or OFF
|
-- Comparator Logic for alarm LED to be ON or OFF
|
||||||
|
-- TODO BUG proste niekedy na zaciatku ledka svieti aj ked ma byt zhasnuta
|
||||||
process(CLK)
|
process(CLK)
|
||||||
begin
|
begin
|
||||||
if rising_edge(CLK) then
|
if rising_edge(CLK) then
|
||||||
|
if RST = '1' or RST_B = '1' then
|
||||||
|
ALARM_LED <= '0';
|
||||||
-- Match condition (HH:MM)
|
-- Match condition (HH:MM)
|
||||||
if (sig_h_tens = alrm_h_tens and sig_h_units = alrm_h_units and
|
elsif (START = '1' and
|
||||||
|
sig_h_tens = alrm_h_tens and sig_h_units = alrm_h_units and
|
||||||
sig_m_tens = alrm_m_tens and sig_m_units = alrm_m_units and
|
sig_m_tens = alrm_m_tens and sig_m_units = alrm_m_units and
|
||||||
sig_s_tens = "0000" and sig_s_units = "0000") then
|
sig_s_tens = "0000" and sig_s_units = "0000") then
|
||||||
ALARM_LED <= '1';
|
ALARM_LED <= '1';
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- Reset turns the alarm LED off
|
|
||||||
if RST = '1' then
|
|
||||||
ALARM_LED <= '0';
|
|
||||||
end if;
|
|
||||||
end if;
|
end if;
|
||||||
end process;
|
end process;
|
||||||
|
|
||||||
|
|||||||
@@ -177,6 +177,7 @@
|
|||||||
<Option Name="DesignMode" Val="RTL"/>
|
<Option Name="DesignMode" Val="RTL"/>
|
||||||
<Option Name="TopModule" Val="top_modul"/>
|
<Option Name="TopModule" Val="top_modul"/>
|
||||||
<Option Name="TopAutoSet" Val="TRUE"/>
|
<Option Name="TopAutoSet" Val="TRUE"/>
|
||||||
|
<Option Name="dataflowViewerSettings" Val="min_width=16"/>
|
||||||
</Config>
|
</Config>
|
||||||
</FileSet>
|
</FileSet>
|
||||||
<FileSet Name="constrs_1" Type="Constrs" RelSrcDir="$PSRCDIR/constrs_1" RelGenDir="$PGENDIR/constrs_1">
|
<FileSet Name="constrs_1" Type="Constrs" RelSrcDir="$PSRCDIR/constrs_1" RelGenDir="$PGENDIR/constrs_1">
|
||||||
|
|||||||
Reference in New Issue
Block a user