ruby: numa bit fix for sparse memory

This commit is contained in:
Brad Beckmann 2011-02-06 22:14:19 -08:00
parent 4fa690e8ff
commit 7edab47448
6 changed files with 14 additions and 9 deletions

View file

@ -164,7 +164,9 @@ def create_system(options, system, piobus, dma_devices):
size = dir_size,
use_map = options.use_map,
map_levels = \
options.map_levels),
options.map_levels,
numa_high_bit = \
options.numa_high_bit),
probeFilter = pf,
memBuffer = mem_cntrl,
probe_filter_enabled = options.pf_on,

View file

@ -42,7 +42,7 @@ def define_options(parser):
help="'fixed'|'flexible'")
# ruby mapping options
parser.add_option("--numa-high-bit", type="int", default=None,
parser.add_option("--numa-high-bit", type="int", default=0,
help="high order address bit to use for numa mapping. " \
"0 = highest bit, not specified = lowest bit")

View file

@ -56,9 +56,7 @@ DirectoryMemory::init()
m_num_entries = m_size_bytes / RubySystem::getBlockSizeBytes();
if (m_use_map) {
int entry_bits = floorLog2(m_num_entries);
assert(entry_bits >= m_map_levels);
m_sparseMemory = new SparseMemory(entry_bits, m_map_levels);
m_sparseMemory = new SparseMemory(m_map_levels);
} else {
m_entries = new Directory_Entry*[m_num_entries];
for (int i = 0; i < m_num_entries; i++)

View file

@ -38,4 +38,6 @@ class RubyDirectoryMemory(SimObject):
size = Param.MemorySize("1GB", "capacity in bytes")
use_map = Param.Bool(False, "enable sparse memory")
map_levels = Param.Int(4, "sparse memory map levels")
numa_high_bit = Param.Int(0, "numa high bit")
# the default value of the numa high bit is specified in the command line
# option and must be passed into the directory memory sim object
numa_high_bit = Param.Int("numa high bit")

View file

@ -27,14 +27,17 @@
*/
#include "mem/ruby/system/SparseMemory.hh"
#include "mem/ruby/system/System.hh"
using namespace std;
SparseMemory::SparseMemory(int number_of_bits, int number_of_levels)
SparseMemory::SparseMemory(int number_of_levels)
{
int even_level_bits;
int extra;
m_total_number_of_bits = number_of_bits;
m_total_number_of_bits = RubySystem::getMemorySizeBits()
- RubySystem::getBlockSizeBits();;
m_number_of_levels = number_of_levels;
//

View file

@ -54,7 +54,7 @@ struct CurNextInfo
class SparseMemory
{
public:
SparseMemory(int number_of_bits, int number_of_levels);
SparseMemory(int number_of_levels);
~SparseMemory();
void printConfig(std::ostream& out) { }