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; --- 23 unchanged lines hidden (view full) --- 32#include "mem/ruby/slicc_interface/RubySlicc_Util.hh" 33#include "mem/ruby/structures/DirectoryMemory.hh" 34#include "mem/ruby/system/System.hh" 35 36using namespace std; 37 38int DirectoryMemory::m_num_directories = 0; 39int DirectoryMemory::m_num_directories_bits = 0; |
40uint64_t DirectoryMemory::m_total_size_bytes = 0; |
41int DirectoryMemory::m_numa_high_bit = 0; 42 43DirectoryMemory::DirectoryMemory(const Params *p) 44 : SimObject(p) 45{ 46 m_version = p->version; 47 m_size_bytes = p->size; 48 m_size_bits = floorLog2(m_size_bytes); --- 6 unchanged lines hidden (view full) --- 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 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 } 68 assert(m_numa_high_bit != 0); 69} 70 71DirectoryMemory::~DirectoryMemory() --- 85 unchanged lines hidden --- |