Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16608 Discussions

Missings libs for the emulation

Altera_Forum
Honored Contributor II
1,071 Views

Hello, 

 

I'm trying out the emulation feature that came out with the AOCL 14.0. I want to emulate an application with two channeled kernels (thresholding + 7x7 convolution) with the C5SoC as the targeted board. Here are the steps I have followed : 

 

 

  • Compile the kernels for the emulator on x86 architecture : 

  • aoc -march=emulator -v kernels.cl  

  • Compile the host program "as usual" : 

  • g++ -o host main.cpp -Wall -g `aocl linkflags`.  

  • According to the documentation, the `aocl linkflags` returns what's necessary for this compilation. In fact, it returns the libs and paths for x86_64, arm32 and ppc64 so I get some warnings (for instance /usr/bin/ld: skipping incompatible /opt/altera/14.0/hld/board/c5soc/arm32/lib/libalterammdpcie.so when searching for -lalterammdpcie), which is annoying but fine.  

  • however, it seems that libalterammdpcie.so is missing for all the platforms in the 14.0 release ! i think this was worth reporting here.  

 

 

  • Instead of using the `aocl linkflags` shortcut, I manually set the libs and paths and add the path to libalterammdpcie.so from the 13.1 release : 

  • g++ -o host main.cpp -Wall -g -L/opt/altera/14.0/hld/board/c5soc/arm32/lib -L/opt/altera/14.0/hld/host/arm32/lib -L/opt/altera/14.0/hld/host/linux64/lib -L/opt/altera/13.1/hld/host/linux64/lib -lalteracl -ldl -lacl_emulator_kernel_rt -lalterahalmmd -lalterammdpcie -lelf -lrt -lstdc++  

 

 

  • I add this same path to the LD_LIBRARY_PATH environment variable : 

  • $ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/altera/13.1/hld/host/linux64/lib  

  • I can now start the execution in the simulator : 

  • CL_CONTEXT_EMULATOR_DEVICE_ALTERA=c5soc ./host.  

 

 

And now I just have to figure out how to start concurrent kernels execution in the emulator :p. 

 

 

Apologies if the missing lib was already reported. I hope this can help someone in the future. 

Cheers, 

 

koper
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
321 Views

C5soc is a cross compilation target (host runs on arm). 

The emulation environment only supports x86 (64bit) environments. 

So the easiest way to get emulation to work is probably to target another board for the emulation. 

There should be and s5_ref board with the 14.0 distribution that you could use for emulation. 

If you set your AOCL_BOARD_PACKAGE_ROOT to where that is you should be fine.  

You will also have to figure out the relevant compile and link flags for that board (aocl link-flags etc return different arguments lists for different boards, it will have different library name and a different path to the board library and you have to set the emulation flag to that board as well).  

Just remember to switch it back before you recompile for the C5soc board. 

 

So the missing library is part of the board package. And this particular library you see is now only built for arm so it should be in the board directory for c5soc, but only as an arm library, which is why no linker finds it. 

 

Let me know what problems you have with starting the emulation. I don't think you can mix and match 13.1 and 14.0 parts 

 

 

/Tommy 

/Tommy
Reply