Deleted Added
sdiff udiff text old ( 13942:e8b59b523af6 ) new ( 13943:4046b0c547be )
full compact
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;

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

31/** @file
32 * Definition of a basic cache compressor.
33 */
34
35#include "mem/cache/compressors/base.hh"
36
37#include <algorithm>
38#include <cstdint>
39
40#include "debug/CacheComp.hh"
41#include "mem/cache/tags/super_blk.hh"
42#include "params/BaseCacheCompressor.hh"
43
44// Uncomment this line if debugging compression
45//#define DEBUG_COMPRESSION
46

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

95 // Check if decompressed line matches original cache line
96 fatal_if(std::memcmp(data, decomp_data, blkSize),
97 "Decompressed line does not match original line.");
98 #endif
99
100 // Get compression size
101 comp_size_bits = comp_data->getSizeBits();
102
103 // Print debug information
104 DPRINTF(CacheComp, "Compressed cache line from %d to %d bits. " \
105 "Compression latency: %llu, decompression latency: %llu\n",
106 blkSize*8, comp_size_bits, comp_lat, decomp_lat);
107}
108
109Cycles
110BaseCacheCompressor::getDecompressionLatency(const CacheBlk* blk)

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

135{
136 // Sanity check
137 assert(blk != nullptr);
138
139 // Assign size
140 static_cast<CompressionBlk*>(blk)->setSizeBits(size_bits);
141}
142