2

I ran a basic hello world program in gem5 and below is the command I ran:

./build/ARM/gem5.opt ./configs/example/se.py --cpu-type=TimingSimpleCPU --cmd=tests/test-progs/hello/bin/arm/linux/hello

I expected that the number of read/write requests would not be crossing few 100s of instructions but when i looked into the stats.txt in the m5out folder I can see that:

system.mem_ctrls.readReqs 6088 # Number of read requests accepted

system.mem_ctrls.writeReqs 936 # Number of write requests accepted

Also here, i statically compiled the binary. Could someone help me understand why there are so many requests going into the main memory.

ssg
  • 71
  • 5
  • If you remove the hello world and run just and empty main, do you still see a lot of requests? If not, then it comes from `puts` / `printf`, so go red their source code / step debug them :-) Otherwise, glibc and other standard libraries run some setup code before calling main in the crtX objects, so they might be coming from there: so then you should start playing with freestanding executables that don't link to stdlib at all, see e.g.: https://stackoverflow.com/questions/2463150/what-is-the-fpie-option-for-position-independent-executables-in-gcc-and-ld/51308031#51308031 – Ciro Santilli Jun 04 '19 at 20:24

0 Answers0