DirectoryMemory.cc (11793:ef606668d247) DirectoryMemory.cc (11903:a75e4eae89c0)
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * Copyright (c) 2017 Google Inc.
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;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the

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

19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer;
10 * redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the

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

20 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 * Authors: Lena Olson
27 */
28
29#include "mem/ruby/structures/DirectoryMemory.hh"
30
31#include "base/intmath.hh"
32#include "debug/RubyCache.hh"
33#include "debug/RubyStats.hh"
34#include "mem/ruby/slicc_interface/RubySlicc_Util.hh"
35#include "mem/ruby/system/RubySystem.hh"
30 */
31
32#include "mem/ruby/structures/DirectoryMemory.hh"
33
34#include "base/intmath.hh"
35#include "debug/RubyCache.hh"
36#include "debug/RubyStats.hh"
37#include "mem/ruby/slicc_interface/RubySlicc_Util.hh"
38#include "mem/ruby/system/RubySystem.hh"
39#include "sim/system.hh"
36
37using namespace std;
38
39int DirectoryMemory::m_num_directories = 0;
40int DirectoryMemory::m_num_directories_bits = 0;
41int DirectoryMemory::m_numa_high_bit = 0;
42
43DirectoryMemory::DirectoryMemory(const Params *p)
44 : SimObject(p)
45{
46 m_version = p->version;
40
41using namespace std;
42
43int DirectoryMemory::m_num_directories = 0;
44int DirectoryMemory::m_num_directories_bits = 0;
45int DirectoryMemory::m_numa_high_bit = 0;
46
47DirectoryMemory::DirectoryMemory(const Params *p)
48 : SimObject(p)
49{
50 m_version = p->version;
47 m_size_bytes = p->size;
51 // In X86, there is an IO gap in the 3-4GB range.
52 if (p->system->getArch() == Arch::X86ISA && p->size > 0xc0000000){
53 // We need to add 1GB to the size for the gap
54 m_size_bytes = p->size + 0x40000000;
55 }
56 else {
57 m_size_bytes = p->size;
58 }
48 m_size_bits = floorLog2(m_size_bytes);
49 m_num_entries = 0;
50 m_numa_high_bit = p->numa_high_bit;
51}
52
53void
54DirectoryMemory::init()
55{

--- 100 unchanged lines hidden ---
59 m_size_bits = floorLog2(m_size_bytes);
60 m_num_entries = 0;
61 m_numa_high_bit = p->numa_high_bit;
62}
63
64void
65DirectoryMemory::init()
66{

--- 100 unchanged lines hidden ---