i do my first programm in vhdl and i have a mistake and i dont know where it is..
i checked carefully all my work and i really dont know where am i wrong
please help me
it wrote in the compiler the errors:
Cannot read output "cnt".
Illegal sequential statement.
counter.vhd(34): near ",": expecting ';'
i checked carefully all my work and i really dont know where am i wrong
please help me
HTML:
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity counter is
generic(G_DATA_WIDTH : integer := 8);
port(clk,reset, load : in std_logic;
opcode : in std_logic_vector (1 downto 0);
data_in : in std_logic_vector(G_DATA_WIDTH-1 downto 0);
cnt : out std_logic_vector(G_DATA_WIDTH-1 downto 0));
end counter;
architecture arc_counter of counter is
SIGNAL temp1: integer;
signal ZEROS: std_logic_vector(G_DATA_WIDTH-1 downto 0);
signal ONES: std_logic_vector(G_DATA_WIDTH-1 downto 0);
begin
process(reset,clk)
begin
if( reset='1') then
cnt <=(others =>'0');
elsif reset='0' then
if (clk'event and clk='1') then
ONES <= (others => '1');
ZEROS <= (others =>'0');
temp1 <= to_integer(unsigned(cnt));
cnt <= std_logic_vector(to_unsigned(temp1+1,G_DATA_WIDTH)) when (opcode='01' and cnt/=ONES ),
ZEROS when opcode='01' and cnt=ONES ,
std_logic_vector(to_unsigned(temp1-1,G_DATA_WIDTH)) when opcode='10' and cnt/=ZEROS ,
ONES when opcode='10' and cnt=ZEROS ,
cnt when opcode='00' ,
data_in when others ;
end if;
end if;
end process;
end arc_counter;
configuration cfg_counter of counter is
for arc_counter
end for;
end cfg_counter;
it wrote in the compiler the errors:
Cannot read output "cnt".
Illegal sequential statement.
counter.vhd(34): near ",": expecting ';'