Param: Transition to Cycles for relevant parameters

This patch is a first step to using Cycles as a parameter type. The
main affected modules are the CPUs and the Ruby caches. There are
definitely plenty more places that are affected, but this patch serves
as a starting point to making the transition.

An important part of this patch is to actually enable parameters to be
specified as Param.Cycles which involves some changes to params.py.
This commit is contained in:
Andreas Hansson
2012-09-07 12:34:38 -04:00
parent 4124ea09f8
commit 287ea1a081
24 changed files with 111 additions and 100 deletions

View File

@@ -37,7 +37,7 @@ class BaseCache(MemObject):
assoc = Param.Int("associativity")
block_size = Param.Int("block size in bytes")
latency = Param.Latency("Latency")
hash_delay = Param.Int(1, "time in cycles of hash access")
hash_delay = Param.Cycles(1, "time in cycles of hash access")
max_miss_count = Param.Counter(0,
"number of misses to handle before calling exit")
mshrs = Param.Int("number of MSHRs (max outstanding requests)")

View File

@@ -250,6 +250,8 @@ IIC::accessBlock(Addr addr, int &lat, int context_src)
}
}
// @todo: is hashDelay is really cycles, then
// multiply with period
set_lat = set_lat * hashDelay + hitLatency;
if (tag_ptr != NULL) {
// IIC replacement: if this is not the first element of

View File

@@ -196,7 +196,7 @@ class IIC : public BaseTags
const unsigned subMask;
/** The latency of a hash lookup. */
const unsigned hashDelay;
const Cycles hashDelay;
/** The total number of tags in primary and secondary. */
const unsigned numTags;
/** The number of tags in the secondary tag store. */