Can we view actual data stored in L1 cache, L2 cache and DRAM

591 views
Skip to first unread message

khki...@gmail.com

unread,
May 25, 2015, 1:18:09 PM5/25/15
to gem5-g...@googlegroups.com


Hi.

I am wondering if gem5-gpu simulator simulates actual data coming and going between cache and DRAM? 
I would like to view actual data stored in L1 cache, L2 cache, and DRAM to analyze their characteristics. 
GPGPU-sim seems not to do it. What about gem5-gpu? 


Thanks. 






Joel Hestness

unread,
May 25, 2015, 7:14:15 PM5/25/15
to khki...@gmail.com, gem5-gpu developers
Hi,
  The short answer is 'yes, you can observe the data in caches in gem5-gpu'. This includes CUDA global, local, and const memory, but not shared, which is still handled by GPGPU-Sim code.

  The longer answer is that it is a little complicated to access this memory, and you can only observe the coherent version of the data. Currently, gem5-gpu Ruby coherence protocols do store actual cached data in their caches (CacheMemory objects), but we have not validated that that data is correct for all coherence protocols. Instead, Ruby allows cache accesses to pull correct data from a faked backing store which is coherent (see RubySystem::m_phys_mem). To get the data that should be in a cache, you first need to check that a cache line should be valid in a cache, and you can do this by checking for it in the respective protocol file (e.g. gem5-gpu/src/mem/protocol/VI_hammer-GPUL1cache.sm). If the line is valid, you can grab the coherent version of the data from Ruby's backing store using a functional access by doing something like:

    g_system_ptr->getPhysMem()->functionalAccess(pkt);

  Hopefully this is enough to get you started, but feel free to ping us for further clarification if necessary.
  Joel


--
  Joel Hestness
  PhD Candidate, Computer Architecture
  Dept. of Computer Science, University of Wisconsin - Madison
  http://pages.cs.wisc.edu/~hestness/

li...@umich.edu

unread,
Jun 5, 2015, 12:46:35 PM6/5/15
to gem5-g...@googlegroups.com, khki...@gmail.com
Hi Joel,

If I'm using non-split mode gem5-gpu, can I get the cache shared by gpu and cpu?  

Thanks,
Sihang

Jason Power

unread,
Jun 5, 2015, 9:32:43 PM6/5/15
to li...@umich.edu, gem5-g...@googlegroups.com, khki...@gmail.com
Hi Sihang,

As I said in the other email, look at the Ruby caches in gem5. You can find the code in gem5/src/mem/ruby/structures/CacheMemory.cc You could modify this file to allow you to introspect into the caches during execution, or to dump the cache contents. If you just want to dump the cache contents you can look at the checkpointing code src/mem/ruby/system/CacheRecorder.cc.

Cheers,

Jason

Joel Hestness

unread,
Jun 6, 2015, 10:43:23 AM6/6/15
to Jason Power, li...@umich.edu, gem5-g...@googlegroups.com, khki...@gmail.com
Hi guys,
  Sorry for the delay on this.

  You'll need to be careful with how you inspect data if instrumenting CacheMemory.cc as Jason describes. As I described in my prior email on this thread, gem5-gpu coherence protocols use Ruby's backing store, which contains the coherent version of the data. The data held in the CacheMemory may not be correctly updated by the coherence protocols in gem5-gpu, so for instance, the CacheMemory::tryCacheAccess function may not return correct data in the DataBlk data_ptr. So, to clarify, you can use CacheMemory to indicate which cache lines (addresses) are in the cache, but you'll need to access Ruby's backing store to get the current version of the data. From CacheMemory, you could include mem/ruby/common/Global.hh and get the backing store pointer with g_system_ptr->getPhysMem().

  Hope this is clearer,
  Joel


ch nandavardhan

unread,
Jul 12, 2019, 2:52:57 PM7/12/19
to gem5-gpu Developers List
HI, 

     Could you elabarate more on how to store the cache contents into a file.
Reply all
Reply to author
Forward
0 new messages