ruby: convert to M5 MemorySize

Converted both ruby caches and directory memory to use the M5 MemorySize python
type.
This commit is contained in:
Brad Beckmann
2010-01-29 20:29:23 -08:00
parent 3a835c7cbb
commit 134cc3d48d
8 changed files with 26 additions and 17 deletions

View File

@@ -5,7 +5,7 @@ from Controller import RubyController
class RubyCache(SimObject):
type = 'RubyCache'
cxx_class = 'CacheMemory'
size = Param.Int("");
size = Param.MemorySize("capacity in bytes");
latency = Param.Int("");
assoc = Param.Int("");
replacement_policy = Param.String("PSEUDO_LRU", "");

View File

@@ -49,7 +49,7 @@ DirectoryMemory::DirectoryMemory(const Params *p)
: SimObject(p)
{
m_version = p->version;
m_size_bytes = p->size_mb * static_cast<uint64>(1<<20);
m_size_bytes = p->size;
m_size_bits = log_int(m_size_bytes);
}

View File

@@ -6,4 +6,4 @@ class RubyDirectoryMemory(SimObject):
type = 'RubyDirectoryMemory'
cxx_class = 'DirectoryMemory'
version = Param.Int(0, "")
size_mb = Param.Int(1024, "")
size = Param.MemorySize("1GB", "capacity in bytes")

View File

@@ -9,7 +9,7 @@ class RubySystem(SimObject):
clock = Param.Clock('1GHz', "")
block_size_bytes = Param.Int(64,
"default cache block size; must be a power of two");
mem_size_mb = Param.Int("");
mem_size = Param.MemorySize("total memory size of the system");
network = Param.RubyNetwork("")
debug = Param.RubyDebug("the default debug object")
profiler = Param.RubyProfiler("");

View File

@@ -98,7 +98,7 @@ RubySystem::RubySystem(const Params *p)
assert(is_power_of_2(m_block_size_bytes));
m_block_size_bits = log_int(m_block_size_bytes);
m_memory_size_bytes = (uint64_t)p->mem_size_mb * 1024 * 1024;
m_memory_size_bytes = p->mem_size;
m_memory_size_bits = log_int(m_memory_size_bytes);
m_network_ptr = p->network;