diff -r d062cc7a8bdf -r 954ba5d80ec9 SConstruct --- a/SConstruct Thu Apr 12 08:35:56 2012 -0400 +++ b/SConstruct Thu Apr 12 21:07:01 2012 +0100 @@ -486,7 +486,7 @@ main['GCC'] = CXX_version and CXX_version.find('g++') >= 0 main['SUNCC'] = CXX_V and CXX_V.find('Sun C++') >= 0 main['ICC'] = CXX_V and CXX_V.find('Intel') >= 0 -main['CLANG'] = CXX_V and CXX_V.find('clang') >= 0 +main['CLANG'] = CXX_version and CXX_version.find('clang') >= 0 if main['GCC'] + main['SUNCC'] + main['ICC'] + main['CLANG'] > 1: print 'Error: How can we have two at the same time?' Exit(1) @@ -496,7 +496,6 @@ main.Append(CCFLAGS=['-pipe']) main.Append(CCFLAGS=['-fno-strict-aliasing']) main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef']) - main.Append(CXXFLAGS=['-Wno-deprecated']) # Read the GCC version to check for versions with bugs # Note CCVERSION doesn't work here because it is run with the CC # before we override it from the command line @@ -506,6 +505,8 @@ not compareVersions(gcc_version, '4.4.2'): print 'Info: Tree vectorizer in GCC 4.4.1 & 4.4.2 is buggy, disabling.' main.Append(CCFLAGS=['-fno-tree-vectorize']) + if compareVersions(gcc_version, '4.6') >= 0: + main.Append(CXXFLAGS=['-std=c++0x']) elif main['ICC']: pass #Fix me... add warning flags once we clean up icc warnings elif main['SUNCC']: @@ -533,6 +534,12 @@ main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef']) main.Append(CCFLAGS=['-Wno-tautological-compare']) main.Append(CCFLAGS=['-Wno-self-assign']) + # Ruby makes frequent use of extraneous parantheses in the printing + # of if-statements + main.Append(CCFLAGS=['-Wno-parentheses']) + + if compareVersions(clang_version, "3") >= 0: + main.Append(CXXFLAGS=['-std=c++0x']) else: print 'Error: Don\'t know what compiler options to use for your compiler.' print ' Please fix SConstruct and src/SConscript and try again.' diff -r d062cc7a8bdf -r 954ba5d80ec9 ext/libelf/SConscript --- a/ext/libelf/SConscript Thu Apr 12 08:35:56 2012 -0400 +++ b/ext/libelf/SConscript Thu Apr 12 21:07:01 2012 +0100 @@ -32,6 +32,8 @@ Import('main') +from m5.util import compareVersions + elf_files = [] def ElfFile(filename): elf_files.append(File(filename)) @@ -91,9 +93,11 @@ m4env = main.Clone() if m4env['GCC']: - major,minor,dot = [int(x) for x in m4env['GCC_VERSION'].split('.')] - if major >= 4: + if compareVersions(m4env['GCC_VERSION'], '4') >= 0: m4env.Append(CCFLAGS=['-Wno-pointer-sign']) + if compareVersions(m4env['GCC_VERSION'], '4.6') >= 0: + m4env.Append(CCFLAGS=['-Wno-unused-but-set-variable', + '-Wno-implicit-function-declaration']) if m4env['CLANG']: m4env.Append(CCFLAGS=['-Wno-initializer-overrides', '-Wno-pointer-sign']) m4env.Append(CCFLAGS=['-Wno-implicit']) diff -r d062cc7a8bdf -r 954ba5d80ec9 src/SConscript --- a/src/SConscript Thu Apr 12 08:35:56 2012 -0400 +++ b/src/SConscript Thu Apr 12 21:07:01 2012 +0100 @@ -790,7 +790,7 @@ namespace { -const char data_${sym}[] = { +const uint8_t data_${sym}[] = { ''') code.indent() step = 16 @@ -852,7 +852,7 @@ swig_env.Append(CCFLAGS='-Wno-sign-compare') swig_env.Append(CCFLAGS='-Wno-parentheses') swig_env.Append(CCFLAGS='-Wno-unused-label') - if compareVersions(env['GCC_VERSION'], '4.6.0') != -1: + if compareVersions(env['GCC_VERSION'], '4.6') >= 0: swig_env.Append(CCFLAGS='-Wno-unused-but-set-variable') if env['CLANG']: swig_env.Append(CCFLAGS=['-Wno-unused-label']) @@ -925,7 +925,7 @@ # Debug binary ccflags = {} -if env['GCC'] or env['CLANG']: +if env['GCC']: if sys.platform == 'sunos5': ccflags['debug'] = '-gstabs+' else: @@ -943,6 +943,11 @@ ccflags['opt'] = '-g -O' ccflags['fast'] = '-fast' ccflags['prof'] = '-fast -g -pg' +elif env['CLANG']: + ccflags['debug'] = '-g -O0' + ccflags['opt'] = '-g -O3' + ccflags['fast'] = '-O3' + ccflags['prof'] = '-O3 -g -pg' else: print 'Unknown compiler, please fix compiler options' Exit(1) diff -r d062cc7a8bdf -r 954ba5d80ec9 src/arch/alpha/isa/main.isa --- a/src/arch/alpha/isa/main.isa Thu Apr 12 08:35:56 2012 -0400 +++ b/src/arch/alpha/isa/main.isa Thu Apr 12 21:07:01 2012 +0100 @@ -70,7 +70,7 @@ }}; output exec {{ -#include +#include #include "arch/alpha/registers.hh" #include "arch/alpha/regredir.hh" diff -r d062cc7a8bdf -r 954ba5d80ec9 src/arch/alpha/mt.hh --- a/src/arch/alpha/mt.hh Thu Apr 12 08:35:56 2012 -0400 +++ b/src/arch/alpha/mt.hh Thu Apr 12 21:07:01 2012 +0100 @@ -44,7 +44,6 @@ #include "base/bitfield.hh" #include "base/misc.hh" #include "base/trace.hh" -using namespace std; namespace AlphaISA { diff -r d062cc7a8bdf -r 954ba5d80ec9 src/arch/arm/isa/includes.isa --- a/src/arch/arm/isa/includes.isa Thu Apr 12 08:35:56 2012 -0400 +++ b/src/arch/arm/isa/includes.isa Thu Apr 12 21:07:01 2012 +0100 @@ -94,6 +94,6 @@ #include "sim/sim_exit.hh" using namespace ArmISA; -using std::isnan; + }}; diff -r d062cc7a8bdf -r 954ba5d80ec9 src/arch/arm/types.hh --- a/src/arch/arm/types.hh Thu Apr 12 08:35:56 2012 -0400 +++ b/src/arch/arm/types.hh Thu Apr 12 21:07:01 2012 +0100 @@ -540,13 +540,13 @@ } // namespace ArmISA -namespace __hash_namespace { +__hash_namespace_begin template<> struct hash : public hash { size_t operator()(const ArmISA::ExtMachInst &emi) const { return hash::operator()((uint32_t)emi); }; }; -} +__hash_namespace_end #endif diff -r d062cc7a8bdf -r 954ba5d80ec9 src/arch/mips/isa/includes.isa --- a/src/arch/mips/isa/includes.isa Thu Apr 12 08:35:56 2012 -0400 +++ b/src/arch/mips/isa/includes.isa Thu Apr 12 21:07:01 2012 +0100 @@ -45,7 +45,7 @@ }}; output decoder {{ -#include +#include #include "arch/mips/dsp.hh" #include "arch/mips/dt_constants.hh" @@ -69,7 +69,7 @@ }}; output exec {{ -#include +#include #include "arch/generic/memhelpers.hh" #include "arch/mips/dsp.hh" diff -r d062cc7a8bdf -r 954ba5d80ec9 src/arch/power/isa/includes.isa --- a/src/arch/power/isa/includes.isa Thu Apr 12 08:35:56 2012 -0400 +++ b/src/arch/power/isa/includes.isa Thu Apr 12 21:07:01 2012 +0100 @@ -66,7 +66,6 @@ #include "cpu/thread_context.hh" using namespace PowerISA; -using std::isnan; }}; output exec {{ @@ -87,6 +86,5 @@ #include "sim/sim_exit.hh" using namespace PowerISA; -using std::isnan; }}; diff -r d062cc7a8bdf -r 954ba5d80ec9 src/arch/power/types.hh --- a/src/arch/power/types.hh Thu Apr 12 08:35:56 2012 -0400 +++ b/src/arch/power/types.hh Thu Apr 12 21:07:01 2012 +0100 @@ -89,7 +89,7 @@ } // PowerISA namespace -namespace __hash_namespace { +__hash_namespace_begin template<> struct hash : public hash { @@ -98,6 +98,6 @@ }; }; -} // namespace __hash_namespace +__hash_namespace_end #endif // __ARCH_POWER_TYPES_HH__ diff -r d062cc7a8bdf -r 954ba5d80ec9 src/arch/sparc/isa/decoder.isa --- a/src/arch/sparc/isa/decoder.isa Thu Apr 12 08:35:56 2012 -0400 +++ b/src/arch/sparc/isa/decoder.isa Thu Apr 12 21:07:01 2012 +0100 @@ -683,7 +683,7 @@ 0x47: FpUnimpl::fmovrqlez(); 0x51: fcmps({{ uint8_t fcc; - if (isnan(Frs1s) || isnan(Frs2s)) + if (std::isnan(Frs1s) || std::isnan(Frs2s)) fcc = 3; else if (Frs1s < Frs2s) fcc = 1; @@ -698,7 +698,7 @@ }}); 0x52: fcmpd({{ uint8_t fcc; - if (isnan(Frs1) || isnan(Frs2)) + if (std::isnan(Frs1) || std::isnan(Frs2)) fcc = 3; else if (Frs1 < Frs2) fcc = 1; @@ -714,7 +714,7 @@ 0x53: FpUnimpl::fcmpq(); 0x55: fcmpes({{ uint8_t fcc = 0; - if (isnan(Frs1s) || isnan(Frs2s)) + if (std::isnan(Frs1s) || std::isnan(Frs2s)) fault = new FpExceptionIEEE754; if (Frs1s < Frs2s) fcc = 1; @@ -727,7 +727,7 @@ }}); 0x56: fcmped({{ uint8_t fcc = 0; - if (isnan(Frs1) || isnan(Frs2)) + if (std::isnan(Frs1) || std::isnan(Frs2)) fault = new FpExceptionIEEE754; if (Frs1 < Frs2) fcc = 1; diff -r d062cc7a8bdf -r 954ba5d80ec9 src/arch/sparc/mt.hh --- a/src/arch/sparc/mt.hh Thu Apr 12 08:35:56 2012 -0400 +++ b/src/arch/sparc/mt.hh Thu Apr 12 21:07:01 2012 +0100 @@ -44,7 +44,6 @@ #include "base/bitfield.hh" #include "base/misc.hh" #include "base/trace.hh" -using namespace std; namespace SparcISA { diff -r d062cc7a8bdf -r 954ba5d80ec9 src/arch/sparc/tlb_map.hh --- a/src/arch/sparc/tlb_map.hh Thu Apr 12 08:35:56 2012 -0400 +++ b/src/arch/sparc/tlb_map.hh Thu Apr 12 21:07:01 2012 +0100 @@ -98,7 +98,7 @@ if (intersect(r)) return tree.end(); - return tree.insert(std::make_pair(r, d)).first; + return tree.insert(std::make_pair(r, d)).first; } size_t diff -r d062cc7a8bdf -r 954ba5d80ec9 src/arch/x86/isa/microops/fpop.isa --- a/src/arch/x86/isa/microops/fpop.isa Thu Apr 12 08:35:56 2012 -0400 +++ b/src/arch/x86/isa/microops/fpop.isa Thu Apr 12 21:07:01 2012 +0100 @@ -285,7 +285,7 @@ // OF = SF = AF = 0 ccFlagBits = ccFlagBits & ~(OFBit | SFBit | AFBit | ZFBit | PFBit | CFBit); - if (isnan(FpSrcReg1) || isnan(FpSrcReg2)) + if (std::isnan(FpSrcReg1) || std::isnan(FpSrcReg2)) ccFlagBits = ccFlagBits | (ZFBit | PFBit | CFBit); else if(FpSrcReg1 < FpSrcReg2) ccFlagBits = ccFlagBits | CFBit; diff -r d062cc7a8bdf -r 954ba5d80ec9 src/arch/x86/isa/microops/mediaop.isa --- a/src/arch/x86/isa/microops/mediaop.isa Thu Apr 12 08:35:56 2012 -0400 +++ b/src/arch/x86/isa/microops/mediaop.isa Thu Apr 12 21:07:01 2012 +0100 @@ -1404,7 +1404,7 @@ } uint64_t resBits = 0; - bool nanop = isnan(arg1) || isnan(arg2); + bool nanop = std::isnan(arg1) || std::isnan(arg2); switch (ext & mask(3)) { case 0: if (arg1 == arg2 && !nanop) @@ -1492,7 +1492,7 @@ // OF = SF = AF = 0 ccFlagBits = ccFlagBits & ~(OFBit | SFBit | AFBit | ZFBit | PFBit | CFBit); - if (isnan(arg1) || isnan(arg2)) + if (std::isnan(arg1) || std::isnan(arg2)) ccFlagBits = ccFlagBits | (ZFBit | PFBit | CFBit); else if(arg1 < arg2) ccFlagBits = ccFlagBits | CFBit; diff -r d062cc7a8bdf -r 954ba5d80ec9 src/arch/x86/types.hh --- a/src/arch/x86/types.hh Thu Apr 12 08:35:56 2012 -0400 +++ b/src/arch/x86/types.hh Thu Apr 12 21:07:01 2012 +0100 @@ -280,7 +280,7 @@ } -namespace __hash_namespace { +__hash_namespace_begin template<> struct hash { size_t operator()(const X86ISA::ExtMachInst &emi) const { @@ -298,7 +298,7 @@ emi.stackSize ^ emi.dispSize; }; }; -} +__hash_namespace_end // These two functions allow ExtMachInst to be used with SERIALIZE_SCALAR // and UNSERIALIZE_SCALAR. diff -r d062cc7a8bdf -r 954ba5d80ec9 src/base/hashmap.hh --- a/src/base/hashmap.hh Thu Apr 12 08:35:56 2012 -0400 +++ b/src/base/hashmap.hh Thu Apr 12 21:07:01 2012 +0100 @@ -1,4 +1,16 @@ /* + * Copyright (c) 2012 ARM Limited + * All rights reserved + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * * Copyright (c) 2003-2005 The Regents of The University of Michigan * All rights reserved. * @@ -26,29 +38,106 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Authors: Nathan Binkert + * Andreas Hansson */ #ifndef __HASHMAP_HH__ #define __HASHMAP_HH__ -#if defined(__GNUC__) && __GNUC__ >= 3 +#if defined(__GNUC__) + +// for compilers that deprecate ext/hash_map, i.e. gcc >= 4.3 and +// clang, use unordered_map + +// we need to determine what is available, as in the non-c++0x case, +// e.g. gcc >= 4.3 and <= 4.5, the containers are in the std::tr1 +// namespace, and only gcc >= 4.6 (with -std=c++0x) adds the final +// container implementation in the std namespace + +#if defined(__clang__) +// align with -std=c++0x only for clang >= 3.0 in CCFLAGS and also +// check if the header is present as this depends on what clang was +// built against, using XCode clang 3.1, for example, the header is +// not present without adding -stdlib=libc++ +#if (__clang_major__ >= 3 && __has_include()) +#define HAVE_STD_UNORDERED_MAP 1 +#else +// we only support clang versions above 2.9 and these all have the tr1 +// unordered_map +#define HAVE_STD_TR1_UNORDERED_MAP 1 +#endif +#else +// align with -std=c++0x only for gcc >= 4.6 in CCFLAGS, contrary to +// clang we can rely entirely on the compiler version +#if ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) +#define HAVE_STD_UNORDERED_MAP 1 +#else +#define HAVE_STD_TR1_UNORDERED_MAP 1 +#endif +#endif + +// set a default value of 0 +#ifndef HAVE_STD_UNORDERED_MAP +#define HAVE_STD_UNORDERED_MAP 0 +#endif + +// set a default value of 0 +#ifndef HAVE_STD_TR1_UNORDERED_MAP +#define HAVE_STD_TR1_UNORDERED_MAP 0 +#endif + +// now we are ready to deal with the actual includes based on what is +// available +#if (HAVE_STD_UNORDERED_MAP || HAVE_STD_TR1_UNORDERED_MAP) + +#define hash_map unordered_map +#define hash_multimap unordered_multimap +#define hash_set unordered_set +#define hash_multiset unordered_multiset + +// these versions also have an existing hash function for strings +#define HAVE_STRING_HASH 1 + +#if HAVE_STD_UNORDERED_MAP + +// clang or gcc >= 4.6 +#include +#include +// note that this assumes that -std=c++0x is added to the command line +// which is done in the SConstruct CXXFLAGS for gcc >= 4.6 and clang +// >= 3.0 +#define __hash_namespace std +#define __hash_namespace_begin namespace std { +#define __hash_namespace_end } +#else +// clang <= 3.0, gcc >= 4.3 and < 4.6 +#include +#include +#define __hash_namespace std::tr1 +#define __hash_namespace_begin namespace std { namespace tr1 { +#define __hash_namespace_end } } +#endif +#else +// gcc < 4.3 #include #include +#define __hash_namespace __gnu_cxx +#define __hash_namespace_begin namespace __gnu_cxx { +#define __hash_namespace_end } +#endif #else +// non GNU compiler #include #include +#define __hash_namsepace std +#define __hash_namespace_begin namespace std { +#define __hash_namespace_end } #endif #include #include "base/types.hh" -#if defined(__GNUC__) && __GNUC__ >= 3 - #define __hash_namespace __gnu_cxx -#else - #define __hash_namespace std -#endif - namespace m5 { using ::__hash_namespace::hash_multimap; using ::__hash_namespace::hash_multiset; @@ -62,8 +151,8 @@ // Some default Hashing Functions // -namespace __hash_namespace { -#if defined(__APPLE__) || !defined(__LP64__) && !defined(__alpha__) && !defined(__SUNPRO_CC) +__hash_namespace_begin +#if !defined(__LP64__) && !defined(__alpha__) && !defined(__SUNPRO_CC) template<> struct hash { size_t operator()(uint64_t r) const { @@ -79,6 +168,9 @@ }; #endif +// if the hash functions for strings are not already defined, then +// declare them here +#if !defined(HAVE_STRING_HASH) template<> struct hash { size_t operator()(const std::string &s) const { @@ -92,6 +184,7 @@ return (__stl_hash_string(r.first.c_str())) ^ r.second; } }; -} // namespace __hash_namespace +#endif +__hash_namespace_end #endif // __HASHMAP_HH__ diff -r d062cc7a8bdf -r 954ba5d80ec9 src/base/inifile.cc --- a/src/base/inifile.cc Thu Apr 12 08:35:56 2012 -0400 +++ b/src/base/inifile.cc Thu Apr 12 21:07:01 2012 +0100 @@ -29,6 +29,7 @@ * Steve Reinhardt */ +#include #include #include #include diff -r d062cc7a8bdf -r 954ba5d80ec9 src/base/range.hh --- a/src/base/range.hh Thu Apr 12 08:35:56 2012 -0400 +++ b/src/base/range.hh Thu Apr 12 21:07:01 2012 +0100 @@ -316,7 +316,13 @@ inline bool operator<(const Range &range, const U &pos) { - return range.end < pos; + // with -std=gnu++0x, gcc and clang get confused when range.end is + // compared to pos using the operator "<", and the parser expects it + // to be the opening bracket for a template parameter, + // i.e. range.end(...);, the reason seems to be the range-type + // iteration introduced in c++11 where begin and end are members + // that return iterators + return operator<(range.end, pos); } /** diff -r d062cc7a8bdf -r 954ba5d80ec9 src/base/stats/text.cc --- a/src/base/stats/text.cc Thu Apr 12 08:35:56 2012 -0400 +++ b/src/base/stats/text.cc Thu Apr 12 21:07:01 2012 +0100 @@ -166,7 +166,7 @@ { stringstream val; - if (!isnan(value)) { + if (!std::isnan(value)) { if (precision != -1) val.precision(precision); else if (value == rint(value)) @@ -211,15 +211,15 @@ ScalarPrint::operator()(ostream &stream) const { if ((flags.isSet(nozero) && value == 0.0) || - (flags.isSet(nonan) && isnan(value))) + (flags.isSet(nonan) && std::isnan(value))) return; stringstream pdfstr, cdfstr; - if (!isnan(pdf)) + if (!std::isnan(pdf)) ccprintf(pdfstr, "%.2f%%", pdf * 100.0); - if (!isnan(cdf)) + if (!std::isnan(cdf)) ccprintf(cdfstr, "%.2f%%", cdf * 100.0); ccprintf(stream, "%-40s %12s %10s %10s", name, diff -r d062cc7a8bdf -r 954ba5d80ec9 src/cpu/inorder/inorder_dyn_inst.cc --- a/src/cpu/inorder/inorder_dyn_inst.cc Thu Apr 12 08:35:56 2012 -0400 +++ b/src/cpu/inorder/inorder_dyn_inst.cc Thu Apr 12 21:07:01 2012 +0100 @@ -68,7 +68,7 @@ inFrontEnd(true), frontSked(NULL), backSked(NULL), squashingStage(0), predictTaken(false), procDelaySlotOnMispred(false), fetchMemReq(NULL), dataMemReq(NULL), instEffAddr(0), eaCalcDone(false), - lqIdx(0), sqIdx(0), instListIt(NULL), onInstList(false) + lqIdx(0), sqIdx(0), onInstList(false) { for(int i = 0; i < MaxInstSrcRegs; i++) { _readySrcRegIdx[i] = false; diff -r d062cc7a8bdf -r 954ba5d80ec9 src/mem/ruby/common/Address.hh --- a/src/mem/ruby/common/Address.hh Thu Apr 12 08:35:56 2012 -0400 +++ b/src/mem/ruby/common/Address.hh Thu Apr 12 21:07:01 2012 +0100 @@ -31,6 +31,7 @@ #include #include +#include #include "base/hashmap.hh" #include "mem/ruby/common/TypeDefines.hh" @@ -201,8 +202,7 @@ return (m_address >> number); } -class Address; -namespace __hash_namespace { +__hash_namespace_begin template <> struct hash
{ size_t @@ -211,7 +211,7 @@ return (size_t)s.getAddress(); } }; -} // namespace __hash_namespace +__hash_namespace_end namespace std { template <> struct equal_to
diff -r d062cc7a8bdf -r 954ba5d80ec9 src/mem/ruby/common/NetDest.cc --- a/src/mem/ruby/common/NetDest.cc Thu Apr 12 08:35:56 2012 -0400 +++ b/src/mem/ruby/common/NetDest.cc Thu Apr 12 21:07:01 2012 +0100 @@ -26,6 +26,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include + #include "mem/ruby/common/NetDest.hh" NetDest::NetDest() diff -r d062cc7a8bdf -r 954ba5d80ec9 src/mem/ruby/network/fault_model/FaultModel.hh --- a/src/mem/ruby/network/fault_model/FaultModel.hh Thu Apr 12 08:35:56 2012 -0400 +++ b/src/mem/ruby/network/fault_model/FaultModel.hh Thu Apr 12 21:07:01 2012 +0100 @@ -47,7 +47,6 @@ // C++ includes #include -using namespace std; // GEM5 includes #include "params/FaultModel.hh" @@ -112,7 +111,7 @@ int number_of_buff_per_data_vc, int number_of_buff_per_ctrl_vc); - string fault_type_to_string(int fault_type_index); + std::string fault_type_to_string(int fault_type_index); // the following 2 functions are called at runtime, to get the probability // of each fault type (fault_vector) or the aggregate fault probability @@ -134,9 +133,9 @@ void print(void); private: - vector configurations; - vector routers; - vector temperature_weights; + std::vector configurations; + std::vector routers; + std::vector temperature_weights; }; #endif // __MEM_RUBY_NETWORK_FAULT_MODEL_HH__ diff -r d062cc7a8bdf -r 954ba5d80ec9 src/mem/ruby/network/fault_model/FaultModel.cc --- a/src/mem/ruby/network/fault_model/FaultModel.cc Thu Apr 12 08:35:56 2012 -0400 +++ b/src/mem/ruby/network/fault_model/FaultModel.cc Thu Apr 12 21:07:01 2012 +0100 @@ -37,11 +37,8 @@ * Proceedings of the 48th Design Automation Conference (DAC'11) */ -// C includes -#include -#include - // C++ includes +#include #include #include #include @@ -50,6 +47,8 @@ #include "FaultModel.hh" #include "base/misc.hh" +using namespace std; + #define MAX(a,b) ((a > b) ? (a) : (b)) diff -r d062cc7a8bdf -r 954ba5d80ec9 src/mem/ruby/network/garnet/BaseGarnetNetwork.cc --- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc Thu Apr 12 08:35:56 2012 -0400 +++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc Thu Apr 12 21:07:01 2012 +0100 @@ -33,6 +33,8 @@ #include "mem/ruby/network/Topology.hh" #include "mem/ruby/network/garnet/BaseGarnetNetwork.hh" +using namespace std; + BaseGarnetNetwork::BaseGarnetNetwork(const Params *p) : Network(p) { diff -r d062cc7a8bdf -r 954ba5d80ec9 src/mem/ruby/network/orion/OrionConfig.hh --- a/src/mem/ruby/network/orion/OrionConfig.hh Thu Apr 12 08:35:56 2012 -0400 +++ b/src/mem/ruby/network/orion/OrionConfig.hh Thu Apr 12 21:07:01 2012 +0100 @@ -37,8 +37,6 @@ #include "mem/ruby/network/orion/Type.hh" -using namespace std; - class TechParameter; class OrionConfig @@ -56,12 +54,12 @@ void set_in_buf_num_set(uint32_t in_buf_num_set_); void set_flit_width(uint32_t flit_width_); - void read_file(const string& filename_); - void print_config(ostream& out_); + void read_file(const std::string& filename_); + void print_config(std::ostream& out_); public: template - T get(const string& key_) const; + T get(const std::string& key_) const; const TechParameter* get_tech_param_ptr() const { return m_tech_param_ptr; } uint32_t get_num_in_port() const { return m_num_in_port; } uint32_t get_num_out_port() const { return m_num_out_port; } @@ -71,7 +69,7 @@ uint32_t get_flit_width() const { return m_flit_width; } private: - map m_params_map; + std::map m_params_map; TechParameter* m_tech_param_ptr; uint32_t m_num_in_port; @@ -84,28 +82,28 @@ protected: struct key_not_found { - string m_key; - key_not_found(const string& key_ = string()) : m_key(key_) + std::string m_key; + key_not_found(const std::string& key_ = string()) : m_key(key_) {} }; template - static T string_as_T(const string& str_); + static T string_as_T(const std::string& str_); template - static string T_as_string(const T& t_); + static std::string T_as_string(const T& t_); private: - static string ms_param_name[]; + static std::string ms_param_name[]; }; template T OrionConfig::get(const string& key_) const { - map::const_iterator it; + std::map::const_iterator it; it = m_params_map.find(key_); if (it == m_params_map.end()) { - cerr << key_ << " NOT FOUND!" << endl; + std::cerr << key_ << " NOT FOUND!" << std::endl; throw key_not_found(key_); } return string_as_T(it->second); @@ -140,7 +138,8 @@ } else { - cerr << "Invalid bool value: '" << str_ << "'. Treated as FALSE." << endl; + std::cerr << "Invalid bool value: '" << str_ << + "'. Treated as FALSE." << std::endl; ret = false; } return ret; diff -r d062cc7a8bdf -r 954ba5d80ec9 src/mem/ruby/network/orion/OrionRouter.cc --- a/src/mem/ruby/network/orion/OrionRouter.cc Thu Apr 12 08:35:56 2012 -0400 +++ b/src/mem/ruby/network/orion/OrionRouter.cc Thu Apr 12 21:07:01 2012 +0100 @@ -43,6 +43,8 @@ #include "mem/ruby/network/orion/OrionConfig.hh" #include "OrionRouter.hh" +using namespace std; + OrionRouter::OrionRouter( uint32_t num_in_port_, uint32_t num_out_port_, diff -r d062cc7a8bdf -r 954ba5d80ec9 src/mem/ruby/network/orion/TechParameter.hh --- a/src/mem/ruby/network/orion/TechParameter.hh Thu Apr 12 08:35:56 2012 -0400 +++ b/src/mem/ruby/network/orion/TechParameter.hh Thu Apr 12 21:07:01 2012 +0100 @@ -40,8 +40,6 @@ #include "mem/ruby/network/orion/Type.hh" -using namespace std; - class OrionConfig; class TechParameter diff -r d062cc7a8bdf -r 954ba5d80ec9 src/mem/ruby/profiler/Profiler.cc --- a/src/mem/ruby/profiler/Profiler.cc Thu Apr 12 08:35:56 2012 -0400 +++ b/src/mem/ruby/profiler/Profiler.cc Thu Apr 12 21:07:01 2012 +0100 @@ -45,6 +45,8 @@ // Allows use of times() library call, which determines virtual runtime #include #include +#include +#include #include #include diff -r d062cc7a8bdf -r 954ba5d80ec9 src/mem/ruby/system/PerfectCacheMemory.hh --- a/src/mem/ruby/system/PerfectCacheMemory.hh Thu Apr 12 08:35:56 2012 -0400 +++ b/src/mem/ruby/system/PerfectCacheMemory.hh Thu Apr 12 21:07:01 2012 +0100 @@ -188,7 +188,6 @@ Address line_address = address; line_address.makeLineAddress(); PerfectCacheLineState& line_state = m_map[line_address]; - AccessPermission old_perm = line_state.m_permission; line_state.m_permission = new_perm; } diff -r d062cc7a8bdf -r 954ba5d80ec9 src/mem/slicc/symbols/StateMachine.py --- a/src/mem/slicc/symbols/StateMachine.py Thu Apr 12 08:35:56 2012 -0400 +++ b/src/mem/slicc/symbols/StateMachine.py Thu Apr 12 21:07:01 2012 +0100 @@ -408,6 +408,9 @@ * Created by slicc definition of Module "${{self.short}}" */ +#include +#include + #include #include #include @@ -990,6 +993,9 @@ // Auto generated C++ code started by $__file__:$__line__ // ${ident}: ${{self.short}} +#include +#include + #include #include "base/misc.hh" diff -r d062cc7a8bdf -r 954ba5d80ec9 src/sim/init.hh --- a/src/sim/init.hh Thu Apr 12 08:35:56 2012 -0400 +++ b/src/sim/init.hh Thu Apr 12 21:07:01 2012 +0100 @@ -36,6 +36,8 @@ */ #include +#include + #ifndef PyObject_HEAD struct _object; typedef _object PyObject; @@ -46,12 +48,12 @@ const char *filename; const char *abspath; const char *modpath; - const char *code; + const uint8_t *code; int zlen; int len; EmbeddedPython(const char *filename, const char *abspath, - const char *modpath, const char *code, int zlen, int len); + const char *modpath, const uint8_t *code, int zlen, int len); PyObject *getCode() const; bool addModule() const; diff -r d062cc7a8bdf -r 954ba5d80ec9 src/sim/init.cc --- a/src/sim/init.cc Thu Apr 12 08:35:56 2012 -0400 +++ b/src/sim/init.cc Thu Apr 12 21:07:01 2012 +0100 @@ -113,7 +113,7 @@ EmbeddedPython *EmbeddedPython::importer = NULL; PyObject *EmbeddedPython::importerModule = NULL; EmbeddedPython::EmbeddedPython(const char *filename, const char *abspath, - const char *modpath, const char *code, int zlen, int len) + const char *modpath, const unsigned char *code, int zlen, int len) : filename(filename), abspath(abspath), modpath(modpath), code(code), zlen(zlen), len(len) {