Vhdl的新手,我正在尝试制作一个6到64的解码器。我有一个正常运行的3到8解码器,我需要使用它(其中9个是准确的)来制作6到64.我一直得到10500错误代码我声明我的组件的端口映射和“ ;”在最后一行。
library ieee;
Use ieee.std_logic_1164.all;
entity dec6to64 is
port (w0,w1,w2,w3,w4,w5, En : in std_logic;
f : out std_logic_vector(63 downto 0));
end dec6to64;
Architecture Structure of dec6to64 is
component dec3to8
port(
w0,w1,w2, En : in std_logic;
y0,y1, y2, y3, y4, y5, y6 ,y7 : out std_logic);
end component;
Begin
process(w0, w1, w2, w3, w4, w5, En)
Begin
dec1: dec3to8 port map(w0, w1, w2, En, y0, y1, y2, y3, y4, y5, y6, y7);
dec2: dec3to8 port map(w3, w4, w5, y0, f(0), f(1), f(2), f(3), f(4), f(5), f(6), f(7));
dec3: dec3to8 port map(w3, w4, w5, y1, f(8), f(9), f(10), f(11), f(12), f(13), f(14), f(15));
dec4: dec3to8 port map(w3, w4, w5, y2, f(16), f(17), f(18), f(19), f(20), f(21), f(22), f(23));
dec5: dec3to8 port map(w3, w4, w5, y3, f(24), f(25), f(26), f(27), f(28), f(29), f(30), f(31));
dec6: dec3to8 port map(w3, w4, w5, y4, f(32), f(33), f(34), f(35), f(36), f(37), f(38), f(39));
dec7: dec3to8 port map(w3, w4, w5, y5, f(40), f(41), f(42), f(43), f(44), f(45), f(46), f(47));
dec8: dec3to8 port map(w3, w4, w5, y6, f(48), f(49), f(50), f(51), f(52), f(53), f(54), f(55));
dec9: dec3to8 port map(w3, w4, w5, y7, f(56), f(57), f(58), f(59), f(60), f(61), f(62), f(63));
end process;
end Structure;
答案 0 :(得分:1)
正如Morten指出实例化组件和组件声明之间的端口接口列表不匹配。
分析:
library ieee;
use ieee.std_logic_1164.all;
entity dec6to64 is
end entity;
architecture foo of dec6to64 is
signal w0,w1,w2, En: std_logic;
signal y0,y1, y2, y3, y4, y5, y6 ,y7: std_logic;
component dec3to8
port(
w0,w1,w2, En : in std_logic;
y0,y1, y2, y3, y4, y5, y6 ,y7 : out std_logic);
end component;
begin
dec1: dec3to8 port map(w0, w1, w2, En, y0, y1, y2, y3, y4, y5, y6, y7);
end architecture;
y0
已添加到组件声明中。
您的代码示例设置进行分析:
library ieee;
Use ieee.std_logic_1164.all;
entity dec6to64 is
port (w0,w1,w2,w3,w4,w5, En : in std_logic;
f : out std_logic_vector(63 downto 0));
end dec6to64;
Architecture Structure of dec6to64 is
signal y0,y1, y2, y3, y4, y5, y6 ,y7: std_logic; -- ADDED
component dec3to8
port(
w0,w1,w2, En : in std_logic;
y0,y1, y2, y3, y4, y5, y6 ,y7 : out std_logic);
end component;
Begin
-- process(w0, w1, w2, w3, w4, w5, En) component instantiations
-- Begin are concurrent statements
dec1: dec3to8 port map(w0, w1, w2, En, y0, y1, y2, y3, y4, y5, y6, y7);
dec2: dec3to8 port map(w3, w4, w5, y0, f(0), f(1), f(2), f(3), f(4), f(5), f(6), f(7));
dec3: dec3to8 port map(w3, w4, w5, y1, f(8), f(9), f(10), f(11), f(12), f(13), f(14), f(15));
dec4: dec3to8 port map(w3, w4, w5, y2, f(16), f(17), f(18), f(19), f(20), f(21), f(22), f(23));
dec5: dec3to8 port map(w3, w4, w5, y3, f(24), f(25), f(26), f(27), f(28), f(29), f(30), f(31));
dec6: dec3to8 port map(w3, w4, w5, y4, f(32), f(33), f(34), f(35), f(36), f(37), f(38), f(39));
dec7: dec3to8 port map(w3, w4, w5, y5, f(40), f(41), f(42), f(43), f(44), f(45), f(46), f(47));
dec8: dec3to8 port map(w3, w4, w5, y6, f(48), f(49), f(50), f(51), f(52), f(53), f(54), f(55));
dec9: dec3to8 port map(w3, w4, w5, y7, f(56), f(57), f(58), f(59), f(60), f(61), f(62), f(63));
-- end process;
end Structure;