DirectoryMemory.cc (11045:0bffd44521f5) DirectoryMemory.cc (11049:dfb0aa3f0649)
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;
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;
40int DirectoryMemory::m_numa_high_bit = 0;
41
42DirectoryMemory::DirectoryMemory(const Params *p)
43 : SimObject(p)
44{
45 m_version = p->version;
46 m_size_bytes = p->size;
47 m_size_bits = floorLog2(m_size_bytes);

--- 6 unchanged lines hidden (view full) ---

54{
55 m_num_entries = m_size_bytes / RubySystem::getBlockSizeBytes();
56 m_entries = new AbstractEntry*[m_num_entries];
57 for (int i = 0; i < m_num_entries; i++)
58 m_entries[i] = NULL;
59
60 m_num_directories++;
61 m_num_directories_bits = ceilLog2(m_num_directories);
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;
62
63 if (m_numa_high_bit == 0) {
64 m_numa_high_bit = RubySystem::getMemorySizeBits() - 1;
65 }
66 assert(m_numa_high_bit != 0);
67}
68
69DirectoryMemory::~DirectoryMemory()

--- 85 unchanged lines hidden ---
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 ---