I have been trying to compile my code using -pg to enable profiling in the simulator and once I do that it gives me linker errors.
Compilation command
hexagon-clang++ main.cpp -o hello -mv62 -pg
Error
hexagon-clang++ main.cpp -o hello -mv62 -pg
Error: /tmp/main-924ac3.o(.text+0x30): undefined reference to `mcount'
Error: /tmp/main-924ac3.o(.text+0x130): undefined reference to `mcount'
Fatal: Linking had errors.
This is my first time to write code for DSP chip, specifically the hexagon 682. Are there any tutorials or references other than the programmer reference manual because they haven't been very useful in helping me understand how things work. Specially I don't understand how SIMD programming works. I am not sure what's the size of SIMD registers. Also it seems that using Floating point in DSP chips is not a great idea. So would it be better if I convert my code to use fixed point.
You can use
hexagon-sim
to generate the profiling data without rebuilding instrumented binaries.hexagon-sim --profile ./hello
will generate thegmon
input file(s) necessary forhexagon-gprof
to consume.e.g. (taken from SDK 3.3.3
Examples/
)Note also that the SDK comes with
hexagon-profiler
, a richer tool that allows you to see in depth performance counters -- information beyond just which code was executed and how often.See "Hexagon Profiler User Guide" (doc number 80-N2040-10 A) for details.
Hexagon's vector programming extension is called "HVX". There's a HVX-specific PRM that's available at https://developer.qualcomm.com/software/hexagon-dsp-sdk/tools -- it describes different 512-bit and 1024-bit vector modes.