我对架构中声明的信号何时必须插入进程的敏感度列表感到困惑。
是否有任何情况下都可以遵循的一般法则?
当我必须将信号包含在过程敏感度列表中时,我确实很难理解。
最佳答案
“一般法则”是这样的
<小时/>anything that your process needs to know about changes of needs to be in the sensitivity list.
对于具有同步复位的典型可综合寄存器:
process (clk) is
begin
if rising_edge(clk) then
if reset = '1' then
-- do reset things
else
-- read some signals, assign some outputs
end if;
end if;
end process;
只有时钟需要出现在列表中,因为只有当时钟发生变化时才查看其他所有内容(由于 if Riding_edge(clk)
语句。
如果您需要异步重置:
process (clk, reset) is
begin
if reset = '1' then
-- do reset things
elsif rising_edge(clk) then
-- read some signals, assign some outputs
end if;
end process;
那么 reset
信号也必须位于敏感度列表中,因为您的设计需要在每次更改时检查它的值,无论时钟在做什么。
对于组合逻辑,我完全避免使用进程,因为保持敏感列表最新会出现问题,并且模拟的行为可能与合成代码不同。 VHDL-2008 中的 all
关键字已经缓解了这个问题,但我仍然没有发现自己想要编写长而复杂的组合逻辑,这样一个过程会有所帮助。
关于process - 何时必须将信号插入进程的敏感列表中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8991223/