Guest
#3521223
Salut tout le monde , j`'ai un problème avec mon code. Mon but est
d,obtenir une horloge de période 2s.
voila mon code :
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity clk_enabler is
Port ( clk_100Mhz : in STD_LOGIC;
new_clk : out STD_LOGIC);
end clk_enabler;
architecture clockenabler of clk_enabler is
signal prescaler : std_logic_vector(25 downto 0);
signal clk_2s : std_logic;
begin
gen_clk : process (clk_100Mhz)
begin -- process gen_clk
clk_2s <= '0';
prescaler <= (others => '0');
if rising_edge(clk_100Mhz) then -- rising clock edge
if prescaler = X"BEBC200" then -- 200000000 in hex
prescaler <= (others => '0');
clk_2s <= not clk_2s;
else
prescaler <= STD_LOGIC_VECTOR(unsigned(prescaler) + "1") ;
end if;
end if;
end process;
new_clk <= clk_2s ;
end;
L'erreur est la suivante : Signal prescaler cannot be synthesized, bad
synchronous description. The description style you are using to describe
a synchronous element (register, memory, etc.) is not supported in the
current software release.
S'il vous plait j'ai besoin d'aide