这个设计有什么问题

时间:2013-05-22 20:27:06

标签: vhdl

我有一些VHDL代码在合成时表现得很奇怪,但我怀疑这是我对VHDL合成的基本理解是错误的。

“同步”是一个短脉冲(大约半个clk周期),它在clk上升沿上很高,但在变为低电平后不久。在综合期间,当同步为高电平时,只有一些信号分配在clk上升沿分配。

同步是否需要在最短时间内保持高水平?

process(clk)
begin
if rising_edge(clk) then
   if sync = '1' then
      a <= '1';
      y3 <= y2;
      y2 <= y1;
      y1 <= y0; 
   end if;
end if;
...

只有“a”在合成时才会更新其值......

1 个答案:

答案 0 :(得分:4)

我只能猜测,因为你没有展示整个过程。

直到运行进程后才会更新信号。因此,如果您使用信号作为中间变量,其他信号将不会按预期更新。

if a is a signal which has value 1 before the process.
process(clk)
     ...
     a <= '0'
     a still has value 1 here
     ....
end process
a's value is now updated to 0
相关问题