Hello everyone,

I am new to the gem5 simulator. I created the pseudo instruction to read
data from the memory system in SE mode. The simulation is finished
normally with the program as below:

#include <gem5/m5ops.h>

int main(){
     const int bits = 128;
     std::bitset<bits> src(250);
     uint64_t size = bits / 8;

     m5_READ((uint64_t)&src, size);
     return 0;
}

However, when I added a loop into the program, the segmentation fault error
happened with the program as below:

#include <gem5/m5ops.h>

int main(){
     const int total = 10;
     const int bits = 128;
     std::bitset<bits> src[total];
     // size of rows for operation
     uint64_t size = bits / 8;
     for (int i=0; i<total; i++) {
         src[i] = i;
     }
     for (int i=1; i<total; i++) {
         m5_READ((uint64_t)&src, size);
     }
     return 0;
}

The command that I used to run the simulation as below:
build/X86/gem5.opt --debug-flag=TEST --debug-file=debugTEST.txt
configs/example/se.py  -c tests/test-progs/read-test/src/read-test
--cpu-type=TimingSimpleCPU --caches --l2cache --mem-type=DDR4_2400_4x16
--mem-size=4GB

The BACKTRACE is as below detail:
--- BEGIN LIBC BACKTRACE ---
build/X86/gem5.opt(_Z15print_backtracev+0x15)[0x10f5a85]
build/X86/gem5.opt[0x1107b7d]
/lib64/libpthread.so.0(+0xf630)[0x7f3f7e030630]
/lib64/libtcmalloc.so.4(_ZN8tcmalloc11ThreadCache21ReleaseToCentralCacheEPNS0_8FreeListEji+0xdb)[0x7f3f7cf4042b]
/lib64/libtcmalloc.so.4(_ZN8tcmalloc11ThreadCache8ScavengeEv+0x48)[0x7f3f7cf40798]
/lib64/libpython2.7.so.1.0(+0x817d8)[0x7f3f7dcd67d8]
/lib64/libpython2.7.so.1.0(+0x817bf)[0x7f3f7dcd67bf]
/lib64/libpython2.7.so.1.0(_PyImport_Fini+0x1a)[0x7f3f7dd4b88a]
/lib64/libpython2.7.so.1.0(Py_Finalize+0x105)[0x7f3f7dd577f5]
build/X86/gem5.opt(main+0x34)[0x8b8fc4]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f3f7b76d555]
build/X86/gem5.opt[0x8dbb6f]
--- END LIBC BACKTRACE ---
Segmentation fault (core dumped)

Could someone help me with it? I really appreciated it.

Thank you in advance!
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org

Reply via email to