|
Article on other languages:
|
VHDL(VHSIC Hardware Description Language)は、デジタル回路設計用の、ハードウェア記述言語(HDL)の一種である。EDA分野における標準の一つとしてFPGAやASICなどの設計で使われる。
歴史米国国防総省は、業者の納品する機器で含むASICの動作の文書記述のためにVHDLを開発した。すなわち、分厚く複雑になりがちな紙のマニュアルの代替を目指したのが始まりである。 VHDLの文法はプログラム言語のALGOLおよびその直系である、Pascal、Adaに似せた設計であるため、VHDLも大文字、小文字の区別をしない。 この文書作成用言語で書いた仕様がそのまま実行できたら便利であろうとのアイデアにより、論理(シミュレータ)を実現した。さらにゲートレベルの回路を生成する論理合成ツール(ソフトウェア)を開発した。最新の合成ツールを用いれば、同じVHDL記述から設計者の指定する条件で別の回路を合成することもできる。費用を優先するか、性能を優先するか、その他各種の複合条件を指定して生成することができる。 ただしこれは同様のHDLであるVerilogでも可能なことであり、VHDLの特質というよりは合成ツールの機能による。 VHDLの最初のバージョンはIEEE 1076-1987として規格化した。整数、実数、論理値、文字、時間およびそれらの配列としてbit_vectorやstring(文字列)など広範囲なデータ型を用意している。 しかしこのバージョンでは多値論理を定義していない。信号のドライブ能力や不定値を考慮した9値のstd_logicを定め、IEEE 1164として規格化した。 コード例ここではVHDL-93に準拠したコードを示す。 Hello WorldHello 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; シミュレーションを行うと |
This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.
Mercedes Car
This site monitored by SitePinger.net