Also, nehme ich mal deine originale VHDL Beschreibung und bekomme damit:
1 | WARNING:Xst:819 - "C:/..." line 51: One or more signals are missing in
|
2 | the process sensitivity list. ... The missing signals are:
|
3 | <sw0>, <sw1>, <dataout1>
|
ALARM! Das hätte man bei einem getakteten Prozess nicht erwartet! Denn
da gehört nur der Takt in die Sensitivliste.
Und dann
1 | WARNING:Xst:737 - Found 8-bit latch for signal <address_z2>. Latches
|
2 | may be generated from incomplete case or if statements. We do not recommend
|
3 | the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
|
4 | WARNING:Xst:737 - Found 8-bit latch for signal <address_z3>. Latches ....
|
5 | WARNING:Xst:737 - Found 8-bit latch for signal <datain2>. Latches ....
|
6 | WARNING:Xst:737 - Found 8-bit latch for signal <address1>. Latches ....
|
ALARM, ALARM, ALARM!!! Warum sollte es bei einem getakteten Prozess
Latches geben? Da muss irgendwas nicht passen!
Und wenn ich jetzt einfach hinten ein "end if;" anhänge, dann bekomme
ich wie erwartet einen Fehler, der genau dieses if anmeckert:
1 | ERROR:HDLParsers:164 - "C:/...." Line 87. parse error, unexpected IF, expecting PROCESS
|
Ergo: du hast das "end if;" VERSCHOBEN. Und zwar so:
1 | process(clock)
|
2 | variable address_z3 : integer range 0 to 255 := 0;
|
3 | variable address_z2 : integer range 0 to 255 := 0;
|
4 | variable address_z1 : integer range 0 to 255 := 0;
|
5 |
|
6 | begin
|
7 | if rising_edge(clock) then
|
8 | if (cnt<20000000 and sw2='1') then
|
9 | cnt <= cnt+1;
|
10 | else
|
11 | cnt <= 0;
|
12 | we2<='0';
|
13 | if address_z1 <= 255 then
|
14 | address_z1 := address_z1 +1;
|
15 | address2 <=address_z1;
|
16 | end if;
|
17 | end if;
|
18 | -- end if; ---------> hier raus
|
19 |
|
20 | if sw0='1' then
|
21 | address_z1:=0;
|
22 | address_z2:=0;
|
23 | address_z3:=0;
|
24 | end if;
|
25 |
|
26 | if sw1='1' then
|
27 | we2<='1';
|
28 | if address_z2 <= 255 then
|
29 | address_z3 := address_z3 +1;
|
30 | address_z2 := address_z2 +1;
|
31 | address1<=address_z2;
|
32 | address2<=address_z3;
|
33 |
|
34 | datain2<=dataout1;
|
35 | end if;
|
36 | end if;
|
37 | end if; -- <---------- hier rein
|
38 |
|
39 | end process;
|
Das ist klar wie Kloßbrühe!
Mit "wait until rising_edge()" wäre das nicht passiert, deshalb verwende
ich es so gern...
1 | process
|
2 | variable address_z3 : integer range 0 to 255 := 0;
|
3 | variable address_z2 : integer range 0 to 255 := 0;
|
4 | variable address_z1 : integer range 0 to 255 := 0;
|
5 |
|
6 | begin
|
7 | wait until rising_edge(clock);
|
8 | if (cnt<20000000 and sw2='1') then
|
9 | cnt <= cnt+1;
|
10 | else
|
11 | cnt <= 0;
|
12 | we2<='0';
|
13 | if address_z1 <= 255 then
|
14 | address_z1 := address_z1 +1;
|
15 | address2 <=address_z1;
|
16 | end if;
|
17 | end if;
|
18 |
|
19 | if sw0='1' then
|
20 | address_z1:=0;
|
21 | address_z2:=0;
|
22 | address_z3:=0;
|
23 | end if;
|
24 |
|
25 | if sw1='1' then
|
26 | we2<='1';
|
27 | if address_z2 <= 255 then
|
28 | address_z3 := address_z3 +1;
|
29 | address_z2 := address_z2 +1;
|
30 | address1<=address_z2;
|
31 | address2<=address_z3;
|
32 |
|
33 | datain2<=dataout1;
|
34 | end if;
|
35 | end if;
|
36 |
|
37 | end process;
|
Achja, Peter: wenn du das Zeug so leicht wieder vergisst, das ich zum
Thema Bibliotheken und Variablen schon alles geschrieben habe, dann
DRUCK ES DIR AUS und häng es an die Wand.