VHDL书写的testbench
时间:10-02
整理:3721RD
点击:
出现一个问题,Modelsim仿真的图像没有反应,一直都没有数值,请教是什么问题?
附上源程序,请各位前辈赐教,谢谢!
1)这是VHDL文件:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY DFF1 IS
PORT(CLK:IN STD_LOGIC;
D:IN STD_LOGIC;
Q:OUT STD_LOGIC);
END ENTITY DFF1;
ARCHITECTURE bhv OF DFF1 IS
SIGNAL Q1:STD_LOGIC;
BEGIN
PROCESS(CLK,Q1)
BEGIN
IF CLK'EVENT AND CLK='1'
THEN Q1<=D;
END IF;
END PROCESS;
Q<=Q1;
END bhv;
2)这是VHDL testbench:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY DFF1_vhd_tst IS
END DFF1_vhd_tst;
ARCHITECTURE DFF1_arch OF DFF1_vhd_tst IS
CONSTANT period:TIME:=80 ns;
SIGNAL CLK : STD_LOGIC:='0';
SIGNAL D : STD_LOGIC;
SIGNAL Q : STD_LOGIC;
COMPONENT DFF1
PORT (
CLK : IN STD_LOGIC;
D : IN STD_LOGIC;
Q : BUFFER STD_LOGIC
);
END COMPONENT;
BEGIN
clock_gen:PROCESS(CLK)
BEGIN
CLK<=not CLK AFTER period/2;
END PROCESS;
CLK<='0','1' AFTER 60 ns,'0' AFTER 120 ns;
D<='0','1'AFTER 120 ns;
Q<='1','0'AFTER 120 ns;
END DFF1_arch;
Modelsim需要进行什么设置吗