1/* 2 * Copyright (c) 2012-2013,2016,2018 ARM Limited 3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 97 unchanged lines hidden (view full) --- 106 FALRUBlk *blks; 107 108 /** The MRU block. */ 109 FALRUBlk *head; 110 /** The LRU block. */ 111 FALRUBlk *tail; 112 113 /** Hash table type mapping addresses to cache block pointers. */ |
114 struct PairHash 115 { 116 template <class T1, class T2> 117 std::size_t operator()(const std::pair<T1, T2> &p) const 118 { 119 return std::hash<T1>()(p.first) ^ std::hash<T2>()(p.second); 120 } 121 }; 122 typedef std::pair<Addr, bool> TagHashKey; 123 typedef std::unordered_map<TagHashKey, FALRUBlk *, PairHash> TagHash; |
124 125 /** The address hash table. */ |
126 TagHash tagHash; |
127 128 /** |
129 * Move a cache block to the MRU position. 130 * 131 * @param blk The block to promote. 132 */ 133 void moveToHead(FALRUBlk *blk); 134 135 /** 136 * Move a cache block to the LRU position. --- 245 unchanged lines hidden --- |