gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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  * Authors: Daniel Carvalho
29  */
30 
36 #ifndef __MEM_CACHE_TAGS_COMPRESSED_TAGS_HH__
37 #define __MEM_CACHE_TAGS_COMPRESSED_TAGS_HH__
38 
39 #include <vector>
40 
43 
44 class BaseCache;
45 class CacheBlk;
46 struct CompressedTagsParams;
47 
73 class CompressedTags : public SectorTags
74 {
75  private:
80 
81  public:
83  typedef CompressedTagsParams Params;
84 
88  CompressedTags(const Params *p);
89 
93  virtual ~CompressedTags() {};
94 
98  void tagsInit() override;
99 
110  CacheBlk* findVictim(Addr addr, const bool is_secure,
111  const std::size_t compressed_size,
112  std::vector<CacheBlk*>& evict_blks) override;
113 
120  void insertBlock(const PacketPtr pkt, CacheBlk *blk) override;
121 
130  void forEachBlk(std::function<void(CacheBlk &)> visitor) override;
131 
141  bool anyBlk(std::function<bool(CacheBlk &)> visitor) override;
142 };
143 
144 #endif //__MEM_CACHE_TAGS_COMPRESSED_TAGS_HH__
void forEachBlk(std::function< void(CacheBlk &)> visitor) override
Visit each sub-block in the tags and apply a visitor.
CompressedTagsParams Params
Convenience typedef.
A SectorTags cache tag store.
Definition: sector_tags.hh:60
void insertBlock(const PacketPtr pkt, CacheBlk *blk) override
Insert the new block into the cache and update replacement data.
CompressedTags(const Params *p)
Construct and initialize this tag store.
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.
ip6_addr_t addr
Definition: inet.hh:335
A Basic Cache block.
Definition: cache_blk.hh:87
A CompressedTags cache tag store.
Copyright (c) 2018 Inria All rights reserved.
A basic cache interface.
Definition: base.hh:93
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
Declaration of a sector tag store.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:255
bool anyBlk(std::function< bool(CacheBlk &)> visitor) override
Find if any of the sub-blocks satisfies a condition.
virtual ~CompressedTags()
Destructor.
Bitfield< 0 > p
std::vector< CompressionBlk > blks
The cache blocks.
void tagsInit() override
Initialize blocks as SuperBlk and CompressionBlk instances.
std::vector< SuperBlk > superBlks
The cache superblocks.

Generated on Fri Feb 28 2020 16:27:02 for gem5 by doxygen 1.8.13