summaryrefslogtreecommitdiff
path: root/ext/systemc/src/sysc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2017-05-19 16:35:00 -0700
committerGabe Black <gabeblack@google.com>2017-05-29 16:54:08 +0000
commit6e8b0f659602602765fcfdb4d32a8aa2548d669e (patch)
treed4d4011856f28be4b90e4b0180d9195499c4d9dc /ext/systemc/src/sysc
parent7159ea669825a2a876dc3f0f2022336b517299a0 (diff)
downloadgem5-6e8b0f659602602765fcfdb4d32a8aa2548d669e.tar.xz
ext: Revamp the systemc SConscripts.
The existing scripts were including pthread code and QT code at the same time, and also insisting on an having a set of architecture specific source files for whatever the current architecture is. This change selects using either QT or pthreads based on the host architecture, distributes accumulating source files, list source files explicitly (to avoid including redundant coroutine libraries) and makes scons insist on an architecture specific QT implementation only if QT is being used. It also defines a preprocessor symbol which tells some headers whether or not pthreads are being used, and also clones the scons environment to avoid leaking flags into the main environment used to compile gem5 itself. If the host architecture isn't supported by systemc, a warning will be printed, and the various build products and SConscript files will be skipped over. Change-Id: I1a40123a11e49e02922a054f093246cf197087bf Reviewed-on: https://gem5-review.googlesource.com/3461 Reviewed-by: Matthias Jung <jungma@eit.uni-kl.de> Reviewed-by: Christian Menard <christian.menard@tu-dresden.de> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'ext/systemc/src/sysc')
-rw-r--r--ext/systemc/src/sysc/communication/SConscript.sc42
-rw-r--r--ext/systemc/src/sysc/datatypes/bit/SConscript.sc33
-rw-r--r--ext/systemc/src/sysc/datatypes/fx/SConscript.sc40
-rw-r--r--ext/systemc/src/sysc/datatypes/int/SConscript.sc40
-rw-r--r--ext/systemc/src/sysc/datatypes/misc/SConscript.sc31
-rw-r--r--ext/systemc/src/sysc/kernel/SConscript.sc67
-rw-r--r--ext/systemc/src/sysc/qt/SConscript.sc42
-rw-r--r--ext/systemc/src/sysc/tracing/SConscript.sc33
-rw-r--r--ext/systemc/src/sysc/utils/SConscript.sc39
9 files changed, 367 insertions, 0 deletions
diff --git a/ext/systemc/src/sysc/communication/SConscript.sc b/ext/systemc/src/sysc/communication/SConscript.sc
new file mode 100644
index 000000000..952615033
--- /dev/null
+++ b/ext/systemc/src/sysc/communication/SConscript.sc
@@ -0,0 +1,42 @@
+# Copyright (c) 2017, TU Dresden
+# Copyright (c) 2017, University of Kaiserslautern
+# All rights reserved.
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+# Authors: Christian Menard
+# Matthias Jung
+
+Import('systemc', 'SystemCSource')
+
+SystemCSource(
+ 'sc_clock.cpp',
+ 'sc_event_finder.cpp',
+ 'sc_event_queue.cpp',
+ 'sc_export.cpp',
+ 'sc_interface.cpp',
+ 'sc_mutex.cpp',
+ 'sc_port.cpp',
+ 'sc_prim_channel.cpp',
+ 'sc_semaphore.cpp',
+ 'sc_signal.cpp',
+ 'sc_signal_ports.cpp',
+ 'sc_signal_resolved.cpp',
+ 'sc_signal_resolved_ports.cpp',
+)
diff --git a/ext/systemc/src/sysc/datatypes/bit/SConscript.sc b/ext/systemc/src/sysc/datatypes/bit/SConscript.sc
new file mode 100644
index 000000000..aca97d356
--- /dev/null
+++ b/ext/systemc/src/sysc/datatypes/bit/SConscript.sc
@@ -0,0 +1,33 @@
+# Copyright (c) 2017, TU Dresden
+# Copyright (c) 2017, University of Kaiserslautern
+# All rights reserved.
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+# Authors: Christian Menard
+# Matthias Jung
+
+Import('systemc', 'SystemCSource')
+
+SystemCSource(
+ 'sc_bit.cpp',
+ 'sc_bv_base.cpp',
+ 'sc_logic.cpp',
+ 'sc_lv_base.cpp',
+)
diff --git a/ext/systemc/src/sysc/datatypes/fx/SConscript.sc b/ext/systemc/src/sysc/datatypes/fx/SConscript.sc
new file mode 100644
index 000000000..71de4a5e4
--- /dev/null
+++ b/ext/systemc/src/sysc/datatypes/fx/SConscript.sc
@@ -0,0 +1,40 @@
+# Copyright (c) 2017, TU Dresden
+# Copyright (c) 2017, University of Kaiserslautern
+# All rights reserved.
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+# Authors: Christian Menard
+# Matthias Jung
+
+Import('systemc', 'SystemCSource')
+
+SystemCSource(
+ 'sc_fxcast_switch.cpp',
+ 'sc_fxdefs.cpp',
+ 'sc_fxnum.cpp',
+ 'sc_fxnum_observer.cpp',
+ 'sc_fxtype_params.cpp',
+ 'sc_fxval.cpp',
+ 'sc_fxval_observer.cpp',
+ 'scfx_mant.cpp',
+ 'scfx_pow10.cpp',
+ 'scfx_rep.cpp',
+ 'scfx_utils.cpp',
+)
diff --git a/ext/systemc/src/sysc/datatypes/int/SConscript.sc b/ext/systemc/src/sysc/datatypes/int/SConscript.sc
new file mode 100644
index 000000000..874242926
--- /dev/null
+++ b/ext/systemc/src/sysc/datatypes/int/SConscript.sc
@@ -0,0 +1,40 @@
+# Copyright (c) 2017, TU Dresden
+# Copyright (c) 2017, University of Kaiserslautern
+# All rights reserved.
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+# Authors: Christian Menard
+# Matthias Jung
+
+Import('systemc', 'SystemCSource')
+
+SystemCSource(
+ 'sc_int_base.cpp',
+ 'sc_int32_mask.cpp',
+ 'sc_int64_io.cpp',
+ 'sc_int64_mask.cpp',
+ 'sc_length_param.cpp',
+ 'sc_nbdefs.cpp',
+ 'sc_nbexterns.cpp',
+ 'sc_nbutils.cpp',
+ 'sc_signed.cpp',
+ 'sc_uint_base.cpp',
+ 'sc_unsigned.cpp',
+)
diff --git a/ext/systemc/src/sysc/datatypes/misc/SConscript.sc b/ext/systemc/src/sysc/datatypes/misc/SConscript.sc
new file mode 100644
index 000000000..a01c2c180
--- /dev/null
+++ b/ext/systemc/src/sysc/datatypes/misc/SConscript.sc
@@ -0,0 +1,31 @@
+# Copyright (c) 2017, TU Dresden
+# Copyright (c) 2017, University of Kaiserslautern
+# All rights reserved.
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+# Authors: Christian Menard
+# Matthias Jung
+
+Import('systemc', 'SystemCSource')
+
+SystemCSource(
+ 'sc_concatref.cpp',
+ 'sc_value_base.cpp',
+)
diff --git a/ext/systemc/src/sysc/kernel/SConscript.sc b/ext/systemc/src/sysc/kernel/SConscript.sc
new file mode 100644
index 000000000..0db22a6ad
--- /dev/null
+++ b/ext/systemc/src/sysc/kernel/SConscript.sc
@@ -0,0 +1,67 @@
+# Copyright (c) 2017, TU Dresden
+# Copyright (c) 2017, University of Kaiserslautern
+# All rights reserved.
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+# Authors: Christian Menard
+# Matthias Jung
+
+Import('systemc', 'SystemCSource')
+
+SystemCSource(
+ 'sc_attribute.cpp',
+ 'sc_cthread_process.cpp',
+ 'sc_event.cpp',
+ 'sc_except.cpp',
+ 'sc_join.cpp',
+ 'sc_main.cpp',
+ 'sc_main_main.cpp',
+ 'sc_method_process.cpp',
+ 'sc_module.cpp',
+ 'sc_module_name.cpp',
+ 'sc_module_registry.cpp',
+ 'sc_name_gen.cpp',
+ 'sc_object.cpp',
+ 'sc_object_manager.cpp',
+ 'sc_phase_callback_registry.cpp',
+ 'sc_process.cpp',
+ 'sc_reset.cpp',
+ 'sc_sensitive.cpp',
+ 'sc_simcontext.cpp',
+ 'sc_spawn_options.cpp',
+ 'sc_thread_process.cpp',
+ 'sc_time.cpp',
+ 'sc_ver.cpp',
+ 'sc_wait.cpp',
+ 'sc_wait_cthread.cpp',
+)
+
+coroutine_lib = systemc['COROUTINE_LIB']
+if coroutine_lib == 'qt':
+ SystemCSource('sc_cor_qt.cpp')
+elif coroutine_lib == 'pthreads':
+ systemc.Append(CXXFLAGS=['-pthread'])
+ systemc.Append(CFLAGS=['-pthread'])
+ SystemCSource('sc_cor_pthread.cpp')
+elif coroutine_lib == 'fiber':
+ SystemCSource('sc_cor_fiber.cpp')
+else:
+ print 'Unrecognized threading implementation \'%s\'' % coroutine_lib
+ Exit(1)
diff --git a/ext/systemc/src/sysc/qt/SConscript.sc b/ext/systemc/src/sysc/qt/SConscript.sc
new file mode 100644
index 000000000..5ffb0d3aa
--- /dev/null
+++ b/ext/systemc/src/sysc/qt/SConscript.sc
@@ -0,0 +1,42 @@
+# Copyright (c) 2017, TU Dresden
+# Copyright (c) 2017, University of Kaiserslautern
+# All rights reserved.
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+# Authors: Christian Menard
+# Matthias Jung
+
+import os
+
+Import('systemc', 'SystemCSource')
+
+if systemc['COROUTINE_LIB'] == 'qt':
+ SystemCSource('qt.c')
+
+ qt_arch = systemc.get('QT_ARCH', None)
+ if not qt_arch:
+ print 'No architecture selected for the QT coroutine library.'
+ Exit(1)
+
+ if qt_arch in ('i386', 'iX86_64'):
+ SystemCSource(os.path.join('md', qt_arch + '.s'))
+ else:
+ print 'Don\'t know what to do for QT arch %s.' % qt_arch
+ Exit(1)
diff --git a/ext/systemc/src/sysc/tracing/SConscript.sc b/ext/systemc/src/sysc/tracing/SConscript.sc
new file mode 100644
index 000000000..7cd016746
--- /dev/null
+++ b/ext/systemc/src/sysc/tracing/SConscript.sc
@@ -0,0 +1,33 @@
+# Copyright (c) 2017, TU Dresden
+# Copyright (c) 2017, University of Kaiserslautern
+# All rights reserved.
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+# Authors: Christian Menard
+# Matthias Jung
+
+Import('systemc', 'SystemCSource')
+
+SystemCSource(
+ 'sc_trace.cpp',
+ 'sc_trace_file_base.cpp',
+ 'sc_vcd_trace.cpp',
+ 'sc_wif_trace.cpp',
+)
diff --git a/ext/systemc/src/sysc/utils/SConscript.sc b/ext/systemc/src/sysc/utils/SConscript.sc
new file mode 100644
index 000000000..63c4a24ff
--- /dev/null
+++ b/ext/systemc/src/sysc/utils/SConscript.sc
@@ -0,0 +1,39 @@
+# Copyright (c) 2017, TU Dresden
+# Copyright (c) 2017, University of Kaiserslautern
+# All rights reserved.
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+# Authors: Christian Menard
+# Matthias Jung
+
+Import('systemc', 'SystemCSource')
+
+SystemCSource(
+ 'sc_hash.cpp',
+ 'sc_list.cpp',
+ 'sc_mempool.cpp',
+ 'sc_pq.cpp',
+ 'sc_report.cpp',
+ 'sc_report_handler.cpp',
+ 'sc_stop_here.cpp',
+ 'sc_string.cpp',
+ 'sc_utils_ids.cpp',
+ 'sc_vector.cpp',
+)