gem5 v24.0.0.0
Loading...
Searching...
No Matches
register_file_cache.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 The University of Wisconsin
3 *
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer;
10 * redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution;
13 * neither the name of the copyright holders nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#ifndef __REGISTER_FILE_CACHE_HH__
31#define __REGISTER_FILE_CACHE_HH__
32
33#include <limits>
34#include <unordered_set>
35#include <vector>
36
37#include "base/statistics.hh"
38#include "base/types.hh"
39#include "gpu-compute/misc.hh"
40#include "sim/sim_object.hh"
41
42namespace gem5
43{
44
45class ComputeUnit;
46class Wavefront;
47
48struct RegisterFileCacheParams;
49
51{
52 public:
53 RegisterFileCache(const RegisterFileCacheParams &p);
54 virtual ~RegisterFileCache();
55 virtual void setParent(ComputeUnit *_computeUnit);
56 int cacheSize() const { return _capacity; }
57
58 // Debug functions
59 virtual std::string dumpLL() const;
60
61 // Abstract Register Event
63 {
64 protected:
66 int regIdx;
67
68 public:
71 };
72
80
81 virtual void enqCacheInsertEvent(uint32_t regIdx, uint64_t delay);
82
83 virtual void waveExecuteInst(Wavefront *w, GPUDynInstPtr ii);
84
85 // Add register to rfc using LRU replacement policy
86 virtual void markRFC(int regIdx);
87
88 virtual bool inRFC(int regIdx);
89
90 protected:
93
95 {
96 public:
97 int regIdx;
98
101 OrderedRegs(int val) : regIdx(val), next(nullptr), prev(nullptr) {}
102 };
103
104 // Doubly linked list, head is the most recently used
105 std::unordered_map<int, OrderedRegs*> lruHash;
108
109};
110
111} // namespace gem5
112
113#endif // __REGISTER_FILE_CACHE_HH__
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
static const FlagsType AutoDelete
Definition eventq.hh:110
void setFlags(Flags _flags)
Definition eventq.hh:331
MarkRegCachedEvent(RegisterFileCache *rfc, int regIdx)
RegisterCacheEvent(RegisterFileCache *rfc, int regIdx)
std::unordered_map< int, OrderedRegs * > lruHash
virtual void enqCacheInsertEvent(uint32_t regIdx, uint64_t delay)
RegisterFileCache(const RegisterFileCacheParams &p)
virtual std::string dumpLL() const
virtual void markRFC(int regIdx)
virtual void setParent(ComputeUnit *_computeUnit)
virtual bool inRFC(int regIdx)
virtual void waveExecuteInst(Wavefront *w, GPUDynInstPtr ii)
Abstract superclass for simulation objects.
Bitfield< 0 > p
Bitfield< 0 > w
Bitfield< 63 > val
Definition misc.hh:804
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
std::shared_ptr< GPUDynInst > GPUDynInstPtr
Definition misc.hh:49
Declaration of Statistics objects.

Generated on Tue Jun 18 2024 16:24:04 for gem5 by doxygen 1.11.0