diff options
Diffstat (limited to 'src/mem/ruby')
-rw-r--r-- | src/mem/ruby/common/Debug.cc | 39 | ||||
-rw-r--r-- | src/mem/ruby/common/Debug.def | 17 | ||||
-rw-r--r-- | src/mem/ruby/common/Debug.hh | 21 |
3 files changed, 42 insertions, 35 deletions
diff --git a/src/mem/ruby/common/Debug.cc b/src/mem/ruby/common/Debug.cc index a07e61b2d..4c2263b0c 100644 --- a/src/mem/ruby/common/Debug.cc +++ b/src/mem/ruby/common/Debug.cc @@ -43,20 +43,31 @@ class Debug; extern Debug* g_debug_ptr; std::ostream * debug_cout_ptr; -// component character list -const char DEFINE_COMP_CHAR[] = +struct DebugComponentData { -#undef DEFINE_COMP -#define DEFINE_COMP(component, character, description) character, -#include "Debug.def" + const char *desc; + const char ch; }; -// component description list -const char* DEFINE_COMP_DESCRIPTION[] = +// component character list +DebugComponentData debugComponents[] = { -#undef DEFINE_COMP -#define DEFINE_COMP(component, character, description) description, -#include "Debug.def" + {"System", 's' }, + {"Node", 'N' }, + {"Queue", 'q' }, + {"Event Queue", 'e' }, + {"Network", 'n' }, + {"Sequencer", 'S' }, + {"Tester", 't' }, + {"Generated", 'g' }, + {"SLICC", 'l' }, + {"Network Queues", 'Q' }, + {"Time", 'T' }, + {"Network Internals", 'i' }, + {"Store Buffer", 'b' }, + {"Cache", 'c' }, + {"Predictor", 'p' }, + {"Allocator", 'a' }, }; extern "C" void changeDebugVerbosity(VerbosityLevel vb); @@ -197,7 +208,7 @@ bool Debug::checkFilter(char ch) { for (int i=0; i<NUMBER_OF_COMPS; i++) { // Look at all components to find a character match - if (DEFINE_COMP_CHAR[i] == ch) { + if (debugComponents[i].ch == ch) { // We found a match - return no error return false; // no error } @@ -263,9 +274,9 @@ bool Debug::addFilter(char ch) { for (int i=0; i<NUMBER_OF_COMPS; i++) { // Look at all components to find a character match - if (DEFINE_COMP_CHAR[i] == ch) { + if (debugComponents[i].ch == ch) { // We found a match - update the filter bit mask - cout << " Debug: Adding to filter: '" << ch << "' (" << DEFINE_COMP_DESCRIPTION[i] << ")" << endl; + cout << " Debug: Adding to filter: '" << ch << "' (" << debugComponents[i].desc << ")" << endl; m_filter |= (1 << i); return false; // no error } @@ -291,7 +302,7 @@ void Debug::usageInstructions(void) { cerr << "Debug components: " << endl; for (int i=0; i<NUMBER_OF_COMPS; i++) { - cerr << " " << DEFINE_COMP_CHAR[i] << ": " << DEFINE_COMP_DESCRIPTION[i] << endl; + cerr << " " << debugComponents[i].ch << ": " << debugComponents[i].desc << endl; } } diff --git a/src/mem/ruby/common/Debug.def b/src/mem/ruby/common/Debug.def deleted file mode 100644 index 23af06655..000000000 --- a/src/mem/ruby/common/Debug.def +++ /dev/null @@ -1,17 +0,0 @@ -DEFINE_COMP(SYSTEM_COMP, 's', "System") -DEFINE_COMP(NODE_COMP, 'N', "Node") -DEFINE_COMP(QUEUE_COMP, 'q', "Queue") -DEFINE_COMP(EVENTQUEUE_COMP, 'e', "Event Queue") -DEFINE_COMP(NETWORK_COMP, 'n', "Network") -DEFINE_COMP(SEQUENCER_COMP, 'S', "Sequencer") -DEFINE_COMP(TESTER_COMP, 't', "Tester") -DEFINE_COMP(GENERATED_COMP, 'g', "Generated") -DEFINE_COMP(SLICC_COMP, 'l', "SLICC") -DEFINE_COMP(NETWORKQUEUE_COMP, 'Q', "Network Queues") -DEFINE_COMP(TIME_COMP, 'T', "Time") -DEFINE_COMP(NETWORK_INTERNALS_COMP, 'i', "Network Internals") -DEFINE_COMP(STOREBUFFER_COMP, 'b', "Store Buffer") -DEFINE_COMP(CACHE_COMP, 'c', "Cache") -DEFINE_COMP(PREDICTOR_COMP, 'p', "Predictor") -DEFINE_COMP(ALLOCATOR_COMP, 'a', "Allocator") - diff --git a/src/mem/ruby/common/Debug.hh b/src/mem/ruby/common/Debug.hh index afa10f57f..5ac171275 100644 --- a/src/mem/ruby/common/Debug.hh +++ b/src/mem/ruby/common/Debug.hh @@ -42,10 +42,23 @@ extern std::ostream * debug_cout_ptr; // component enumeration enum DebugComponents { -#undef DEFINE_COMP -#define DEFINE_COMP(component, character, description) component, -#include "Debug.def" - NUMBER_OF_COMPS + SYSTEM_COMP, + NODE_COMP, + QUEUE_COMP, + EVENTQUEUE_COMP, + NETWORK_COMP, + SEQUENCER_COMP, + TESTER_COMP, + GENERATED_COMP, + SLICC_COMP, + NETWORKQUEUE_COMP, + TIME_COMP, + NETWORK_INTERNALS_COMP, + STOREBUFFER_COMP, + CACHE_COMP, + PREDICTOR_COMP, + ALLOCATOR_COMP, + NUMBER_OF_COMPS }; enum PriorityLevel {HighPrio, MedPrio, LowPrio}; |