<var id="fnfpo"><source id="fnfpo"></source></var>
<rp id="fnfpo"></rp>

<em id="fnfpo"><object id="fnfpo"><input id="fnfpo"></input></object></em>
<em id="fnfpo"><acronym id="fnfpo"></acronym></em>
  • <th id="fnfpo"><track id="fnfpo"></track></th>
  • <progress id="fnfpo"><track id="fnfpo"></track></progress>
  • <tbody id="fnfpo"><pre id="fnfpo"></pre></tbody>

  • x
    x
    查看: 25463|回復: 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 (26.96 KB)

    1.jpg

    2.jpg (68.79 KB)

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

    本版積分規則

    關于我們  -  服務條款  -  使用指南  -  站點地圖  -  友情鏈接  -  聯系我們
    電子工程網 © 版權所有   京ICP備16069177號 | 京公網安備11010502021702
    快速回復 返回頂部 返回列表
    精品一区二区三区自拍图片区_国产成人亚洲精品_亚洲Va欧美va国产综合888_久久亚洲国产精品五月天婷