base.hh (13942:e8b59b523af6) | base.hh (13943:4046b0c547be) |
---|---|
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; --- 26 unchanged lines hidden (view full) --- 35 * line. 36 */ 37 38#ifndef __MEM_CACHE_COMPRESSORS_BASE_HH__ 39#define __MEM_CACHE_COMPRESSORS_BASE_HH__ 40 41#include <cstdint> 42 | 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; --- 26 unchanged lines hidden (view full) --- 35 * line. 36 */ 37 38#ifndef __MEM_CACHE_COMPRESSORS_BASE_HH__ 39#define __MEM_CACHE_COMPRESSORS_BASE_HH__ 40 41#include <cstdint> 42 |
43#include "base/statistics.hh" |
|
43#include "base/types.hh" 44#include "sim/sim_object.hh" 45 46class CacheBlk; 47struct BaseCacheCompressorParams; 48 49/** 50 * Base cache compressor interface. Every cache compressor must implement a --- 8 unchanged lines hidden (view full) --- 59 class CompressionData; 60 61 /** 62 * Uncompressed cache line size (in bytes). 63 */ 64 const std::size_t blkSize; 65 66 /** | 44#include "base/types.hh" 45#include "sim/sim_object.hh" 46 47class CacheBlk; 48struct BaseCacheCompressorParams; 49 50/** 51 * Base cache compressor interface. Every cache compressor must implement a --- 8 unchanged lines hidden (view full) --- 60 class CompressionData; 61 62 /** 63 * Uncompressed cache line size (in bytes). 64 */ 65 const std::size_t blkSize; 66 67 /** |
68 * @defgroup CompressionStats Compression specific statistics. 69 * @{ 70 */ 71 72 /** Number of blocks that were compressed to this power of two size. */ 73 Stats::Vector compressionSize; 74 75 /** 76 * @} 77 */ 78 79 /** |
|
67 * Apply the compression process to the cache line. 68 * Returns the number of cycles used by the compressor, however it is 69 * usually covered by a good pipelined execution, and is currently ignored. 70 * The decompression latency is also returned, in order to avoid 71 * increasing simulation time and memory consumption. 72 * 73 * @param cache_line The cache line to be compressed. 74 * @param comp_lat Compression latency in number of cycles. --- 56 unchanged lines hidden (view full) --- 131 132 /** 133 * Set the size of the compressed block, in bits. 134 * 135 * @param blk The compressed block. 136 * @param size_bits The block size. 137 */ 138 static void setSizeBits(CacheBlk* blk, const std::size_t size_bits); | 80 * Apply the compression process to the cache line. 81 * Returns the number of cycles used by the compressor, however it is 82 * usually covered by a good pipelined execution, and is currently ignored. 83 * The decompression latency is also returned, in order to avoid 84 * increasing simulation time and memory consumption. 85 * 86 * @param cache_line The cache line to be compressed. 87 * @param comp_lat Compression latency in number of cycles. --- 56 unchanged lines hidden (view full) --- 144 145 /** 146 * Set the size of the compressed block, in bits. 147 * 148 * @param blk The compressed block. 149 * @param size_bits The block size. 150 */ 151 static void setSizeBits(CacheBlk* blk, const std::size_t size_bits); |
152 153 /** 154 * Register local statistics. 155 */ 156 void regStats() override; |
|
139}; 140 141class BaseCacheCompressor::CompressionData { 142 private: 143 /** 144 * Compressed cache line size (in bits). 145 */ 146 std::size_t _size; --- 35 unchanged lines hidden --- | 157}; 158 159class BaseCacheCompressor::CompressionData { 160 private: 161 /** 162 * Compressed cache line size (in bits). 163 */ 164 std::size_t _size; --- 35 unchanged lines hidden --- |