summaryrefslogtreecommitdiff
path: root/src/mem/ruby/structures
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2015-08-14 19:28:43 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2015-08-14 19:28:43 -0500
commit9648c05db19292ddd285a80914593cc0631403ff (patch)
tree501c8342d95b1c87f988a2fd3be2d17f63b86f0e /src/mem/ruby/structures
parent7fc725fdb55e192520c148c87ec44f75f5d07ad0 (diff)
downloadgem5-9648c05db19292ddd285a80914593cc0631403ff.tar.xz
ruby: slicc: use default argument value
Before this patch, while one could declare / define a function with default argument values, but the actual function call would require one to specify all the arguments. This patch changes the check for function arguments. Now a function call needs to specify arguments that are at least as much as those with default values and at most the total number of arguments taken as input by the function.
Diffstat (limited to 'src/mem/ruby/structures')
-rw-r--r--src/mem/ruby/structures/AbstractReplacementPolicy.cc2
-rw-r--r--src/mem/ruby/structures/AbstractReplacementPolicy.hh6
-rw-r--r--src/mem/ruby/structures/LRUPolicy.cc8
-rw-r--r--src/mem/ruby/structures/LRUPolicy.hh4
-rw-r--r--src/mem/ruby/structures/PseudoLRUPolicy.cc12
-rw-r--r--src/mem/ruby/structures/PseudoLRUPolicy.hh6
6 files changed, 19 insertions, 19 deletions
diff --git a/src/mem/ruby/structures/AbstractReplacementPolicy.cc b/src/mem/ruby/structures/AbstractReplacementPolicy.cc
index fbcce6e2d..d802ecd31 100644
--- a/src/mem/ruby/structures/AbstractReplacementPolicy.cc
+++ b/src/mem/ruby/structures/AbstractReplacementPolicy.cc
@@ -66,7 +66,7 @@ AbstractReplacementPolicy::~AbstractReplacementPolicy()
}
Tick
-AbstractReplacementPolicy::getLastAccess(int64 set, int64 way)
+AbstractReplacementPolicy::getLastAccess(int64_t set, int64_t way)
{
return m_last_ref_ptr[set][way];
}
diff --git a/src/mem/ruby/structures/AbstractReplacementPolicy.hh b/src/mem/ruby/structures/AbstractReplacementPolicy.hh
index 03ef0d2fd..c118f3c11 100644
--- a/src/mem/ruby/structures/AbstractReplacementPolicy.hh
+++ b/src/mem/ruby/structures/AbstractReplacementPolicy.hh
@@ -44,13 +44,13 @@ class AbstractReplacementPolicy : public SimObject
virtual ~AbstractReplacementPolicy();
/* touch a block. a.k.a. update timestamp */
- virtual void touch(int64 set, int64 way, Tick time) = 0;
+ virtual void touch(int64_t set, int64_t way, Tick time) = 0;
/* returns the way to replace */
- virtual int64 getVictim(int64 set) const = 0;
+ virtual int64_t getVictim(int64_t set) const = 0;
/* get the time of the last access */
- Tick getLastAccess(int64 set, int64 way);
+ Tick getLastAccess(int64_t set, int64_t way);
virtual bool useOccupancy() const { return false; }
diff --git a/src/mem/ruby/structures/LRUPolicy.cc b/src/mem/ruby/structures/LRUPolicy.cc
index a1e3b277e..286d19772 100644
--- a/src/mem/ruby/structures/LRUPolicy.cc
+++ b/src/mem/ruby/structures/LRUPolicy.cc
@@ -50,7 +50,7 @@ LRUReplacementPolicyParams::create()
void
-LRUPolicy::touch(int64 set, int64 index, Tick time)
+LRUPolicy::touch(int64_t set, int64_t index, Tick time)
{
assert(index >= 0 && index < m_assoc);
assert(set >= 0 && set < m_num_sets);
@@ -58,11 +58,11 @@ LRUPolicy::touch(int64 set, int64 index, Tick time)
m_last_ref_ptr[set][index] = time;
}
-int64
-LRUPolicy::getVictim(int64 set) const
+int64_t
+LRUPolicy::getVictim(int64_t set) const
{
Tick time, smallest_time;
- int64 smallest_index;
+ int64_t smallest_index;
smallest_index = 0;
smallest_time = m_last_ref_ptr[set][0];
diff --git a/src/mem/ruby/structures/LRUPolicy.hh b/src/mem/ruby/structures/LRUPolicy.hh
index 9a9c9e3eb..388718319 100644
--- a/src/mem/ruby/structures/LRUPolicy.hh
+++ b/src/mem/ruby/structures/LRUPolicy.hh
@@ -41,8 +41,8 @@ class LRUPolicy : public AbstractReplacementPolicy
LRUPolicy(const Params * p);
~LRUPolicy();
- void touch(int64 set, int64 way, Tick time);
- int64 getVictim(int64 set) const;
+ void touch(int64_t set, int64_t way, Tick time);
+ int64_t getVictim(int64_t set) const;
};
#endif // __MEM_RUBY_STRUCTURES_LRUPOLICY_HH__
diff --git a/src/mem/ruby/structures/PseudoLRUPolicy.cc b/src/mem/ruby/structures/PseudoLRUPolicy.cc
index 8eee0821b..a2b21a625 100644
--- a/src/mem/ruby/structures/PseudoLRUPolicy.cc
+++ b/src/mem/ruby/structures/PseudoLRUPolicy.cc
@@ -38,7 +38,7 @@ PseudoLRUPolicy::PseudoLRUPolicy(const Params * p)
// associativity cannot exceed capacity of tree representation
assert(m_num_sets > 0 &&
m_assoc > 1 &&
- m_assoc <= (int64) sizeof(uint64)*4);
+ m_assoc <= (int64_t) sizeof(uint64_t)*4);
m_trees = NULL;
m_num_levels = 0;
@@ -55,7 +55,7 @@ PseudoLRUPolicy::PseudoLRUPolicy(const Params * p)
m_num_levels++;
}
assert(m_num_levels < sizeof(unsigned int)*4);
- m_trees = new uint64[m_num_sets];
+ m_trees = new uint64_t[m_num_sets];
for (unsigned i = 0; i < m_num_sets; i++) {
m_trees[i] = 0;
}
@@ -75,7 +75,7 @@ PseudoLRUPolicy::~PseudoLRUPolicy()
}
void
-PseudoLRUPolicy::touch(int64 set, int64 index, Tick time)
+PseudoLRUPolicy::touch(int64_t set, int64_t index, Tick time)
{
assert(index >= 0 && index < m_assoc);
assert(set >= 0 && set < m_num_sets);
@@ -93,10 +93,10 @@ PseudoLRUPolicy::touch(int64 set, int64 index, Tick time)
m_last_ref_ptr[set][index] = time;
}
-int64
-PseudoLRUPolicy::getVictim(int64 set) const
+int64_t
+PseudoLRUPolicy::getVictim(int64_t set) const
{
- int64 index = 0;
+ int64_t index = 0;
int tree_index = 0;
int node_val;
diff --git a/src/mem/ruby/structures/PseudoLRUPolicy.hh b/src/mem/ruby/structures/PseudoLRUPolicy.hh
index fc5add8b1..a4a388cf5 100644
--- a/src/mem/ruby/structures/PseudoLRUPolicy.hh
+++ b/src/mem/ruby/structures/PseudoLRUPolicy.hh
@@ -53,13 +53,13 @@ class PseudoLRUPolicy : public AbstractReplacementPolicy
PseudoLRUPolicy(const Params * p);
~PseudoLRUPolicy();
- void touch(int64 set, int64 way, Tick time);
- int64 getVictim(int64 set) const;
+ void touch(int64_t set, int64_t way, Tick time);
+ int64_t getVictim(int64_t set) const;
private:
unsigned int m_effective_assoc; /** nearest (to ceiling) power of 2 */
unsigned int m_num_levels; /** number of levels in the tree */
- uint64* m_trees; /** bit representation of the
+ uint64_t *m_trees; /** bit representation of the
* trees, one for each set */
};