Step 4: Running Hardware Emulation

  1. Now that Software Emulation is complete, you can run Hardware Emulation. To do this without changing the makefile, run the following command:
    make all REPORT=estimate TARGETS=hw_emu DEVICES=xilinx:kcu1500:dynamic
    By defining the TARGETS this way, it passes the value and overwrites the default that was set in the makefile that we saw in Step 2.
    Note: Like in Lab 1, Hardware Emulation takes longer to compile than the Software Emulation.
  2. Next, you can re-run the application. You do not need to regenerate emconfig.json since the device information has not changed; however, the emulation needs to be set for Hardware Emulation. Re-run the application with the following command:
    make check TARGETS=hw_emu DEVICES=xilinx:kcu1500:dynamic
    Note: The makefile sets the enviornment variable to hw_emu.
  3. The output should be similar to the Software Emulation with the following output.
    [sdaccel@localhost vadd]$ make check TARGETS=hw_emu DEVICES=xilinx_kcu1500_dynamic_5_0
    /<install location>/SDx/2017.4/bin/emconfigutil --platform xilinx_kcu1500_dynamic_5_0 --nd 1
    ...
    INFO: [ConfigUtil 60-895]    Target platform: <install location>/SDx/2017.4/platforms/xilinx_kcu1500_dynamic_5_0/xilinx_kcu1500_dynamic_5_0.xpfm
    emulation configuration file `emconfig.json` is created in current working directory 
    ...
    platform Name: Intel(R) OpenCL
    Vendor Name : Xilinx
    platform Name: Xilinx
    Vendor Name : Xilinx
    Found Platform
    XCLBIN File Name: krnl_vadd
    INFO: Importing xclbin/krnl_vadd.sw_emu.xilinx_kcu1500_dynamic.xclbin
    Loading: 'xclbin/krnl_vadd.sw_emu.xilinx_kcu1500_dynamic.xclbin'
    Result Match: i = 0 CPU result = 0 Krnl Result = 0
    Result Match: i = 1 CPU result = 3 Krnl Result = 3
    Result Match: i = 2 CPU result = 6 Krnl Result = 6
    Result Match: i = 3 CPU result = 9 Krnl Result = 9
    Result Match: i = 4 CPU result = 12 Krnl Result = 12
    Result Match: i = 5 CPU result = 15 Krnl Result = 15
    ...
    Result Match: i = 1018 CPU result = 3054 Krnl Result = 3054
    Result Match: i = 1019 CPU result = 3057 Krnl Result = 3057
    Result Match: i = 1020 CPU result = 3060 Krnl Result = 3060
    Result Match: i = 1021 CPU result = 3063 Krnl Result = 3063
    Result Match: i = 1022 CPU result = 3066 Krnl Result = 3066
    Result Match: i = 1023 CPU result = 3069 Krnl Result = 3069
    INFO: [SDx-EM 22] [Wall clock time: 10:42, Emulation time: 0.010001 ms] Data transfer between kernel(s) and global memory(s)
    BANK0          RD = 8.000 KB               WR = 4.000 KB        
    BANK1          RD = 0.000 KB               WR = 0.000 KB        
    BANK2          RD = 0.000 KB               WR = 0.000 KB        
    BANK3          RD = 0.000 KB               WR = 0.000 KB   
    TEST PASSED
  4. To view the profile summary and timeline trace, run the following commands to convert them for the SDx IDE to read and view the updated information below:
    sdx_analyze profile sdaccel_profile_summary.csv
    sdx_analyze trace sdaccel_timeline_trace.csv

    For the Profile Summary you should get something similar in the following figure.

    Figure: SDx Makefile Hardware Emulation Profile Summary