行为附近的语法错误
syntax error near behavioral
我正在尝试在 vhdl 中编写用于将两个 100x100 矩阵相乘的代码
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.numeric_std.all;
library work;
use work.mult_100x100_pack.all;
entity multiplier_main_code is
Port ( in_matrix1 : in t_2d_array;
in_matrix2 : in t_2d_array;
out_matrix : inout t_2d_array);
end multiplier_main_code;
architecture Behavioral of multiplier_main_code is
begin
process(in_matrix1, in_matrix2)
begin
for i in 0 to 99 loop
for j in 0 to 99 loop
for k in 0 to 99 loop
out_matrix(i)(j) <= std_logic_vector(signed(out_matrix(i)(j)) + (signed(in_matrix1(i)(k)) * signed(in_matrix2(k)(j))));
end loop;
end loop;
end loop;
end Behavioral;
它一次又一次地显示错误说:
"behavioral"
的类型为 void
"Behavioral"
附近的语法错误
mult_100X100_pack 包的代码是:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use ieee.numeric_std.all;
package mult_100x100_pack is
type t_1d_array is array(integer range 0 to 99)of std_logic_vector(7 downto 0);
type t_2d_array is array(integer range 0 to 99)of t_1d_array;
end mult_100x100_pack;
拜托,有人可以帮我解决这个错误吗?
修复缩进后,您应该很明显遗漏了什么:
process(in_matrix1, in_matrix2)
begin
for i in 0 to 99 loop
for j in 0 to 99 loop
for k in 0 to 99 loop
-- Do things
end loop;
end loop;
end loop;
-- Perhaps `end process;` might be appropriate here...
您的 process
需要一个 end process;
:
end loop;
end process;
end Behavioral;
这说明了注意正确缩进代码的好处。如果您所有的 end for
都与相应的 for
对齐,这就很明显了。
我正在尝试在 vhdl 中编写用于将两个 100x100 矩阵相乘的代码
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.numeric_std.all;
library work;
use work.mult_100x100_pack.all;
entity multiplier_main_code is
Port ( in_matrix1 : in t_2d_array;
in_matrix2 : in t_2d_array;
out_matrix : inout t_2d_array);
end multiplier_main_code;
architecture Behavioral of multiplier_main_code is
begin
process(in_matrix1, in_matrix2)
begin
for i in 0 to 99 loop
for j in 0 to 99 loop
for k in 0 to 99 loop
out_matrix(i)(j) <= std_logic_vector(signed(out_matrix(i)(j)) + (signed(in_matrix1(i)(k)) * signed(in_matrix2(k)(j))));
end loop;
end loop;
end loop;
end Behavioral;
它一次又一次地显示错误说:
"behavioral"
的类型为 void
"Behavioral"
mult_100X100_pack 包的代码是:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use ieee.numeric_std.all;
package mult_100x100_pack is
type t_1d_array is array(integer range 0 to 99)of std_logic_vector(7 downto 0);
type t_2d_array is array(integer range 0 to 99)of t_1d_array;
end mult_100x100_pack;
拜托,有人可以帮我解决这个错误吗?
修复缩进后,您应该很明显遗漏了什么:
process(in_matrix1, in_matrix2)
begin
for i in 0 to 99 loop
for j in 0 to 99 loop
for k in 0 to 99 loop
-- Do things
end loop;
end loop;
end loop;
-- Perhaps `end process;` might be appropriate here...
您的 process
需要一个 end process;
:
end loop;
end process;
end Behavioral;
这说明了注意正确缩进代码的好处。如果您所有的 end for
都与相应的 for
对齐,这就很明显了。