FIFO error: can't find control signal - VHDL

FIFO error: can't find control signal - VHDL

我找到了一个 VHDL FIFO 代码并尝试修改它以使用两种不同的时钟,一个用于写入,一个用于读取。 我已经尝试了代码并且似乎在模拟中工作,但是当我尝试合成它时我得到了这个错误:

"Can't find control signal for Full"

library IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;

entity FIFO is
    Generic (
        constant DATA_WIDTH  : positive := 8;
        constant FIFO_DEPTH : positive := 100
    );
    Port ( 
        WCLOCK      : in  STD_LOGIC;
        RCLOCK      : in  STD_LOGIC;
        WriteEn : in  STD_LOGIC;
        DataIn  : in  STD_LOGIC_VECTOR (DATA_WIDTH - 1 downto 0);
        ReadEn  : in  STD_LOGIC;
        DataOut : out STD_LOGIC_VECTOR (DATA_WIDTH - 1 downto 0);
        Empty   : out STD_LOGIC;
        Full    : out STD_LOGIC;
        ModuleRESET : in STD_LOGIC
    );
end FIFO;

architecture FIFO_archi of FIFO is
    type FIFO_Memory is array (0 to FIFO_DEPTH - 1) of STD_LOGIC_VECTOR (DATA_WIDTH - 1 downto 0);
    signal Memory : FIFO_Memory;
    signal Head : natural range 0 to FIFO_DEPTH - 1;
    signal Tail : natural range 0 to FIFO_DEPTH - 1;


    begin
         -- Memory Pointer Process
        process (WCLOCK, RCLOCK, ModuleRESET)
            variable Looped : boolean;
        begin
            if ModuleRESET = '0' then
                Head <= 0;
                Tail <= 0;
                Looped := false;
                Full  <= '0';
                Empty <= '1';
                DataOut <= (others => '0');
            elsif ReadEn = '1' then
                if rising_edge(RCLOCK) then                    
                    if ((Looped = true) or (Head /= Tail)) then
                        -- Update data output
                        DataOut <= Memory(Tail);

                        -- Update Tail pointer as needed
                        if (Tail = FIFO_DEPTH - 1) then
                            Tail <= 0;
                            Looped := false;
                            else
                                Tail <= Tail + 1;
                            end if;
                        end if;
                    end if;
                -- Update Empty and Full flags
                if (Head = Tail) then
                    if Looped then
                        Full <= '1';
                        else
                            Empty <= '1';
                        end if;
                    else
                        Empty   <= '0';
                        Full    <= '0';
                end if;
            elsif WriteEn = '1' then
                if rising_edge(WCLOCK) then   
                        if ((Looped = false) or (Head /= Tail)) then
                            -- Write Data to Memory
                            Memory(Head) <= DataIn;

                            -- Increment Head pointer as needed
                            if (Head = FIFO_DEPTH - 1) then
                                Head <= 0;
                                Looped := true;
                            else
                                Head <= Head + 1;
                            end if;
                        end if;
                -- Update Empty and Full flags
                if (Head = Tail) then
                    if Looped then
                        Full <= '1';
                        else
                            Empty <= '1';
                        end if;
                    else
                        Empty   <= '0';
                        Full    <= '0';
                end if;
                end if;
            end if;
        end process;

end FIFO_archi;

如何解决这个错误?

无论使用何种工具集,推断具有用于读写的单个时钟的 FIFO 通常都很简单。推断具有用于读取和写入的单独时钟的 FIFO 可能很棘手,具体取决于您的目标硬件和用于合成 HDL 的工具。

首先检查综合工具的手册/用户指南,以确保它支持使用单独的 read/write 时钟推断 FIFO。如果是这样,它可能会建议一个受支持的 HDL 行为描述,您应该按照该描述为您的代码建模。

经常有一个问题是用具有两个时钟的单个进程来描述 FIFO。通常这样做会推断出一个对两个时钟敏感的寄存器——硬件不支持,因此会导致错误。没有更多关于工具的具体信息,更具体的答案将是猜测。

尝试将单个时钟FIFO修改为时钟域交叉FIFO绝非易事。他们是两种截然不同的野兽。

我试图绘制一个可能最简单的时钟域交叉 FIFO 设计的框图。请原谅我徒手绘画技巧的粗糙。我的例子是一个16字节的FIFO,但是可以扩展到任意深度和宽度,只要深度是2的幂即可。

我使用蓝色标记突出显示必须应用供应商特定属性以防止综合优化的所有信号。

没有捷径。如果您想创建自己的跨 FIFO 时钟域,那么这个框图代表了您必须做的最低限度。