Vielen Dank schon mal für die Antwort. Jetzt kann ich mir schon ein
bisschen besser vorstellen, wie ich das Projekt aufzubauen habe. Jedoch
habe ich noch Probleme mit der Syntax.
Mein main-Code sieht bis jetzt so aus:
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 |
|
6 |
|
7 | ---- Uncomment the following library declaration if instantiating
|
8 | ---- any Xilinx primitives in this code.
|
9 | --library UNISIM;
|
10 | --use UNISIM.VComponents.all;
|
11 |
|
12 | entity main is
|
13 | Port ( CLK : in STD_LOGIC;
|
14 | SW0 : in STD_LOGIC;
|
15 | SW1 : in STD_LOGIC;
|
16 | SW2 : in STD_LOGIC;
|
17 | SW3 : in STD_LOGIC;
|
18 | WAVE_OUT : out STD_LOGIC_VECTOR (7 downto 0));
|
19 |
|
20 | end entity main;
|
21 |
|
22 | architecture Behavioral of main is
|
23 |
|
24 | component Zaehler is
|
25 | Port ( clk : in STD_LOGIC;
|
26 | counter_out : out STD_LOGIC_VECTOR (7 downto 0));
|
27 | end component Zaehler;
|
28 |
|
29 | component generator is
|
30 | Port ( CLK : in STD_LOGIC;
|
31 | YOUT : out STD_LOGIC_VECTOR(7 downto 0));
|
32 | end component generator;
|
33 |
|
34 | for all: Zaehler use entity WORK.Zaehler(Behavioral);
|
35 | for all: generator use entity WORK.generator(Behavioral);
|
36 |
|
37 | begin
|
38 | process(CLK)
|
39 | begin
|
40 | if SW0 = '1' then
|
41 | Zaehler1: zaehler
|
42 | port map(CLK => CLK, counter_out => WAVE_OUT);
|
43 |
|
44 | else then
|
45 | PRBS: generator
|
46 | port map(CLK => CLK, YOUT => WAVE_OUT);
|
47 |
|
48 | end if;
|
49 | end process;
|
50 | end Behavioral;
|
Dabei liegt das Problem in der If-Anweisung, denke ich. Ich bekomme den
Fehler:
ERROR:HDLParsers:808 - Line 59. = can not have such operands in this
context.
ERROR:HDLParsers:164 - Line 61. parse error, unexpected PORT, expecting
OPENPAR or TICK or LSQBRACK
Wie kann ich diesen Fehler verhindern, und auf die jeweilige Stellung
der Switche ein anderes Signal auf den Ausgang geben?
Grüße
Kim