如何解决进程问题中的端口映射?
我仍在尝试构建神经网络系统。无需训练,仅使用已计算的权重进行计算。
fp_mulp 和 addsub32 实体只是 IEEE 754 32 位计算器的计算。我正在做主
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity mainProject is
Port ( inputLayer : in std_logic_vector (24 downto 0);
outputLayer : in std_logic_vector (3 downto 0));
end mainProject;
architecture Behavioral of mainProje is
component addsub32 is
Port ( addsub_a : in std_logic_vector(31 downto 0);
addsub_b : in std_logic_vector(31 downto 0);
addsub_res : out std_logic_vector(31 downto 0)
);
end component;
component fp_mulp is
Port ( multiple_a : in std_logic_vector (31 downto 0);
multiple_b : in std_logic_vector (31 downto 0);
multiple_res : out std_logic_vector (31 downto 0));
end component;
signal mulp_out : std_logic_vector (31 downto 0) :=(others=>'0');
signal mulp_a : std_logic_vector (31 downto 0) :=(others=>'0');
signal mulp_b: std_logic_vector (31 downto 0) :=(others=>'0');
signal adder_out: std_logic_vector (31 downto 0) :=(others=>'0');
signal adder_a: std_logic_vector (31 downto 0) :=(others=>'0');
signal adder_b: std_logic_vector (31 downto 0) :=(others=>'0');
type inWeights is array(1 to 10,1 to 25) of std_logic_vector(31 downto 0);
type outWeights is array(1 to 4,1 to 10) of std_logic_vector(31 downto 0);
type inLayerNode is array(1 to 25) of std_logic_vector(31 downto 0);
signal iWeights : inWeights;
signal oWeights : outWeights;
signal inLayerN: inLayerNode;
begin
--input Weights
iWeights(1,1) <= "00111101001110111011101100011010";-- 0.0458327319962061
iWeights(1,2) <= "00111110110001000100100100110001";-- 0.383370910990698
iWeights(1,3) <= "10111111001101000111100011110001";-- -0.704970429655861
iWeights(1,4) <= "10111110101110001011111001010111";-- -0.360827181637624
iWeights(1,5) <= "00111111000010110010100001011101";-- 0.543584647799883
iWeights(1,6) <= "10111110010001111101111111110010";-- -0.195190222049452
iWeights(1,7) <= "10111110101011000100111110001101";-- -0.336544423789263
iWeights(1,8) <= "10111101111010011100101111101000";-- -0.114158454028173
iWeights(1,9) <= "00111111000101111111000101000001";-- 0.593525018028288
iWeights(1,10) <= "10111110101110100101001010001011";-- -0.36391100592217
process(inputLayer,mulp_a,mulp_b,adder_a,adder_b)
variable sumBuffer : std_logic_vector(31 downto 0):=(others=>'0');
begin
for i in 0 to 9 loop --- chech if node have 1
if inputLayer(i) = '1' then
mulp_a <= "00111111100000000000000000000000";
mulp_b <= iWeights(1,i+1);
multiple32: fp_mulp port map(multiple_a => mulp_a,multiple_b => mulp_b,multiple_res => mulp_out);
adder_a <= mulp_out;
adder_b <= sumBuffer;
adder32: addsub32 port map(addsub_a => adder_a,addsub_b => adder_b,addsub_res => adder_out);
sumBuffer := adder_out;
else
end if;
end loop;
end process;
end Behavioral;
正如您在代码中看到的那样。我需要使用进程来控制操作的时间,如果语句需要进程块,那么任何人都可以帮助我吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。