sector_tags.cc (13445:070fc4d948c0) | sector_tags.cc (13752:135bb759ee9c) |
---|---|
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 | 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) |
173{ 174 // Get block's sector 175 SectorSubBlk* sub_blk = static_cast<SectorSubBlk*>(blk); 176 const SectorBlk* sector_blk = sub_blk->getSectorBlock(); 177 178 // When a block is inserted, the tag is only a newly used tag if the 179 // sector was not previously present in the cache. 180 if (sector_blk->isValid()) { 181 // An existing entry's replacement data is just updated 182 replacementPolicy->touch(sector_blk->replacementData); 183 } else { 184 // Increment tag counter 185 tagsInUse++; 186 187 // A new entry resets the replacement data 188 replacementPolicy->reset(sector_blk->replacementData); 189 } 190 191 // Do common block insertion functionality | 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); |
193} 194 195CacheBlk* 196SectorTags::findBlock(Addr addr, bool is_secure) const 197{ 198 // Extract sector tag 199 const Addr tag = extractTag(addr); 200 --- 110 unchanged lines hidden --- | 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 --- |