If you have tried hardware emulation in the previous step, you must run the following command to disable the hw_emu
mode:
source setup_emu.sh -s off
Now, you can run the compiled host_krnl_aes_test
file to test the system in hardware mode. The default words number to process is 1M 128-bit words, which is 16 MBytes. Because of the data transfer efficiency between host and FPGA via PCIe, you can peak processing throughput with big-enough input data.
./host_krnl_aes_test
------------------------ krnl_aes test program ------------------------
128-bit words number : 1048576
Key length : 256-bit
Key : 123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0
Generating plain data
[MESSAGE] Program running in hardware mode
Load krnl_aes_test_hw.xclbin
Create kernels
Create input and output device buffers
Run krnl_aes for AES key expansion
Kernel run finish
-------------- AES Encryption Test
Transfer plain data into device buffer
Start strm_issue and strm_dump kernels
Kernel run finish
AES engines execution time = 170.820007 ms
Transfer cipher data from device buffer and verification
-- AES Engine 0
SUCCESS
-- AES Engine 1
SUCCESS
-- AES Engine 2
SUCCESS
-- AES Engine 3
SUCCESS
AES total encryption throughput = 392.857971 MB/s
-------------- AES Decryption Test
Transfer cipher data into device buffer
Start strm_issue and strm_dump kernels
Kernel run finish
AES engines execution time = 170.800995 ms
Transfer plain data from device buffer and verification
-- AES Engine 0
SUCCESS
-- AES Engine 1
SUCCESS
-- AES Engine 2
SUCCESS
-- AES Engine 3
SUCCESS
AES total decryption throughput = 392.901703 MB/s
Now you have a Vitis RTL kernel file, krnl_aes.xo
, with the ap_ctrl_hs
execution model. In the next session, you will learn about another RTL kernel, krnl_cbc
, which supports the ap_ctrl_chain
model, and integrates these two kernel into a hardware overlay (XCLBIN) to form a complete AES-CBC acceleration application. This is described in the next section: RTL Kernel: krnl_cbc.
Copyright © 2020–2023 Advanced Micro Devices, Inc