FORUM Syndrome-OC - Jacky-PC


  Programmation


  Autre


  [VHDL]message d'erreur alors qu'il ne devrait pas y en avoir

 




M4vrick Le salon de discussion : DarkBears et 12 utilisateurs inconnus

 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[VHDL]message d'erreur alors qu'il ne devrait pas y en avoir

n°4998
bilbot
L'Isarien des Flandres
Posté le 15-02-2005 à 11:49:01  profilanswer
 

Code :
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.std_logic_arith.all;
  4. use ieee.std_logic_unsigned.all;
  5. ENTITY decodeur_odometrie IS
  6. PORT
  7. (
  8.  ina,inb,clk,oe,selodo,selbyt  : IN STD_LOGIC;
  9.  donnee        : OUT STD_LOGIC_VECTOR(5 DOWNTO 0);
  10.  ack         : INOUT STD_LOGIC
  11. );
  12. END decodeur_odometrie;
  13. ARCHITECTURE description OF decodeur_odometrie IS
  14. SIGNAL ina_old,inb_old,ina_filtre,inb_filtre,oe_filtre  : STD_LOGIC; --variables permettant de decoder les impulsions des encodeurs
  15. SIGNAL a1,a2,b1,b2,oe1,oe2        : STD_LOGIC; --variables permettant de faire le filtrage numériques des impulsions
  16. SIGNAL cpt,cpt_out          : STD_LOGIC_VECTOR (11 DOWNTO 0); --variable servant au comptage puis a la bufferisation lors d'une demande de lecture
  17. SIGNAL inc,dec           : STD_LOGIC;
  18. BEGIN
  19. --Decodage des impulsions pour l'incrémentation du cpt
  20. inc <= ina_old and inb_old and not(ina_filtre) and inb_filtre;
  21. inc <= not(ina_old) and inb_old and not(ina_filtre) and not(inb_filtre);
  22. inc <= not(ina_old) and not(inb_old) and ina_filtre and not(inb_filtre);
  23. inc <= ina_old and not(inb_old) and ina_filtre and inb_filtre;
  24. --Decodage des impulsions pour la decrementation du cpt
  25. dec <= ina_old and inb_old and ina_filtre and not(inb_filtre);
  26. dec <= ina_old and not(inb_old) and not(ina_filtre) and not(inb_filtre);
  27. dec <= not(ina_old) and not(inb_old) and not(ina_filtre) and inb_filtre;
  28. dec <= not(ina_old) and inb_old and ina_filtre and inb_filtre;
  29. ---gestion de la lecture
  30. donnee <= cpt_out(11 downto 6) when (oe_filtre = '1' and ack = '1' and selodo = '0' and selbyt = '0') else
  31.        cpt_out(5 downto 0)  when (oe_filtre = '1' and ack = '1' and selodo = '0' and selbyt = '1') else
  32.        "ZZZZZZ" ;
  33.       
  34. PROCESS (clk)
  35. begin
  36.  if (clk'event and clk ='1') then
  37.  ---filtrage oe
  38.   oe2 <= oe1;
  39.   oe1 <= oe2;
  40.   if ((oe2 and oe1 and oe) = '1' and ack ='0') then
  41.    oe_filtre <= '1';
  42.    cpt_out <= cpt;
  43.    ack <= '1';
  44.   elsif (oe2 and oe1 and oe) = '0' then
  45.    oe_filtre <= '0';
  46.   end if;
  47.  ---filtrage du canal a
  48.   a2 <= a1 ;
  49.   a1 <= ina;
  50.   if (a2 and a1 and ina) = '1' then
  51.    ina_filtre <= '1';
  52.   elsif (a2 and a1 and ina) = '0' then
  53.    ina_filtre <= '0';
  54.   end if;
  55.  ---filtrage du canal b
  56.   b2 <= b1 ;
  57.   b1 <= inb;
  58.   if (b2 and b1 and inb) = '1' then
  59.    inb_filtre <= '1';
  60.   elsif (b2 and b1 and inb) = '0' then
  61.    inb_filtre <= '0';
  62.   end if;
  63.  ---sauvegarde des valeur filtrees
  64.   ina_old <= ina_filtre;
  65.   inb_old <= inb_filtre;
  66.   if dec = '1' then
  67.    cpt <= cpt-1;
  68.   elsif inc = '1' then
  69.    cpt <= cpt+1;
  70.   end if;
  71.  end if;
  72. END PROCESS;
  73. END description;


 
voila lorsque je rentre ca le compilo me sort ca comme erreur
 
Error: Can't resolve multiple constant drivers for net "inc" at decodeur_odo.vhd(28)
Error: Constant driver at decodeur_odo.vhd(29)
Error: Can't elaborate top-level user hierarchy
Error: Quartus II Analysis & Synthesis was unsuccessful. 3 errors, 0 warnings
 Error: Processing ended: Tue Feb 15 11:44:40 2005
 Error: Elapsed time: 00:00:01
Error: Quartus II Full Compilation was unsuccessful. 3 errors, 0 warnings
 
Je comprend pas pourquoi il me sort ces erreurs, en fait apres divers essais le pb semble venir de mon affectation conditionnelle (L38 a 40) présente au tout debut (qd je l'enleve le compilo veut bien compiler) mais je vois vraiment pas ou se situe le pb car elle ne touche pas aux variables...(j'ai reverifié la syntaxe plusieurs fois et c'est bon)


Message édité par bilbot le 15-02-2005 à 12:07:14
mood
Google
Posté le 15-02-2005 à 11:49:01  profilanswer
 

n°5003
Trracer
Posté le 16-02-2005 à 11:43:03  profilanswer
 

Y'aurait pas une erreur dans la section 'filtrage oe' ? oe2 = oe1 alors que visiblement tu veux les swapper nan ?

n°5004
bilbot
L'Isarien des Flandres
Posté le 16-02-2005 à 11:48:54  profilanswer
 

yep exact :D
j'ai avancé depuis hier yavait ca comme erreur et un truc que j'avais pas compris avec ca :
 
inc <= ina_old and inb_old and not(ina_filtre) and inb_filtre;  
    inc <= not(ina_old) and inb_old and not(ina_filtre) and not(inb_filtre);  
    inc <= not(ina_old) and not(inb_old) and ina_filtre and not(inb_filtre);  
    inc <= ina_old and not(inb_old) and ina_filtre and inb_filtre;  
 
meme si les instruction sont concurrentes c'est pas correct faut mettre un or en tre chaque propal, j'ai donc un peu amelioré le code mais maintenant mon nouveau problème c'est que j'ai besoin de 78 macocellules alors que j'en ai que 64 ds mon composant :/

n°5005
Trracer
Posté le 16-02-2005 à 12:33:46  profilanswer
 

ça prendrait pas moins d'instruction de remplacer les inc <= et dec <= par des "when...else" ?

n°5018
Atarien
JackyPC
Posté le 18-02-2005 à 19:32:17  profilanswer
 

je viens de decouvrir que le Verilog est quand meme assez different du VHDL :D
 


---------------
www.JackyPC.com
mood
Google
Posté le 18-02-2005 à 19:32:17  profilanswer
 


Aller à :
Ajouter une réponse

  FORUM Syndrome-OC - Jacky-PC


  Programmation


  Autre


  [VHDL]message d'erreur alors qu'il ne devrait pas y en avoir

 

Hit Parade