warnings con Latches en VHDL

Hola a tod@s...

Estoy compilando un codigo en VHDL. El codigo compila sin errores pero con muchisimos warnings, casi todos los warnings dice que son debidos a latches.

Alguien sabe que es un latch y que tan critico puede ser cuando se programa la FPGa??..

Los warnings que aparecen tienen la siguiente estructura:

WARNING:Xst:737 - Found 32-bit latch for signal <contador3>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.

WARNING:Xst:1293 - FF/Latch <0> has a constant value of 0 in block <25>. This FF/Latch will be trimmed during the optimization process.


Les agradesco por adelantado
 
Un latch en FPGA es un biestable asíncrono (independiente del reloj). En una buena programación no te deberían aparecer latches, en principio no quiere decir que el diseño no funcione sino que es mejorable, pero también puede ser una fuente de problemas.

Si tu código no es muy amplio, copia y pega aquí y también los errores que te dé en él... con eso te puedo hacer alguna recomendación para mejorar tu código.
 
Pues son tres códigos, este es el primero:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
--------------------------------------------------------------------
-----------------------------Entidad--------------------------------
--------------------------------------------------------------------
entity Control16 is
port ( clk : in STD_LOGIC:='0' ;
prof_max : in STD_LOGIC_VECTOR(5 downto 0) ;
prof_enf : in STD_LOGIC_VECTOR(5 downto 0) ;
DIN : out STD_LOGIC:='0' ;
CLK_mux : out STD_LOGIC:='0' ;
CLR : out STD_LOGIC:='0' ;
EN : out STD_LOGIC_VECTOR(15 downto 0) ;
Sup : out STD_LOGIC_VECTOR(15 downto 0) ;
Sdown : out STD_LOGIC_VECTOR(15 downto 0));
end Control16;

architecture Behavioral of Control16 is

--------------------------------------------------------------------
---------------------Declaración de Señales-------------------------
--------------------------------------------------------------------

signal H1 : STD_LOGIC :='0' ;
signal H2 : STD_LOGIC :='0' ;
signal cual_mux1 : STD_LOGIC_VECTOR(3 downto 0) ;
signal borrador1 : STD_LOGIC :='0' ;
signal Termine_HVP : STD_LOGIC :='0' ;
signal Termine_INIC : STD_LOGIC :='0' ;
signal Termine_CORR : STD_LOGIC :='0' ;
signal Termine_UNOS : STD_LOGIC :='0' ;
signal contador_t : integer := 0 ;
signal contador : integer := 1 ;
signal contador2 : integer := 0 ;
signal contador3 : integer := 0 ;
signal t : integer := 500;


--------------------------------------------------------------------
-------------------Declaración de Componentes-----------------------
--------------------------------------------------------------------

component uno is

port( Sup : out STD_LOGIC_VECTOR(15 downto 0) :="0000000000000000" ;
Sdown : out STD_LOGIC_VECTOR(15 downto 0) :="1111111111111111" ;
Termine : out STD_LOGIC ;
clk : in STD_LOGIC :='0' ;
prof : in STD_LOGIC_VECTOR(5 downto 0) :="000101" ;
borrador : in STD_LOGIC :='1') ;
end component;

component multiplex is

port( DIN : out STD_LOGIC :='0' ;
clk : in STD_LOGIC :='0' ;
CLK_mux : out STD_LOGIC :='0' ;
CLR : out STD_LOGIC :='0' ;
EN : out STD_LOGIC_VECTOR(15 downto 0) :="1111111111111111" ;
habilitador1 : in STD_LOGIC :='0' ;
habilitador2 : in STD_LOGIC :='0' ;
cual_mux : in STD_LOGIC_VECTOR(3 downto 0) :="0000" ;
OK_inic : out STD_LOGIC:='0' ;
OK_corr : out STD_LOGIC:='0' ;
OK_unos : out STD_LOGIC:='0') ;
end component;

--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------

begin
--------------------------------------------------------------------
--_______________----------------------------------_______________--
--_______________ CONEXIÓN ENTRE LOS COMPONENTES: _______________--
-----------------__________________________________-----------------
--------------------------------------------------------------------

U1: uno port map (Sup,Sdown,Termine_HVP,clk,prof_enf,borrador1);
U2: multiplex port map (DIN,clk,CLK_mux,CLR,EN,H1,H2,cual_mux1,termine_inic,termine_corr,termine_unos);


process(clk)
begin

---------------------------------------------------------------------
------------------------Primera Comparación--------------------------
---------------------------------------------------------------------

if (contador=1) then

if termine_inic='0' then
H1<='1';
H2<='0';
end if;

if termine_inic='1' then
H1<='1';
H2<='1';
contador<=2;
end if;
end if;

---------------------------------------------------------------------
------------------------Segunda Comparación--------------------------
---------------------------------------------------------------------

if (contador=2) then

if termine_HVP='0' then
borrador1<='0';
end if;

if termine_HVP='1' then
borrador1<='1';
contador<=3;
end if;
end if;

---------------------------------------------------------------------
------------------------Tercera Comparación--------------------------
---------------------------------------------------------------------

if (contador=3) then

if contador_t<t then
contador_t<=contador_t+1;
else
t<=0;
contador<=4;

end if;
end if;

---------------------------------------------------------------------
-------------------------Cuarta Comparación--------------------------
---------------------------------------------------------------------

if (contador=4) then

if termine_corr='0' then
H1<='0';
H2<='1';
end if;

if termine_inic='1' then
H1<='1';
H2<='1';
contador<=5;
end if;
end if;


---------------------------------------------------------------------
-------------------------Quinta Comparación--------------------------
---------------------------------------------------------------------

if (contador=5 and contador2<=8 and contador3<16) then
contador2<=contador2+1;
contador<=2;
cual_mux1<=cual_mux1 or "0001";
end if;


---------------------------------------------------------------------
-------------------------Sexta Comparación---------------------------
---------------------------------------------------------------------

if (contador=5 and contador2=8 and contador3<16) then
contador2<=0;
contador<=2;
contador3<=contador3+1;
cual_mux1<="0000";
end if;

---------------------------------------------------------------------
-------------------------Septima Comparación---------------------------
---------------------------------------------------------------------

if (contador=5 and contador2=8 and contador3=16) then
contador2<=0;
contador3<=0;
contador<=6;
cual_mux1<="0000";
end if;

---------------------------------------------------------------------
-----------------------Ocatava Comparación---------------------------
---------------------------------------------------------------------

if contador=6 then

if termine_unos='0' then

H1<='0';
H2<='0';

end if;

if termine_unos='1' then
H1<='1';
H2<='1';
contador<=1;
end if;

end if;

end process;

end Behavioral;

Este es el segundo codigo:

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use IEEE.math_real.all;
use ieee.numeric_std.all ;
use IEEE.std_logic_signed.all;

entity uno is
port ( Sup : out STD_LOGIC_VECTOR(15 downto 0) :="0000000000000000" ;
Sdown : out STD_LOGIC_VECTOR(15 downto 0) :="1111111111111111" ;
termine : out STD_LOGIC:='0' ;
clk : in STD_LOGIC ;
prof : in STD_LOGIC_VECTOR(5 downto 0) :="000101" ;
borrador : in STD_LOGIC :='1' ) ;
end uno;

-------------------------------------------------------------------------------------------------------------------------------------------------
--!0,2 0,4 0,6 0,8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 !
-------------------------------------------------------------------------------------------------------------------------------------------------
--!0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 !
-------------------------------------------------------------------------------------------------------------------------------------------------
--!36 36 35 34 33 27 22 18 15 13 11 10 9 8 8 7 6 6 6 5 5 5 4 4 !
-------------------------------------------------------------------------------------------------------------------------------------------------
--!67 66 65 64 62 51 41 34 28 24 21 19 17 15 14 13 12 11 10 10 9 9 8 8 !
-------------------------------------------------------------------------------------------------------------------------------------------------
--!93 92 90 88 85 70 57 46 39 33 29 26 23 21 19 18 16 15 14 13 12 12 11 11 !
-------------------------------------------------------------------------------------------------------------------------------------------------
--!113 111 109 107 104 85 69 56 47 40 35 31 28 25 23 21 20 18 17 16 15 14 14 13 !
-------------------------------------------------------------------------------------------------------------------------------------------------
--!127 125 123 120 117 96 77 63 53 45 40 35 31 28 26 24 22 21 19 18 17 16 15 15 !
-------------------------------------------------------------------------------------------------------------------------------------------------
--!136 134 132 128 125 102 83 68 57 49 42 37 34 30 28 26 24 22 21 19 18 17 16 15 !
-------------------------------------------------------------------------------------------------------------------------------------------------
--!138 137 134 131 127 105 84 69 58 50 43 38 34 31 28 26 24 22 21 20 19 18 17 16 !
-------------------------------------------------------------------------------------------------------------------------------------------------


architecture behavioral of uno is
signal contador_clk: integer:=0;
signal profundidad : integer:=0;
type retardos is array (0 to 191) of integer;
signal retar: retardos:=(( 1, 37, 68, 94, 114, 128, 137, 139,
1, 37, 67, 93, 112, 126, 135, 138,
1, 36, 66, 91, 110, 124, 133, 135,
1, 35, 65, 89, 108, 121, 129, 132,
1, 34, 63, 86, 105, 118, 126, 128,
1, 28, 52, 71, 86, 97, 103, 106,
1, 23, 42, 58, 70, 78, 84, 85,
1, 19, 35, 47, 57, 64, 69, 70,
1, 16, 29, 40, 48, 54, 58, 59,
1, 14, 25, 34, 41, 46, 50, 51,
1, 12, 22, 30, 36, 41, 43, 44,
1, 11, 20, 27, 32, 36, 38, 39,
1, 10, 18, 24, 29, 32, 35, 35,
1, 9, 16, 22, 26, 29, 31, 32,
1, 9, 15, 20, 24, 27, 29, 29,
1, 8, 14, 19, 22, 25, 27, 27,
1, 7, 13, 17, 21, 23, 25, 25,
1, 7, 12, 16, 19, 22, 23, 23,
1, 7, 11, 15, 18, 20, 22, 22,
1, 6, 11, 14, 17, 19, 20, 21,
1, 6, 10, 13, 16, 18, 19, 20,
1, 6, 10, 13, 15, 17, 18, 19,
1, 6, 10, 13, 15, 17, 18, 19,
1, 5, 9, 12, 14, 16, 16, 17));

-- 0,36,67,93,113,127,136,138,
-- 0,36,66,92,111,125,134,137,
-- 0,35,65,90,109,123,132,134,
-- 0,34,64,88,107,120,128,131,
-- 0,33,62,85,104,117,125,127,
-- 0,27,51,70,85 ,96 ,102,105,
-- 0,22,41,57,69 ,77 ,83 ,84 ,
-- 0,18,34,46,56 ,63 ,68 ,69 ,
-- 0,15,28,39,47 ,53 ,57 ,58 ,
-- 0,13,24,33,40 ,45 ,49 ,50 ,
-- 0,11,21,29,35 ,40 ,42 ,43 ,
-- 0,10,19,26,31 ,35 ,37 ,38 ,
-- 0,9 ,17,23,28 ,31 ,34 ,34 ,
-- 0,8 ,15,21,25 ,28 ,30 ,31 ,
-- 0,8 ,14,19,23 ,26 ,28 ,28 ,
-- 0,7 ,13,18,21 ,24 ,26 ,26 ,
-- 0,6 ,12,16,20 ,22 ,24 ,24 ,
-- 0,6 ,11,15,18 ,21 ,22 ,22 ,
-- 0,6 ,10,14,17 ,19 ,21 ,21 ,
-- 0,5 ,10,13,16 ,18 ,19 ,20 ,
-- 0,5 ,9 ,12,15 ,17 ,18 ,19 ,
-- 0,5 ,9 ,12,14 ,16 ,17 ,18 ,
-- 0,5 ,9 ,12,14 ,16 ,17 ,18 ,
-- 0,4 ,8 ,11,13 ,15 ,15 ,16));


begin

profundidad <= CONV_INTEGER(prof);

process(clk)

begin

if (clk'event and clk = '1') then


if (borrador='0' and contador_clk<=1500) then
contador_clk<=contador_clk+1;
end if;

if borrador='1' then
contador_clk<=0;
termine<='0';
end if;

if (contador_clk=1500 and borrador='0') then
contador_clk<=1501;
end if;
----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------

if((contador_clk= retar(8*profundidad)) or (contador_clk=retar(8*profundidad)+56) or (contador_clk=retar(8*profundidad)+112))then
Sup(0)<='1';
Sup(15)<='1';
end if;

if((contador_clk= retar(8*profundidad)+28) or (contador_clk= retar(8*profundidad)+84) or (contador_clk= retar(8*profundidad)+140)) then
Sup(0)<='0';
Sup(15)<='0';
end if;

if((contador_clk= retar(8*profundidad+1)) or (contador_clk=retar(8*profundidad+1)+56) or (contador_clk=retar(8*profundidad+1)+112)) then
Sup(1)<='1';
Sup(14)<='1';
end if;

if((contador_clk= retar(8*profundidad+1)+28) or (contador_clk= retar(8*profundidad+1)+84) or (contador_clk= retar(8*profundidad+1)+140)) then
Sup(1)<='0';
Sup(14)<='0';
end if;

if((contador_clk= retar(8*profundidad+2)) or (contador_clk=retar(8*profundidad+2)+56) or (contador_clk=retar(8*profundidad+2)+112)) then
Sup(2)<='1';
Sup(13)<='1';
end if;

if((contador_clk= retar(8*profundidad+2)+28) or (contador_clk= retar(8*profundidad+2)+84) or (contador_clk= retar(8*profundidad+2)+140)) then
Sup(2)<='0';
Sup(13)<='0';
end if;

if((contador_clk= retar(8*profundidad+3)) or (contador_clk=retar(8*profundidad+3)+56) or (contador_clk=retar(8*profundidad+3)+112)) then
Sup(3)<='1';
Sup(12)<='1';
end if;


if((contador_clk= retar(8*profundidad+3)+28) or (contador_clk= retar(8*profundidad+3)+84) or (contador_clk= retar(8*profundidad+3)+140)) then
Sup(3)<='0';
Sup(12)<='0';
end if;


if((contador_clk= retar(8*profundidad+4)) or (contador_clk=retar(8*profundidad+4)+56) or (contador_clk=retar(8*profundidad+4)+112)) then
Sup(4)<='1';
Sup(11)<='1';
end if;

if((contador_clk= retar(8*profundidad+4)+28) or (contador_clk= retar(8*profundidad+4)+84) or (contador_clk= retar(8*profundidad+4)+140)) then
Sup(4)<='0';
Sup(11)<='0';
end if;

if((contador_clk= retar(8*profundidad+5)) or (contador_clk=retar(8*profundidad+5)+56) or (contador_clk=retar(8*profundidad+5)+112)) then
Sup(5)<='1';
Sup(10)<='1';
end if;

if((contador_clk= retar(8*profundidad+5)+28) or (contador_clk= retar(8*profundidad+5)+84) or (contador_clk= retar(8*profundidad+5)+140)) then
Sup(5)<='0';
Sup(10)<='0';
end if;

if((contador_clk= retar(8*profundidad+6)) or (contador_clk=retar(8*profundidad+6)+56) or (contador_clk=retar(8*profundidad+6)+112)) then
Sup(9)<='1';
Sup(6)<='1';
end if;

if((contador_clk= retar(8*profundidad+6)+28) or (contador_clk= retar(8*profundidad+6)+84) or (contador_clk= retar(8*profundidad+6)+140)) then
Sup(9)<='0';
Sup(6)<='0';
end if;

if((contador_clk= retar(8*profundidad+7)) or (contador_clk=retar(8*profundidad+7)+56) or (contador_clk=retar(8*profundidad+7)+112)) then
Sup(8)<='1';
Sup(7)<='1';
end if;

if((contador_clk= retar(8*profundidad+7)+28) or (contador_clk= retar(8*profundidad+7)+84) or (contador_clk= retar(8*profundidad+7)+140)) then
Sup(8)<='0';
Sup(7)<='0';
end if;


----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------

if ((contador_clk=retar(8*profundidad)+28) or (contador_clk=retar(8*profundidad)+84) or (contador_clk=retar(8*profundidad)+140)) then
Sdown(0)<='0';
Sdown(15)<='0';
end if;

if ((contador_clk=retar(8*profundidad)+56) or (contador_clk=retar(8*profundidad)+112) or (contador_clk=retar(8*profundidad)+168)) then
Sdown(0)<='1';
Sdown(15)<='1';
end if;

if ((contador_clk=retar(8*profundidad+1)+28) or (contador_clk=retar(8*profundidad+1)+84) or (contador_clk=retar(8*profundidad+1)+140)) then
Sdown(1)<='0';
Sdown(14)<='0';
end if;

if ((contador_clk=retar(8*profundidad+1)+56) or (contador_clk=retar(8*profundidad+1)+112) or (contador_clk=retar(8*profundidad+1)+168)) then
Sdown(1)<='1';
Sdown(14)<='1';
end if;

if ((contador_clk=retar(8*profundidad+2)+28) or (contador_clk=retar(8*profundidad+2)+84) or (contador_clk=retar(8*profundidad+2)+140)) then
Sdown(2)<='0';
Sdown(13)<='0';
end if;

if ((contador_clk=retar(8*profundidad+2)+56) or (contador_clk=retar(8*profundidad+2)+112) or (contador_clk=retar(8*profundidad+2)+168)) then
Sdown(2)<='1';
Sdown(13)<='1';
end if;

if ((contador_clk=retar(8*profundidad+3)+28) or (contador_clk=retar(8*profundidad+3)+84) or (contador_clk=retar(8*profundidad+3)+140)) then
Sdown(3)<='0';
Sdown(12)<='0';
end if;

if ((contador_clk=retar(8*profundidad+3)+56) or (contador_clk=retar(8*profundidad+3)+112) or (contador_clk=retar(8*profundidad+3)+168)) then
Sdown(3)<='1';
Sdown(12)<='1';
end if;

if ((contador_clk=retar(8*profundidad+4)+28) or (contador_clk=retar(8*profundidad+4)+84) or (contador_clk=retar(8*profundidad+4)+140)) then
Sdown(4)<='0';
Sdown(11)<='0';
end if;

if ((contador_clk=retar(8*profundidad+4)+56) or (contador_clk=retar(8*profundidad+4)+112) or (contador_clk=retar(8*profundidad+4)+168)) then
Sdown(4)<='1';
Sdown(11)<='1';
end if;

if ((contador_clk=retar(8*profundidad+5)+28) or (contador_clk=retar(8*profundidad+5)+84) or (contador_clk=retar(8*profundidad+5)+140)) then
Sdown(10)<='0';
Sdown(5)<='0';
end if;

if ((contador_clk=retar(8*profundidad+5)+56) or (contador_clk=retar(8*profundidad+5)+112) or (contador_clk=retar(8*profundidad+5)+168)) then
Sdown(10)<='1';
Sdown(5)<='1';
end if;

if ((contador_clk=retar(8*profundidad+6)+28) or (contador_clk=retar(8*profundidad+6)+84) or (contador_clk=retar(8*profundidad+6)+140)) then
Sdown(9)<='0';
Sdown(6)<='0';
end if;

if ((contador_clk=retar(8*profundidad+6)+56) or (contador_clk=retar(8*profundidad+6)+112) or (contador_clk=retar(8*profundidad+6)+168)) then
Sdown(9)<='1';
Sdown(6)<='1';
end if;

if ((contador_clk=retar(8*profundidad+7)+28) or (contador_clk=retar(8*profundidad+7)+84) or (contador_clk=retar(8*profundidad+7)+140)) then
Sdown(8)<='0';
Sdown(7)<='0';
end if;

if ((contador_clk=retar(8*profundidad+7)+56) or (contador_clk=retar(8*profundidad+7)+112) or (contador_clk=retar(8*profundidad+7)+168)) then
Sdown(8)<='1';
Sdown(7)<='1';
end if;


if (contador_clk=retar(8*profundidad+7)+169) then
termine<='1';
end if;

end if;
end process;
end behavioral;

Este es el tercer codigo:

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use IEEE.math_real.all;
use ieee.numeric_std.all ;
use IEEE.std_logic_signed.all;

entity multiplex is
Port ( DIN : out STD_LOGIC:='0';
clk : in STD_LOGIC:='1';
CLK_mux : out STD_LOGIC:='0';
CLR : out STD_LOGIC:='0';
EN : out STD_LOGIC_VECTOR (15 downto 0):="1111111111111111";
habilitador1 : in STD_LOGIC:='0';
habilitador2 : in STD_LOGIC:='0';
cual_mux : in std_logic_vector (3 downto 0):="0000";
OK_inic : out STD_LOGIC:='0' ;
OK_corr : out STD_LOGIC:='0' ;
OK_unos : out STD_LOGIC:='0');
end multiplex;

-----------------------------------------------------------------
-----------------------------------------------------------------

architecture Behavioral of multiplex is

signal clk2: std_logic:='0';
signal cont: integer:=0;
signal contador: integer:=0;
signal contador2: integer:=0;
signal contador3: integer:=0;
signal CLK_mux2 :STD_LOGIC:='0';
signal CLK_mux3 :STD_LOGIC:='0';
signal CLK_mux4 :STD_LOGIC:='0';

begin

--Divisor de frecuencia de entrada----------------------------------------------------------------------

process(clk,clk2, contador, habilitador1, habilitador2) --Divisor de frecuencia de entrada
begin
if clk='1' and clk'event then -- flanco de subida
if cont < 10 then
cont <= cont + 1;
else
clk2 <= not clk2;
cont <= 0;
end if;
end if;

if contador < 10 and habilitador1='1' and habilitador2='0' and clk2='1' then
CLK_mux2 <= clk2;
else CLK_mux2<='0';
end if;
end process;

-------------------------------------------------------------------------------------------------------
----------------1º: Inicialización de los multiplexores------------------------------------------------
-------------------------------------------------------------------------------------------------------

process(clk2,habilitador1,contador, habilitador2)

begin

if clk2'event and clk2='1' then

--La salida habilitador1 indica que se quiere inicializar los MUX
--La salida DIN lleva los datos que entran de manera serial a los MUX
--La salida CLR es la que borra lo que hay en los MUX
--La salida EN es la que habilita los MUX
--La señal contador limita el numero de veces que se mandan señales de reloj
--a los MUX para que carguen lo que se coloca en DIN

if habilitador1='1' and habilitador2='0' then
if contador < 8 then
contador<=contador+1;
DIN<='0';
EN<="0000000000000000";
CLR<='0';
end if;

if contador = 8 then
contador<=contador+1;
DIN<='1';
EN<="0000000000000000";
CLR<='0';
end if;

if contador > 8 then
contador<=10;
EN<="1111111111111111";
DIN<='0';
CLR<='0';

OK_inic<='1';
OK_corr<='0';
OK_unos<='0';

end if;

end if;

-------------------------------------------------------------------------------------------------------
----------------2º: Recorrido de los cristales---------------------------------------------------------
-------------------------------------------------------------------------------------------------------

--Para el recorrido de los cristales se utiliza una señal habilitador 2,
--que indica que se quiere ejecutar esta parte del algoritmo, y una
--señal llamada cual_mux, que indica cual de los mux va a ser habilitado para
--recibir serialmente una señal por la entrada DIN cuando se aplique
--una señal de reloj..
--La señal contador2 es una señal de conteo para controlar los tiempos en los
--cuales aparece la señal de reloj para carga serial

if habilitador1='0' and habilitador2='1' then

if contador2<1 then
contador2<=contador2+1;
DIN<='0';
CLR<='0';
CASE cual_mux IS
WHEN "0000" => EN<="0111111111111111";
WHEN "0001" => EN<="1011111111111111";
WHEN "0010" => EN<="1101111111111111";
WHEN "0011" => EN<="1110111111111111";
WHEN "0100" => EN<="1111011111111111";
WHEN "0101" => EN<="1111101111111111";
WHEN "0110" => EN<="1111110111111111";
WHEN "0111" => EN<="1111111011111111";
WHEN "1000" => EN<="1111111101111111";
WHEN "1001" => EN<="1111111110111111";
WHEN "1010" => EN<="1111111111011111";
WHEN "1011" => EN<="1111111111101111";
WHEN "1100" => EN<="1111111111110111";
WHEN "1101" => EN<="1111111111111011";
WHEN "1110" => EN<="1111111111111101";
WHEN "1111" => EN<="1111111111111110";
WHEN OTHERS => EN <= "XXXXXXXXXXXXXXXX";
END CASE;

end if;

if contador2=1 then
contador2<=contador2+1;
DIN<='0';
CLR<='0';
CASE cual_mux IS
WHEN "0000" => EN<="0111111111111111";
WHEN "0001" => EN<="1011111111111111";
WHEN "0010" => EN<="1101111111111111";
WHEN "0011" => EN<="1110111111111111";
WHEN "0100" => EN<="1111011111111111";
WHEN "0101" => EN<="1111101111111111";
WHEN "0110" => EN<="1111110111111111";
WHEN "0111" => EN<="1111111011111111";
WHEN "1000" => EN<="1111111101111111";
WHEN "1001" => EN<="1111111110111111";
WHEN "1010" => EN<="1111111111011111";
WHEN "1011" => EN<="1111111111101111";
WHEN "1100" => EN<="1111111111110111";
WHEN "1101" => EN<="1111111111111011";
WHEN "1110" => EN<="1111111111111101";
WHEN "1111" => EN<="1111111111111110";
WHEN OTHERS => EN <= "XXXXXXXXXXXXXXXX";
END CASE;
CLK_mux3<='1';
end if;

if contador2=2 then
contador2<=5;
DIN<='0';
CLR<='0';
EN<="1111111111111111";
CLK_mux3<='0';

OK_inic<='0';
OK_corr<='1';
OK_unos<='0';

end if;

end if;

-------------------------------------------------------------------------------------------------------
----------------3º: Restauración de las variables------------------------------------------------------
--se reinician las variables contador y contador2 para que el modulo
--sea capaz de volver a hacer cualquiera de los procedimientos que se
--le soliciten (reiniciar MUX's, correrse de cristal o reiniciar vriables)
-------------------------------------------------------------------------------------------------------
if habilitador1='1' and habilitador2='1' then
contador<=0;
contador2<=0;
contador3<=0;
OK_inic<='0';
OK_corr<='0';
OK_unos<='0';

end if;

-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
---------------COLOCACIÓN DE UN 1 EN LA PRIMERA POSICIÓN DE TODOS LOS MUX----------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------

if habilitador1='0' and habilitador2='0' then

if contador3<1 then
contador3<=contador3+1;
DIN<='1';
CLR<='0';
EN<="0000000000000000";
CLK_mux4<='0';
end if;

if contador3=1 then
contador3<=contador3+1;
DIN<='1';
CLR<='0';
EN<="0000000000000000";
CLK_mux4<='1';
end if;

if contador3=2 then
contador3<=5;
DIN<='0';
CLR<='0';
EN<="1111111111111111";
CLK_mux4<='0';


OK_inic<='0';
OK_corr<='0';
OK_unos<='1';

end if;

end if;

end if;
end process;

CLK_mux<=CLK_mux2 or CLK_mux3 or CLK_mux4;

end Behavioral;

Como ves el codigo es un poco largo.... entonces se me ha dificultado analizar en donde estan los latches.
Cuando compilo los codigos 2 y 3 de manera individual no sale ningun error ni warning, pero cuando conecto esos dos codigos con el codigo tres aparecen todos los warnings (alrededor de 40) , que tienen que ver con Flip Flops y Latches.

Creo que es debido a que en algunos if no considero todas las combinaciones posibles entre las variables en las condiciones. Sin embargo, a pesar de que ya he arreglado eso no se van los warnings.

Te agradesco!!!

WARNING:Xst:819 - "C:/proyecto/control_16_MUX/Control16.vhd" line 84: One or more signals are missing in the process sensitivity list. To enable synthesis of FPGA/CPLD hardware, XST will assume that all necessary signals are present in the sensitivity list. Please note that the result of the synthesis may differ from the initial design specification. The missing signals are:
<contador>, <Termine_INIC>, <Termine_HVP>, <contador_t>, <t>, <Termine_CORR>, <contador2>, <contador3>, <Termine_UNOS>
WARNING:Xst:1781 - Signal <retar> is used but never assigned. Tied to default value.
WARNING:Xst:646 - Signal <profundidad<31:29>> is assigned but never used. This unconnected signal will be trimmed during the optimization process.
WARNING:Xst:737 - Found 1-bit latch for signal <borrador1>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 32-bit latch for signal <contador2>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 32-bit latch for signal <contador_t>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 32-bit latch for signal <contador3>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 4-bit latch for signal <cual_mux1>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 6-bit latch for signal <contador>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal <H1>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal <H2>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
 
Última edición:
Atrás
Arriba