ruby: convert to M5 MemorySize
Converted both ruby caches and directory memory to use the M5 MemorySize python type.
This commit is contained in:
@@ -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", "");
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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("");
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user