CacheMemory.hh (10970:ea8bdb1d9f1e) CacheMemory.hh (10973:4820cc8408b0)
1/*
2 * Copyright (c) 1999-2012 Mark D. Hill and David A. Wood
1/*
2 * Copyright (c) 1999-2012 Mark D. Hill and David A. Wood
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
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

--- 115 unchanged lines hidden (view full) ---

126 Stats::Scalar numDataArrayReads;
127 Stats::Scalar numDataArrayWrites;
128 Stats::Scalar numTagArrayReads;
129 Stats::Scalar numTagArrayWrites;
130
131 Stats::Scalar numTagArrayStalls;
132 Stats::Scalar numDataArrayStalls;
133
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

--- 115 unchanged lines hidden (view full) ---

127 Stats::Scalar numDataArrayReads;
128 Stats::Scalar numDataArrayWrites;
129 Stats::Scalar numTagArrayReads;
130 Stats::Scalar numTagArrayWrites;
131
132 Stats::Scalar numTagArrayStalls;
133 Stats::Scalar numDataArrayStalls;
134
135 int getCacheSize() const { return m_cache_size; }
136 int getNumBlocks() const { return m_cache_num_sets * m_cache_assoc; }
137 Address getAddressAtIdx(int idx) const;
138
134 private:
135 // convert a Address to its location in the cache
136 int64 addressToCacheSet(const Address& address) const;
137
138 // Given a cache tag: returns the index of the tag in a set.
139 // returns -1 if the tag is not found.
140 int findTagInSet(int64 line, const Address& tag) const;
141 int findTagInSetIgnorePermissions(int64 cacheSet,

--- 33 unchanged lines hidden ---
139 private:
140 // convert a Address to its location in the cache
141 int64 addressToCacheSet(const Address& address) const;
142
143 // Given a cache tag: returns the index of the tag in a set.
144 // returns -1 if the tag is not found.
145 int findTagInSet(int64 line, const Address& tag) const;
146 int findTagInSetIgnorePermissions(int64 cacheSet,

--- 33 unchanged lines hidden ---