From 6aed4d4f931f0eca15d1211e7e28a06d66f16d32 Mon Sep 17 00:00:00 2001 From: Nilay Vaish Date: Thu, 31 Jan 2013 09:44:20 -0600 Subject: ruby: correct computation of number of bits required for address The number of bits required for an address was set to floorLog2(memory size). This is correct under the assumption that the memory size is a power of 2, which is not always true. Hence, floorLog2 is being replaced with ceilLog2. --- src/mem/ruby/system/System.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mem') diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc index 6a0721217..01e50ef0b 100644 --- a/src/mem/ruby/system/System.cc +++ b/src/mem/ruby/system/System.cc @@ -69,7 +69,7 @@ RubySystem::RubySystem(const Params *p) if (m_memory_size_bytes == 0) { m_memory_size_bits = 0; } else { - m_memory_size_bits = floorLog2(m_memory_size_bytes); + m_memory_size_bits = ceilLog2(m_memory_size_bytes); } g_system_ptr = this; -- cgit v1.2.3