时钟变低时更新数据-VHDL

时钟变低时更新数据-VHDL,vhdl,fpga,Vhdl,Fpga,我需要在时钟变低而不是下一个上升沿时设置输出数据,我修改了一个代码以这种方式工作,但我有以下警告: 寄存器上的时钟空绑定到常数 寄存器上的时钟与常数完全绑定 代码如下: elsif rising_edge(Clock) then if (Head = Tail) then if Looped then FullVar := '1';

我需要在时钟变低而不是下一个上升沿时设置输出数据,我修改了一个代码以这种方式工作,但我有以下警告:

寄存器上的时钟空绑定到常数 寄存器上的时钟与常数完全绑定

代码如下:

elsif rising_edge(Clock) then  
                if (Head = Tail) then
                    if Looped then
                        FullVar := '1';
                    else
                        EmptyVar := '1';
                    end if;
                else
                    EmptyVar := '0';
                    FullVar := '0';
                end if;
   else
      Full <= FullVar;
      Empty <= EmptyVar;
   end if;
end process;
elsif上升沿(时钟),然后
如果(头=尾),那么
如果循环那么
FullVar:=“1”;
其他的
EmptyVar:=“1”;
如果结束;
其他的
EmptyVar:=“0”;
FullVar:=“0”;
如果结束;
其他的

Full是的,您应该始终使用上升沿(时钟),除非您“真的”需要第二个时钟域。在您的情况下,不需要第二个时钟域

在您的示例中也没有理由使用变量。如果Head等于Tail,且上升沿前的Looped为“1”,则以下代码将在时钟上升沿后上升为空

check : process (Clock)
if rising_edge(Clock) then
    if Head = Tail then
        if Looped then
            Full <= '1';
        else
            Empty <= '1';
        end if;
    else
        Empty <= '0';
        Full <= '0';
    end if;
end if;
end process;
检查:进程(时钟)
如果上升沿(时钟),则
如果头=尾,那么
如果循环那么

完全使用下降沿。正如Brian提到的,
falling\u edge()
函数满足您的需要。请注意,这将有效地创建一个新的中时时钟域,延迟半个周期。在这些域之间的交叉点上,您将有更少的可用设置时间,并且需要在实际设计中考虑时间限制。不,这不是我的意思。例如,这是一个FIFO,它不是在FIFO变空时声明空标志,而是在下一个时钟时声明空标志。这样,当时钟在同一时钟周期的上升沿变空后变低时,空标志被断言。我想问的是,既然在我看来这不是一种标准编码,但这种编码是有效的,那么它是否会在长期运行中产生错误?
如果上升沿(时钟)那么
就不能有其他情况。它不可合成。
check : process (Clock)
if rising_edge(Clock) then
    if Head = Tail then
        if Looped then
            Full <= '1';
        else
            Empty <= '1';
        end if;
    else
        Empty <= '0';
        Full <= '0';
    end if;
end if;
end process;
check : process (Head,Tail,Looped)
Empty <= '0';
Full <= '0';
if Head = Tail then
    if Looped then
        Full <= '1';
    else
        Empty <= '1';
    end if;
end process;