Hello All,

I have recently been working on adding both data and instruction scratch Pad 
(SPM) in GEM5 FS simulation. I was able to add both of them alongside with 
having L1-I and L1-D cache. The memory system now looks as in figure at 
https://imgur.com/a/wUtUX

Since I am using FS mode, I can access the D-SPM and I-SPM using 
open("/dev/mem") and mmap(). I-SPM is connected to both the instruction as well 
as data port, so that we can write the program to it through data port and 
execute and read through instruction port.
To test this, I compiled a helloworld program as a library which does not print 
anything, but just returns an integer value. We access this library through 
dlopen and the function in the library through dlsym. Then through function 
pointer we copied the function to the I-SPM. Finally we jumped to the function 
in I-SPM through a function pointer call. After this the program gets stuck and 
does not proceed.

In the stats file I can see the write accesses (to copy the function to) the 
SPM issued by cpu.data, but I don't see any read cpu.inst access to I-SPM. Can 
someone suggest why the CPU does not read the I-SPM when I jump to the function 
in it ?

NOTE: When using mmap() I do enable PROT_EXEC to mark I-SPM as executable 
memory region.

Regards
Yasir


_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to