Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
All support for Intel NUC 7 - 13 systems has transitioned to ASUS. Read latest update.
16510 Discussions

how to know the Eclipse compiled hex file match the source code?

New Contributor III

Dear Intel Support/Expert, 


I am working on an old project which need to do a lot of upgrade, FPGA chip and Quartus tools. after I port the old Nios II project to the new FPGA, it won't work. I tried to comment all code out, except one line  printf("Hello from Nios II!\n"); it won't show the text on the simulation console.  I made a comparison with AN351 result. I found something wrong but don't know why.

for AN351 which is working in my simulation environment. 

the C source code is 

#include <stdio.h>

int main()
printf("Hello from Nios II!\n");

return 0;

after compile I checked the .hex file.  I show a small piece of the text, I can find 6c6c65486266206f. which is the ASCII code of "Hello fr", of cause I can see it in the modelsim memory list when execute simulation. 





But for the real application project.  after I commented all the code, and only keep one line

printf("Hello from Nios II!\n"); after I compiled the project, I couldn't find 6c6c65486266206f in the .hex file. 


I saw every time I change code, after "build all" and execute "run as nios II modelsim", the .hex file got updated, and the memory list file in the modelsim also changed. 


how to make sure the compiled file match the source code in the project? 

is there some trick to check the .hex file was compiled from the source instead of from somewhere else?

Beside the content of the printf, is there other C code that can be identified in the .hex file?

I am a FPGA designer, not good at Nios II and Eclipse tools. so I need an example like AN351 to make apple to apple comparison. It will be much helpful to get suggestions from experienced Nios II and FPGA system level engineers. 


Best Regards,

















0 Kudos
3 Replies

unfortunately there is no method to match .hex to source code.

0 Kudos
New Contributor III
0 Kudos

I’m glad that your question has been addressed, I now transition this thread to community support. If you have a new question, feel free to open a new thread to get the support from Intel experts. Otherwise, the community users will continue to help you on this thread. Thank you.

0 Kudos