IEEE 1076

del.icio.us del.icio.us
Digg Digg
Furl Furl
Reddit Reddit
Rojo Rojo
Add to OnlyWire

VHDL(VHSIC Hardware Description Language)は、デジタル回路設計用の、ハードウェア記述言語(HDL)の一種である。EDA分野における標準の一つとしてFPGAASICなどの設計で使うハードウェアのプログラミング言語である。

目次

歴史

米国国防総省は、業者の納品する機器で含むASICの動作の文書記述のためにVHDLを開発した。すなわち、分厚く複雑になりがちな紙の手引き(マニュアル)の代替を目指したのが始まりである。

VHDLの文法はプログラム言語のALGOLおよびその直系である、PascalAdaに似た設計である。昔のコンピュータまたは通信路では大文字、小文字の区別をしないものがあったため、VHDLも大文字、小文字の区別をしない。

この文書作成用言語で書いた仕様がそのまま実行できたら便利であろうとの考え(アイデア)により、論理模擬実験(シミュレータ)を実現した。さらにゲートレベルの回路を生成する論理合成を開発した。最新の合成ツールを用いれば、同じVHDL記述から設計者の指定する条件で別の回路を合成することもできる。費用を優先するか、性能を優先するか、その他各種の複合条件を指定して生成することができる。 ただしこれは同様のHDLであるVerilogでも可能なことであり、VHDLの特質というよりは道具(ツール)の機能による。

VHDLの最初の版(バージョン)はIEEE 1076-1987として規格化した。整数実数、論理値、文字、時間およびそれらの配列としてbit_vectorstring(文字列)など広範囲なデータ型を用意している。

しかしこの版では多値論理を定義していない。信号のドライブ能力や不定値を考慮した9値のstd_logicを定め、IEEE 1164として規格化した。

コード例

ここではVHDL-93に準拠したコードを示す。

Hello World

Hello Worldプログラム例:

--  VHDL example programme: hello.vhd
 
use std.textio.all;
 
entity hello is
end entity hello;
 
architecture Wiki of hello is
 
    constant message : string := "hello world";
 
begin
 
    process is
        variable L: line;
    begin
        write(L, message);
        writeline(output, L);
        wait;
    end process;
 
end architecture Wiki;

メッセージはシミュレータのデフォルト出力ウインドウに出力される。

フィボナッチ数列

次の例はもう少し実用的なものである:

--  Fib.vhd
--
--  Fibonacci number sequence generator
 
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
 
entity Fibonacci is
port
(
    Reset       : in    std_logic;
    Clock       : in    std_logic;
    Number      : out   unsigned(31 downto 0)
);
end entity Fibonacci;
 
architecture Rcingham of Fibonacci is
 
    signal  Previous    : natural;
    signal  Current     : natural;
    signal  Next_Fib    : natural;
 
begin
 
    Adder:
    Next_Fib <= Current + Previous;
 
    Registers:
    process (Clock, Reset) is
    begin
        if Reset = '1' then
            Previous <= 1;
            Current  <= 1;
        elsif Clock'event and Clock = '1' then
            Previous <= Current;
            Current  <= Next_Fib;
        end if;
    end process Registers;
 
    Number <= to_unsigned(Previous, 32);
 
end architecture Rcingham;

シミュレーションを行うとNext_Fibがオーバーフローするまで、フィボナッチ数列を生成する。

This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.


Giant Panda

Mercedes Car
James Bond Guide
This site monitored by SitePinger.net