さてmodelsimの部分にちょっと気になる点がありますが
ともかく動作させてみたいと思います
c:\intelFPGA_lite\18.0\hls\examplesに入るとcounterと言うディレクトリがあるので
counter_testにコピーして
ここでビルドする
.\build.bat
No target specified, defaulting to test-x86-64
Available targets: test-x86-64, test-fpga, test-msvc, clean
i++ -march=x86-64 counter.cpp -o test-x86-64.exe
Run test-x86-64.exe to execute the test.
あっビルド出来た
と思ったら、これはソフトウェアでビルドしたものだったな
まあとりあえず実行してみましょう
出来たファイルの中にtest-x86-64.exeがあるので実行
.\test-x86-64.exe
PASSED
よしOKだ
では次にfpgaとしてビルドしてみよう
この辺は覚えている
.\build.bat test-fpga
よいしょっと
あれ?エラーがでる
Modelsim-Alteraのライセンスが無いって事だけど・・・
Modelsim-AlteraSEは、ライセンスが要らないし、大体の事が出来る筈
ここでピンときたのがinit_hls.batを実行した時に出た大量のModelsimの行
Will be using Modelsim at C:\altera\81\modelsim_ae\win32aloem\
Will be using Modelsim at C:\altera\15.1\modelsim_ase\win32aloem\
Will be using Modelsim at c:\altera\12.1\modelsim_ase\win32aloem\
Will be using Modelsim at C:\intelFPGA\17.1\modelsim_ase\win32aloem\
Will be using Modelsim at C:\intelFPGA_lite\18.0\modelsim_ase\win32aloem\
環境変数を見てみるとpathのところは、こんな感じ
遥か昔にインストールしたQuartusIIのversion8.1のmodelsimが有効になっている
QuartusPrimeの18.0のModelSimが先頭に来るようにして、再びinit_hls.batから
Assuming current directory (c:\intelFPGA_lite\18.0\hls\) is root of i++Will use c:\intelFPGA_lite\18.0\hls\..\quartus to find Quartus
for internal i++ use
Quartus at C:\intelFPGA_lite\18.0\quartus\bin64\ will be used for any direct use
Will be using Modelsim at C:\intelFPGA_lite\18.0\modelsim_ase\win32aloem\
Will be using Modelsim at C:\altera\81\modelsim_ae\win32aloem\
Will be using Modelsim at C:\altera\15.1\modelsim_ase\win32aloem\
Will be using Modelsim at c:\altera\12.1\modelsim_ase\win32aloem\
Will be using Modelsim at C:\intelFPGA\17.1\modelsim_ase\win32aloem\Adding c:\intelFPGA_lite\18.0\hls\bin to PATH
Adding c:\intelFPGA_lite\18.0\hls\host\windows64\bin to PATH
ふむ、エラーは無い
もう一度counter_testに入りなおして
.\build.bat test-fpga
i++ -march=Arria10 counter.cpp -o test-fpga.exe
test-fpga.exe : warning LNK4088: /FORCE オプションによってイメージが生成されています。イメージは動作しない可能性があります。
Run test-fpga.exe to execute the test.
warningが気になるけど、ビルドは出来たみたい
.\test-fpga.exeを実行してみる
PASSED
よっしゃ動いた・・・
けどここまでの結果はソフトウェアと変わらないのであった
ちゃんとFPGAとして検証できないといけません