Merge ktlim@zizzer:/bk/newmem
[gem5.git] / src / mem / cache / cache.cc
1 /*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
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
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
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.
27 *
28 * Authors: Erik Hallnor
29 * Steve Reinhardt
30 * Lisa Hsu
31 * Kevin Lim
32 */
33
34 /**
35 * @file
36 * Cache template instantiations.
37 */
38
39 #include "mem/config/cache.hh"
40 #include "mem/config/compression.hh"
41
42 #include "mem/cache/tags/cache_tags.hh"
43
44 #if defined(USE_CACHE_LRU)
45 #include "mem/cache/tags/lru.hh"
46 #endif
47
48 #if defined(USE_CACHE_FALRU)
49 #include "mem/cache/tags/fa_lru.hh"
50 #endif
51
52 #if defined(USE_CACHE_IIC)
53 #include "mem/cache/tags/iic.hh"
54 #endif
55
56 #if defined(USE_CACHE_SPLIT)
57 #include "mem/cache/tags/split.hh"
58 #endif
59
60 #if defined(USE_CACHE_SPLIT_LIFO)
61 #include "mem/cache/tags/split_lifo.hh"
62 #endif
63
64 #include "base/compression/null_compression.hh"
65 #if defined(USE_LZSS_COMPRESSION)
66 #include "base/compression/lzss_compression.hh"
67 #endif
68
69 #include "mem/cache/miss/miss_queue.hh"
70 #include "mem/cache/miss/blocking_buffer.hh"
71
72 #include "mem/cache/coherence/uni_coherence.hh"
73 #include "mem/cache/coherence/simple_coherence.hh"
74
75 #include "mem/cache/cache_impl.hh"
76
77 // Template Instantiations
78 #ifndef DOXYGEN_SHOULD_SKIP_THIS
79
80
81 #if defined(USE_CACHE_FALRU)
82 template class Cache<CacheTags<FALRU,NullCompression>, BlockingBuffer, SimpleCoherence>;
83 template class Cache<CacheTags<FALRU,NullCompression>, BlockingBuffer, UniCoherence>;
84 template class Cache<CacheTags<FALRU,NullCompression>, MissQueue, SimpleCoherence>;
85 template class Cache<CacheTags<FALRU,NullCompression>, MissQueue, UniCoherence>;
86 #if defined(USE_LZSS_COMPRESSION)
87 template class Cache<CacheTags<FALRU,LZSSCompression>, BlockingBuffer, SimpleCoherence>;
88 template class Cache<CacheTags<FALRU,LZSSCompression>, BlockingBuffer, UniCoherence>;
89 template class Cache<CacheTags<FALRU,LZSSCompression>, MissQueue, SimpleCoherence>;
90 template class Cache<CacheTags<FALRU,LZSSCompression>, MissQueue, UniCoherence>;
91 #endif
92 #endif
93
94 #if defined(USE_CACHE_IIC)
95 template class Cache<CacheTags<IIC,NullCompression>, BlockingBuffer, SimpleCoherence>;
96 template class Cache<CacheTags<IIC,NullCompression>, BlockingBuffer, UniCoherence>;
97 template class Cache<CacheTags<IIC,NullCompression>, MissQueue, SimpleCoherence>;
98 template class Cache<CacheTags<IIC,NullCompression>, MissQueue, UniCoherence>;
99 #if defined(USE_LZSS_COMPRESSION)
100 template class Cache<CacheTags<IIC,LZSSCompression>, BlockingBuffer, SimpleCoherence>;
101 template class Cache<CacheTags<IIC,LZSSCompression>, BlockingBuffer, UniCoherence>;
102 template class Cache<CacheTags<IIC,LZSSCompression>, MissQueue, SimpleCoherence>;
103 template class Cache<CacheTags<IIC,LZSSCompression>, MissQueue, UniCoherence>;
104 #endif
105 #endif
106
107 #if defined(USE_CACHE_LRU)
108 template class Cache<CacheTags<LRU,NullCompression>, BlockingBuffer, SimpleCoherence>;
109 template class Cache<CacheTags<LRU,NullCompression>, BlockingBuffer, UniCoherence>;
110 template class Cache<CacheTags<LRU,NullCompression>, MissQueue, SimpleCoherence>;
111 template class Cache<CacheTags<LRU,NullCompression>, MissQueue, UniCoherence>;
112 #if defined(USE_LZSS_COMPRESSION)
113 template class Cache<CacheTags<LRU,LZSSCompression>, BlockingBuffer, SimpleCoherence>;
114 template class Cache<CacheTags<LRU,LZSSCompression>, BlockingBuffer, UniCoherence>;
115 template class Cache<CacheTags<LRU,LZSSCompression>, MissQueue, SimpleCoherence>;
116 template class Cache<CacheTags<LRU,LZSSCompression>, MissQueue, UniCoherence>;
117 #endif
118 #endif
119
120 #if defined(USE_CACHE_SPLIT)
121 template class Cache<CacheTags<Split,NullCompression>, BlockingBuffer, SimpleCoherence>;
122 template class Cache<CacheTags<Split,NullCompression>, BlockingBuffer, UniCoherence>;
123 template class Cache<CacheTags<Split,NullCompression>, MissQueue, SimpleCoherence>;
124 template class Cache<CacheTags<Split,NullCompression>, MissQueue, UniCoherence>;
125 #if defined(USE_LZSS_COMPRESSION)
126 template class Cache<CacheTags<Split,LZSSCompression>, BlockingBuffer, SimpleCoherence>;
127 template class Cache<CacheTags<Split,LZSSCompression>, BlockingBuffer, UniCoherence>;
128 template class Cache<CacheTags<Split,LZSSCompression>, MissQueue, SimpleCoherence>;
129 template class Cache<CacheTags<Split,LZSSCompression>, MissQueue, UniCoherence>;
130 #endif
131 #endif
132
133 #if defined(USE_CACHE_SPLIT_LIFO)
134 template class Cache<CacheTags<SplitLIFO,NullCompression>, BlockingBuffer, SimpleCoherence>;
135 template class Cache<CacheTags<SplitLIFO,NullCompression>, BlockingBuffer, UniCoherence>;
136 template class Cache<CacheTags<SplitLIFO,NullCompression>, MissQueue, SimpleCoherence>;
137 template class Cache<CacheTags<SplitLIFO,NullCompression>, MissQueue, UniCoherence>;
138 #if defined(USE_LZSS_COMPRESSION)
139 template class Cache<CacheTags<SplitLIFO,LZSSCompression>, BlockingBuffer, SimpleCoherence>;
140 template class Cache<CacheTags<SplitLIFO,LZSSCompression>, BlockingBuffer, UniCoherence>;
141 template class Cache<CacheTags<SplitLIFO,LZSSCompression>, MissQueue, SimpleCoherence>;
142 template class Cache<CacheTags<SplitLIFO,LZSSCompression>, MissQueue, UniCoherence>;
143 #endif
144 #endif
145
146 #endif //DOXYGEN_SHOULD_SKIP_THIS