diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2015-09-18 13:27:47 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2015-09-18 13:27:47 -0500 |
commit | 96c999fe88a5f600a1a5ddf8c15eadba3051508b (patch) | |
tree | b1fb5220ffcd3b0688d53cb7f41a6c016eadc0fa /src/mem/ruby/structures/CacheMemory.cc | |
parent | 216529bf182f58830cfccad090f348e1b8730675 (diff) | |
download | gem5-96c999fe88a5f600a1a5ddf8c15eadba3051508b.tar.xz |
ruby: print addresses in hex
Changeset 4872dbdea907 replaced Address by Addr, but did not make changes to
print statements. So the addresses which were being printed in hex earlier
along with their line address, were now being printed in decimals. This patch
adds a function printAddress(Addr) that can be used to print the address in hex
along with the lines address. This function has been put to use in some of the
places. At other places, change has been made to print just the address in
hex.
Diffstat (limited to 'src/mem/ruby/structures/CacheMemory.cc')
-rw-r--r-- | src/mem/ruby/structures/CacheMemory.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mem/ruby/structures/CacheMemory.cc b/src/mem/ruby/structures/CacheMemory.cc index a269d4f5b..b0e54ec99 100644 --- a/src/mem/ruby/structures/CacheMemory.cc +++ b/src/mem/ruby/structures/CacheMemory.cc @@ -163,7 +163,7 @@ CacheMemory::tryCacheAccess(Addr address, RubyRequestType type, DataBlock*& data_ptr) { assert(address == makeLineAddress(address)); - DPRINTF(RubyCache, "address: %s\n", address); + DPRINTF(RubyCache, "address: %#x\n", address); int64_t cacheSet = addressToCacheSet(address); int loc = findTagInSet(cacheSet, address); if (loc != -1) { @@ -190,7 +190,7 @@ CacheMemory::testCacheAccess(Addr address, RubyRequestType type, DataBlock*& data_ptr) { assert(address == makeLineAddress(address)); - DPRINTF(RubyCache, "address: %s\n", address); + DPRINTF(RubyCache, "address: %#x\n", address); int64_t cacheSet = addressToCacheSet(address); int loc = findTagInSet(cacheSet, address); @@ -218,10 +218,10 @@ CacheMemory::isTagPresent(Addr address) const if (loc == -1) { // We didn't find the tag - DPRINTF(RubyCache, "No tag match for address: %s\n", address); + DPRINTF(RubyCache, "No tag match for address: %#x\n", address); return false; } - DPRINTF(RubyCache, "address: %s found\n", address); + DPRINTF(RubyCache, "address: %#x found\n", address); return true; } @@ -256,7 +256,7 @@ CacheMemory::allocate(Addr address, AbstractCacheEntry *entry, bool touch) assert(address == makeLineAddress(address)); assert(!isTagPresent(address)); assert(cacheAvail(address)); - DPRINTF(RubyCache, "address: %s\n", address); + DPRINTF(RubyCache, "address: %#x\n", address); // Find the first open slot int64_t cacheSet = addressToCacheSet(address); @@ -288,7 +288,7 @@ CacheMemory::deallocate(Addr address) { assert(address == makeLineAddress(address)); assert(isTagPresent(address)); - DPRINTF(RubyCache, "address: %s\n", address); + DPRINTF(RubyCache, "address: %#x\n", address); int64_t cacheSet = addressToCacheSet(address); int loc = findTagInSet(cacheSet, address); if (loc != -1) { @@ -417,7 +417,7 @@ CacheMemory::printData(ostream& out) const void CacheMemory::setLocked(Addr address, int context) { - DPRINTF(RubyCache, "Setting Lock for addr: %x to %d\n", address, context); + DPRINTF(RubyCache, "Setting Lock for addr: %#x to %d\n", address, context); assert(address == makeLineAddress(address)); int64_t cacheSet = addressToCacheSet(address); int loc = findTagInSet(cacheSet, address); @@ -428,7 +428,7 @@ CacheMemory::setLocked(Addr address, int context) void CacheMemory::clearLocked(Addr address) { - DPRINTF(RubyCache, "Clear Lock for addr: %x\n", address); + DPRINTF(RubyCache, "Clear Lock for addr: %#x\n", address); assert(address == makeLineAddress(address)); int64_t cacheSet = addressToCacheSet(address); int loc = findTagInSet(cacheSet, address); @@ -443,7 +443,7 @@ CacheMemory::isLocked(Addr address, int context) int64_t cacheSet = addressToCacheSet(address); int loc = findTagInSet(cacheSet, address); assert(loc != -1); - DPRINTF(RubyCache, "Testing Lock for addr: %llx cur %d con %d\n", + DPRINTF(RubyCache, "Testing Lock for addr: %#llx cur %d con %d\n", address, m_cache[cacheSet][loc]->m_locked, context); return m_cache[cacheSet][loc]->isLocked(context); } @@ -582,7 +582,7 @@ CacheMemory::checkResourceAvailable(CacheResourceType res, Addr addr) if (tagArray.tryAccess(addressToCacheSet(addr))) return true; else { DPRINTF(RubyResourceStalls, - "Tag array stall on addr %s in set %d\n", + "Tag array stall on addr %#x in set %d\n", addr, addressToCacheSet(addr)); numTagArrayStalls++; return false; @@ -591,7 +591,7 @@ CacheMemory::checkResourceAvailable(CacheResourceType res, Addr addr) if (dataArray.tryAccess(addressToCacheSet(addr))) return true; else { DPRINTF(RubyResourceStalls, - "Data array stall on addr %s in set %d\n", + "Data array stall on addr %#x in set %d\n", addr, addressToCacheSet(addr)); numDataArrayStalls++; return false; |