Salut,
Je fais un projet "Question pour un champion" avec une carte DE2
lorsque je veux lieer mes deux fichier vhdl (FSM & compteur + affichage7segments) j'ai les erreurs :
10482 : object "compteurT" is used but not declared
10558 : cannot associate formal port "compteurT" of mode "out" with an expression
1er fichier fsm:
library ieee;
use ieee.std_logic_1164.all;
entity TP1_S2_HUET_ROBIN is
port(
a: in STD_LOGIC;
b: in STD_LOGIC;
c: in STD_LOGIC;
raz:in BIT;
clk: in STD_LOGIC;
va: out STD_LOGIC;
vb: out STD_LOGIC;
vc: out STD_LOGIC;
compteurT: out integer
);
end TP1_S2_HUET_ROBIN;
architecture questionpourunchampion of TP1_S2_HUET_ROBIN is
type etats is (etape1,etape2);
signal etat1: etats;
signal etat2: etats;
begin
etapes: process(clk,raz)
begin
if raz = '0'
then etat1 <= etape1;
elsif rising_edge(clk)
then
etat1 <= etat2;
end if;
end process etapes;
deroulementetape: process(a,b,c,etat1,clk)
begin
case etat1 is
when etape1 => /*si etat1 = etape1*/
/* qqfais a letape 1
on eteins les leds
et reinitialise compteur
+ afficheur a vide */
va <= '0';
vb <= '0';
vc <= '0';
etat2 <= etape2;/*passe a l'etape 2*/
when etape2 =>
/* qqfais a letape 2
on detecte 1ere appuie sur bouton
on allume la led du bouton
on attend bouton raz */
if a = '0' /*si bouton A pressé*/
then va <= '1'; /*on allume la led A*/
vb <= '0';
vc <= '0';
compteurT <= 1;
elsif b = '0' /*si bouton B pressé*/
then vb <= '1'; /*on allume la led B*/
va <= '0';
vc <= '0';
compteurT <= 1;
elsif c = '0' /*si bouton C pressé*/
then vc <= '1'; /*on allume la led C*/
vb <= '0';
va <= '0';
compteurT <= 1;
end if;
end case;
end process deroulementetape;
end questionpourunchampion;
2eme fichier compteur:
library ieee;
use ieee.std_logic_1164.all;
entity ecompteur is
port(
raz:in BIT;
clk: in STD_LOGIC;
compteurC : in integer;
Digit0,Digit1,Digit2,Digit3,Digit4,Digit5,Digit6: out STD_LOGIC
);
end ecompteur;
architecture acompteur of ecompteur is
begin
pcompteur: process(clk,raz,compteurC)
variable cpt: integer:= 0;
begin
if compteurC = 1 then
if raz = '0'
then cpt := 0;
elsif rising_edge(clk)
then
if cpt < 100000000
then cpt := cpt + 1;
end if;
end if;
if cpt > 10 and cpt <= 50000000
then
Digit0 <= '0';
Digit1 <= '0';
Digit2 <= '0';
Digit3 <= '0';
Digit4 <= '0';
Digit5 <= '0';
Digit6 <= '0';
end if;
if cpt > 50000000 and cpt < 100000000
then
Digit0 <= '1';
Digit1 <= '1';
Digit2 <= '1';
Digit3 <= '1';
Digit4 <= '1';
Digit5 <= '1';
Digit6 <= '1';
end if;
if cpt = 100000000
then cpt := 0;
Digit0 <= '1';
Digit1 <= '1';
Digit2 <= '0';
Digit3 <= '1';
Digit4 <= '0';
Digit5 <= '0';
Digit6 <= '1';
end if;
end if;
end process pcompteur;
end acompteur;
3eme fichier mapping (ici sont les erreurs):
library IEEE;
use IEEE.std_logic_1164.all;
use WORK.all;
entity emapping is
port (
a,b,c,raz,clk:in std_logic;
va,vb,vc: out std_logic;
Digit0,Digit1,Digit2,Digit3,Digit4,Digit5,Digit6: out std_logic
);
end emapping;
architecture amapping of emapping is
component TP1_S2_HUET_ROBIN
port(
a,b,c,raz,clk: in std_logic;
va,vb,vc: out std_logic;
compteurT: out integer
);
end component TP1_S2_HUET_ROBIN;
component compteur
port(
raz,clk: in std_logic;
compteurC: in integer;
Digit0,Digit1,Digit2,Digit3,Digit4,Digit5,Digit6: out std_logic
);
end component compteur;
signal compte: integer;
begin
bbbb : TP1_S2_HUET_ROBIN port map( a, b, c, raz, clk, va, vb, vc, compteurT);
aaaa : compteur port map(raz, clk, compte, Digit0, Digit1, Digit2, Digit3, Digit4, Digit5, Digit6);
end architecture amapping;
/*
configuration cmapping of emapping is
for FSM
for bbbb : TP1_S2_HUET_ROBIN USE ENTITY WORK.TP1_S2_HUET_ROBIN;
end for;
for aaaa : compteur USE ENTITY WORK.compteur;
end for;
end for;
end configuration cmapping;
*/
Partager