diff options
Diffstat (limited to 'src/mem')
-rw-r--r-- | src/mem/ruby/common/Address.hh | 6 | ||||
-rw-r--r-- | src/mem/ruby/common/NetDest.cc | 2 | ||||
-rw-r--r-- | src/mem/ruby/network/fault_model/FaultModel.cc | 7 | ||||
-rw-r--r-- | src/mem/ruby/network/fault_model/FaultModel.hh | 9 | ||||
-rw-r--r-- | src/mem/ruby/network/garnet/BaseGarnetNetwork.cc | 2 | ||||
-rw-r--r-- | src/mem/ruby/network/orion/OrionConfig.hh | 27 | ||||
-rw-r--r-- | src/mem/ruby/network/orion/OrionRouter.cc | 2 | ||||
-rw-r--r-- | src/mem/ruby/network/orion/TechParameter.hh | 2 | ||||
-rw-r--r-- | src/mem/ruby/profiler/Profiler.cc | 2 | ||||
-rw-r--r-- | src/mem/ruby/system/PerfectCacheMemory.hh | 1 | ||||
-rw-r--r-- | src/mem/slicc/symbols/StateMachine.py | 6 |
11 files changed, 37 insertions, 29 deletions
diff --git a/src/mem/ruby/common/Address.hh b/src/mem/ruby/common/Address.hh index 7ab3d1251..ce1e76e91 100644 --- a/src/mem/ruby/common/Address.hh +++ b/src/mem/ruby/common/Address.hh @@ -31,6 +31,7 @@ #include <cassert> #include <iomanip> +#include <iostream> #include "base/hashmap.hh" #include "mem/ruby/common/TypeDefines.hh" @@ -201,8 +202,7 @@ Address::shiftLowOrderBits(int number) const return (m_address >> number); } -class Address; -namespace __hash_namespace { +__hash_namespace_begin template <> struct hash<Address> { size_t @@ -211,7 +211,7 @@ template <> struct hash<Address> return (size_t)s.getAddress(); } }; -} // namespace __hash_namespace +__hash_namespace_end namespace std { template <> struct equal_to<Address> diff --git a/src/mem/ruby/common/NetDest.cc b/src/mem/ruby/common/NetDest.cc index 82c60f415..2d070d33d 100644 --- a/src/mem/ruby/common/NetDest.cc +++ b/src/mem/ruby/common/NetDest.cc @@ -26,6 +26,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <algorithm> + #include "mem/ruby/common/NetDest.hh" NetDest::NetDest() diff --git a/src/mem/ruby/network/fault_model/FaultModel.cc b/src/mem/ruby/network/fault_model/FaultModel.cc index 195f7c66c..83679984d 100644 --- a/src/mem/ruby/network/fault_model/FaultModel.cc +++ b/src/mem/ruby/network/fault_model/FaultModel.cc @@ -37,11 +37,8 @@ * Proceedings of the 48th Design Automation Conference (DAC'11) */ -// C includes -#include <assert.h> -#include <stdio.h> - // C++ includes +#include <cassert> #include <fstream> #include <iostream> #include <vector> @@ -50,6 +47,8 @@ #include "FaultModel.hh" #include "base/misc.hh" +using namespace std; + #define MAX(a,b) ((a > b) ? (a) : (b)) diff --git a/src/mem/ruby/network/fault_model/FaultModel.hh b/src/mem/ruby/network/fault_model/FaultModel.hh index 12a3f3844..c099220ca 100644 --- a/src/mem/ruby/network/fault_model/FaultModel.hh +++ b/src/mem/ruby/network/fault_model/FaultModel.hh @@ -47,7 +47,6 @@ // C++ includes #include <string> -using namespace std; // GEM5 includes #include "params/FaultModel.hh" @@ -112,7 +111,7 @@ class FaultModel : public SimObject 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 @@ class FaultModel : public SimObject void print(void); private: - vector <system_conf> configurations; - vector <system_conf> routers; - vector <int> temperature_weights; + std::vector <system_conf> configurations; + std::vector <system_conf> routers; + std::vector <int> temperature_weights; }; #endif // __MEM_RUBY_NETWORK_FAULT_MODEL_HH__ diff --git a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc index f7093c8ba..69d513329 100644 --- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc +++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc @@ -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 --git a/src/mem/ruby/network/orion/OrionConfig.hh b/src/mem/ruby/network/orion/OrionConfig.hh index 7138fd8a2..d9b0e0830 100644 --- a/src/mem/ruby/network/orion/OrionConfig.hh +++ b/src/mem/ruby/network/orion/OrionConfig.hh @@ -37,8 +37,6 @@ #include "mem/ruby/network/orion/Type.hh" -using namespace std; - class TechParameter; class OrionConfig @@ -56,12 +54,12 @@ class OrionConfig 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<class T> - 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 @@ class OrionConfig uint32_t get_flit_width() const { return m_flit_width; } private: - map<string, string> m_params_map; + std::map<std::string, std::string> m_params_map; TechParameter* m_tech_param_ptr; uint32_t m_num_in_port; @@ -84,28 +82,28 @@ class OrionConfig 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<class T> - static T string_as_T(const string& str_); + static T string_as_T(const std::string& str_); template<class T> - 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<class T> T OrionConfig::get(const string& key_) const { - map<string, string>::const_iterator it; + std::map<std::string, std::string>::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<T>(it->second); @@ -140,7 +138,8 @@ inline bool OrionConfig::string_as_T<bool>(const string& str_) } 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 --git a/src/mem/ruby/network/orion/OrionRouter.cc b/src/mem/ruby/network/orion/OrionRouter.cc index e6fc88a78..bcf7c3920 100644 --- a/src/mem/ruby/network/orion/OrionRouter.cc +++ b/src/mem/ruby/network/orion/OrionRouter.cc @@ -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 --git a/src/mem/ruby/network/orion/TechParameter.hh b/src/mem/ruby/network/orion/TechParameter.hh index af9ba65d4..c894a513c 100644 --- a/src/mem/ruby/network/orion/TechParameter.hh +++ b/src/mem/ruby/network/orion/TechParameter.hh @@ -40,8 +40,6 @@ #include "mem/ruby/network/orion/Type.hh" -using namespace std; - class OrionConfig; class TechParameter diff --git a/src/mem/ruby/profiler/Profiler.cc b/src/mem/ruby/profiler/Profiler.cc index 04e44bc13..098eb9b1f 100644 --- a/src/mem/ruby/profiler/Profiler.cc +++ b/src/mem/ruby/profiler/Profiler.cc @@ -45,6 +45,8 @@ // Allows use of times() library call, which determines virtual runtime #include <sys/resource.h> #include <sys/times.h> +#include <sys/types.h> +#include <unistd.h> #include <algorithm> #include <fstream> diff --git a/src/mem/ruby/system/PerfectCacheMemory.hh b/src/mem/ruby/system/PerfectCacheMemory.hh index b880b6434..33419c5c7 100644 --- a/src/mem/ruby/system/PerfectCacheMemory.hh +++ b/src/mem/ruby/system/PerfectCacheMemory.hh @@ -188,7 +188,6 @@ PerfectCacheMemory<ENTRY>::changePermission(const Address& address, Address line_address = address; line_address.makeLineAddress(); PerfectCacheLineState<ENTRY>& line_state = m_map[line_address]; - AccessPermission old_perm = line_state.m_permission; line_state.m_permission = new_perm; } diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py index a9886b229..41348ba6d 100644 --- a/src/mem/slicc/symbols/StateMachine.py +++ b/src/mem/slicc/symbols/StateMachine.py @@ -408,6 +408,9 @@ void unset_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr); * Created by slicc definition of Module "${{self.short}}" */ +#include <sys/types.h> +#include <unistd.h> + #include <cassert> #include <sstream> #include <string> @@ -990,6 +993,9 @@ $c_ident::${{action.ident}}(const Address& addr) // Auto generated C++ code started by $__file__:$__line__ // ${ident}: ${{self.short}} +#include <sys/types.h> +#include <unistd.h> + #include <cassert> #include "base/misc.hh" |