AbstractReplacementPolicy.hh (11049:dfb0aa3f0649) AbstractReplacementPolicy.hh (11061:25b53a7195f7)
1/*
2 * Copyright (c) 2007 Mark D. Hill and David A. Wood
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;

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

39class AbstractReplacementPolicy : public SimObject
40{
41 public:
42 typedef ReplacementPolicyParams Params;
43 AbstractReplacementPolicy(const Params * p);
44 virtual ~AbstractReplacementPolicy();
45
46 /* touch a block. a.k.a. update timestamp */
1/*
2 * Copyright (c) 2007 Mark D. Hill and David A. Wood
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;

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

39class AbstractReplacementPolicy : public SimObject
40{
41 public:
42 typedef ReplacementPolicyParams Params;
43 AbstractReplacementPolicy(const Params * p);
44 virtual ~AbstractReplacementPolicy();
45
46 /* touch a block. a.k.a. update timestamp */
47 virtual void touch(int64 set, int64 way, Tick time) = 0;
47 virtual void touch(int64_t set, int64_t way, Tick time) = 0;
48
49 /* returns the way to replace */
48
49 /* returns the way to replace */
50 virtual int64 getVictim(int64 set) const = 0;
50 virtual int64_t getVictim(int64_t set) const = 0;
51
52 /* get the time of the last access */
51
52 /* get the time of the last access */
53 Tick getLastAccess(int64 set, int64 way);
53 Tick getLastAccess(int64_t set, int64_t way);
54
55 virtual bool useOccupancy() const { return false; }
56
57 void setCache(CacheMemory * pCache) {m_cache = pCache;}
58 CacheMemory * m_cache;
59
60 protected:
61 unsigned m_num_sets; /** total number of sets */
62 unsigned m_assoc; /** set associativity */
63 Tick **m_last_ref_ptr; /** timestamp of last reference */
64};
65
66#endif // __MEM_RUBY_STRUCTURES_ABSTRACTREPLACEMENTPOLICY_HH__
54
55 virtual bool useOccupancy() const { return false; }
56
57 void setCache(CacheMemory * pCache) {m_cache = pCache;}
58 CacheMemory * m_cache;
59
60 protected:
61 unsigned m_num_sets; /** total number of sets */
62 unsigned m_assoc; /** set associativity */
63 Tick **m_last_ref_ptr; /** timestamp of last reference */
64};
65
66#endif // __MEM_RUBY_STRUCTURES_ABSTRACTREPLACEMENTPOLICY_HH__