35 int persistent_randomize[] = {0, 4, 8, 12, 1, 5, 9, 13, 2, 6,
36 10, 14, 3, 7, 11, 15};
37 int persistent_randomize[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
38 10, 11, 12, 13, 14, 15};
55 if (locker == m_chip_ptr->getID())
56 cout <<
"Chip " << m_chip_ptr->getID() <<
": " << llocker
57 <<
" requesting lock for " << address << endl;
66 m_map.insert(AddressMap::value_type(address, dflt));
68 AddressMap::iterator
i = r.first;
77 if (type == AccessType_Write)
89 if (unlocker == m_chip_ptr->getID())
90 cout <<
"Chip " << m_chip_ptr->getID() <<
": " << uunlocker
91 <<
" requesting unlock for " << address << endl;
97 assert(m_map.count(address));
103 assert(entry.m_starving.isElement(unlocker));
104 assert(entry.m_marked.isSubset(entry.m_starving));
106 entry.m_marked.remove(unlocker);
107 entry.m_request_to_write.remove(unlocker);
108 assert(entry.m_marked.isSubset(entry.m_starving));
111 if (entry.m_starving.isEmpty()) {
112 assert(entry.m_marked.isEmpty());
113 m_map.erase(address);
123 AddressMap::const_iterator
i = m_map.find(address);
124 if (i == m_map.end()) {
144 AddressMap::const_iterator
i = m_map.find(address);
145 assert(i != m_map.end());
154 AddressMap::const_iterator
i = m_map.find(address);
155 assert(i != m_map.end());
157 if (entry.m_request_to_write.
158 isElement(entry.m_starving.smallestElement())) {
159 return AccessType_Write;
161 return AccessType_Read;
169 AddressMap::iterator
i = m_map.find(address);
170 if (i == m_map.end())
188 return m_map.count(address) > 0;
195 AddressMap::const_iterator
i = m_map.find(address);
196 if (i == m_map.end())
207 AddressMap::const_iterator
i = m_map.find(address);
208 if (i == m_map.end())
NetDest m_request_to_write
AccessType typeOfSmallest(Addr address) const
void persistentRequestUnlock(Addr address, MachineID unlocker)
void add(MachineID newElement)
bool isElement(MachineID element) const
void print(std::ostream &out) const
void remove(MachineID oldElement)
MachineID findSmallest(Addr address) const
bool isLocked(Addr addr) const
bool okToIssueStarving(Addr address, MachineID machID) const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Addr makeLineAddress(Addr addr)
bool isSubset(const NetDest &test) const
MachineID smallestElement() const
void markEntries(Addr address)
int countStarvingForAddress(Addr addr) const
int countReadStarvingForAddress(Addr addr) const
void persistentRequestLock(Addr address, MachineID locker, AccessType type)