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

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

dsun01
New Contributor III
506 Views

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. 

:20158000E0BFFE17E0BFFF15E0BFFF1710000226002AF07000000106002AF0B00001883AD9
:20158800003FFF066C6C65487266206F4E206D6F20736F69002149490000000A7665642F33
:201590006C756E2F0000006C7665642F61746A2F61755F67000074727665642F61746A2F17
:2015980061755F6700007472000000000000000000000000000000000000000000000000B1
:2015A00000000000000000000000000000000000000000000000000000000000000000002B

 

--------------------------------------------------------------------------

 

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,

 

David 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0 Kudos
3 Replies
EricMunYew_C_Intel
Moderator
489 Views

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


0 Kudos
dsun01
New Contributor III
484 Views
0 Kudos
EricMunYew_C_Intel
Moderator
480 Views

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
Reply