查看: 25451|回復: 0
打印 上一主題 下一主題

[提問(wèn)] 請問(wèn) 我的ISE工程 生成了TESTBENCH文件 用modelsim仿真的時(shí)候 只能出來(lái)一個(gè)周期

[復制鏈接]
跳轉到指定樓層
樓主
發(fā)表于 2017-11-13 20:44:40 | 只看該作者 |只看大圖 回帖獎勵 |倒序瀏覽 |閱讀模式
我ISE的工程 生成了TESTBENCH文件 用modelsim仿真的時(shí)候 只能出來(lái)一個(gè)周期 不知道是代碼的問(wèn)題還是設置的問(wèn)題 下面附上工程代碼和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 (26.96 KB)

1.jpg

2.jpg (68.79 KB)

2.jpg
您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

關(guān)于我們  -  服務(wù)條款  -  使用指南  -  站點(diǎn)地圖  -  友情鏈接  -  聯(lián)系我們
電子工程網(wǎng) © 版權所有   京ICP備16069177號 | 京公網(wǎng)安備11010502021702
快速回復 返回頂部 返回列表
午夜高清国产拍精品福利|亚洲色精品88色婷婷七月丁香|91久久精品无码一区|99久久国语露脸精品|动漫卡通亚洲综合专区48页