gem5  v20.1.0.0
compressed_tags.hh
Go to the documentation of this file.
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;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
34 #ifndef __MEM_CACHE_TAGS_COMPRESSED_TAGS_HH__
35 #define __MEM_CACHE_TAGS_COMPRESSED_TAGS_HH__
36 
37 #include <vector>
38 
41 
42 class BaseCache;
43 class CacheBlk;
44 struct CompressedTagsParams;
45 
71 class CompressedTags : public SectorTags
72 {
73  private:
78 
79  public:
81  typedef CompressedTagsParams Params;
82 
86  CompressedTags(const Params *p);
87 
91  virtual ~CompressedTags() {};
92 
96  void tagsInit() override;
97 
108  CacheBlk* findVictim(Addr addr, const bool is_secure,
109  const std::size_t compressed_size,
110  std::vector<CacheBlk*>& evict_blks) override;
111 
118  void insertBlock(const PacketPtr pkt, CacheBlk *blk) override;
119 
128  void forEachBlk(std::function<void(CacheBlk &)> visitor) override;
129 
139  bool anyBlk(std::function<bool(CacheBlk &)> visitor) override;
140 };
141 
142 #endif //__MEM_CACHE_TAGS_COMPRESSED_TAGS_HH__
CompressedTags::findVictim
CacheBlk * findVictim(Addr addr, const bool is_secure, const std::size_t compressed_size, std::vector< CacheBlk * > &evict_blks) override
Find replacement victim based on address.
Definition: compressed_tags.cc:102
CompressedTags::blks
std::vector< CompressionBlk > blks
The cache blocks.
Definition: compressed_tags.hh:75
std::vector< CompressionBlk >
CompressedTags::forEachBlk
void forEachBlk(std::function< void(CacheBlk &)> visitor) override
Visit each sub-block in the tags and apply a visitor.
Definition: compressed_tags.cc:191
sector_tags.hh
CompressedTags::insertBlock
void insertBlock(const PacketPtr pkt, CacheBlk *blk) override
Insert the new block into the cache and update replacement data.
Definition: compressed_tags.cc:169
CompressedTags::anyBlk
bool anyBlk(std::function< bool(CacheBlk &)> visitor) override
Find if any of the sub-blocks satisfies a condition.
Definition: compressed_tags.cc:199
SectorTags
A SectorTags cache tag store.
Definition: sector_tags.hh:58
BaseTags::Params
BaseTagsParams Params
Definition: base.hh:158
BaseCache
A basic cache interface.
Definition: base.hh:89
CompressedTags::~CompressedTags
virtual ~CompressedTags()
Destructor.
Definition: compressed_tags.hh:91
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
CompressedTags::CompressedTags
CompressedTags(const Params *p)
Construct and initialize this tag store.
Definition: compressed_tags.cc:44
CompressedTags::superBlks
std::vector< SuperBlk > superBlks
The cache superblocks.
Definition: compressed_tags.hh:77
super_blk.hh
Copyright (c) 2018 Inria All rights reserved.
CacheBlk
A Basic Cache block.
Definition: cache_blk.hh:84
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
addr
ip6_addr_t addr
Definition: inet.hh:423
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
CompressedTags::Params
CompressedTagsParams Params
Convenience typedef.
Definition: compressed_tags.hh:81
CompressedTags
A CompressedTags cache tag store.
Definition: compressed_tags.hh:71
CompressedTags::tagsInit
void tagsInit() override
Initialize blocks as SuperBlk and CompressionBlk instances.
Definition: compressed_tags.cc:50

Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17