DirectoryMemory.cc (10520:7740e0d97d48) | DirectoryMemory.cc (10522:13312d6e1caf) |
---|---|
1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 43 unchanged lines hidden (view full) --- 52 53void 54DirectoryMemory::init() 55{ 56 m_num_entries = m_size_bytes / RubySystem::getBlockSizeBytes(); 57 m_entries = new AbstractEntry*[m_num_entries]; 58 for (int i = 0; i < m_num_entries; i++) 59 m_entries[i] = NULL; | 1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 43 unchanged lines hidden (view full) --- 52 53void 54DirectoryMemory::init() 55{ 56 m_num_entries = m_size_bytes / RubySystem::getBlockSizeBytes(); 57 m_entries = new AbstractEntry*[m_num_entries]; 58 for (int i = 0; i < m_num_entries; i++) 59 m_entries[i] = NULL; |
60 m_ram = g_system_ptr->getMemoryVector(); | |
61 62 m_num_directories++; 63 m_num_directories_bits = ceilLog2(m_num_directories); 64 m_total_size_bytes += m_size_bytes; 65 66 if (m_numa_high_bit == 0) { 67 m_numa_high_bit = RubySystem::getMemorySizeBits() - 1; 68 } --- 58 unchanged lines hidden (view full) --- 127DirectoryMemory::allocate(const PhysAddress& address, AbstractEntry* entry) 128{ 129 assert(isPresent(address)); 130 uint64 idx; 131 DPRINTF(RubyCache, "Looking up address: %s\n", address); 132 133 idx = mapAddressToLocalIdx(address); 134 assert(idx < m_num_entries); | 60 61 m_num_directories++; 62 m_num_directories_bits = ceilLog2(m_num_directories); 63 m_total_size_bytes += m_size_bytes; 64 65 if (m_numa_high_bit == 0) { 66 m_numa_high_bit = RubySystem::getMemorySizeBits() - 1; 67 } --- 58 unchanged lines hidden (view full) --- 126DirectoryMemory::allocate(const PhysAddress& address, AbstractEntry* entry) 127{ 128 assert(isPresent(address)); 129 uint64 idx; 130 DPRINTF(RubyCache, "Looking up address: %s\n", address); 131 132 idx = mapAddressToLocalIdx(address); 133 assert(idx < m_num_entries); |
135 entry->getDataBlk().assign(m_ram->getBlockPtr(address)); | |
136 entry->changePermission(AccessPermission_Read_Only); 137 m_entries[idx] = entry; 138 139 return entry; 140} 141 142void 143DirectoryMemory::print(ostream& out) const --- 14 unchanged lines hidden --- | 134 entry->changePermission(AccessPermission_Read_Only); 135 m_entries[idx] = entry; 136 137 return entry; 138} 139 140void 141DirectoryMemory::print(ostream& out) const --- 14 unchanged lines hidden --- |