38d37
< #include "mem/ruby/config/RubyConfig.hh"
65,135d63
< /*
< #ifdef MACHINETYPE_PersistentArbiter
< #define MACHINETYPE_PERSISTENTARBITER_ENUM MachineType_PersistentArbiter
< #else
< #define MACHINETYPE_PERSISTENTARBITER_ENUM MachineType_NUM
< #endif
< */
< /*
< inline MachineID map_Address_to_L2Cache(const Address & addr)
< {
< int L2bank = 0;
< MachineID mach = {MACHINETYPE_L2CACHE_ENUM, 0};
< L2bank = addr.bitSelect(RubySystem::getBlockSizeBits(),
< RubySystem::getBlockSizeBits() + RubyConfig::getNumberOfCachesPerLevel(2)-1);
< mach.num = L2bank;
< return mach;
< }
<
< // input parameter is the base ruby node of the L1 cache
< // returns a value between 0 and total_L2_Caches_within_the_system
< inline
< MachineID map_L1CacheMachId_to_L2Cache(const Address& addr, MachineID L1CacheMachId)
< {
< return map_Address_to_L2Cache(addr);
<
< int L2bank = 0;
< MachineID mach = {MACHINETYPE_L2CACHE_ENUM, 0};
<
< if (RubyConfig::L2CachePerChipBits() > 0) {
< if (RubyConfig::getMAP_L2BANKS_TO_LOWEST_BITS()) {
< L2bank = addr.bitSelect(RubySystem::getBlockSizeBits(),
< RubySystem::getBlockSizeBits()+RubyConfig::L2CachePerChipBits()-1);
< } else {
< L2bank = addr.bitSelect(RubySystem::getBlockSizeBits()+RubyConfig::getL2_CACHE_NUM_SETS_BITS(),
< RubySystem::getBlockSizeBits()+RubyConfig::getL2_CACHE_NUM_SETS_BITS()+RubyConfig::L2CachePerChipBits()-1);
< }
< }
<
< assert(L2bank < RubyConfig::numberOfL2CachePerChip());
< assert(L2bank >= 0);
<
< mach.num = RubyConfig::L1CacheNumToL2Base(L1CacheMachId.num)*RubyConfig::numberOfL2CachePerChip() // base #
< + L2bank; // bank #
< assert(mach.num < RubyConfig::numberOfL2Cache());
< return mach;
<
< }
<
<
< // used to determine the correct L2 bank
< // input parameter is the base ruby node of the L2 cache
< // returns a value between 0 and total_L2_Caches_within_the_system
<
< inline
< MachineID map_L2ChipId_to_L2Cache(const Address& addr, NodeID L2ChipId)
< {
< return map_Address_to_L2Cache(addr);
<
< assert(L2ChipId < RubyConfig::numberOfChips());
<
< int L2bank = 0;
< MachineID mach = {MACHINETYPE_L2CACHE_ENUM, 0};
< L2bank = addr.bitSelect(RubySystem::getBlockSizeBits(),
< RubySystem::getBlockSizeBits() + RubyConfig::numberOfCachesPerLevel(2)-1);
< mach.num = L2bank;
< return mach
<
< }
< */
<
<
160,179d87
< /*
< inline
< NetDest getOtherLocalL1IDs(MachineID L1)
< {
< int start = (L1.num / RubyConfig::numberOfProcsPerChip()) * RubyConfig::numberOfProcsPerChip();
< NetDest ret;
<
< assert(MACHINETYPE_L1CACHE_ENUM != MachineType_NUM);
<
< for (int i = start; i < (start + RubyConfig::numberOfProcsPerChip()); i++) {
< if (i != L1.num) {
< MachineID mach = { MACHINETYPE_L1CACHE_ENUM, i };
< ret.add( mach );
< }
< }
<
< return ret;
< }
< */
<
182d89
< // return machID.num%RubyConfig::numberOfChips();
196,211c103
< /*
< extern inline NodeID L2CacheMachIDToChipID(MachineID machID)
< {
< assert(machID.type == MACHINETYPE_L2CACHE_ENUM);
< int L2bank = machID.num;
< int banks_seen = 0;
< for (int i=0;i<RubyConfig::getNumberOfChips();i++) {
< for (int j=0;j<RubyConfig::getNumberOfCachesPerLevelPerChip(2,i);j++) {
< if (banks_seen == L2bank)
< return i;
< banks_seen++;
< }
< }
< assert(0);
< }
< */
---
>