Couter - ParseError808

Gast #252804
Lesenswert?

Guten Morgen,
habe ein Problem mit einem kleinen Testprogram. Bitte nicht lachen,
fange gerade an. Der Compiler meckert die Zeile "if CLOCK='1' and
CLOCK'event then" mit dem Fheler HDLParser808 an. Kann mir bitte jmd.
sagen wo das Problem liegt? (Xilinx ISE, VHDL-Top-Level_Module)

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.std_logic_unsigned.all;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
library UNISIM;
use UNISIM.VComponents.all;

entity Counter is
    Port ( CLOCK : in std_logic_vector(0 downto 0);
           DIRECTION : in std_logic_vector(0 downto 0);
           COUNT_OUT : out std_logic_vector(3 downto 0));
end Counter;

architecture Behavioral of counter is
signal count_int : std_logic_vector(0 to 3) := "0000";
begin
process (CLOCK)
begin
   if CLOCK='1' and CLOCK'event then
      if DIRECTION='1' then
         count_int <= count_int + 1;
      else
         count_int <= count_int - 1;
      end if;
   end if;
end process;
COUNT_OUT <= count_int;
end Behavioral;
Gast #252807
Lesenswert?

Hallo Daniel,

probier doch mal Folgendes:
  if CLOCK="1" and CLOCK'event then
    if DIRECTION="1" then
  ...

oder:
  if CLOCK(0)='1' and CLOCK'event then
    if DIRECTION(0)='1' then
  ...

Ich bin mir zwar nicht sicher, aber es könnte sein, dass das Tool
Probleme hat, weil die beiden Ports als Vektor deklariert sind, aber
als einzelnes Bit genutzt werden.

Gruß
Ines
Gast #252808
Lesenswert?

Warum ist CLOCK ein Vector?

Mach mal aus

entity Counter is
    Port ( CLOCK : in std_logic_vector(0 downto 0);
           DIRECTION : in std_logic_vector(0 downto 0);
           COUNT_OUT : out std_logic_vector(3 downto 0));
end Counter;

entity Counter is
    Port ( CLOCK : in std_logic;
           DIRECTION : in std_logic;
           COUNT_OUT : out std_logic_vector(3 downto 0));
end Counter;


Vielleicht lieg es ja daran?
VieleGrüße
TobiFlex
Gast #252810
Lesenswert?

Ok, danke Leute - habs begriffen.
Habe zu Beginn des Design den Vector für Count_out angelegt und dabei
für die anderen beiden Variablen LSB und MSB=0 gesetzt, was dann wohl
einen Vektor erzeugt hat.
Danke

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren