我需要有人检查我的代码并给我一个健全性检查。这是用 VHDL 编写的。Vivado 不断抱怨错误:
[Synth 8-493] 没有这样的设计单元 'onesevenseg'
但是,我可以清楚地看到我的项目中的文件,并且项目管理器源窗口正在以正确的方式列出文件。
这是发生错误的行。
digitOne: entity xil_defaultlib.oneSevenSeg port map (switchIn, sevenSegOut);
这是有错误的顶级文件。它被编译到库xil_defaultlib
中。
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity oneSevenSegTop is
Port ( anodeOut : out STD_LOGIC_VECTOR (0 to 7);
switchIn : in STD_LOGIC_VECTOR (0 to 3);
sevenSegOut : out STD_LOGIC_VECTOR (0 to 6));
end oneSevenSegTop;
architecture Behavioral of oneSevenSegTop is
component oneSevenSeg
Port ( digitIn : in STD_LOGIC_VECTOR (0 to 3);
segOut : out STD_LOGIC_VECTOR (0 to 6));
end component;
begin
digitOne: entity xil_defaultlib.oneSevenSeg port map (switchIn, sevenSegOut);
anodeOut <= "00000001";
end Behavioral;
这是由上述文件实例化的文件,也编译到库xil_defaultlib
中。
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity oneSevenSeg is
Port ( digitIn : in STD_LOGIC_VECTOR (0 to 3);
segOut : out STD_LOGIC_VECTOR (0 to 6));
end oneSevenSeg;
architecture Behavioral of oneSevenSeg is
begin
process(digitIn)
begin
if digitIn = "0000" then --0
segOut <= "1000000";
elsif digitIn = "0001" then --1
segOut <= "1111001";
elsif digitIn = "0010" then --2
segOut <= "0100100";
elsif digitIn = "0011" then --3
segOut <= "0110000";
elsif digitIn = "0100" then --4
segOut <= "0011001";
elsif digitIn = "0101" then --5
segOut <= "0010010";
elsif digitIn = "0110" then --6
segOut <= "0000010";
elsif digitIn = "0111" then --7
segOut <= "1111000";
elsif digitIn = "1000" then --8
segOut <= "0000000";
elsif digitIn = "1001" then --9
segOut <= "0011000";
else -- error
segOut <= "0110110";
end if;
end process;
end Behavioral;