diff options
author | Nathan Binkert <nate@binkert.org> | 2009-07-06 15:49:47 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2009-07-06 15:49:47 -0700 |
commit | a7904e2cf341d5452c5622adfcbdcd268d4ab7d1 (patch) | |
tree | 76c744e731c275b393130b869c2c2944807a77af /src/mem/ruby/common | |
parent | 5b080ae0463c9644eb81bd923e25139dfe787e6e (diff) | |
download | gem5-a7904e2cf341d5452c5622adfcbdcd268d4ab7d1.tar.xz |
ruby: apply some fixes that were overwritten by the recent ruby import.
Diffstat (limited to 'src/mem/ruby/common')
-rw-r--r-- | src/mem/ruby/common/DataBlock.cc | 28 | ||||
-rw-r--r-- | src/mem/ruby/common/Debug.cc | 40 | ||||
-rw-r--r-- | src/mem/ruby/common/Debug.hh | 40 | ||||
-rw-r--r-- | src/mem/ruby/common/Driver.hh | 2 | ||||
-rw-r--r-- | src/mem/ruby/common/Set.cc | 2 |
5 files changed, 84 insertions, 28 deletions
diff --git a/src/mem/ruby/common/DataBlock.cc b/src/mem/ruby/common/DataBlock.cc index 5e6b8338e..75ede7f4f 100644 --- a/src/mem/ruby/common/DataBlock.cc +++ b/src/mem/ruby/common/DataBlock.cc @@ -1,4 +1,32 @@ +/* + * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include "mem/ruby/common/DataBlock.hh" DataBlock & diff --git a/src/mem/ruby/common/Debug.cc b/src/mem/ruby/common/Debug.cc index c1a6e16d0..1115152f4 100644 --- a/src/mem/ruby/common/Debug.cc +++ b/src/mem/ruby/common/Debug.cc @@ -45,21 +45,31 @@ extern Debug* g_debug_ptr; std::ostream * debug_cout_ptr; bool Debug::m_protocol_trace = false; - -// 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); @@ -226,7 +236,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 } @@ -292,9 +302,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 } @@ -320,7 +330,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.hh b/src/mem/ruby/common/Debug.hh index 54e449908..c038d57c2 100644 --- a/src/mem/ruby/common/Debug.hh +++ b/src/mem/ruby/common/Debug.hh @@ -31,21 +31,39 @@ * $Id$ */ -#ifndef DEBUG_H -#define DEBUG_H +#ifndef __MEM_RUBY_DEBUG_HH__ +#define __MEM_RUBY_DEBUG_HH__ #include <unistd.h> #include <iostream> +#include <string> +#include <vector> + +#include "config/ruby_debug.hh" +#include "mem/ruby/common/Global.hh" 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}; @@ -55,7 +73,7 @@ class Debug { public: // Constructors Debug(); - Debug( const string & name, const vector<string> & argv ); + Debug(const std::string & name, const std::vector<std::string> & argv); Debug( const char *filterString, const char *verboseString, Time filterStartTime, const char *filename ); @@ -65,7 +83,7 @@ public: // Public Methods static bool getProtocolTrace() { return m_protocol_trace; } bool validDebug(int module, PriorityLevel priority); - void printVerbosity(ostream& out) const; + void printVerbosity(std::ostream& out) const; void setVerbosity(VerbosityLevel vb); static bool checkVerbosityString(const char *verb_str); bool setVerbosityString(const char *); @@ -79,7 +97,7 @@ public: bool addFilter(char); void clearFilter(); void allFilter(); - void print(ostream& out) const; + void print(std::ostream& out) const; /* old school debugging "vararg": sends messages to screen and log */ void debugMsg( const char *fmt, ... ); @@ -104,13 +122,13 @@ private: }; // Output operator declaration -ostream& operator<<(ostream& out, const Debug& obj); +std::ostream& operator<<(std::ostream& out, const Debug& obj); // ******************* Definitions ******************* // Output operator definition extern inline -ostream& operator<<(ostream& out, const Debug& obj) +std::ostream& operator<<(std::ostream& out, const Debug& obj) { obj.print(out); out << flush; diff --git a/src/mem/ruby/common/Driver.hh b/src/mem/ruby/common/Driver.hh index db8279fa5..9aa756386 100644 --- a/src/mem/ruby/common/Driver.hh +++ b/src/mem/ruby/common/Driver.hh @@ -60,7 +60,7 @@ public: virtual void get_network_config() {} virtual void dmaHitCallback() = 0; virtual void hitCallback(NodeID proc, SubBlock& data, CacheRequestType type, int thread) = 0; // Called by sequencer - virtual void conflictCallback(NodeID proc, SubBlock& data, CacheRequestType type, int thread) { assert(0) }; // Called by sequencer + virtual void conflictCallback(NodeID proc, SubBlock& data, CacheRequestType type, int thread) { assert(0); }; // Called by sequencer virtual integer_t getInstructionCount(int procID) const { return 1; } virtual integer_t getCycleCount(int procID) const { return 1; } virtual void addThreadDependency(int procID, int requestor_thread, int conflict_thread) const { assert(0);} diff --git a/src/mem/ruby/common/Set.cc b/src/mem/ruby/common/Set.cc index 6f01c4043..2c64ad3bc 100644 --- a/src/mem/ruby/common/Set.cc +++ b/src/mem/ruby/common/Set.cc @@ -566,7 +566,7 @@ void Set::print(ostream& out) const #ifdef __32BITS__ sprintf(buff,"%08X ",m_p_nArray[i]); #else - sprintf(buff,"0x %016llX ",m_p_nArray[i]); + sprintf(buff,"0x %016llX ", (long long)m_p_nArray[i]); #endif // __32BITS__ out << buff; } |