I'm making 32-bit MIPS simulator with cpp just for studying.
But I can't understand how benchmark programs are run on simulator.
Also, I don't know how code of benchmark programs are structured.
Can you answer me these questions?
Thank you!
I'm making 32-bit MIPS simulator with cpp just for studying.
But I can't understand how benchmark programs are run on simulator.
Also, I don't know how code of benchmark programs are structured.
Can you answer me these questions?
Thank you!
When you compile the program into an executable, it will contain the information needed to recreate a process image (instruction section, initialized/uninitialized data section). On a real machine, the OS should load the executable and handle the section mapping. On a simulator, you will need to write the executable decoder and loader yourself to parse the program and load each section into your simulated memory space. Additionally, you will need to set the registers (e.g. PC and SP) to proper values for the program to start.
One example is the ELF file format.