diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/arm/isa/util.isa | 16 | ||||
-rw-r--r-- | src/mem/gems_common/Map.hh | 19 | ||||
-rw-r--r-- | src/mem/gems_common/ioutil/initvar.cc | 2 | ||||
-rw-r--r-- | src/mem/gems_common/util.cc | 2 | ||||
-rw-r--r-- | src/mem/ruby/common/Global.hh | 1 | ||||
-rw-r--r-- | src/mem/ruby/common/SubBlock.hh | 2 | ||||
-rw-r--r-- | src/mem/ruby/system/MemoryControl.cc | 19 | ||||
-rw-r--r-- | src/mem/slicc/SConscript | 4 | ||||
-rw-r--r-- | src/mem/slicc/ast/Location.cc | 8 | ||||
-rw-r--r-- | src/mem/slicc/ast/Location.hh | 2 | ||||
-rw-r--r-- | src/mem/slicc/parser/parser.yy | 4 | ||||
-rw-r--r-- | src/mem/slicc/symbols/SymbolTable.cc | 10 |
12 files changed, 38 insertions, 51 deletions
diff --git a/src/arch/arm/isa/util.isa b/src/arch/arm/isa/util.isa index 4fe0d732c..20eb80ecf 100644 --- a/src/arch/arm/isa/util.isa +++ b/src/arch/arm/isa/util.isa @@ -242,8 +242,8 @@ output exec {{ return ((arm_NEG(lhs) && arm_NEG(rhs)) || (arm_NEG(lhs) && arm_POS(result)) || (arm_NEG(rhs) && arm_POS(result))); - else - return 0; + + return 0; } // Generate the appropriate carry bit for a subtraction operation @@ -254,8 +254,8 @@ output exec {{ return ((arm_NEG(lhs) && arm_POS(rhs)) || (arm_NEG(lhs) && arm_POS(result)) || (arm_POS(rhs) && arm_POS(result))); - else - return 0; + + return 0; } inline int32_t @@ -264,8 +264,8 @@ output exec {{ if ((lhs | rhs) >> 30) return ((arm_NEG(lhs) && arm_NEG(rhs) && arm_POS(result)) || (arm_POS(lhs) && arm_POS(rhs) && arm_NEG(result))); - else - return 0; + + return 0; } inline int32_t @@ -274,8 +274,8 @@ output exec {{ if ((lhs >= rhs) || ((rhs | lhs) >> 31)) return ((arm_NEG(lhs) && arm_POS(rhs) && arm_POS(result)) || (arm_POS(lhs) && arm_NEG(rhs) && arm_NEG(result))); - else - return 0; + + return 0; } }}; diff --git a/src/mem/gems_common/Map.hh b/src/mem/gems_common/Map.hh index 6b145a90a..5128a0fee 100644 --- a/src/mem/gems_common/Map.hh +++ b/src/mem/gems_common/Map.hh @@ -34,24 +34,9 @@ #ifndef MAP_H #define MAP_H +#include "base/hashmap.hh" #include "mem/gems_common/Vector.hh" -namespace __gnu_cxx { - template <> struct hash <std::string> - { - size_t operator()(const string& s) const { return hash<char*>()(s.c_str()); } - }; -} - -typedef unsigned long long uint64; -//hack for uint64 hashes... -namespace __gnu_cxx { - template <> struct hash <uint64> - { - size_t operator()(const uint64 & s) const { return (size_t) s; } - }; -} - template <class KEY_TYPE, class VALUE_TYPE> class Map { @@ -84,7 +69,7 @@ private: // m_map is declared mutable because some methods from the STL "map" // class that should be const are not. Thus we define this as // mutable so we can still have conceptually const accessors. - mutable __gnu_cxx::hash_map<KEY_TYPE, VALUE_TYPE> m_map; + mutable m5::hash_map<KEY_TYPE, VALUE_TYPE> m_map; }; template <class KEY_TYPE, class VALUE_TYPE> diff --git a/src/mem/gems_common/ioutil/initvar.cc b/src/mem/gems_common/ioutil/initvar.cc index 62fe3b6af..4388c0de4 100644 --- a/src/mem/gems_common/ioutil/initvar.cc +++ b/src/mem/gems_common/ioutil/initvar.cc @@ -541,7 +541,7 @@ void initvar_t::list_param( FILE *fp ) #define PARAM_UINT( NAME ) \ fprintf( fp, "%-44.44s: %26u\n", #NAME, NAME ); #define PARAM_ULONG( NAME ) \ - fprintf( fp, "%-44.44s: %26llu\n", #NAME, NAME ); + fprintf( fp, "%-44.44s: %26llu\n", #NAME, (unsigned long long)NAME ); #define PARAM_BOOL( NAME ) \ if (NAME == true) { \ fprintf( fp, "%-44.44s: %26.26s\n", #NAME, "true" ); \ diff --git a/src/mem/gems_common/util.cc b/src/mem/gems_common/util.cc index f1535bdcf..d7b0e7853 100644 --- a/src/mem/gems_common/util.cc +++ b/src/mem/gems_common/util.cc @@ -42,7 +42,7 @@ string string_split(string& str, char split_character) string head = ""; string tail = ""; - uint counter = 0; + unsigned counter = 0; while(counter < str.size()) { if (str[counter] == split_character) { counter++; diff --git a/src/mem/ruby/common/Global.hh b/src/mem/ruby/common/Global.hh index 6b524bb70..de2d06e0e 100644 --- a/src/mem/ruby/common/Global.hh +++ b/src/mem/ruby/common/Global.hh @@ -85,7 +85,6 @@ typedef integer_t simtime_t; typedef Time LogicalTime; typedef int64 Index; // what the address bit ripper returns typedef int word; // one word of a cache line -typedef unsigned int uint; typedef int SwitchID; typedef int LinkID; diff --git a/src/mem/ruby/common/SubBlock.hh b/src/mem/ruby/common/SubBlock.hh index 5831be35a..2943bb886 100644 --- a/src/mem/ruby/common/SubBlock.hh +++ b/src/mem/ruby/common/SubBlock.hh @@ -85,7 +85,7 @@ private: // Data Members (m_ prefix) Address m_address; Address m_logicalAddress; - Vector<uint> m_data; + Vector<unsigned> m_data; }; // Output operator declaration diff --git a/src/mem/ruby/system/MemoryControl.cc b/src/mem/ruby/system/MemoryControl.cc index 2f93d98d5..d26348ad4 100644 --- a/src/mem/ruby/system/MemoryControl.cc +++ b/src/mem/ruby/system/MemoryControl.cc @@ -110,6 +110,9 @@ * */ +#include <list> + +#include "base/cprintf.hh" #include "mem/ruby/common/Global.hh" #include "mem/gems_common/Map.hh" #include "mem/ruby/common/Address.hh" @@ -119,13 +122,9 @@ #include "mem/ruby/slicc_interface/RubySlicc_ComponentMapping.hh" #include "mem/ruby/slicc_interface/NetworkMessage.hh" #include "mem/ruby/network/Network.hh" - #include "mem/ruby/common/Consumer.hh" - #include "mem/ruby/system/MemoryControl.hh" -#include <list> - class Consumer; // Value to reset watchdog timer to. @@ -261,8 +260,8 @@ void MemoryControl::enqueueMemRef (MemoryNode& memRef) { physical_address_t addr = memRef.m_addr; int bank = getBank(addr); if (m_debug) { - printf("New memory request%7d: 0x%08llx %c arrived at %10lld ", m_msg_counter, addr, is_mem_read? 'R':'W', at); - printf("bank =%3x\n", bank); + cprintf("New memory request%7d: %#08x %c arrived at %10d bank =%3x\n", + m_msg_counter, addr, is_mem_read? 'R':'W', at, bank); } g_system_ptr->getProfiler()->profileMemReq(bank); m_input_queue.push_back(memRef); @@ -296,7 +295,7 @@ MemoryNode MemoryControl::peekNode () { MemoryNode req = m_response_queue.front(); uint64 returnTime = req.m_time; if (m_debug) { - printf("Old memory request%7d: 0x%08llx %c peeked at %10lld\n", + cprintf("Old memory request%7d: %#08x %c peeked at %10d\n", req.m_msg_counter, req.m_addr, req.m_is_mem_read? 'R':'W', returnTime); } return req; @@ -392,7 +391,7 @@ int MemoryControl::getRank (int bank) { bool MemoryControl::queueReady (int bank) { if ((m_bankBusyCounter[bank] > 0) && !m_memFixedDelay) { g_system_ptr->getProfiler()->profileMemBankBusy(); - //if (m_debug) printf(" bank %x busy %d\n", bank, m_bankBusyCounter[bank]); + //if (m_debug) cprintf(" bank %x busy %d\n", bank, m_bankBusyCounter[bank]); return false; } if (m_memRandomArbitrate >= 2) { @@ -454,7 +453,7 @@ bool MemoryControl::issueRefresh (int bank) { //if (m_debug) { //uint64 current_time = g_eventQueue_ptr->getTime(); - //printf(" Refresh bank %3x at %lld\n", bank, current_time); + //cprintf(" Refresh bank %3x at %d\n", bank, current_time); //} g_system_ptr->getProfiler()->profileMemRefresh(); m_need_refresh--; @@ -489,7 +488,7 @@ void MemoryControl::issueRequest (int bank) { m_bankQueues[bank].pop_front(); if (m_debug) { uint64 current_time = g_eventQueue_ptr->getTime(); - printf(" Mem issue request%7d: 0x%08llx %c at %10lld bank =%3x\n", + cprintf(" Mem issue request%7d: %#08x %c at %10d bank =%3x\n", req.m_msg_counter, req.m_addr, req.m_is_mem_read? 'R':'W', current_time, bank); } if (req.m_msgptr.ref() != NULL) { // don't enqueue L3 writebacks diff --git a/src/mem/slicc/SConscript b/src/mem/slicc/SConscript index 64a199347..677ee33ec 100644 --- a/src/mem/slicc/SConscript +++ b/src/mem/slicc/SConscript @@ -51,8 +51,8 @@ common_dir = Dir('../gems_common') slicc_env = env.Clone() slicc_env['CPPDEFINES'] = '' slicc_env['CPPPATH'] = Dir('../..') -slicc_env['CCFLAGS'] = '' -slicc_env['CXXFLAGS'] = '-Wall -W -Wwrite-strings -Woverloaded-virtual -Wno-unused -Wno-deprecated' +slicc_env.Append(CCFLAGS=['-g', '-O0']) +slicc_env.Append(CPPDEFINES=['DEBUG', 'TRACING_ON=1']) slicc_env['LIBS'] = '' slicc_env['LIBPATH'] = '' all_slicc_sources = [] diff --git a/src/mem/slicc/ast/Location.cc b/src/mem/slicc/ast/Location.cc index 6209ccdb7..23d1dba0f 100644 --- a/src/mem/slicc/ast/Location.cc +++ b/src/mem/slicc/ast/Location.cc @@ -39,11 +39,15 @@ #include "mem/slicc/ast/Location.hh" int g_line_number = 0; -string g_file_name(""); +string &g_file_name() +{ + static string the_string; + return the_string; +} Location::Location() { - m_file_name = g_file_name; + m_file_name = g_file_name(); m_line_number = g_line_number; ostringstream sstr; diff --git a/src/mem/slicc/ast/Location.hh b/src/mem/slicc/ast/Location.hh index f070efc46..3233bdb3b 100644 --- a/src/mem/slicc/ast/Location.hh +++ b/src/mem/slicc/ast/Location.hh @@ -42,7 +42,7 @@ #include "mem/slicc/slicc_global.hh" extern int g_line_number; -extern string g_file_name; +extern string &g_file_name(); class Location { public: diff --git a/src/mem/slicc/parser/parser.yy b/src/mem/slicc/parser/parser.yy index 8090b88f7..724184665 100644 --- a/src/mem/slicc/parser/parser.yy +++ b/src/mem/slicc/parser/parser.yy @@ -337,7 +337,7 @@ DeclListAST* parse(string filename) exit(1); } g_line_number = 1; - g_file_name = filename; + g_file_name() = filename; yyin = file; g_decl_list_ptr = NULL; yyparse(); @@ -346,7 +346,7 @@ DeclListAST* parse(string filename) extern "C" void yyerror(char* s) { - fprintf(stderr, "%s:%d: %s at %s\n", g_file_name.c_str(), g_line_number, s, yytext); + fprintf(stderr, "%s:%d: %s at %s\n", g_file_name().c_str(), g_line_number, s, yytext); exit(1); } diff --git a/src/mem/slicc/symbols/SymbolTable.cc b/src/mem/slicc/symbols/SymbolTable.cc index 70391f838..e598ffcb4 100644 --- a/src/mem/slicc/symbols/SymbolTable.cc +++ b/src/mem/slicc/symbols/SymbolTable.cc @@ -477,8 +477,8 @@ void SymbolTable::writeChipFiles(string path) const string child_types = var->lookupPair("child_types"); string::iterator it = child_types.begin(); - uint num_types = 0; - for(uint t=0;t<child_types.size();t++){ + unsigned num_types = 0; + for(unsigned t=0;t<child_types.size();t++){ if(child_types.at(t) == '<'){ num_types++; } @@ -488,10 +488,10 @@ void SymbolTable::writeChipFiles(string path) const string* ids = new string[num_types]; int type_idx = 0; bool id_done = false; - for(uint t=0;t<child_types.size();t++){ + for(unsigned t=0;t<child_types.size();t++){ if(child_types[t] == '<'){ id_done = false; - uint r; + unsigned r; for(r=t+1;child_types.at(r)!='>';r++){ if(r == child_types.size()){ cerr << "Parse error in child_types" << endl; @@ -509,7 +509,7 @@ void SymbolTable::writeChipFiles(string path) const } } - for(uint t=0;t<num_types;t++){ + for(unsigned t=0;t<num_types;t++){ if(t==0) sstr << " if(strcmp(" << child_selector << ", \"" << ids[t] << "\") == 0)" << endl; else |