块语句中是否不支持受保护的信号?

Are guarded signals unsupported in block statement?

我在这行代码中有 4 个错误:

architecture guard of FlipFlop is
begin
    bb: block(clk='1' and not clk'stable) is   -- errorHDLParsers:1074 Guarded signal unsupported in block statement.
    begin
        Q <= guarded D after tpl;     -- errorHDLParsers:1024 Guarded unsupported in signal assignment.
        Qb <= guarded not D after tph;  -- errorHDLParsers:1024 Guarded unsupported in signal assignment.
    end block bb;
end guard;

architecture guard2 of FlipFlop is
begin
    bb: block(clk='1' and not clk'stable) is  -- errorHDLParsers:1074 Guarded signal unsupported in block statement.
    begin
        Q <= D after tpl;
        Qb <= not D after tph;
    end block bb;
end guard2;

为什么我不能定义带有保护信号的块?

看来你的综合工具不支持这个VHDL语句。我已经检查了第一个架构 guard 与 Quartus-II 13.1 网络版的集成合成器 Windows 并且它在这里工作。综合工具仅提供 VHDL 语言的一个子集并不罕见。

我更喜欢使用时钟进程:

process(clk)
begin
  if rising_edge(clk) then
    Q <= D;
    Qb <= not D;
  end if;
end process;

信号QQb在进程完成后获得新值。因此,分配使用时钟上升沿之前的 D 的值。

请注意,我省略了 after xy 延迟。实际时序由 FPGA 内置的触发器定义。因此,指定的延迟会被综合工具忽略。仅用于RTL仿真。

编辑:第二种架构guard2没有描述触发器,因为块的保护条件只控制guarded信号分配。因此代码等同于:

Q <= D;      -- after tpl
Qb <= not D; -- after tph