summaryrefslogtreecommitdiff
path: root/src/mem/ruby/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby/common')
-rw-r--r--src/mem/ruby/common/Address.hh2
-rw-r--r--src/mem/ruby/common/DataBlock.hh6
-rw-r--r--src/mem/ruby/common/Debug.cc31
-rw-r--r--src/mem/ruby/common/Debug.hh1
-rw-r--r--src/mem/ruby/common/NetDest.cc5
-rw-r--r--src/mem/ruby/common/NetDest.hh4
6 files changed, 33 insertions, 16 deletions
diff --git a/src/mem/ruby/common/Address.hh b/src/mem/ruby/common/Address.hh
index c48152354..88cd2668a 100644
--- a/src/mem/ruby/common/Address.hh
+++ b/src/mem/ruby/common/Address.hh
@@ -148,7 +148,7 @@ inline
physical_address_t Address::bitSelect(int small, int big) const // rips bits inclusive
{
physical_address_t mask;
- assert(big >= small);
+ assert((unsigned)big >= (unsigned)small);
if (big >= ADDRESS_WIDTH - 1) {
return (m_address >> small);
diff --git a/src/mem/ruby/common/DataBlock.hh b/src/mem/ruby/common/DataBlock.hh
index 3c8ef56f4..1d399753e 100644
--- a/src/mem/ruby/common/DataBlock.hh
+++ b/src/mem/ruby/common/DataBlock.hh
@@ -45,7 +45,11 @@ class DataBlock {
}
// Destructor
- ~DataBlock() { if(m_alloc) delete [] m_data;}
+ ~DataBlock() {
+ if(m_alloc) {
+ delete [] m_data;
+ }
+ }
DataBlock& operator=(const DataBlock& obj);
diff --git a/src/mem/ruby/common/Debug.cc b/src/mem/ruby/common/Debug.cc
index 1115152f4..cb9fdf082 100644
--- a/src/mem/ruby/common/Debug.cc
+++ b/src/mem/ruby/common/Debug.cc
@@ -39,6 +39,7 @@
#include "mem/ruby/common/Debug.hh"
#include "mem/ruby/eventqueue/RubyEventQueue.hh"
#include "mem/gems_common/util.hh"
+#include "base/misc.hh"
class Debug;
extern Debug* g_debug_ptr;
@@ -70,6 +71,7 @@ DebugComponentData debugComponents[] =
{"Cache", 'c' },
{"Predictor", 'p' },
{"Allocator", 'a' },
+ {"Memory", 'M' },
};
extern "C" void changeDebugVerbosity(VerbosityLevel vb);
@@ -95,19 +97,27 @@ Debug::Debug()
Debug::Debug( const string & name, const vector<string> & argv )
{
- for (size_t i=0;i<argv.size();i+=2){
- if (argv[i] == "filter_string")
- setFilterString( argv[i+1].c_str() );
- else if (argv[i] == "verbosity_string")
+ //
+ // must clear the filter before adding filter strings
+ //
+ clearFilter();
+
+ for (size_t i=0;i<argv.size();i+=2) {
+ if (argv[i] == "filter_string") {
+ if (setFilterString(argv[i+1].c_str())) {
+ fatal("could not set filter string to %s\n", argv[i+1].c_str());
+ }
+ } else if (argv[i] == "verbosity_string") {
setVerbosityString( argv[i+1].c_str() );
- else if (argv[i] == "start_time")
+ } else if (argv[i] == "start_time") {
m_starting_cycle = atoi( argv[i+1].c_str() );
- else if (argv[i] == "output_filename")
+ } else if (argv[i] == "output_filename") {
setDebugOutputFile( argv[i+1].c_str() );
- else if (argv[i] == "protocol_trace")
+ } else if (argv[i] == "protocol_trace") {
m_protocol_trace = string_to_bool(argv[i+1]);
- else
- assert(0);
+ } else {
+ fatal("invalid argument %s\n");
+ }
}
}
@@ -119,7 +129,8 @@ Debug::Debug( const char *filterString, const char *verboseString,
debug_cout_ptr = &cout;
m_starting_cycle = filterStartTime;
- setFilterString( filterString );
+ if (setFilterString(filterString))
+ fatal("could not set filter string to %s\n", filterString);
setVerbosityString( verboseString );
setDebugOutputFile( filename );
}
diff --git a/src/mem/ruby/common/Debug.hh b/src/mem/ruby/common/Debug.hh
index c038d57c2..03e123866 100644
--- a/src/mem/ruby/common/Debug.hh
+++ b/src/mem/ruby/common/Debug.hh
@@ -63,6 +63,7 @@ enum DebugComponents
CACHE_COMP,
PREDICTOR_COMP,
ALLOCATOR_COMP,
+ MEMORY_COMP,
NUMBER_OF_COMPS
};
diff --git a/src/mem/ruby/common/NetDest.cc b/src/mem/ruby/common/NetDest.cc
index 32771235f..35bb4ec43 100644
--- a/src/mem/ruby/common/NetDest.cc
+++ b/src/mem/ruby/common/NetDest.cc
@@ -133,13 +133,14 @@ NodeID NetDest::elementAt(MachineID index) {
return m_bits[vecIndex(index)].elementAt(bitIndex(index.num));
}
-NodeID NetDest::smallestElement() const
+MachineID NetDest::smallestElement() const
{
assert(count() > 0);
for (int i=0; i<m_bits.size(); i++) {
for (int j=0; j<m_bits[i].getSize(); j++) {
if (m_bits[i].isElement(j)) {
- return j;
+ MachineID mach = {MachineType_from_base_level(i), j};
+ return mach;
}
}
}
diff --git a/src/mem/ruby/common/NetDest.hh b/src/mem/ruby/common/NetDest.hh
index 1dcee7b7a..071106623 100644
--- a/src/mem/ruby/common/NetDest.hh
+++ b/src/mem/ruby/common/NetDest.hh
@@ -63,7 +63,7 @@ public:
NetDest& operator=(const Set& obj);
// Destructor
- // ~NetDest();
+ ~NetDest() { DEBUG_MSG(MEMORY_COMP, LowPrio, "NetDest Destructor"); }
// Public Methods
void add(MachineID newElement);
@@ -96,7 +96,7 @@ public:
//For Princeton Network
Vector<NodeID> getAllDest();
- NodeID smallestElement() const;
+ MachineID smallestElement() const;
MachineID smallestElement(MachineType machine) const;
void setSize();