Tester update
[gem5.git] / src / mem / ruby / common / Global.hh
1
2 /*
3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
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
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.
16 *
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.
28 */
29
30 /*
31 * $Id$
32 *
33 * */
34
35 #ifndef GLOBAL_H
36 #define GLOBAL_H
37
38 /*
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
45 #else
46 const bool TWO_LEVEL_CACHE = true;
47 #ifdef IS_CMP
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
52 #else // not IS_CMP
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
58 #endif // IS_CMP
59 #endif //SINGLE_LEVEL_CACHE
60
61 #define DIRECTORY_MEMBER_VARIABLE m_Directory_directory_vec[m_version]
62 #define TBE_TABLE_MEMBER_VARIABLE m_L1Cache_TBEs_vec[m_version]
63
64 */
65
66
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"
71
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;
77 typedef int SwitchID;
78 typedef int LinkID;
79
80 class RubyEventQueue;
81 extern RubyEventQueue* g_eventQueue_ptr;
82
83 class RubySystem;
84 extern RubySystem* g_system_ptr;
85
86 class Debug;
87 extern Debug* g_debug_ptr;
88
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()
92 {
93 return 1024;
94 }
95
96
97 #endif //GLOBAL_H
98