1/** 2 * Copyright (c) 2018 Inria 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; --- 36 unchanged lines hidden (view full) --- 45/** 46 * A replaceable entry is used by any table-like structure that needs to 47 * implement replacement functionality. It provides the replacement data 48 * pointer instantiated and needed by the replacement policy used. 49 * @sa Replacement Policies 50 */ 51class ReplaceableEntry 52{ |
53 private: |
54 /** |
55 * Set to which this entry belongs. |
56 */ |
57 uint32_t _set; 58 59 /** 60 * Way (relative position within the set) to which this entry belongs. 61 */ 62 uint32_t _way; 63 64 public: 65 /** 66 * Replacement data associated to this entry. 67 * It is instantiated by the replacement policy. 68 */ 69 std::shared_ptr<ReplacementData> replacementData; 70 71 /** 72 * Set both the set and way. Should be called only once. 73 * 74 * @param set The set of this entry. 75 * @param way The way of this entry. 76 */ 77 void setPosition(const uint32_t set, const uint32_t way) { 78 _set = set; 79 _way = way; 80 } 81 82 /** 83 * Get set number. 84 * 85 * @return The set to which this entry belongs. 86 */ 87 uint32_t getSet() const { return _set; } 88 89 /** 90 * Get way number. 91 * 92 * @return The way to which this entry belongs. 93 */ 94 uint32_t getWay() const { return _way; } |
95}; 96 97/** 98 * Replacement candidates as chosen by the indexing policy. 99 */ 100typedef std::vector<ReplaceableEntry*> ReplacementCandidates; 101 102/** --- 62 unchanged lines hidden --- |