ruby: numa bit fix for sparse memory
This commit is contained in:
parent
4fa690e8ff
commit
7edab47448
6 changed files with 14 additions and 9 deletions
|
@ -164,7 +164,9 @@ def create_system(options, system, piobus, dma_devices):
|
||||||
size = dir_size,
|
size = dir_size,
|
||||||
use_map = options.use_map,
|
use_map = options.use_map,
|
||||||
map_levels = \
|
map_levels = \
|
||||||
options.map_levels),
|
options.map_levels,
|
||||||
|
numa_high_bit = \
|
||||||
|
options.numa_high_bit),
|
||||||
probeFilter = pf,
|
probeFilter = pf,
|
||||||
memBuffer = mem_cntrl,
|
memBuffer = mem_cntrl,
|
||||||
probe_filter_enabled = options.pf_on,
|
probe_filter_enabled = options.pf_on,
|
||||||
|
|
|
@ -42,7 +42,7 @@ def define_options(parser):
|
||||||
help="'fixed'|'flexible'")
|
help="'fixed'|'flexible'")
|
||||||
|
|
||||||
# ruby mapping options
|
# 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. " \
|
help="high order address bit to use for numa mapping. " \
|
||||||
"0 = highest bit, not specified = lowest bit")
|
"0 = highest bit, not specified = lowest bit")
|
||||||
|
|
||||||
|
|
|
@ -56,9 +56,7 @@ DirectoryMemory::init()
|
||||||
m_num_entries = m_size_bytes / RubySystem::getBlockSizeBytes();
|
m_num_entries = m_size_bytes / RubySystem::getBlockSizeBytes();
|
||||||
|
|
||||||
if (m_use_map) {
|
if (m_use_map) {
|
||||||
int entry_bits = floorLog2(m_num_entries);
|
m_sparseMemory = new SparseMemory(m_map_levels);
|
||||||
assert(entry_bits >= m_map_levels);
|
|
||||||
m_sparseMemory = new SparseMemory(entry_bits, m_map_levels);
|
|
||||||
} else {
|
} else {
|
||||||
m_entries = new Directory_Entry*[m_num_entries];
|
m_entries = new Directory_Entry*[m_num_entries];
|
||||||
for (int i = 0; i < m_num_entries; i++)
|
for (int i = 0; i < m_num_entries; i++)
|
||||||
|
|
|
@ -38,4 +38,6 @@ class RubyDirectoryMemory(SimObject):
|
||||||
size = Param.MemorySize("1GB", "capacity in bytes")
|
size = Param.MemorySize("1GB", "capacity in bytes")
|
||||||
use_map = Param.Bool(False, "enable sparse memory")
|
use_map = Param.Bool(False, "enable sparse memory")
|
||||||
map_levels = Param.Int(4, "sparse memory map levels")
|
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")
|
||||||
|
|
|
@ -27,14 +27,17 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mem/ruby/system/SparseMemory.hh"
|
#include "mem/ruby/system/SparseMemory.hh"
|
||||||
|
#include "mem/ruby/system/System.hh"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
SparseMemory::SparseMemory(int number_of_bits, int number_of_levels)
|
SparseMemory::SparseMemory(int number_of_levels)
|
||||||
{
|
{
|
||||||
int even_level_bits;
|
int even_level_bits;
|
||||||
int extra;
|
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;
|
m_number_of_levels = number_of_levels;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -54,7 +54,7 @@ struct CurNextInfo
|
||||||
class SparseMemory
|
class SparseMemory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SparseMemory(int number_of_bits, int number_of_levels);
|
SparseMemory(int number_of_levels);
|
||||||
~SparseMemory();
|
~SparseMemory();
|
||||||
|
|
||||||
void printConfig(std::ostream& out) { }
|
void printConfig(std::ostream& out) { }
|
||||||
|
|
Loading…
Reference in a new issue