From 4c35b42d2fb6f7588dbd56f0dde64b32ce1adafb Mon Sep 17 00:00:00 2001 From: Brandon Potter Date: Mon, 19 Feb 2018 14:49:05 -0500 Subject: ruby: remove unused code inside '#if 0 ... #endif' The commented code contains bitrot. It is not clear how to fix the code so remove it. The code will not compile if the preprocessor defines are removed. The llocker and uulocker variables that are used as indices into the persistent_randomize array are undefined. It's not clear what they should be from the current code. 5ab13e2deb shows when the lines were last modified. The functionality contained in the comments probably have not been used since that time. (This is an example of why one should never add commented code that is enabled by removing defines. The code rots and sits in the source forever.) Change-Id: I3e0e7c9afc0b6088130e6f319075809fb6f16e5a Reviewed-on: https://gem5-review.googlesource.com/8481 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- src/mem/ruby/structures/PersistentTable.cc | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/mem/ruby/structures/PersistentTable.cc b/src/mem/ruby/structures/PersistentTable.cc index 1e4e0f555..f52cdf331 100644 --- a/src/mem/ruby/structures/PersistentTable.cc +++ b/src/mem/ruby/structures/PersistentTable.cc @@ -30,13 +30,6 @@ using namespace std; -// randomize so that handoffs are not locality-aware -#if 0 -int persistent_randomize[] = {0, 4, 8, 12, 1, 5, 9, 13, 2, 6, - 10, 14, 3, 7, 11, 15}; -int persistent_randomize[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15}; -#endif PersistentTable::PersistentTable() { @@ -51,14 +44,6 @@ PersistentTable::persistentRequestLock(Addr address, MachineID locker, AccessType type) { -#if 0 - if (locker == m_chip_ptr->getID()) - cout << "Chip " << m_chip_ptr->getID() << ": " << llocker - << " requesting lock for " << address << endl; - - MachineID locker = (MachineID) persistent_randomize[llocker]; -#endif - assert(address == makeLineAddress(address)); static const PersistentTableEntry dflt; @@ -85,14 +70,6 @@ void PersistentTable::persistentRequestUnlock(Addr address, MachineID unlocker) { -#if 0 - if (unlocker == m_chip_ptr->getID()) - cout << "Chip " << m_chip_ptr->getID() << ": " << uunlocker - << " requesting unlock for " << address << endl; - - MachineID unlocker = (MachineID) persistent_randomize[uunlocker]; -#endif - assert(address == makeLineAddress(address)); assert(m_map.count(address)); PersistentTableEntry& entry = m_map[address]; -- cgit v1.2.3