diff -X dontdiff -uprN gems-2.1.1/opal/system/cache.C gems-2.1.1-gedare/opal/system/cache.C --- gems-2.1.1/opal/system/cache.C 2010-09-01 14:06:13.000000000 -0400 +++ gems-2.1.1-gedare/opal/system/cache.C 2010-09-01 16:46:58.000000000 -0400 @@ -360,57 +360,6 @@ pa_t generic_cache_template:: #endif -//************************************************************************** -template -void generic_cache_template::Warmup(pa_t a) { - - uint32 index = Set(a); - pa_t ba = BlockAddress(a); - ASSERT(index < n_sets); - - /* search all sets until we find a match */ - BlockType *set = &cache[index * m_assoc]; - for (uint32 i = 0 ; i < m_assoc ; i ++) { - bool hit = IsValid(set[i]) && (getBlockAddress(set[i]) == ba); - if (hit) { - return; - } - } - int replace_set = random() % m_assoc; - /* write new block into the cache */ - set[replace_set].address_state = ba | CACHE_BLK_VALID; -} - -//************************************************************************** -template -void generic_cache_template::OracleAccess(pa_t a) { - /* used when we want the execution of a particular load or store to - * be prefetched perfectly. - */ - uint32 index = Set(a); - pa_t ba = BlockAddress(a); - ASSERT(index < n_sets); - STAT_INC(reads); - - /* search all sets until we find a match */ - BlockType *set = &cache[index * m_assoc]; - int replace_set = 0; - for (uint32 i = 0 ; i < m_assoc ; i ++) { - bool hit = IsValid(set[i]) && (getBlockAddress(set[i]) == ba); - if (hit) { - STAT_INC(read_hit); - return; - } - if (set[i].last_access < set[replace_set].last_access) { - replace_set = i; - } - } - - /* write new block into the cache */ - STAT_INC(read_miss); - set[replace_set].address_state = ba | CACHE_BLK_VALID; - set[replace_set].last_access = m_eventQueue->getCycle(); -} //************************************************************************** /* this function is called when a store is retired. If the address @@ -568,18 +517,6 @@ set_error_t generic_cache_template -int generic_cache_template::registerCheckpoint( confio_t *conf ) -{ - int rc; - - rc = conf->register_attribute( name, - generic_cache_template::get_cache_data, (void *) this, - generic_cache_template::set_cache_data, (void *) this ); - return rc; -} - /*------------------------------------------------------------------------*/ /* Accessor(s) / mutator(s) */ /*------------------------------------------------------------------------*/ diff -X dontdiff -uprN gems-2.1.1/opal/system/cache.h gems-2.1.1-gedare/opal/system/cache.h --- gems-2.1.1/opal/system/cache.h 2010-09-01 14:06:13.000000000 -0400 +++ gems-2.1.1-gedare/opal/system/cache.h 2010-09-01 16:46:58.000000000 -0400 @@ -59,6 +59,7 @@ #include "mshr.h" #include "scheduler.h" +#include "confio.h" /*------------------------------------------------------------------------*/ /* Macro declarations */ @@ -473,4 +474,72 @@ protected: /* Global functions */ /*------------------------------------------------------------------------*/ +/* workaround see: https://lists.cs.wisc.edu/archive/gems-users/2009-March/msg00116.shtml */ +//************************************************************************** +template +int generic_cache_template::registerCheckpoint( confio_t *conf ) +{ + int rc; + + rc = conf->register_attribute( name, + generic_cache_template::get_cache_data, (void *) this, + generic_cache_template::set_cache_data, (void *) this ); + return rc; +} + +//************************************************************************** +template +void generic_cache_template::OracleAccess(pa_t a) { + /* used when we want the execution of a particular load or store to + * be prefetched perfectly. + */ + uint32 index = Set(a); + pa_t ba = BlockAddress(a); + ASSERT(index < n_sets); + STAT_INC(reads); + + /* search all sets until we find a match */ + BlockType *set = &cache[index * m_assoc]; + int replace_set = 0; + for (uint32 i = 0 ; i < m_assoc ; i ++) { + bool hit = IsValid(set[i]) && (getBlockAddress(set[i]) == ba); + if (hit) { + STAT_INC(read_hit); + return; + } + if (set[i].last_access < set[replace_set].last_access) { + replace_set = i; + } + } + + /* write new block into the cache */ + STAT_INC(read_miss); + set[replace_set].address_state = ba | CACHE_BLK_VALID; + set[replace_set].last_access = m_eventQueue->getCycle(); +} + +//************************************************************************** +template +void generic_cache_template::Warmup(pa_t a) { + + uint32 index = Set(a); + pa_t ba = BlockAddress(a); + ASSERT(index < n_sets); + + /* search all sets until we find a match */ + BlockType *set = &cache[index * m_assoc]; + for (uint32 i = 0 ; i < m_assoc ; i ++) { + bool hit = IsValid(set[i]) && (getBlockAddress(set[i]) == ba); + if (hit) { + return; + } + } + int replace_set = random() % m_assoc; + /* write new block into the cache */ + set[replace_set].address_state = ba | CACHE_BLK_VALID; +} + + + + #endif /* _CACHE_H_ */ diff -X dontdiff -uprN gems-2.1.1/ruby/common/Debug.C gems-2.1.1-gedare/ruby/common/Debug.C --- gems-2.1.1/ruby/common/Debug.C 2010-09-01 14:06:10.000000000 -0400 +++ gems-2.1.1-gedare/ruby/common/Debug.C 2010-09-01 16:32:11.000000000 -0400 @@ -66,6 +66,7 @@ #include "Debug.h" #include "EventQueue.h" +#include "string.h" class Debug; extern Debug* g_debug_ptr; std::ostream * debug_cout_ptr; diff -X dontdiff -uprN gems-2.1.1/ruby/log_tm/LazyTransactionVersionManager.C gems-2.1.1-gedare/ruby/log_tm/LazyTransactionVersionManager.C --- gems-2.1.1/ruby/log_tm/LazyTransactionVersionManager.C 2010-09-01 14:06:10.000000000 -0400 +++ gems-2.1.1-gedare/ruby/log_tm/LazyTransactionVersionManager.C 2010-09-01 16:31:49.000000000 -0400 @@ -280,8 +280,9 @@ void LazyTransactionVersionManager::issu should_escape = true; } - CacheMsg storeMsg(Address(request_address), - Address(request_address), + Address ad(request_address); + CacheMsg storeMsg(ad, + ad, CacheRequestType_ST_XACT, SIMICS_get_program_counter(getLogicalProcID(thread)), AccessModeType_UserMode, diff -X dontdiff -uprN gems-2.1.1/ruby/system/CacheMemory.h gems-2.1.1-gedare/ruby/system/CacheMemory.h --- gems-2.1.1/ruby/system/CacheMemory.h 2010-09-01 14:06:10.000000000 -0400 +++ gems-2.1.1-gedare/ruby/system/CacheMemory.h 2010-09-01 16:30:13.000000000 -0400 @@ -78,6 +78,7 @@ #include "PseudoLRUPolicy.h" #include "LRUPolicy.h" #include +#include "string.h" template class CacheMemory {