3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
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
12 * documentation and/or other materials provided with the distribution;
13 * neither the name of the copyright holders nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
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.
39 #ifdef SINGLE_LEVEL_CACHE
40 const bool TWO_LEVEL_CACHE = false;
41 #define L1I_CACHE_MEMBER_VARIABLE m_L1Cache_cacheMemory_vec[m_version] // currently all protocols require L1s == nodes
42 #define L1D_CACHE_MEMBER_VARIABLE m_L1Cache_cacheMemory_vec[m_version] // "
43 #define L2_CACHE_MEMBER_VARIABLE m_L1Cache_cacheMemory_vec[m_version] // "
44 #define L2_CACHE_VARIABLE m_L1Cache_cacheMemory_vec
46 const bool TWO_LEVEL_CACHE = true;
48 #define L1I_CACHE_MEMBER_VARIABLE m_L1Cache_L1IcacheMemory_vec[m_version]
49 #define L1D_CACHE_MEMBER_VARIABLE m_L1Cache_L1DcacheMemory_vec[m_version]
50 #define L2_CACHE_MEMBER_VARIABLE m_L2Cache_L2cacheMemory_vec[m_version]
51 #define L2_CACHE_VARIABLE m_L2Cache_L2cacheMemory_vec
53 #define L1I_CACHE_MEMBER_VARIABLE m_L1Cache_L1IcacheMemory_vec[m_version] // currently all protocols require L1s == nodes
54 #define L1D_CACHE_MEMBER_VARIABLE m_L1Cache_L1DcacheMemory_vec[m_version] // "
55 // #define L2_CACHE_MEMBER_VARIABLE m_L1Cache_L2cacheMemory_vec[m_version] // old exclusive caches don't support L2s != nodes
56 #define L2_CACHE_MEMBER_VARIABLE m_L1Cache_cacheMemory_vec[m_version] // old exclusive caches don't support L2s != nodes
57 #define L2_CACHE_VARIABLE m_L1Cache_L2cacheMemory_vec
59 #endif //SINGLE_LEVEL_CACHE
61 #define DIRECTORY_MEMBER_VARIABLE m_Directory_directory_vec[m_version]
62 #define TBE_TABLE_MEMBER_VARIABLE m_L1Cache_TBEs_vec[m_version]
67 // external includes for all classes
68 #include "mem/ruby/common/TypeDefines.hh"
69 #include "mem/gems_common/std-includes.hh"
70 #include "mem/ruby/common/Debug.hh"
72 // simple type declarations
73 typedef Time LogicalTime;
74 typedef int64 Index; // what the address bit ripper returns
75 typedef int word; // one word of a cache line
76 typedef unsigned int uint;
81 extern RubyEventQueue* g_eventQueue_ptr;
84 extern RubySystem* g_system_ptr;
87 extern Debug* g_debug_ptr;
89 // FIXME: this is required by the contructor of Directory_Entry.hh. It can't go
90 // into slicc_util.hh because it opens a can of ugly worms
91 extern inline int max_tokens()