以下这段代码,信号位宽为20BIT,不管是在用ISM还是用MODELSIM仿真都得不到延时一拍的结果,请问大家这上为什么。谢谢
PROCESS(rstN,vclk)
BEGIN
IF rstN = '0' THEN
Video_out <=(OTHERS => '0');
ELSIF vclk'EVENT AND vclk = '1' THEN
Video_out <= Video_in;
END IF;
END PROCESS;
entity Active_video_detect20140922 is
Port (
RstN_in : IN STD_LOGIC;
VCLK_in : IN STD_LOGIC;
Video_in : IN STD_LOGIC_VECTOR(19 DOWNTO 0);
Video_out : OUT STD_LOGIC_VECTOR(19 DOWNTO 0)
);
end Active_video_detect20140922;
architecture Behavioral of Active_video_detect20140922 is
SIGNAL rstN : STD_LOGIC;
SIGNAL vclk : STD_LOGIC;
begin
rstN <= RstN_in;
vclk <= VCLK_in;
PROCESS(rstN,vclk)
BEGIN
IF rstN = '0' THEN
Video_out <= (OTHERS => '0');
ELSIF vclk'EVENT AND vclk = '1' THEN
Video_out <= Video_in;
END IF;
END PROCESS;
D:\1.jpg
TB代码
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--USE ieee.numeric_std.ALL;
ENTITY gg IS
END gg;
ARCHITECTURE behavior OF gg IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT Active_video_detect20140922
PORT(
RstN_in : IN std_logic;
VCLK_in : IN std_logic;
Video_in : IN std_logic_vector(19 downto 0);
Video_out : OUT std_logic_vector(19 downto 0)
);
END COMPONENT;
--Inputs
signal RstN_in : std_logic := '0';
signal VCLK_in : std_logic := '0';
signal Video_in : std_logic_vector(19 downto 0) := (others => '0');
--Outputs
signal Video_out : std_logic_vector(19 downto 0);
-- No clocks detected in port list. Replace <clock> below with
-- appropriate port name
constant VCLK_in_period : time := 10 ns;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: Active_video_detect20140922 PORT MAP (
RstN_in => RstN_in,
VCLK_in => VCLK_in,
Video_in => Video_in,
Video_out => Video_out
);
-- Clock process definitions
VCLK_in_process :process
begin
VCLK_in <= '0';
wait for VCLK_in_period/2;
VCLK_in <= '1';
wait for VCLK_in_period/2;
end process;
-- Stimulus process
stim_proc: process
begin
RstN_in <= '0';
wait for 100 ns;
RstN_in <= '1';
-- wait for <clock>_period*10;
-- insert stimulus here
wait;
end process;
process(RstN_in,VCLK_in)
begin
if RstN_in = '0' then
Video_in <= (others => '0');
elsif VCLK_in'event and VCLK_in = '1' then
Video_in <= Video_in + '1';
end if;
end process;