查看: 23740|回复: 0

[提问] 请问 我的ISE工程 生成了TESTBENCH文件 用modelsim仿真的时候 只能出来一个周期

[复制链接]
发表于 2017-11-13 20:44:40 | 显示全部楼层 |阅读模式
我ISE的工程 生成了TESTBENCH文件 用modelsim仿真的时候 只能出来一个周期 不知道是代码的问题还是设置的问题 下面附上工程代码和tb代码
library ieee;
use ieee.std_logic_1164.all;
entity div10 is
      generic(n:integer :=10);
      port (clk:in std_logic;
              qut std_logic);
end div10;
architecture behave of div10 is
   signal count :integer range n-1 downto 0:=n-1;
begin
    process(clk)
    begin
        if (clk'event and clk='1' and clk'last_value ='0') then
          count<=count-1;
           if count>= n/2 then
               q<='0';
            else
               q<='1';
            end if;
            if count<=0 then
              count<=n-1;
            end if;
          end if;
       end process;
end behave;



ENTITY tb_div10 IS
END tb_div10;

ARCHITECTURE behavior OF tb_div10 IS

    -- Component Declaration for the Unit Under Test (UUT)

    COMPONENT div10
    PORT(
         clk : IN  std_logic;
         q : OUT  std_logic
        );
    END COMPONENT;


   --Inputs
   signal clk : std_logic := '0';

        --Outputs
   signal q : std_logic;

   -- Clock period definitions
   constant clk_period : time := 10 ns;

BEGIN

        -- Instantiate the Unit Under Test (UUT)
   uut: div10 PORT MAP (
          clk => clk,
          q => q
        );

   -- Clock process definitions
   clk_process :process
   begin
                clk <= '0';
                wait for clk_period/2;
                clk <= '1';
                wait for clk_period/2;
   end process;


   -- Stimulus process
   stim_proc: process
   begin               
      -- hold reset state for 100 ns.
      wait for 100 ns;       

      wait for clk_period*10;

      -- insert stimulus here

      wait;
   end process;

END;

1.jpg
2.jpg
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关于我们  -  服务条款  -  使用指南  -  站点地图  -  友情链接  -  联系我们
电子工程网 © 版权所有   京ICP备16069177号 | 京公网安备11010502021702
快速回复 返回顶部 返回列表