Gabe Black has submitted this change and it was merged. (
https://gem5-review.googlesource.com/c/public/gem5/+/15297 )
Change subject: systemc: Replace sc_core::sc_type_index with
std::type_index.
......................................................................
systemc: Replace sc_core::sc_type_index with std::type_index.
The former is either the same as the later, or a custom wrapper if
C++11 isn't supported. Since we generally expect C++11 support, we can
skip the indirection.
Change-Id: I9a45e3854bb7cc56d094e3fe2773fe4b5c94403b
Reviewed-on: https://gem5-review.googlesource.com/c/15297
Reviewed-by: Anthony Gutierrez <anthony.gutier...@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutier...@amd.com>
---
M src/systemc/ext/tlm_core/2/sockets/base_socket_if.hh
M src/systemc/ext/tlm_core/2/sockets/initiator_socket.hh
M src/systemc/ext/tlm_core/2/sockets/target_socket.hh
M src/systemc/tlm_core/2/generic_payload/gp.cc
M src/systemc/tlm_core/2/generic_payload/phase.cc
M src/systemc/tlm_utils/instance_specific_extensions.cc
6 files changed, 17 insertions(+), 12 deletions(-)
Approvals:
Anthony Gutierrez: Looks good to me, approved; Looks good to me, approved
diff --git a/src/systemc/ext/tlm_core/2/sockets/base_socket_if.hh
b/src/systemc/ext/tlm_core/2/sockets/base_socket_if.hh
index 29f3397..a494b68 100644
--- a/src/systemc/ext/tlm_core/2/sockets/base_socket_if.hh
+++ b/src/systemc/ext/tlm_core/2/sockets/base_socket_if.hh
@@ -21,6 +21,7 @@
#define __SYSTEMC_EXT_TLM_CORE_2_SOCKETS_BASE_SOCKET_IF_H__
#include <systemc>
+#include <typeindex>
namespace tlm
{
@@ -45,7 +46,7 @@
virtual sc_core::sc_export_base &get_export_base() = 0;
virtual sc_core::sc_export_base const &get_export_base() const = 0;
virtual unsigned int get_bus_width() const = 0;
- virtual sc_core::sc_type_index get_protocol_types() const = 0;
+ virtual std::type_index get_protocol_types() const = 0;
virtual tlm_socket_category get_socket_category() const = 0;
protected:
diff --git a/src/systemc/ext/tlm_core/2/sockets/initiator_socket.hh
b/src/systemc/ext/tlm_core/2/sockets/initiator_socket.hh
index 91c147b..a7c53cc 100644
--- a/src/systemc/ext/tlm_core/2/sockets/initiator_socket.hh
+++ b/src/systemc/ext/tlm_core/2/sockets/initiator_socket.hh
@@ -20,6 +20,8 @@
#ifndef __SYSTEMC_EXT_TLM_CORE_2_SOCKETS_INITIATOR_SOCKET_HH__
#define __SYSTEMC_EXT_TLM_CORE_2_SOCKETS_INITIATOR_SOCKET_HH__
+#include <typeindex>
+
#include "tlm_core/2/interfaces/fw_bw_ifs.hh"
#include "tlm_core/2/sockets/base_socket_if.hh"
@@ -192,7 +194,7 @@
virtual const char *kind() const { return "tlm_initiator_socket"; }
- virtual sc_core::sc_type_index
+ virtual std::type_index
get_protocol_types() const
{
return typeid(TYPES);
diff --git a/src/systemc/ext/tlm_core/2/sockets/target_socket.hh
b/src/systemc/ext/tlm_core/2/sockets/target_socket.hh
index b412a7d..4ca31c9 100644
--- a/src/systemc/ext/tlm_core/2/sockets/target_socket.hh
+++ b/src/systemc/ext/tlm_core/2/sockets/target_socket.hh
@@ -20,6 +20,8 @@
#ifndef __SYSTEMC_EXT_TLM_CORE_2_SOCKETS_TARGET_SOCKET_HH__
#define __SYSTEMC_EXT_TLM_CORE_2_SOCKETS_TARGET_SOCKET_HH__
+#include <typeindex>
+
#include "tlm_core/2/interfaces/fw_bw_ifs.hh"
#include "tlm_core/2/sockets/base_socket_if.hh"
@@ -211,7 +213,7 @@
virtual const char* kind() const { return "tlm_target_socket"; }
- virtual sc_core::sc_type_index
+ virtual std::type_index
get_protocol_types() const
{
return typeid(TYPES);
diff --git a/src/systemc/tlm_core/2/generic_payload/gp.cc
b/src/systemc/tlm_core/2/generic_payload/gp.cc
index ff3c92b..b42bdb8 100644
--- a/src/systemc/tlm_core/2/generic_payload/gp.cc
+++ b/src/systemc/tlm_core/2/generic_payload/gp.cc
@@ -21,8 +21,7 @@
#include <map>
#include <systemc>
#include <tlm>
-
-using sc_core::sc_type_index;
+#include <typeindex>
namespace tlm
{
@@ -39,7 +38,7 @@
class tlm_extension_registry
{
typedef unsigned int key_type;
- typedef std::map<sc_core::sc_type_index, key_type> type_map;
+ typedef std::map<std::type_index, key_type> type_map;
public:
static tlm_extension_registry &
instance()
@@ -52,7 +51,7 @@
}
unsigned int
- register_extension(sc_type_index type)
+ register_extension(std::type_index type)
{
type_map::const_iterator it = ids_.find(type);
diff --git a/src/systemc/tlm_core/2/generic_payload/phase.cc
b/src/systemc/tlm_core/2/generic_payload/phase.cc
index 2c8b1e1..a3fb937 100644
--- a/src/systemc/tlm_core/2/generic_payload/phase.cc
+++ b/src/systemc/tlm_core/2/generic_payload/phase.cc
@@ -21,9 +21,9 @@
#include <map>
#include <systemc>
#include <tlm>
+#include <typeindex>
using sc_core::sc_string_view;
-using sc_core::sc_type_index;
namespace tlm
{
@@ -43,7 +43,7 @@
}
unsigned int
- register_phase(sc_type_index type, sc_string_view name)
+ register_phase(std::type_index type, sc_string_view name)
{
type_map::const_iterator it = ids_.find(type);
@@ -77,7 +77,7 @@
}
private:
- typedef std::map<sc_type_index, key_type> type_map;
+ typedef std::map<std::type_index, key_type> type_map;
typedef std::vector<std::string> name_table;
type_map ids_;
diff --git a/src/systemc/tlm_utils/instance_specific_extensions.cc
b/src/systemc/tlm_utils/instance_specific_extensions.cc
index c0836cd..91610dd 100644
--- a/src/systemc/tlm_utils/instance_specific_extensions.cc
+++ b/src/systemc/tlm_utils/instance_specific_extensions.cc
@@ -23,6 +23,7 @@
#include <map>
#include <systemc>
#include <tlm>
+#include <typeindex>
namespace tlm
{
@@ -40,7 +41,7 @@
class ispex_registry // Copied from tlm_gp.cpp.
{
typedef unsigned int key_type;
- typedef std::map<sc_core::sc_type_index, key_type> type_map;
+ typedef std::map<std::type_index, key_type> type_map;
public:
static ispex_registry &
@@ -54,7 +55,7 @@
}
unsigned int
- register_extension(sc_core::sc_type_index type)
+ register_extension(std::type_index type)
{
type_map::const_iterator it = ids_.find(type);
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/15297
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I9a45e3854bb7cc56d094e3fe2773fe4b5c94403b
Gerrit-Change-Number: 15297
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Anthony Gutierrez <anthony.gutier...@amd.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Matthias Jung <jun...@eit.uni-kl.de>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev