VHDL中的D触发器

VHDL中的D触发器,vhdl,sequential,flip-flop,Vhdl,Sequential,Flip Flop,我正在尝试用VHDL实现一个D触发器,使用我编写的D锁存器。 但时钟似乎有点错误,我不知道那是什么 这是我的D闩锁的代码 Library ieee; Use ieee.std_logic_1164.all; entity d_latch is port (c,d : in std_logic; q,nq : out std_logic); end d_latch; architecture arch of d_latch is Signal qt, nqt: std_l

我正在尝试用VHDL实现一个D触发器,使用我编写的D锁存器。 但时钟似乎有点错误,我不知道那是什么

这是我的D闩锁的代码

Library ieee;
Use ieee.std_logic_1164.all;

entity d_latch is
  port (c,d : in std_logic;
        q,nq : out std_logic);
end d_latch;

architecture arch of d_latch is

Signal qt, nqt: std_logic;

begin  

  qt <= (d nand c) nand nqt;
  nqt <= ((not d) nand c) nand qt;

  q <= qt;
  nq <= nqt;

end arch;
下面是错误:

** Error: /home/devplayer/CSC343/Lab_2_Content/d_flipflop.vhd(25): (vcom-1436) Use of non globally static actual (prefix expression) of formal "clk" requires VHDL 2008.

谢谢

您不能在端口分配中使用完整表达式。将时钟分配给dl1实例的端口时,不要反转时钟,而是创建一个反转时钟并使用它:

clockn <= not clock;

dl1: d_latch port map (
  d => d,
  clk => clockn,
  q => qt
);
clockn d,
时钟=>时钟,
q=>qt
);
clockn <= not clock;

dl1: d_latch port map (
  d => d,
  clk => clockn,
  q => qt
);