This code work properly.
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all; -- for type conversions
entity example is
--generic (
-- DATA_WIDTH : integer := 8
--);
port (
i_Reset : in std_logic;
i_Clock : in std_logic;
i_Data : in std_logic_vector(DATA_WIDTH -1 downto 0);
o_Data : out std_logic_vector(DATA_WIDTH -1 downto 0)
) ;
end example;
architecture example_arc of example is
begin
P : process (i_Reset, i_Clock)
begin
if (i_Reset = '1') then
o_Data <= (others => '0');
elsif (rising_edge(i_Clock)) then
o_Data <= i_Data;
end if;
end process P;
end example_arc;
but this code doenât
entity example is
generic (
DATA_WIDTH : integer := 8
);
port (
i_Reset : in std_logic;
i_Clock : in std_logic;
i_Data : in std_logic_vector(DATA_WIDTH -1 downto 0);
o_Data : out std_logic_vector(DATA_WIDTH -1 downto 0)
) ;
end example;
architecture example_arc of example is
begin
P : process (i_Reset, i_Clock)
begin
if (i_Reset = '1') then
o_Data <= (others => '0');
elsif (rising_edge(i_Clock)) then
o_Data <= i_Data;
end if;
end process P;
end example_arc;