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;

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

162
163 // The tag lookup latency is the same for a hit or a miss
164 lat = lookupLatency;
165
166 return blk;
167}
168
169void
170SectorTags::insertBlock(const Addr addr, const bool is_secure,
171 const int src_master_ID, const uint32_t task_ID,
172 CacheBlk *blk)
170SectorTags::insertBlock(const PacketPtr pkt, CacheBlk *blk)
171{
172 // Get block's sector
173 SectorSubBlk* sub_blk = static_cast<SectorSubBlk*>(blk);
174 const SectorBlk* sector_blk = sub_blk->getSectorBlock();
175
176 // When a block is inserted, the tag is only a newly used tag if the
177 // sector was not previously present in the cache.
178 if (sector_blk->isValid()) {
179 // An existing entry's replacement data is just updated
180 replacementPolicy->touch(sector_blk->replacementData);
181 } else {
182 // Increment tag counter
183 tagsInUse++;
184
185 // A new entry resets the replacement data
186 replacementPolicy->reset(sector_blk->replacementData);
187 }
188
189 // Do common block insertion functionality
192 BaseTags::insertBlock(addr, is_secure, src_master_ID, task_ID, blk);
190 BaseTags::insertBlock(pkt, blk);
191}
192
193CacheBlk*
194SectorTags::findBlock(Addr addr, bool is_secure) const
195{
196 // Extract sector tag
197 const Addr tag = extractTag(addr);
198

--- 110 unchanged lines hidden ---