sector_tags.cc (13219:454ecc63338d) sector_tags.cc (13222:0dbcc7d7d66f)
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;

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

37
38#include <cassert>
39#include <memory>
40#include <string>
41
42#include "base/intmath.hh"
43#include "base/logging.hh"
44#include "base/types.hh"
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;

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

37
38#include <cassert>
39#include <memory>
40#include <string>
41
42#include "base/intmath.hh"
43#include "base/logging.hh"
44#include "base/types.hh"
45#include "debug/CacheRepl.hh"
46#include "mem/cache/base.hh"
47#include "mem/cache/replacement_policies/base.hh"
48#include "mem/cache/tags/indexing_policies/base.hh"
49
50SectorTags::SectorTags(const SectorTagsParams *p)
51 : BaseTags(p), allocAssoc(p->assoc),
52 sequentialAccess(p->sequential_access),
53 replacementPolicy(p->replacement_policy),

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

272 assert(!victim->isValid());
273 } else {
274 // The whole sector must be evicted to make room for the new sector
275 for (const auto& blk : victim_sector->blks){
276 evict_blks.push_back(blk);
277 }
278 }
279
45#include "mem/cache/base.hh"
46#include "mem/cache/replacement_policies/base.hh"
47#include "mem/cache/tags/indexing_policies/base.hh"
48
49SectorTags::SectorTags(const SectorTagsParams *p)
50 : BaseTags(p), allocAssoc(p->assoc),
51 sequentialAccess(p->sequential_access),
52 replacementPolicy(p->replacement_policy),

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

271 assert(!victim->isValid());
272 } else {
273 // The whole sector must be evicted to make room for the new sector
274 for (const auto& blk : victim_sector->blks){
275 evict_blks.push_back(blk);
276 }
277 }
278
280 DPRINTF(CacheRepl, "set %x, way %x, sector offset %x: selecting blk " \
281 "for replacement\n", victim->getSet(), victim->getWay(),
282 victim->getSectorOffset());
283
284 return victim;
285}
286
287int
288SectorTags::extractSectorOffset(Addr addr) const
289{
290 return (addr >> sectorShift) & sectorMask;
291}

--- 37 unchanged lines hidden ---
279 return victim;
280}
281
282int
283SectorTags::extractSectorOffset(Addr addr) const
284{
285 return (addr >> sectorShift) & sectorMask;
286}

--- 37 unchanged lines hidden ---