rename pci_7seg to raggedstone
[raggedstone] / heartbeat / source / heartbeat.vhd
CommitLineData
152884e6 1library ieee;
2
3use ieee.std_logic_1164.all;
4use ieee.std_logic_unsigned.all;
5
6entity heartbeat is
7generic (
82cc0f36 8 divider : std_logic_vector(31 downto 0) := X"01F78A40"
152884e6 9);
10
11port (
12 clk_i : in std_logic;
13 nrst_i : in std_logic;
14 led_o : out std_logic
15);
16
17end heartbeat;
18
19architecture rtl of heartbeat is
20begin
21
22process(clk_i, nrst_i)
23variable counter : std_logic_vector(31 downto 0);
24variable state : std_logic := '0';
25begin
26
27if (clk_i'event AND clk_i = '1') then
28 if nrst_i = '0' then
29 counter := (others => '0');
30 else
31 led_o <= state;
32 counter := counter + 1;
33 if counter = divider then
34 state := not state;
82cc0f36 35 counter := (others => '0');
152884e6 36 end if;
37 end if;
38end if;
39end process;
40end architecture;
Impressum, Datenschutz