systemc: Seperate the "external" header interface.

Most (but not all) of the SystemC headers are part of the "external"
interface that an existing, standard compliant module would include
through <systemc.h> or <systemc>. Since those follow slightly different
rules (relative includes, no gem5 includes), this change separates them
out so that they're easier to identify.

Also, this change moves the other files into a "core" subdirectory,
with the intention to add a "dt", aka data type, directory some time in
the future when those standard defined types are implemented.

Change-Id: Ida63f9cc0bc0431024d4dd691cc5b22b944a99a8
Reviewed-on: https://gem5-review.googlesource.com/10835
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
diff --git a/src/systemc/SConscript b/src/systemc/core/SConscript
similarity index 100%
rename from src/systemc/SConscript
rename to src/systemc/core/SConscript
diff --git a/src/systemc/SystemC.py b/src/systemc/core/SystemC.py
similarity index 96%
rename from src/systemc/SystemC.py
rename to src/systemc/core/SystemC.py
index bc04ed6..41fecb2 100644
--- a/src/systemc/SystemC.py
+++ b/src/systemc/core/SystemC.py
@@ -34,7 +34,7 @@
 class SystemC_Kernel(SimObject):
     type = 'SystemC_Kernel'
     cxx_class = 'SystemC::Kernel'
-    cxx_header = 'systemc/kernel.hh'
+    cxx_header = 'systemc/core/kernel.hh'
 
     def sc_main(self, *args):
         '''Call the systemc sc_main function with the given string args'''
@@ -48,7 +48,7 @@
     type = 'SystemC_ScObject'
     abstract = True
     cxx_class = 'sc_core::sc_object'
-    cxx_header = 'systemc/sc_object.hh'
+    cxx_header = 'systemc/ext/core/sc_object.hh'
 
     # Clear cxx_base to stop the c++ binding code from assuming
     # sc_core::sc_object inherits from SimObject, even though SystemC_ScObject
diff --git a/src/systemc/kernel.cc b/src/systemc/core/kernel.cc
similarity index 97%
rename from src/systemc/kernel.cc
rename to src/systemc/core/kernel.cc
index e52d04e..288a037 100644
--- a/src/systemc/kernel.cc
+++ b/src/systemc/core/kernel.cc
@@ -27,7 +27,7 @@
  * Authors: Gabe Black
  */
 
-#include "systemc/kernel.hh"
+#include "systemc/core/kernel.hh"
 
 namespace SystemC
 {
diff --git a/src/systemc/kernel.hh b/src/systemc/core/kernel.hh
similarity index 100%
rename from src/systemc/kernel.hh
rename to src/systemc/core/kernel.hh
diff --git a/src/systemc/sc_attr.cc b/src/systemc/core/sc_attr.cc
similarity index 98%
rename from src/systemc/sc_attr.cc
rename to src/systemc/core/sc_attr.cc
index 6128f93..28e0b60 100644
--- a/src/systemc/sc_attr.cc
+++ b/src/systemc/core/sc_attr.cc
@@ -27,9 +27,8 @@
  * Authors: Gabe Black
  */
 
-#include "systemc/sc_attr.hh"
-
 #include "base/logging.hh"
+#include "systemc/ext/core/sc_attr.hh"
 
 namespace sc_core
 {
diff --git a/src/systemc/sc_event.cc b/src/systemc/core/sc_event.cc
similarity index 99%
rename from src/systemc/sc_event.cc
rename to src/systemc/core/sc_event.cc
index e641af6..0cdab2a 100644
--- a/src/systemc/sc_event.cc
+++ b/src/systemc/core/sc_event.cc
@@ -27,9 +27,8 @@
  * Authors: Gabe Black
  */
 
-#include "systemc/sc_event.hh"
-
 #include "base/logging.hh"
+#include "systemc/ext/core/sc_event.hh"
 
 namespace sc_core
 {
diff --git a/src/systemc/sc_export.cc b/src/systemc/core/sc_export.cc
similarity index 97%
rename from src/systemc/sc_export.cc
rename to src/systemc/core/sc_export.cc
index ab1252a..387b8a7 100644
--- a/src/systemc/sc_export.cc
+++ b/src/systemc/core/sc_export.cc
@@ -27,9 +27,8 @@
  * Authors: Gabe Black
  */
 
-#include "systemc/sc_export.hh"
-
 #include "base/logging.hh"
+#include "systemc/ext/core/sc_export.hh"
 
 namespace sc_core
 {
diff --git a/src/systemc/sc_interface.cc b/src/systemc/core/sc_interface.cc
similarity index 97%
rename from src/systemc/sc_interface.cc
rename to src/systemc/core/sc_interface.cc
index 18124ab..e01bdcc 100644
--- a/src/systemc/sc_interface.cc
+++ b/src/systemc/core/sc_interface.cc
@@ -27,9 +27,8 @@
  * Authors: Gabe Black
  */
 
-#include "systemc/sc_interface.hh"
-
 #include "base/logging.hh"
+#include "systemc/ext/core/sc_interface.hh"
 
 namespace sc_core
 {
diff --git a/src/systemc/sc_main.cc b/src/systemc/core/sc_main.cc
similarity index 98%
rename from src/systemc/sc_main.cc
rename to src/systemc/core/sc_main.cc
index 88d51ba..5a6108a 100644
--- a/src/systemc/sc_main.cc
+++ b/src/systemc/core/sc_main.cc
@@ -27,13 +27,12 @@
  * Authors: Gabe Black
  */
 
-#include "systemc/sc_main.hh"
-
 #include <cstring>
 
 #include "base/logging.hh"
 #include "python/pybind11/pybind.hh"
 #include "sim/init.hh"
+#include "systemc/ext/core/sc_main.hh"
 
 // A default version of this function in case one isn't otherwise defined.
 // This ensures everything will link properly whether or not the user defined
diff --git a/src/systemc/sc_module.cc b/src/systemc/core/sc_module.cc
similarity index 99%
rename from src/systemc/sc_module.cc
rename to src/systemc/core/sc_module.cc
index 60c07bf..6bbb9dc 100644
--- a/src/systemc/sc_module.cc
+++ b/src/systemc/core/sc_module.cc
@@ -27,9 +27,8 @@
  * Authors: Gabe Black
  */
 
-#include "systemc/sc_module.hh"
-
 #include "base/logging.hh"
+#include "systemc/ext/core/sc_module.hh"
 
 namespace sc_core
 {
diff --git a/src/systemc/sc_module_name.cc b/src/systemc/core/sc_module_name.cc
similarity index 97%
rename from src/systemc/sc_module_name.cc
rename to src/systemc/core/sc_module_name.cc
index 06291e6..2646d43 100644
--- a/src/systemc/sc_module_name.cc
+++ b/src/systemc/core/sc_module_name.cc
@@ -28,9 +28,8 @@
  */
 
 
-#include "systemc/sc_module_name.hh"
-
 #include "base/logging.hh"
+#include "systemc/ext/core/sc_module_name.hh"
 
 namespace sc_core
 {
diff --git a/src/systemc/sc_object.cc b/src/systemc/core/sc_object.cc
similarity index 98%
rename from src/systemc/sc_object.cc
rename to src/systemc/core/sc_object.cc
index 6b9fc25..554bc22 100644
--- a/src/systemc/sc_object.cc
+++ b/src/systemc/core/sc_object.cc
@@ -27,9 +27,8 @@
  * Authors: Gabe Black
  */
 
-#include "systemc/sc_object.hh"
-
 #include "base/logging.hh"
+#include "systemc/ext/core/sc_object.hh"
 
 namespace sc_core
 {
diff --git a/src/systemc/sc_port.cc b/src/systemc/core/sc_port.cc
similarity index 97%
rename from src/systemc/sc_port.cc
rename to src/systemc/core/sc_port.cc
index 42c55bd..e1823bc 100644
--- a/src/systemc/sc_port.cc
+++ b/src/systemc/core/sc_port.cc
@@ -27,9 +27,8 @@
  * Authors: Gabe Black
  */
 
-#include "systemc/sc_port.hh"
-
 #include "base/logging.hh"
+#include "systemc/ext/core/sc_port.hh"
 
 namespace sc_core
 {
diff --git a/src/systemc/sc_prim.cc b/src/systemc/core/sc_prim.cc
similarity index 98%
rename from src/systemc/sc_prim.cc
rename to src/systemc/core/sc_prim.cc
index 516eab2..0daf317 100644
--- a/src/systemc/sc_prim.cc
+++ b/src/systemc/core/sc_prim.cc
@@ -27,9 +27,8 @@
  * Authors: Gabe Black
  */
 
-#include "systemc/sc_prim.hh"
-
 #include "base/logging.hh"
+#include "systemc/ext/core/sc_prim.hh"
 
 namespace sc_core
 {
diff --git a/src/systemc/sc_sensitive.cc b/src/systemc/core/sc_sensitive.cc
similarity index 97%
rename from src/systemc/sc_sensitive.cc
rename to src/systemc/core/sc_sensitive.cc
index eedade0..e182fa0 100644
--- a/src/systemc/sc_sensitive.cc
+++ b/src/systemc/core/sc_sensitive.cc
@@ -27,9 +27,8 @@
  * Authors: Gabe Black
  */
 
-#include "systemc/sc_sensitive.hh"
-
 #include "base/logging.hh"
+#include "systemc/ext/core/sc_sensitive.hh"
 
 namespace sc_core
 {
diff --git a/src/systemc/sc_time.cc b/src/systemc/core/sc_time.cc
similarity index 98%
rename from src/systemc/sc_time.cc
rename to src/systemc/core/sc_time.cc
index 7c1b4ee..0228957 100644
--- a/src/systemc/sc_time.cc
+++ b/src/systemc/core/sc_time.cc
@@ -27,9 +27,8 @@
  * Authors: Gabe Black
  */
 
-#include "systemc/sc_time.hh"
-
 #include "base/logging.hh"
+#include "systemc/ext/core/sc_time.hh"
 
 namespace sc_core
 {
diff --git a/src/systemc/sc_attr.hh b/src/systemc/ext/core/sc_attr.hh
similarity index 95%
rename from src/systemc/sc_attr.hh
rename to src/systemc/ext/core/sc_attr.hh
index 6db5893..d7baa14 100644
--- a/src/systemc/sc_attr.hh
+++ b/src/systemc/ext/core/sc_attr.hh
@@ -27,8 +27,8 @@
  * Authors: Gabe Black
  */
 
-#ifndef __SYSTEMC_SC_ATTR_HH__
-#define __SYSTEMC_SC_ATTR_HH__
+#ifndef __SYSTEMC_EXT_CORE_SC_ATTR_HH__
+#define __SYSTEMC_EXT_CORE_SC_ATTR_HH__
 
 #include <string>
 
@@ -95,4 +95,4 @@
 
 } // namespace sc_core
 
-#endif  //__SYSTEMC_SC_ATTR_HH__
+#endif  //__SYSTEMC_EXT_CORE_SC_ATTR_HH__
diff --git a/src/systemc/sc_event.hh b/src/systemc/ext/core/sc_event.hh
similarity index 96%
rename from src/systemc/sc_event.hh
rename to src/systemc/ext/core/sc_event.hh
index 98a16bd..d4d719b 100644
--- a/src/systemc/sc_event.hh
+++ b/src/systemc/ext/core/sc_event.hh
@@ -27,8 +27,8 @@
  * Authors: Gabe Black
  */
 
-#ifndef __SYSTEMC_SC_EVENT_HH__
-#define __SYSTEMC_SC_EVENT_HH__
+#ifndef __SYSTEMC_EXT_CORE_SC_EVENT_HH__
+#define __SYSTEMC_EXT_CORE_SC_EVENT_HH__
 
 #include <vector>
 
@@ -148,4 +148,4 @@
 
 } // namespace sc_core
 
-#endif  //__SYSTEMC_SC_INTERFACE_HH__
+#endif  //__SYSTEMC_EXT_CORE_SC_INTERFACE_HH__
diff --git a/src/systemc/sc_export.hh b/src/systemc/ext/core/sc_export.hh
similarity index 95%
rename from src/systemc/sc_export.hh
rename to src/systemc/ext/core/sc_export.hh
index 5cbd564..dc21764 100644
--- a/src/systemc/sc_export.hh
+++ b/src/systemc/ext/core/sc_export.hh
@@ -27,8 +27,8 @@
  * Authors: Gabe Black
  */
 
-#ifndef __SYSTEMC_SC_EXPORT_HH__
-#define __SYSTEMC_SC_EXPORT_HH__
+#ifndef __SYSTEMC_EXT_CORE_SC_EXPORT_HH__
+#define __SYSTEMC_EXT_CORE_SC_EXPORT_HH__
 
 #include "sc_object.hh"
 
@@ -98,4 +98,4 @@
 
 } // namespace sc_core
 
-#endif  //__SYSTEMC_SC_EXPORT_HH__
+#endif  //__SYSTEMC_EXT_CORE_SC_EXPORT_HH__
diff --git a/src/systemc/sc_interface.hh b/src/systemc/ext/core/sc_interface.hh
similarity index 93%
rename from src/systemc/sc_interface.hh
rename to src/systemc/ext/core/sc_interface.hh
index 4418a95..2073f53 100644
--- a/src/systemc/sc_interface.hh
+++ b/src/systemc/ext/core/sc_interface.hh
@@ -27,8 +27,8 @@
  * Authors: Gabe Black
  */
 
-#ifndef __SYSTEMC_SC_INTERFACE_HH__
-#define __SYSTEMC_SC_INTERFACE_HH__
+#ifndef __SYSTEMC_EXT_CORE_SC_INTERFACE_HH__
+#define __SYSTEMC_EXT_CORE_SC_INTERFACE_HH__
 
 namespace sc_core
 {
@@ -54,4 +54,4 @@
 
 } // namespace sc_core
 
-#endif  //__SYSTEMC_SC_INTERFACE_HH__
+#endif  //__SYSTEMC_EXT_CORE_SC_INTERFACE_HH__
diff --git a/src/systemc/sc_main.hh b/src/systemc/ext/core/sc_main.hh
similarity index 93%
rename from src/systemc/sc_main.hh
rename to src/systemc/ext/core/sc_main.hh
index d9fd2b1..9bf0d0a 100644
--- a/src/systemc/sc_main.hh
+++ b/src/systemc/ext/core/sc_main.hh
@@ -27,8 +27,8 @@
  * Authors: Gabe Black
  */
 
-#ifndef __SYSTEMC_SC_MAIN_HH__
-#define __SYSTEMC_SC_MAIN_HH__
+#ifndef __SYSTEMC_EXT_CORE_SC_MAIN_HH__
+#define __SYSTEMC_EXT_CORE_SC_MAIN_HH__
 
 extern "C" int sc_main(int argc, char *argv[]);
 
@@ -41,4 +41,4 @@
     extern "C" const char *const *sc_argv();
 } // namespace sc_core
 
-#endif  //__SYSTEMC_SC_MAIN_HH__
+#endif  //__SYSTEMC_EXT_CORE_SC_MAIN_HH__
diff --git a/src/systemc/sc_module.hh b/src/systemc/ext/core/sc_module.hh
similarity index 98%
rename from src/systemc/sc_module.hh
rename to src/systemc/ext/core/sc_module.hh
index 2fd85b6..4c4ebb2 100644
--- a/src/systemc/sc_module.hh
+++ b/src/systemc/ext/core/sc_module.hh
@@ -27,8 +27,8 @@
  * Authors: Gabe Black
  */
 
-#ifndef __SYSTEMC_SC_MODULE_HH__
-#define __SYSTEMC_SC_MODULE_HH__
+#ifndef __SYSTEMC_CORE_EXT_SC_MODULE_HH__
+#define __SYSTEMC_CORE_EXT_SC_MODULE_HH__
 
 #include <vector>
 
@@ -243,4 +243,4 @@
 
 } // namespace sc_core
 
-#endif  //__SYSTEMC_SC_MODULE_HH__
+#endif  //__SYSTEMC_EXT_CORE_SC_MODULE_HH__
diff --git a/src/systemc/sc_module_name.hh b/src/systemc/ext/core/sc_module_name.hh
similarity index 92%
rename from src/systemc/sc_module_name.hh
rename to src/systemc/ext/core/sc_module_name.hh
index 40279b3..7ae2fd6 100644
--- a/src/systemc/sc_module_name.hh
+++ b/src/systemc/ext/core/sc_module_name.hh
@@ -27,8 +27,8 @@
  * Authors: Gabe Black
  */
 
-#ifndef __SYSTEMC_SC_MODULE_NAME_HH__
-#define __SYSTEMC_SC_MODULE_NAME_HH__
+#ifndef __SYSTEMC_EXT_CORE_SC_MODULE_NAME_HH__
+#define __SYSTEMC_EXT_CORE_SC_MODULE_NAME_HH__
 
 namespace sc_core
 {
@@ -53,4 +53,4 @@
 
 } // namespace sc_core
 
-#endif  //__SYSTEMC_SC_MODULE_NAME_HH__
+#endif  //__SYSTEMC_EXT_CORE_SC_MODULE_NAME_HH__
diff --git a/src/systemc/sc_object.hh b/src/systemc/ext/core/sc_object.hh
similarity index 95%
rename from src/systemc/sc_object.hh
rename to src/systemc/ext/core/sc_object.hh
index 51ca197..0e97581 100644
--- a/src/systemc/sc_object.hh
+++ b/src/systemc/ext/core/sc_object.hh
@@ -27,8 +27,8 @@
  * Authors: Gabe Black
  */
 
-#ifndef __SYSTEMC_SC_OBJECT_HH__
-#define __SYSTEMC_SC_OBJECT_HH__
+#ifndef __SYSTEMC_EXT_CORE_SC_OBJECT_HH__
+#define __SYSTEMC_EXT_CORE_SC_OBJECT_HH__
 
 #include <iostream>
 #include <string>
@@ -77,4 +77,4 @@
 
 } // namespace sc_core
 
-#endif  //__SYSTEMC_SC_OBJECT_HH__
+#endif  //__SYSTEMC_EXT_CORE_SC_OBJECT_HH__
diff --git a/src/systemc/sc_port.hh b/src/systemc/ext/core/sc_port.hh
similarity index 96%
rename from src/systemc/sc_port.hh
rename to src/systemc/ext/core/sc_port.hh
index 6c39667..1d32422 100644
--- a/src/systemc/sc_port.hh
+++ b/src/systemc/ext/core/sc_port.hh
@@ -27,8 +27,8 @@
  * Authors: Gabe Black
  */
 
-#ifndef __SYSTEMC_SC_PORT_HH__
-#define __SYSTEMC_SC_PORT_HH__
+#ifndef __SYSTEMC_EXT_CORE_SC_PORT_HH__
+#define __SYSTEMC_EXT_CORE_SC_PORT_HH__
 
 #include "sc_object.hh"
 
@@ -189,4 +189,4 @@
 
 } // namespace sc_core
 
-#endif  //__SYSTEMC_SC_PORT_HH__
+#endif  //__SYSTEMC_EXT_CORE_SC_PORT_HH__
diff --git a/src/systemc/sc_prim.hh b/src/systemc/ext/core/sc_prim.hh
similarity index 96%
rename from src/systemc/sc_prim.hh
rename to src/systemc/ext/core/sc_prim.hh
index 1bf15fa..d6265cb 100644
--- a/src/systemc/sc_prim.hh
+++ b/src/systemc/ext/core/sc_prim.hh
@@ -27,8 +27,8 @@
  * Authors: Gabe Black
  */
 
-#ifndef __SYSTEMC_SC_PRIM_HH__
-#define __SYSTEMC_SC_PRIM_HH__
+#ifndef __SYSTEMC_EXT_CORE_SC_PRIM_HH__
+#define __SYSTEMC_EXT_CORE_SC_PRIM_HH__
 
 #include "sc_object.hh"
 #include "sc_time.hh"
@@ -94,4 +94,4 @@
 
 } // namespace sc_core
 
-#endif  //__SYSTEMC_SC_PRIM_HH__
+#endif  //__SYSTEMC_EXT_CORE_SC_PRIM_HH__
diff --git a/src/systemc/sc_sensitive.hh b/src/systemc/ext/core/sc_sensitive.hh
similarity index 93%
rename from src/systemc/sc_sensitive.hh
rename to src/systemc/ext/core/sc_sensitive.hh
index cd0dadb..62f18b6 100644
--- a/src/systemc/sc_sensitive.hh
+++ b/src/systemc/ext/core/sc_sensitive.hh
@@ -27,8 +27,8 @@
  * Authors: Gabe Black
  */
 
-#ifndef __SYSTEMC_SC_SENSITIVE_HH__
-#define __SYSTEMC_SC_SENSITIVE_HH__
+#ifndef __SYSTEMC_EXT_CORE_SC_SENSITIVE_HH__
+#define __SYSTEMC_EXT_CORE_SC_SENSITIVE_HH__
 
 namespace sc_core
 {
@@ -49,4 +49,4 @@
 
 } // namespace sc_core
 
-#endif  //__SYSTEMC_SC_SENSITIVE_HH__
+#endif  //__SYSTEMC_EXT_CORE_SC_SENSITIVE_HH__
diff --git a/src/systemc/sc_time.hh b/src/systemc/ext/core/sc_time.hh
similarity index 94%
rename from src/systemc/sc_time.hh
rename to src/systemc/ext/core/sc_time.hh
index 3c70ba9..456d59e 100644
--- a/src/systemc/sc_time.hh
+++ b/src/systemc/ext/core/sc_time.hh
@@ -27,14 +27,14 @@
  * Authors: Gabe Black
  */
 
-#ifndef __SYSTEMC_SC_TIME_HH__
-#define __SYSTEMC_SC_TIME_HH__
+#ifndef __SYSTEMC_EXT_CORE_SC_TIME_HH__
+#define __SYSTEMC_EXT_CORE_SC_TIME_HH__
 
 #include <stdint.h>
 
 #include <iostream>
 
-#include "dt/int/sc_nbdefs.hh"
+#include "../dt/int/sc_nbdefs.hh"
 
 namespace sc_core
 {
@@ -95,4 +95,4 @@
 
 } // namespace sc_core
 
-#endif  //__SYSTEMC_SC_TIME_HH__
+#endif  //__SYSTEMC_EXT_CORE_SC_TIME_HH__
diff --git a/src/systemc/dt/int/sc_nbdefs.hh b/src/systemc/ext/dt/int/sc_nbdefs.hh
similarity index 100%
rename from src/systemc/dt/int/sc_nbdefs.hh
rename to src/systemc/ext/dt/int/sc_nbdefs.hh