Forum: FPGA, VHDL & Co. Signal X_index has a multi source!


von VHDL Anfänger (Gast)


Lesenswert?

1
count_up: process(Taste1) 
2
begin
3
if (Taste1 = '1' and Taste1'event) then
4
  if X_index < 99 then
5
    X_index <= X_index + 1;
6
  end if;
7
end if;
8
end process count_up;
9
10
count_down: process(Taste2) 
11
begin
12
if (Taste2 = '1' and Taste2'event) then
13
  if X_index > 0 then
14
    X_index <= X_index - 1;
15
  end if;
16
end if;
17
end process count_down;

Kriege die Fehlermeldung:Signal X_index has a multi source.
Was tun?

von Sören (Gast)


Lesenswert?

Alles in einen Prozess packen !

von VHDL Anfänger (Gast)


Lesenswert?

1
count_up_down: process(Taste1, Taste2) 
2
begin
3
if (Taste1 = '1' and Taste1'event) then
4
  if X_index < 99 then
5
    X_index <= X_index + 1;
6
  end if;
7
elsif (Taste2 = '1' and Taste2'event) then
8
  if X_index > 0 then
9
    X_index <= X_index - 1;
10
  end if;
11
end if;
12
end process count_up_down;
Fehlermeldung jetzt:Signal X_index cannot be synthesized, bad 
synchronous description. Wat nu?

von abk (Gast)


Lesenswert?

'event nur einmal für den Takt verwenden. Taste mit dem Takt abtasten.

von berndl (Gast)


Lesenswert?

Nee, Taste1 und Taste2 sauber einsynchronisieren (mal hier im Forum 
suchen), dann die synchronen Signale Taste1_sauber und Taste2_sauber in 
einem geclockten Prozess verwenden...

von VHDL Anfänger (Gast)


Lesenswert?

1
count_up_down: process(Generator,Taste1_DFF,Taste2_DFF) 
2
begin
3
  if (Generator = '1' and Generator'event) then
4
    Taste1_DFF <= Taste1;
5
    Taste2_DFF <= Taste2;
6
  end if;
7
8
  if (Taste1_DFF = '1' and Taste1_DFF'event) then
9
    if X_index < 99 then
10
      X_index <= X_index + 1;
11
    end if;
12
  end if;
13
14
  if (Taste2_DFF = '1' and Taste2_DFF'event) then
15
    if X_index > 0 then
16
      X_index <= X_index - 1;
17
    end if;
18
  end if;
19
end process count_up_down;

Leider immer noch Fehlermeldung:ERROR:Xst:827 -  line 46: Signal X_index 
cannot be synthesized, bad synchronous description.

von Patrick S. (abaddon1979)


Lesenswert?

1
count_up_down: 
2
process(Generator) 
3
begin
4
if rising_edge(Generator) then
5
    
6
  if Taste1 = '1' then
7
    if X_index < 99 then
8
      X_index <= X_index + 1;
9
    end if;
10
  end if;
11
12
  if Taste2 = '1' then
13
    if X_index > 0 then
14
      X_index <= X_index - 1;
15
    end if;
16
  end if;
17
18
end if;
19
end process count_up_down;

von Lothar M. (Firma: Titel) (lkmiller) (Moderator) Benutzerseite


Lesenswert?

Patrick Sulimma schrieb:
1
 count_up_down:
2
 process(Generator) begin
3
   if rising_edge(Generator) then
4
     if Taste1 = '1' then
5
     ...
6
     end if;
7
   ...
8
   end if;
9
 end process count_up_down;
Das ist jetzt aber immer noch keine Flankenerkennung bei den Tasten. 
Sondern solange die Taste gedrückt ist, zählt der Index mit der 
Taktfrequenz hoch oder runter. Und das kann recht schnell sein...

Wie man Tasten einsynchronisiert und auf Betätigungen reagiert sthet 
z.B. dort: 
http://www.lothar-miller.de/s9y/categories/18-Flankenerkennung

von Patrick S. (abaddon1979)


Lesenswert?

Da gebe ich dir natürlich recht, mir ging es auch nur um den genannten 
Fehler:

ERROR:Xst:827 -  line 46: Signal X_index
cannot be synthesized, bad synchronous description.

von Peter Z. (Gast)


Lesenswert?

> Wie man Tasten einsynchronisiert und auf Betätigungen reagiert sthet
> z.B. dort:
> http://www.lothar-miller.de/s9y/categories/18-Flankenerkennung

Sieht hübsch aus, aber kostet wahrscheinlich zu viele Logikzellen auf 
meinem CPLD XC9275.







bastelboy <= VHDL Anfänger -- ;-)

von Lothar M. (Firma: Titel) (lkmiller) (Moderator) Benutzerseite


Lesenswert?

> bastelboy <= VHDL Anfänger
Ah, jetzt ja...   ;-)

> kostet wahrscheinlich zu viele Logikzellen auf meinem CPLD
Stimmt, da sind pro Taster etliche FFs im Spiel und du hast nur 1 FF pro 
Makrozelle. Aber ohne Eintakten mußt du das Thema Metastabilität genau 
im Auge behalten (siehe auch meine HP).

> CPLD XC9275.
Ist das neu? Die 92er Serie kannte ich noch nicht... :-)

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.