compressed_tags.hh (13945:a573bed35a8b) compressed_tags.hh (13946:8e96e9be7f2c)
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#define __MEM_CACHE_TAGS_COMPRESSED_TAGS_HH__
38
39#include <vector>
40
41#include "mem/cache/tags/sector_tags.hh"
42#include "mem/cache/tags/super_blk.hh"
43
44class BaseCache;
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#define __MEM_CACHE_TAGS_COMPRESSED_TAGS_HH__
38
39#include <vector>
40
41#include "mem/cache/tags/sector_tags.hh"
42#include "mem/cache/tags/super_blk.hh"
43
44class BaseCache;
45class CacheBlk;
45struct CompressedTagsParams;
46
47/**
48 * A CompressedTags cache tag store.
49 * @sa \ref gem5MemorySystem "gem5 Memory System"
50 *
51 * The Compression Ratio (CR) of a superblock is defined by
52 * CR = uncompressed_size / compressed_size.

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

92 virtual ~CompressedTags() {};
93
94 /**
95 * Initialize blocks as SuperBlk and CompressionBlk instances.
96 */
97 void tagsInit() override;
98
99 /**
46struct CompressedTagsParams;
47
48/**
49 * A CompressedTags cache tag store.
50 * @sa \ref gem5MemorySystem "gem5 Memory System"
51 *
52 * The Compression Ratio (CR) of a superblock is defined by
53 * CR = uncompressed_size / compressed_size.

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

93 virtual ~CompressedTags() {};
94
95 /**
96 * Initialize blocks as SuperBlk and CompressionBlk instances.
97 */
98 void tagsInit() override;
99
100 /**
101 * Checks whether a superblock can co-allocate given compressed data block.
102 *
103 * @param superblock Superblock to check.
104 * @param compressed_size Size, in bits, of new block to allocate.
105 * @return True if block can be co-allocated in superblock.
106 */
107 bool canCoAllocate(const SuperBlk* superblock,
108 const std::size_t compressed_size) const;
109
110 /**
111 * Find replacement victim based on address. Checks if data can be co-
112 * allocated before choosing blocks to be evicted.
113 *
114 * @param addr Address to find a victim for.
115 * @param is_secure True if the target memory space is secure.
116 * @param compressed_size Size, in bits, of new block to allocate.
117 * @param evict_blks Cache blocks to be evicted.
118 * @return Cache block to be replaced.
119 */
120 CacheBlk* findVictim(Addr addr, const bool is_secure,
121 const std::size_t compressed_size,
122 std::vector<CacheBlk*>& evict_blks) const override;
123
124 /**
100 * Insert the new block into the cache and update replacement data.
101 *
102 * @param pkt Packet holding the address to update
103 * @param blk The block to update.
104 */
105 void insertBlock(const PacketPtr pkt, CacheBlk *blk) override;
106
107 /**

--- 22 unchanged lines hidden ---
125 * Insert the new block into the cache and update replacement data.
126 *
127 * @param pkt Packet holding the address to update
128 * @param blk The block to update.
129 */
130 void insertBlock(const PacketPtr pkt, CacheBlk *blk) override;
131
132 /**

--- 22 unchanged lines hidden ---