base.cc (13943:4046b0c547be) base.cc (13945:a573bed35a8b)
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;

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

106
107 // Print debug information
108 DPRINTF(CacheComp, "Compressed cache line from %d to %d bits. " \
109 "Compression latency: %llu, decompression latency: %llu\n",
110 blkSize*8, comp_size_bits, comp_lat, decomp_lat);
111}
112
113Cycles
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;

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

106
107 // Print debug information
108 DPRINTF(CacheComp, "Compressed cache line from %d to %d bits. " \
109 "Compression latency: %llu, decompression latency: %llu\n",
110 blkSize*8, comp_size_bits, comp_lat, decomp_lat);
111}
112
113Cycles
114BaseCacheCompressor::getDecompressionLatency(const CacheBlk* blk)
114BaseCacheCompressor::getDecompressionLatency(const CacheBlk* blk) const
115{
116 const CompressionBlk* comp_blk = static_cast<const CompressionBlk*>(blk);
117
118 // If block is compressed, return its decompression latency
119 if (comp_blk && comp_blk->isCompressed()){
115{
116 const CompressionBlk* comp_blk = static_cast<const CompressionBlk*>(blk);
117
118 // If block is compressed, return its decompression latency
119 if (comp_blk && comp_blk->isCompressed()){
120 return comp_blk->getDecompressionLatency();
120 const Cycles decomp_lat = comp_blk->getDecompressionLatency();
121 DPRINTF(CacheComp, "Decompressing block: %s (%d cycles)\n",
122 comp_blk->print(), decomp_lat);
123 return decomp_lat;
121 }
122
123 // Block is not compressed, so there is no decompression latency
124 return Cycles(0);
125}
126
127void
128BaseCacheCompressor::setDecompressionLatency(CacheBlk* blk, const Cycles lat)

--- 38 unchanged lines hidden ---
124 }
125
126 // Block is not compressed, so there is no decompression latency
127 return Cycles(0);
128}
129
130void
131BaseCacheCompressor::setDecompressionLatency(CacheBlk* blk, const Cycles lat)

--- 38 unchanged lines hidden ---