【发布时间】:2016-01-04 07:11:18
【问题描述】:
我不知道如何准确地描述它,但也许是这样的?
void monitor_thread(void)
{
for(;;){
if (data==10){
data=0;
data2++;
}
}
}
对我来说,我会在 VHDL 中这样实现:
signal data,data2:std_logic_vector(3 downto 0);
...
process(data)
begin
case data is:
when "0101" => data2<=data2+1;
when others =>
end case;
end process;
但是在 quartus II 中编译时会出现警告。我认为这不是正确的方法。有什么建议吗?
警告:
Warning (10492): VHDL Process Statement warning at xxx: signal "data2" is read inside the Process Statement but isn't in the Process Statement's sensitivity list
Warning (10631): VHDL Process Statement warning at xxx: inferring latch(es) for signal or variable "data", which holds its previous value in one or more paths through the process
【问题讨论】:
-
恐怕,完全不清楚您要达到的目标,
-
如果敏感度列表中没有
data2,您将在data2上创建锁存器,并使用从data上的值派生的启用。取决于即使注册了data也可能不安全的布局和布线——您可以在data上的其他值之间增加data2。看来您应该使用时钟进程。和尤金·什一样。请注意,您没有提供Minimal, Complete, and Verifiable example,从而清楚地说明了所有这些以制定您可以使用的解决方案。 -
@EugeneSh。我正在尝试为数据创建一个监视器,当信号变为某个值时,它将强制信号变为一个新值。当计数器达到 10 时,类似于异步清除信号。