fa_lru.cc (13164:da6240a1ccfb) fa_lru.cc (13165:d52afbf4cdfe)
1/*
1/*
2 * Copyright (c) 2018 Inria
2 * Copyright (c) 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
9 * licensed hereunder. You may use the software subject to the license

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

34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Authors: Erik Hallnor
41 * Nikos Nikoleris
3 * Copyright (c) 2013,2016-2018 ARM Limited
4 * All rights reserved.
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating
9 * to a hardware implementation of the functionality of the software
10 * licensed hereunder. You may use the software subject to the license

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

35 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 *
41 * Authors: Erik Hallnor
42 * Nikos Nikoleris
43 * Daniel Carvalho
42 */
43
44/**
45 * @file
46 * Definitions a fully associative LRU tagstore.
47 */
48
49#include "mem/cache/tags/fa_lru.hh"

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

105{
106 BaseTags::regStats();
107 cacheTracking.regStats(name());
108}
109
110void
111FALRU::invalidate(CacheBlk *blk)
112{
44 */
45
46/**
47 * @file
48 * Definitions a fully associative LRU tagstore.
49 */
50
51#include "mem/cache/tags/fa_lru.hh"

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

107{
108 BaseTags::regStats();
109 cacheTracking.regStats(name());
110}
111
112void
113FALRU::invalidate(CacheBlk *blk)
114{
115 // Erase block entry reference in the hash table
116 auto num_erased = tagHash.erase(std::make_pair(blk->tag, blk->isSecure()));
117
118 // Sanity check; only one block reference should be erased
119 assert(num_erased == 1);
120
121 // Invalidate block entry. Must be done after the hash is erased
113 BaseTags::invalidate(blk);
114
115 // Decrease the number of tags in use
116 tagsInUse--;
117
118 // Move the block to the tail to make it the next victim
119 moveToTail((FALRUBlk*)blk);
122 BaseTags::invalidate(blk);
123
124 // Decrease the number of tags in use
125 tagsInUse--;
126
127 // Move the block to the tail to make it the next victim
128 moveToTail((FALRUBlk*)blk);
120
121 // Erase block entry in the hash table
122 tagHash.erase(std::make_pair(blk->tag, blk->isSecure()));
123}
124
125CacheBlk*
126FALRU::accessBlock(Addr addr, bool is_secure, Cycles &lat)
127{
128 return accessBlock(addr, is_secure, lat, 0);
129}
130

--- 320 unchanged lines hidden ---
129}
130
131CacheBlk*
132FALRU::accessBlock(Addr addr, bool is_secure, Cycles &lat)
133{
134 return accessBlock(addr, is_secure, lat, 0);
135}
136

--- 320 unchanged lines hidden ---