E
eeh
Guest
I am just beginner of vhdl. I write a simple vhdl code segment below
and find errors after synthesis. Could anyone teach me why the errors
arise?
entity test is
Port
(
inp:in integer;
output integer
);
end test;
architecture Behavioral of test is
type temp_typ is array(16 downto 0) of integer;
signal temp:temp_typ;
signal index:integer:=0;
signal i:integer;
signal sum:integer:=0;
begin
temp(index)<=inp;
index<=(index+1)mod 16;
for i in 0 to 15 loop
sum<=sum+temp(index)*inp;
index<=(index+1)mod 16;
end loop;
end Behavioral;
ERROR:HDLParsers:164 - "C:/terry/prj/fpga/counter/echo_can.vhd" Line
51. parse error, unexpected FOR
ERROR:HDLParsers:834 - "C:/terry/prj/fpga/counter/echo_can.vhd" Line
53. Signal index has a multi source.
ERROR:HDLParsers:164 - "C:/terry/prj/fpga/counter/echo_can.vhd" Line
54. parse error, unexpected LOOP, expecting SEMICOLON
and find errors after synthesis. Could anyone teach me why the errors
arise?
entity test is
Port
(
inp:in integer;
output integer
);
end test;
architecture Behavioral of test is
type temp_typ is array(16 downto 0) of integer;
signal temp:temp_typ;
signal index:integer:=0;
signal i:integer;
signal sum:integer:=0;
begin
temp(index)<=inp;
index<=(index+1)mod 16;
for i in 0 to 15 loop
sum<=sum+temp(index)*inp;
index<=(index+1)mod 16;
end loop;
end Behavioral;
ERROR:HDLParsers:164 - "C:/terry/prj/fpga/counter/echo_can.vhd" Line
51. parse error, unexpected FOR
ERROR:HDLParsers:834 - "C:/terry/prj/fpga/counter/echo_can.vhd" Line
53. Signal index has a multi source.
ERROR:HDLParsers:164 - "C:/terry/prj/fpga/counter/echo_can.vhd" Line
54. parse error, unexpected LOOP, expecting SEMICOLON