fa_lru.hh (6216:2f4020838149) fa_lru.hh (6227:a17798f2a52c)
1/*
2 * Copyright (c) 2003-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;

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

73 */
74class FALRU : public BaseTags
75{
76 public:
77 /** Typedef the block type used in this class. */
78 typedef FALRUBlk BlkType;
79 /** Typedef a list of pointers to the local block type. */
80 typedef std::list<FALRUBlk*> BlkList;
1/*
2 * Copyright (c) 2003-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;

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

73 */
74class FALRU : public BaseTags
75{
76 public:
77 /** Typedef the block type used in this class. */
78 typedef FALRUBlk BlkType;
79 /** Typedef a list of pointers to the local block type. */
80 typedef std::list<FALRUBlk*> BlkList;
81
81 protected:
82 /** The block size of the cache. */
82 protected:
83 /** The block size of the cache. */
83 const int blkSize;
84 const unsigned blkSize;
84 /** The size of the cache. */
85 /** The size of the cache. */
85 const int size;
86 const unsigned size;
86 /** The number of blocks in the cache. */
87 /** The number of blocks in the cache. */
87 const int numBlks; // calculated internally
88 const unsigned numBlks; // calculated internally
88 /** The hit latency of the cache. */
89 /** The hit latency of the cache. */
89 const int hitLatency;
90 const unsigned hitLatency;
90
91 /** Array of pointers to blocks at the cache size boundaries. */
92 FALRUBlk **cacheBoundaries;
93 /** A mask for the FALRUBlk::inCache bits. */
94 int cacheMask;
95 /** The number of different size caches being tracked. */
91
92 /** Array of pointers to blocks at the cache size boundaries. */
93 FALRUBlk **cacheBoundaries;
94 /** A mask for the FALRUBlk::inCache bits. */
95 int cacheMask;
96 /** The number of different size caches being tracked. */
96 int numCaches;
97 unsigned numCaches;
97
98 /** The cache blocks. */
99 FALRUBlk *blks;
100
101 /** The MRU block. */
102 FALRUBlk *head;
103 /** The LRU block. */
104 FALRUBlk *tail;

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

151
152public:
153 /**
154 * Construct and initialize this cache tagstore.
155 * @param blkSize The block size of the cache.
156 * @param size The size of the cache.
157 * @param hit_latency The hit latency of the cache.
158 */
98
99 /** The cache blocks. */
100 FALRUBlk *blks;
101
102 /** The MRU block. */
103 FALRUBlk *head;
104 /** The LRU block. */
105 FALRUBlk *tail;

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

152
153public:
154 /**
155 * Construct and initialize this cache tagstore.
156 * @param blkSize The block size of the cache.
157 * @param size The size of the cache.
158 * @param hit_latency The hit latency of the cache.
159 */
159 FALRU(int blkSize, int size, int hit_latency);
160 FALRU(unsigned blkSize, unsigned size, unsigned hit_latency);
160
161 /**
162 * Register the stats for this object.
163 * @param name The name to prepend to the stats name.
164 */
165 void regStats(const std::string &name);
166
167 /**

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

209 {
210 return hitLatency;
211 }
212
213 /**
214 * Return the block size of this cache.
215 * @return The block size.
216 */
161
162 /**
163 * Register the stats for this object.
164 * @param name The name to prepend to the stats name.
165 */
166 void regStats(const std::string &name);
167
168 /**

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

210 {
211 return hitLatency;
212 }
213
214 /**
215 * Return the block size of this cache.
216 * @return The block size.
217 */
217 int getBlockSize()
218 unsigned
219 getBlockSize() const
218 {
219 return blkSize;
220 }
221
222 /**
223 * Return the subblock size of this cache, always the block size.
224 * @return The block size.
225 */
220 {
221 return blkSize;
222 }
223
224 /**
225 * Return the subblock size of this cache, always the block size.
226 * @return The block size.
227 */
226 int getSubBlockSize()
228 unsigned
229 getSubBlockSize() const
227 {
228 return blkSize;
229 }
230
231 /**
232 * Align an address to the block size.
233 * @param addr the address to align.
234 * @return The aligned address.

--- 50 unchanged lines hidden ---
230 {
231 return blkSize;
232 }
233
234 /**
235 * Align an address to the block size.
236 * @param addr the address to align.
237 * @return The aligned address.

--- 50 unchanged lines hidden ---