gem5  v22.1.0.0
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 
40 namespace gem5
41 {
42 
43 namespace ruby
44 {
45 
47 {
48  public:
50  void print(std::ostream& out) const {}
51 
55 };
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 
90 inline std::ostream&
91 operator<<(std::ostream& out, const PersistentTable& obj)
92 {
93  obj.print(out);
94  out << std::flush;
95  return out;
96 }
97 
98 inline std::ostream&
99 operator<<(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
PersistentTable & operator=(const PersistentTable &obj)
MachineID findSmallest(Addr address) const
bool isLocked(Addr addr) const
void markEntries(Addr address)
std::unordered_map< Addr, PersistentTableEntry > AddressMap
bool okToIssueStarving(Addr address, MachineID machID) const
void print(std::ostream &out) const
int countStarvingForAddress(Addr addr) const
Bitfield< 3 > addr
Definition: types.hh:84
std::ostream & operator<<(std::ostream &os, const BoolVec &myvector)
Definition: BoolVec.cc:49
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147

Generated on Wed Dec 21 2022 10:22:38 for gem5 by doxygen 1.9.1