gem5 v24.0.0.0
Loading...
Searching...
No Matches
PersistentTable.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
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
29#ifndef __MEM_RUBY_STRUCTURES_PERSISTENTTABLE_HH__
30#define __MEM_RUBY_STRUCTURES_PERSISTENTTABLE_HH__
31
32#include <iostream>
33#include <unordered_map>
34
38#include "mem/ruby/protocol/AccessType.hh"
39
40namespace gem5
41{
42
43namespace ruby
44{
45
56
58{
59 public:
60 // Constructors
62
63 // Destructor
65
66 // Public Methods
67 void persistentRequestLock(Addr address, MachineID locker,
68 AccessType type);
69 void persistentRequestUnlock(Addr address, MachineID unlocker);
70 bool okToIssueStarving(Addr address, MachineID machID) const;
71 MachineID findSmallest(Addr address) const;
72 AccessType typeOfSmallest(Addr address) const;
73 void markEntries(Addr address);
74 bool isLocked(Addr addr) const;
77
78 void print(std::ostream& out) const;
79
80 private:
81 // Private copy constructor and assignment operator
84
85 // Data Members (m_prefix)
86 typedef std::unordered_map<Addr, PersistentTableEntry> AddressMap;
88};
89
90inline std::ostream&
91operator<<(std::ostream& out, const PersistentTable& obj)
92{
93 obj.print(out);
94 out << std::flush;
95 return out;
96}
97
98inline std::ostream&
99operator<<(std::ostream& out, const PersistentTableEntry& obj)
100{
101 obj.print(out);
102 out << std::flush;
103 return out;
104}
105
106} // namespace ruby
107} // namespace gem5
108
109#endif // __MEM_RUBY_STRUCTURES_PERSISTENTTABLE_HH__
void print(std::ostream &out) const
void persistentRequestLock(Addr address, MachineID locker, AccessType type)
void persistentRequestUnlock(Addr address, MachineID unlocker)
PersistentTable(const PersistentTable &obj)
int countReadStarvingForAddress(Addr addr) const
AccessType typeOfSmallest(Addr address) const
MachineID findSmallest(Addr address) const
bool isLocked(Addr addr) const
std::unordered_map< Addr, PersistentTableEntry > AddressMap
bool okToIssueStarving(Addr address, MachineID machID) const
void print(std::ostream &out) const
int countStarvingForAddress(Addr addr) const
PersistentTable & operator=(const PersistentTable &obj)
Bitfield< 3 > addr
Definition types.hh:84
std::ostream & operator<<(std::ostream &os, const BoolVec &myvector)
Definition BoolVec.cc:49
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147

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