LoginSignup
1
1

More than 5 years have passed since last update.

VHDL入門 > CLK生成

Last updated at Posted at 2016-05-26

参考: VHDLによるFPGA設計 & デバッグ by 松村謙 & 坂巻 佳壽美

実装

  • 10nsごとにH,Lを切替えるCLKの生成
  • 100nsで停止する

code

上記の本の情報を元に、自分なりに考えてみた。

design.vhd
library IEEE;
use IEEE.std_logic_1164.all;

entity CLOCK is
port ( CLK: in std_logic);
end CLOCK;

architecture RTL of CLOCK is
begin
end;
testbench.vhd
library IEEE;
use IEEE.std_logic_1164.all;

entity testbench is
end testbench;

architecture SIM of testbench is
    signal I_CLK : std_logic := '1';
component CLOCK
    port ( CLK: in std_logic);
end component;

begin
    process begin
        I_CLK <= '1';
        wait for 10 ns;
        I_CLK <= '0';
        wait for 10 ns;
    end process;

    process begin
        wait for 100 ns;
        -- to end the testbench
        assert false
        report "end." severity FAILURE;
    end process;

    U1: CLOCK port map(CLK => I_CLK);
end SIM;

testbenchの1つめのprocess beginでCLKを生成しつつ、2つめのprocess beginでシミュレーションを停止する時間を100nsとしている。

結果

qiita.png

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1