gem5
[DEVELOP-FOR-23.0]
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
o
p
q
r
s
t
v
x
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
:
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
s
t
v
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Typedefs
a
b
c
d
g
h
i
l
m
r
s
t
u
w
Enumerations
b
h
i
o
p
Enumerator
h
i
o
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
mem
cache
compressors
zero.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019-2020 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
34
#include "
mem/cache/compressors/zero.hh
"
35
36
#include "
base/trace.hh
"
37
#include "debug/CacheComp.hh"
38
#include "
mem/cache/compressors/dictionary_compressor_impl.hh
"
39
#include "params/ZeroCompressor.hh"
40
41
namespace
gem5
42
{
43
44
namespace
compression
45
{
46
47
Zero::Zero
(
const
Params
&
p
)
48
:
DictionaryCompressor
<uint64_t>(
p
)
49
{
50
}
51
52
void
53
Zero::addToDictionary
(
DictionaryEntry
data
)
54
{
55
assert(
numEntries
<
dictionarySize
);
56
dictionary
[
numEntries
++] =
data
;
57
}
58
59
std::unique_ptr<Base::CompressionData>
60
Zero::compress
(
const
std::vector<Chunk>
& chunks,
Cycles
& comp_lat,
61
Cycles
& decomp_lat)
62
{
63
std::unique_ptr<Base::CompressionData> comp_data =
64
DictionaryCompressor::compress
(chunks);
65
66
// If there is any non-zero entry, the compressor failed
67
if
(
numEntries
> 0) {
68
comp_data->setSizeBits(
blkSize
* 8);
69
DPRINTF
(CacheComp,
"Zero compression failed\n"
);
70
}
71
72
// Set compression latency (Assumes full line zero comparison)
73
comp_lat =
Cycles
(1);
74
75
// Set decompression latency
76
decomp_lat =
Cycles
(1);
77
78
// Return compressed line
79
return
comp_data;
80
}
81
82
}
// namespace compression
83
}
// namespace gem5
gem5::compression::BaseDictionaryCompressor::dictionarySize
const std::size_t dictionarySize
Dictionary size.
Definition:
dictionary_compressor.hh:71
gem5::compression::DictionaryCompressor
A template version of the dictionary compressor that allows to choose the dictionary size.
Definition:
dictionary_compressor.hh:117
data
const char data[]
Definition:
circlebuf.test.cc:48
gem5::compression::DictionaryCompressor< uint64_t >::dictionary
std::vector< DictionaryEntry > dictionary
The dictionary.
Definition:
dictionary_compressor.hh:194
gem5::compression::Zero::addToDictionary
void addToDictionary(DictionaryEntry data) override
Definition:
zero.cc:53
gem5::compression::Base::Params
BaseCacheCompressorParams Params
Definition:
base.hh:201
std::vector< Chunk >
gem5::compression::Base::blkSize
const std::size_t blkSize
Uncompressed cache line size (in bytes).
Definition:
base.hh:93
gem5::compression::DictionaryCompressor::compress
std::unique_ptr< Base::CompressionData > compress(const std::vector< Chunk > &chunks)
Apply compression.
Definition:
dictionary_compressor_impl.hh:130
gem5::compression::Zero::compress
std::unique_ptr< Base::CompressionData > compress(const std::vector< Base::Chunk > &chunks, Cycles &comp_lat, Cycles &decomp_lat) override
Apply the compression process to the cache line.
Definition:
zero.cc:60
zero.hh
gem5::Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition:
types.hh:78
gem5::VegaISA::p
Bitfield< 54 > p
Definition:
pagetable.hh:70
DPRINTF
#define DPRINTF(x,...)
Definition:
trace.hh:210
gem5::compression::BaseDictionaryCompressor::numEntries
std::size_t numEntries
Number of valid entries in the dictionary.
Definition:
dictionary_compressor.hh:74
dictionary_compressor_impl.hh
gem5::compression::Zero::Zero
Zero(const Params &p)
Definition:
zero.cc:47
trace.hh
gem5::compression::Zero::DictionaryEntry
DictionaryCompressor< uint64_t >::DictionaryEntry DictionaryEntry
Definition:
zero.hh:55
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition:
gpu_translation_state.hh:37
Generated on Sun Jul 30 2023 01:56:57 for gem5 by
doxygen
1.8.17