I am in the process of emulating too. I will comment my case and probably open a new thread.
I tried your idea, sstrell, of emulating using the ARM processor. It doesn't work for me (did it for you, alviur?). And in fact it makes sense to me it failing, since the kernel "program" was built for an emulator, not a real board, which is in fact what the error message issues:
root@socfpga:~/testemul# ./host
Querying platform for info:
==========================
CL_PLATFORM_NAME = Intel(R) FPGA SDK for OpenCL(TM)
CL_PLATFORM_VENDOR = Altera Corporation
CL_PLATFORM_VERSION = OpenCL 1.0 Intel(R) FPGA SDK for OpenCL(TM), Version 17.0
Querying device for info:
========================
CL_DEVICE_NAME = de1soc_sharedonly : Cyclone V SoC Development Kit
CL_DEVICE_VENDOR = Intel(R) Corporation
CL_DEVICE_VENDOR_ID = 4466
CL_DEVICE_VERSION = OpenCL 1.0 Intel(R) FPGA SDK for OpenCL(TM), Version 17.0
CL_DRIVER_VERSION = 17.0
CL_DEVICE_ADDRESS_BITS = 64
CL_DEVICE_AVAILABLE = true
CL_DEVICE_ENDIAN_LITTLE = true
CL_DEVICE_GLOBAL_MEM_CACHE_SIZE = 32768
CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE = 0
CL_DEVICE_GLOBAL_MEM_SIZE = 536870912
CL_DEVICE_IMAGE_SUPPORT = true
CL_DEVICE_LOCAL_MEM_SIZE = 16384
CL_DEVICE_MAX_CLOCK_FREQUENCY = 1000
CL_DEVICE_MAX_COMPUTE_UNITS = 1
CL_DEVICE_MAX_CONSTANT_ARGS = 8
CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE = 134217728
CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS = 3
CL_DEVICE_MEM_BASE_ADDR_ALIGN = 8192
CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE = 1024
CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR = 4
CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT = 2
CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT = 1
CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG = 1
CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT = 1
CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE = 0
Command queue out of order? = false
Command queue profiling enabled? = true
Using AOCX: hello_world.aocx
Context callback: Program was compiled for a different board.
aocx is for board EmulatorDevice whereas device is de1soc_sharedonly
Use aocl program to safely transition to the new board
.
Context callback: Invalid binary
ERROR: CL_INVALID_BINARY
Location: ../common/src/AOCLUtils/opencl.cpp:392
Failed to create program with binary
root@socfpga:~/testemul#
Anyway, part of the idea of emulation, besides saving the synthesis time, is the possibility to debug your application from the development systems. The idea of Intel is precisely this, and this is why you need to target a non SoC board. When the guide directs you to (page 38,
https://www.altera.com/en_us/pdfs/literature/hb/opencl-sdk/aocl_c5soc_getting_started.pdf):
Emulation is a Linux-only optional step when setting up the SDK for use with ® SoC
FPGAs. Specifically, you must emulate your OpenCL kernel on a non-SoC FPGA board
before executing your kernel on the SoC FPGA.
1. Install a Custom or Reference Platform because emulation targets a specific FPGA
board.
the idea is using one of the standard boards that comes within the SDK installation (I guess). This is the same the tutorial I attended to in a conference was doing (targetting the s5_ref board for emulation)...I guess it just needs some info on a device/platform to build the kernel.
I did in fact try to do it, but I guess a weird error when building the host application:
rusa@emma ~/dev/IntelFPGA/OpenCL/examples/hello_world $ make
/home/rusa/tools/intelFPGA/17.0/hld/board/s5_ref/linux64/lib/libaltera_s5_ref_mmd.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
Makefile:74: recipe for target 'bin/host' failed
make: *** Error 1
My init scripts are working fine, and the file is itself there but with an unrecognized format. I even tried to grab it again from the RTE (both in the initial 17.0 version and the Update 2), and the same error again. I will open a support ticket and probably a thread here, since I cannot find any previous same issue.
Best