3

GHDL を使用して Xilinx GTXE2 トランシーバーをシミュレートしようとしています。GTXE2_CHANNEL.vhd で、「std_logic_arith」がライブラリ「ieee」に見つからないというエラーが発生しました。

まず、私のマシンのセットアップは次のとおりです。

  • Windows 7 (プロ、x64、ドイツ語)
    • パワーシェル 4.0
    • パイソン3.4
  • ザイリンクス ISE 14.7 (x64、英語)
  • ザイリンクス Vivado 2014.2 (x64、英語)
  • Windows 用 GHDL 0.31 ( http://sourceforge.net/projects/ghdl-updates/ )

質問 1:このパッケージは GHDL に含まれていますか?

VHDL 標準を VHDL-2008 に変更しようとしました--std=08が、このオプションは ghdl で認識されないため、現在 VHDL-2002 でコンパイルしています。しかし、何も変わりませんでした。

また、ザイリンクスの vhdl ソース フォルダーから手動で IEEE ソースを含めようとしましたC:\Xilinx\14.7\ISE_DS \ISE\vhdl\src\ieee。しかし、std_logic_arithをコンパイルすると、通常は見つかるstd_logic_1164が見つからないというエラーが表示されます。これに加えて、std_logic_1164の FOREIGN 属性に問題があります。

したがって、これは私のファイル リスト/コンパイル順序です (ザイリンクスの *.prj ファイルの修正バージョン)。

# board and device configuration
#vhdl poc       "tb/common/my_config_KC705.vhdl"

# IEEE packages
#xilinx ieee    "ieee/std_logic_1164.vhd"
#xilinx ieee    "ieee/std_logic_arith.vhd"

# Xilinx Packages and Primitives
xilinx unisim   "unisims/unisim_VCOMP.vhd"
xilinx unisim   "unisims/unisim_VPKG.vhd"
xilinx work     "unisims/primitive/FD.vhd"
xilinx work     "unisims/primitive/BUFG.vhd"
xilinx work     "unisims/primitive/BUFR.vhd"
xilinx work     "unisims/secureip/GTXE2_CHANNEL.vhd"

このリストは、一時ディレクトリで実行された GHDL コマンドに変換されます。

C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe -a --std=02 -P. --work=poc "D:\VHDL\git\SATAController\lib\PoC\tb\common\my_config_KC705.vhdl"
GHDL Messages:
  D:\VHDL\git\SATAController\lib\PoC\tb\common\my_config_KC705.vhdl:52:14:warning: package "my_config" does not require a body
C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe -a --std=02 -P. --work=unisim "C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\unisim_VCOMP.vhd"
C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe -a --std=02 -P. --work=unisim "C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\unisim_VPKG.vhd"
C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe -a --std=02 -P. --work=work "C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\primitive\FD.vhd"
C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe -a --std=02 -P. --work=work "C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\primitive\BUFG.vhd"
C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe -a --std=02 -P. --work=work "C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\primitive\BUFR.vhd"
C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe -a --std=02 -P. --work=work "C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\secureip\GTXE2_CHANNEL.vhd"
GHDL Messages:
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\secureip\GTXE2_CHANNEL.vhd:34:10: primary unit "std_logic_arith" not found in library "ieee"

最後に、 ieee.std_logic_1164の FOREIGN 属性エラー:

PS D:\VHDL\git\SATAController\lib\PoC\temp\ghdl> & 'C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe' -a --std=02 '-P.' --work=ieee 'C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd'
GHDL Messages:
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:211:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:212:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:213:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:214:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:215:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:216:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:218:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:219:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:220:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:221:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:223:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:224:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:225:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:227:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:228:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:229:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:231:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:232:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:233:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:235:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:236:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
  C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:238:15: 'FOREIGN allowed only for architectures and subprograms

質問 2: ieee.std_logic_1164 をコンパイルするにはどうすればよいですか?

GHDL 環境がインストールされている人なら誰でもこの例をテストできます。ザイリンクス ライブラリでは my_config_KC705.vhdl は必要ありません。


これの目的は何ですか?

  • iSim シミュレーションは非常に遅い -> 約 15 ns シミュレーション時間は 1 秒の CPU 時間で計算されます。100 us -> 40 分の待ち時間
  • iSim は約 2.6 GiB のメイン メモリを使用します - GHDL の方が倹約的かもしれません
  • xSim は VHDL ライブラリに不満を持っているため、iSim は現在の選択肢 #1 です。
  • 以前、ザイリンクス プリミティブを使用して GHDL をテストしたところ、うまくいきました。次の課題は、secureip コンポーネントをシミュレートすることです :)
  • 十分な時間があれば、QuestaSim も試してみます
4

1 に答える 1

6

はい、このパッケージはghdlに含まれています

ghdl マニュアルまたはマニュアル ページでは、分析および詳細なコマンドのコマンド ライン オプションとして--ieee=synopsys またはを選択できることがわかります。--ieee=mentor

ライブラリ ディレクトリを調べます。

david_koontz@Macbook: ls /opt/ghdl/ghdl_mcode/libraries/synopsys
std_logic_arith.vhdl      std_logic_misc.vhdl       std_logic_textio.vhdl
std_logic_misc-body.vhdl  std_logic_signed.vhdl     std_logic_unsigned.vhdl

david_koontz@Macbook: ls /opt/ghdl/ghdl_mcode/libraries/mentor
std_logic_arith.vhdl       std_logic_arith_body.vhdl

package が見つかりますstd_logic_arith

-fexplicit競合する宣言があるため、分析および精緻化中にコマンド ライン オプションも使用する必要があることがわかります。

コマンドの後には、分析 ( -a) または精緻化 ( )中に指定されたオプション-eが続きます。

ieee.std_logic_1164 をコンパイルするにはどうすればよいですか?

package を分析する必要はありませんieee.std_logic_1164。事前に分析されています。最初に上記を試してください (より一般的には synopsys)。mentor も synopsys パッケージも FOREIGN 属性を含んでいないことに注意してください。FOREIGN 属性は、外国のプログラミング言語で実装されたサブプログラム宣言 (関数) を修飾します。

info ghdlまたはghdl.html( GHDL ガイド) セクション 5 VHDL の GHDL 実装(サブセクションUsing vendor libraries、unisim の取り扱いに関する小さなアドバイスを提供します)。FOREIGN 属性の使用方法を扱う、他の言語とのインターフェースのセクションもあります。

3.10 IEEE ライブラリの落とし穴も参照してください。IEEE以外の「標準」ライブラリに関する問題が説明されています。Tristan のネイティブではない英語のスペルミスは別として。

また、本当に IEEE ライブラリを自分で分析したい場合は、最初にGHDL ガイド全体を読んでください。最初に理解する必要があるいくつかのコマンド ライン オプションが含まれます。Windows ghdl ディストリビューションは、ジャスト イン タイム コード生成システム (mcode) に基づいており、コードをライブラリ ファイル (.cf サフィックスで終わる) に分析し、作成中にディストリビューションのライブラリにあるソース コードとまったく同じコードを再分析します。

私は、IEEE ライブラリをいじることなく、OS X の ghdl の mcode バージョンで unisim ライブラリを分析して使用することに成功しました。

ghdl は、メモリ使用率の点で最も倹約的でもなく、最速でもないことがわかります。

参加できるGhdl-discuss メーリングリストもあります。ghdl は Sourceforge で積極的に開発されています。ghdl-updatesを参照してください。ghdl-0.32 は今年リリースされる予定であり (願わくば)、-2008 のサポートが強化され、無数の修正が行われる予定です。

Windows リリースは、mcode バージョン (32 ビット バイナリ) に取って代わる、新しい解釈されたバージョンになる可能性があります。現在、すべての開発作業は Tristan Gingold によって単独で行われています。彼はまた、Windows でより優れたパフォーマンスを約束する可能性のあるオールラウンドな LLVM バックエンド バージョンを実装しています。

FOREIGN属性について

std_logic_arithFOREIGN 属性を含むザイリンクス パッケージ ソース ファイルがいくつかありましたが、行番号が 4 つずれていました。

属性とコンパイラ プラグマの組み合わせ。例:

  -- pragma map_to_operator MULT_TC_OP
  -- pragma type_function MULT_SIGNED_ARG
  -- pragma return_port_name Z

関数の実行を高速化するために使用されます。外国語ライブラリはghdlでは利用できず、mcode (Windows) バージョンはいずれにしてもそれらを使用できません。また、GHDLガイドの5.8.1 外部宣言に見られる、FOREIGN 属性の文字列値に "VHPIDIRECT " のプレフィックスを付けるという要件は、gcc バージョンでのリンクを有効にする制限です。とにかく互換性があります。

エラーメッセージで見つかった属性をコメントアウトするだけです。いずれにせよ、現時点ではghdlのgccバージョンを必要とする高速実行の可能性はありません。

ghdl の Synopsys パッケージを使用するよりもパフォーマンス上の利点はありません。

于 2014-09-14T21:19:08.533 に答える