错误:COMP96_0078:D_FF_tb.vhd:(23,15):未知标识符“d_flip_flop”。
错误:COMP96_0056:D_FF_tb.vhd:(23,15):找不到引用的实体声明“d_flip_flop”。
错误:COMP96_0055:D_FF_tb.vhd:(23,15):找不到引用的上下文元素“d_flip_flop”。
这是我的源代码:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.numeric_std.all;
entity d_flipflop is
port(
d_in : in STD_LOGIC;
q_out: out STD_LOGIC;
qbar_out: out STD_LOGIC;
clock : in STD_LOGIC;
reset : in STD_LOGIC
);
end d_flipflop;
architecture behavioral of d_flipflop is
begin
process (clock) is
begin
if rising_edge(clock) then
if(reset = '1') then
q_out <= '0';
qbar_out <= '1';
else
q_out <= d_in;
qbar_out <= not d_in;
end if;
end if;
end process;
end architecture behavioral;
这是我的Testbench:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.numeric_std.all;
entity d_flipflop_tb is
end d_flipflop_tb;
architecture tb_architecture of d_flipflop_tb is
-- Stimulus Signals--
signal d_tb : std_logic;
signal q_tb : std_logic;
signal qbar_tb: std_logic;
signal reset_tb: std_logic;
signal clock_tb: std_logic := '0';
signal end_sim : boolean := false;
constant half_period : time := 5 ns;
begin
UUT: entity d_flip_flop
port map(
d_tb => d_in,
q_tb => q_out,
qbar_tb => qbar_out,
reset_tb => reset,
clock_tb => clock
);
clock: process
begin
while end_sim = false loop
clock_tb <= not clock_tb;
wait for half_period;
end loop;
wait;
end process;
stim: process
begin
-- Initialize
d_tb <= '0';
reset_tb <= '1';
--Wait for 1 period
wait for half_period*2;
reset_tb <= '0';
--Provide stimulus
for i in 0 to 5 loop
d_tb <= not d_tb;
wait for half_period;
end loop;
end_sim <= true;
wait;
end process;
--end process;
end tb_architecture;
这不是我第一次使用VHDL工作,我只是试图了解一些基本原理并且我正在查看我之前编写的代码并且他们当时都工作正常(现在还没有尝试过更新的代码) aldec的版本)但我不确定我缺少什么。
我找到this,但我真的无法从中获得任何有用的东西。它让我更加困惑的是它是否是工具的错误。