首页 文章

这个设计有什么问题

提问于
浏览
1

我有一些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 回答

  • 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
    

相关问题