收到错误:"Couldn't implement registers for assignments on this clock edge"



我在第28行和第40行不断收到错误。错误是";无法实现用于在该时钟边缘上分配的寄存器";有人能帮我吗?我是VHDL的新手,正在尝试在我的FPGA板上制作一个带有内部时钟的慢速计数器。

LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY part3 IS
port (Clear,CLOCK_50 : IN STD_LOGIC;
Y : OUT STD_LOGIC_VECTOR (7 downto 0));
END part3;
ARCHITECTURE Structural OF part3 IS
component Part1 is
PORT ( Enable,Clear,CLOCK_50: IN STD_LOGIC;
Q : OUT STD_LOGIC_VECTOR(3 DOWNTO 0));
end component;

component display_decoder is
port(X: IN STD_LOGIC_VECTOR(3 DOWNTO 0);
Y: OUT STD_LOGIC_VECTOR(7 DOWNTO 0));
end component;

Signal main_count,slow_count: STD_LOGIC_VECTOR(3 DOWNTO 0);
Signal enable: STD_LOGIC;

Begin

a : process(CLOCK_50) is
begin
if (rising_edge(CLOCK_50)) then --Line 28
enable <= '1';

else
enable <= '0';

end if;
end process a;
counter1: Part1 port map(enable,Clear,CLOCK_50,main_count);

b : process (CLOCK_50,main_count) is
begin
if (rising_edge(CLOCK_50) and main_count = "0000") then --Line 40
enable <= '1';
else
enable <= '0';
end if;
end process b;
counter2: Part1 port map(enable,Clear,CLOCK_50,slow_count);

display_hex : display_decoder port map(slow_count,y); 
end structural;

寄存器仅在时钟的上升沿将数据从D引脚传输到Q。在您的代码中,您的代码需要在时钟边缘将enable设置为"1",理论上在无限窄的时间点将其设置为"0"。事实上,这是不可能的。你应该只在时钟边缘改变信号,也许还可以重置。

此外,您不能分配来自多个进程的信号。假设enable是一条线,并且每个进程都试图仅驱动该线的信号。当它们同时尝试驱动不同的信号时会发生什么?

最新更新