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,
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")
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++)
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")
*/
#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;
//
class SparseMemory
{
public:
- SparseMemory(int number_of_bits, int number_of_levels);
+ SparseMemory(int number_of_levels);
~SparseMemory();
void printConfig(std::ostream& out) { }