Altera_Forum
Honored Contributor
13 years agoNIOS C compilation and optimization issue
11.1SP2 Eclipse Based NIOSII software build Tools
OK, that looks foolish, however, this has happened. I was asked to provide the latency figures for an algorithm. I got different latency figures in the following two trials: Routine() -> SW code for the algorithm Trial 1: The Routine() was declared and defined in the same source file as the main(). The compiled code provided latency of N cycles. Trial 2: 1. 1. Defined the Routine in a separate file, Routine.c. Added its declaration in a header file Routine.h and included the header file in the main source file mainsource.c (good programming practice) When the source files were compiled, the latency result doubled around 2*N cycles. 2. 2. Merged the Routine.c into mainsource.c files and compiled. The latency figures came back to around N cycles. I think I am missing something related to compiler/linker settings. Any idea ?