インテル上位レベルのシンセシス・アクセラレーター機能ユニットのデザイン例のユーザーガイド

ID 683025
日付 11/30/2018
Public
ドキュメント目次

2.7. AFビットストリームの読み込みとホスト・アプリケーションの実行

Intel Quartus Prime v18.1を使用してHLSコンポーネントをコンパイルした場合、run.shが失敗する場合があります。 もう一度実行すると、動作するはずです。
  1. AFをFPGAにロードします。
    # sudo fpgaconf hls_afu.gbs
  2. hello_worldディレクトリーに移動します。
  3. ホスト・アプリケーションをビルドして実行します( USE_ASE = 1を使用しないでください)。
    $ make
    $ sudo ./hls_afu_host
    
予想される出力は次のとおりです。
Using Avalon Slave at offset 0x40
No vector size specified. Default to size 64 floats! run ./hls_afu_host <vectorsize> to specify a vector size at runtime.
Using test vector of size 64.
Running Test
AFU DFH REG = 1000010000000000
AFU ID LO = 944028430b016f3d
AFU ID HI = 5fa7fd4b867c484c
AFU NEXT = 00000000
AFU RESERVED = 00000000
end of output memory before executing kernel:
    [62] - -6259853398707798016.000000 (0xdeadbeef)
    [63] - -6259853398707798016.000000 (0xdeadbeef)
    [64] - -6259853398707798016.000000 (0xdeadbeef)
    [65] - 0.000000 (0x0)
Interrupt enabled = 00000000
Interrupt enabled = 00000001
AFU Latency: 0.01600 milliseconds
Poll success. Return = 1
check output memory:
output memory OK!
sum: Expected 715.000000, calculated 715.000000.

The FPGA writes a full 512-bit word (64 bytes) to host memory, so if the size of your test vector 
(in bytes) is not a multiple of 64, the FPGA will overwrite some space at the end of output memory. 
fpgaPrepareBuffer() allocates your host memory in a buffer that is a multiple of 64 bytes, so the 
FPGA behavior will not affect your application. You should expect to see a single 0xdeadbeef at the 
end of the output memory if and only if the size of your test vector (determined by vector_size, and 
the datatype) is a multiple of 64 bytes (that is, if vector_size is a multiple of 16). 

end of output memory after executing kernel:
    [62] - 22.333334 (0x41b2aaab)
    [63] - 22.666666 (0x41b55555)
    [64] - -6259853398707798016.000000 (0xdeadbeef)
    [65] - 0.000000 (0x0)
Vector size is 64 (256 bytes), so expect memory output at [64] = 0xdeadbeef
Finished Running Test.
Test PASSED