projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a4288da
)
ruby: correct computation of number of bits required for address
author
Nilay Vaish
<nilay@cs.wisc.edu>
Thu, 31 Jan 2013 15:44:20 +0000
(09:44 -0600)
committer
Nilay Vaish
<nilay@cs.wisc.edu>
Thu, 31 Jan 2013 15:44:20 +0000
(09:44 -0600)
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
patch
|
blob
|
history
diff --git
a/src/mem/ruby/system/System.cc
b/src/mem/ruby/system/System.cc
index 6a0721217ac8b31134707bb163a175fb66763fbf..01e50ef0b5bc3246dc9b479c7de5ece17de832e1 100644
(file)
--- 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 =
floor
Log2(m_memory_size_bytes);
+ m_memory_size_bits =
ceil
Log2(m_memory_size_bytes);
}
g_system_ptr = this;