gem5-dev@gem5.org

The gem5 Developer List

View all threads

[M] Change in gem5/gem5[develop]: ext: Add DRAMSys integration instructions

DC
Derek C. (Gerrit)
Wed, Mar 29, 2023 8:19 AM

Derek C. has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/62911?usp=email )

Change subject: ext: Add DRAMSys integration instructions
......................................................................

ext: Add DRAMSys integration instructions

Add instructions to add the DRAMSys memory simulator
to gem5 in the ext/ directory.
The provided SConscript file compiles DRAMSys.

Change-Id: If5c723db61a3151c9155190f968c66927d7bfaa3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62911
Maintainer: Bobby Bruce bbruce@ucdavis.edu
Tested-by: kokoro noreply+kokoro@google.com
Reviewed-by: Bobby Bruce bbruce@ucdavis.edu

A ext/dramsys/README
A ext/dramsys/SConscript
2 files changed, 110 insertions(+), 0 deletions(-)

Approvals:
kokoro: Regressions pass
Bobby Bruce: Looks good to me, approved; Looks good to me, approved

diff --git a/ext/dramsys/README b/ext/dramsys/README
new file mode 100644
index 0000000..477da52
--- /dev/null
+++ b/ext/dramsys/README
@@ -0,0 +1,10 @@
+Follow these steps to get DRAMSys as part of gem5
+
+1. Go to ext/dramsys (this directory)
+2. Clone DRAMSys: 'git clone --recursive
git@github.com:tukl-msd/DRAMSys.git DRAMSys'
+3. Change directory to DRAMSys: 'cd DRAMSys'
+4. Checkout the correct commit: 'git checkout -b gem5
09f6dcbb91351e6ee7cadfc7bc8b29d97625db8f'
+
+If you wish to run a simulation using the gem5 processor cores, make sure
to enable the storage mode in DRAMSys.
+This is done by setting the value of the "StoreMode" key to "Store" in the
base configuration file.
+Those configuration file can be found
in 'DRAMSys/library/resources/configs/simulator'.
diff --git a/ext/dramsys/SConscript b/ext/dramsys/SConscript
new file mode 100644
index 0000000..d771b9c
--- /dev/null
+++ b/ext/dramsys/SConscript
@@ -0,0 +1,100 @@
+# Copyright (c) 2022, Fraunhofer IESE
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its
+#    contributors may be used to endorse or promote products derived from
+#    this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
+# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+
+Import('env')
+
+build_root = Dir('../..').abspath
+src_root = Dir('DRAMSys/DRAMSys/library').srcnode().abspath
+
+# See if we got a cloned DRAMSys repo as a subdirectory and set the
+# HAVE_DRAMSys flag accordingly
+if not os.path.exists(Dir('.').srcnode().abspath + '/DRAMSys'):

  • env['HAVE_DRAMSYS'] = False
  • Return()

+env['HAVE_DRAMSYS'] = True
+
+dramsys_files = []
+dramsys_configuration_files = []
+
+dramsys_files.extend(Glob("%s/*.cpp" % f"{src_root}/src/controller"))
+for root, dirs, files in os.walk(f"{src_root}/src/controller",
topdown=False):

  • for dir in dirs:
  •    dramsys_files.extend(Glob("%s/*.cpp" % os.path.join(root, dir)))
    

+dramsys_files.extend(Glob("%s/*.cpp" % f"{src_root}/src/simulation"))
+for root, dirs, files in os.walk(f"{src_root}/src/simulation",
topdown=False):

  • for dir in dirs:
  •    dramsys_files.extend(Glob("%s/*.cpp" % os.path.join(root, dir)))
    

+dramsys_files.extend(Glob("%s/*.cpp" % f"{src_root}/src/configuration"))
+for root, dirs, files in os.walk(f"{src_root}/src/configuration",
topdown=False):

  • for dir in dirs:
  •    dramsys_files.extend(Glob("%s/*.cpp" % os.path.join(root, dir)))
    

+dramsys_files.extend(Glob("%s/.cpp" % f"{src_root}/src/error"))
+dramsys_files.extend(Glob(f"{src_root}/src/error/ECC/Bit.cpp"))
+dramsys_files.extend(Glob(f"{src_root}/src/error/ECC/ECC.cpp"))
+dramsys_files.extend(Glob(f"{src_root}/src/error/ECC/Word.cpp"))
+
+dramsys_files.extend(Glob("%s/
.cpp" % f"{src_root}/src/common"))
+dramsys_files.extend(Glob("%s/.cpp" %
f"{src_root}/src/common/configuration"))
+dramsys_files.extend(Glob("%s/
.cpp" %
f"{src_root}/src/common/configuration/memspec"))
+dramsys_files.extend(Glob("%s/*.c" %
f"{src_root}/src/common/third_party/sqlite-amalgamation"))
+
+env.Prepend(CPPPATH=[

  • src_root + "/src",
  • src_root + "/src/common/configuration",
  • src_root + "/src/common/third_party/nlohmann/include",
    +])

+env.Prepend(CPPDEFINES=[("DRAMSysResourceDirectory", '\"' + os.getcwd()

  • '/resources' + '\"')])
    +env.Prepend(CPPDEFINES=[("SYSTEMC_VERSION", 20191203)])

+dramsys = env.Clone()
+
+if '-Werror' in dramsys['CCFLAGS']:

  • dramsys['CCFLAGS'].remove('-Werror')

+dramsys.Prepend(CPPPATH=[

  • src_root + "/src/common/third_party/sqlite-amalgamation",
  • build_root + "/systemc/ext"
    +])

+dramsys.Prepend(CPPDEFINES=[("SQLITE_ENABLE_RTREE", "1")])
+
+dramsys_configuration = env.Clone()
+
+dramsys.Library('dramsys', dramsys_files)
+
+env.Append(LIBS=['dramsys', 'dl'])
+env.Append(LIBPATH=[Dir('.')])

--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/62911?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: If5c723db61a3151c9155190f968c66927d7bfaa3
Gerrit-Change-Number: 62911
Gerrit-PatchSet: 9
Gerrit-Owner: Derek C. christ.derek@gmail.com
Gerrit-Reviewer: Bobby Bruce bbruce@ucdavis.edu
Gerrit-Reviewer: Derek C. christ.derek@gmail.com
Gerrit-Reviewer: Jason Lowe-Power jason@lowepower.com
Gerrit-Reviewer: Jason Lowe-Power power.jg@gmail.com
Gerrit-Reviewer: Nikos Nikoleris nikos.nikoleris@arm.com
Gerrit-Reviewer: kokoro noreply+kokoro@google.com
Gerrit-MessageType: merged

Derek C. has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/62911?usp=email ) Change subject: ext: Add DRAMSys integration instructions ...................................................................... ext: Add DRAMSys integration instructions Add instructions to add the DRAMSys memory simulator to gem5 in the ext/ directory. The provided SConscript file compiles DRAMSys. Change-Id: If5c723db61a3151c9155190f968c66927d7bfaa3 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62911 Maintainer: Bobby Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu> --- A ext/dramsys/README A ext/dramsys/SConscript 2 files changed, 110 insertions(+), 0 deletions(-) Approvals: kokoro: Regressions pass Bobby Bruce: Looks good to me, approved; Looks good to me, approved diff --git a/ext/dramsys/README b/ext/dramsys/README new file mode 100644 index 0000000..477da52 --- /dev/null +++ b/ext/dramsys/README @@ -0,0 +1,10 @@ +Follow these steps to get DRAMSys as part of gem5 + +1. Go to ext/dramsys (this directory) +2. Clone DRAMSys: 'git clone --recursive git@github.com:tukl-msd/DRAMSys.git DRAMSys' +3. Change directory to DRAMSys: 'cd DRAMSys' +4. Checkout the correct commit: 'git checkout -b gem5 09f6dcbb91351e6ee7cadfc7bc8b29d97625db8f' + +If you wish to run a simulation using the gem5 processor cores, make sure to enable the storage mode in DRAMSys. +This is done by setting the value of the "StoreMode" key to "Store" in the base configuration file. +Those configuration file can be found in 'DRAMSys/library/resources/configs/simulator'. diff --git a/ext/dramsys/SConscript b/ext/dramsys/SConscript new file mode 100644 index 0000000..d771b9c --- /dev/null +++ b/ext/dramsys/SConscript @@ -0,0 +1,100 @@ +# Copyright (c) 2022, Fraunhofer IESE +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import os + +Import('env') + +build_root = Dir('../..').abspath +src_root = Dir('DRAMSys/DRAMSys/library').srcnode().abspath + +# See if we got a cloned DRAMSys repo as a subdirectory and set the +# HAVE_DRAMSys flag accordingly +if not os.path.exists(Dir('.').srcnode().abspath + '/DRAMSys'): + env['HAVE_DRAMSYS'] = False + Return() + +env['HAVE_DRAMSYS'] = True + +dramsys_files = [] +dramsys_configuration_files = [] + +dramsys_files.extend(Glob("%s/*.cpp" % f"{src_root}/src/controller")) +for root, dirs, files in os.walk(f"{src_root}/src/controller", topdown=False): + for dir in dirs: + dramsys_files.extend(Glob("%s/*.cpp" % os.path.join(root, dir))) + +dramsys_files.extend(Glob("%s/*.cpp" % f"{src_root}/src/simulation")) +for root, dirs, files in os.walk(f"{src_root}/src/simulation", topdown=False): + for dir in dirs: + dramsys_files.extend(Glob("%s/*.cpp" % os.path.join(root, dir))) + +dramsys_files.extend(Glob("%s/*.cpp" % f"{src_root}/src/configuration")) +for root, dirs, files in os.walk(f"{src_root}/src/configuration", topdown=False): + for dir in dirs: + dramsys_files.extend(Glob("%s/*.cpp" % os.path.join(root, dir))) + +dramsys_files.extend(Glob("%s/*.cpp" % f"{src_root}/src/error")) +dramsys_files.extend(Glob(f"{src_root}/src/error/ECC/Bit.cpp")) +dramsys_files.extend(Glob(f"{src_root}/src/error/ECC/ECC.cpp")) +dramsys_files.extend(Glob(f"{src_root}/src/error/ECC/Word.cpp")) + +dramsys_files.extend(Glob("%s/*.cpp" % f"{src_root}/src/common")) +dramsys_files.extend(Glob("%s/*.cpp" % f"{src_root}/src/common/configuration")) +dramsys_files.extend(Glob("%s/*.cpp" % f"{src_root}/src/common/configuration/memspec")) +dramsys_files.extend(Glob("%s/*.c" % f"{src_root}/src/common/third_party/sqlite-amalgamation")) + +env.Prepend(CPPPATH=[ + src_root + "/src", + src_root + "/src/common/configuration", + src_root + "/src/common/third_party/nlohmann/include", +]) + +env.Prepend(CPPDEFINES=[("DRAMSysResourceDirectory", '\\"' + os.getcwd() + '/resources' + '\\"')]) +env.Prepend(CPPDEFINES=[("SYSTEMC_VERSION", 20191203)]) + +dramsys = env.Clone() + +if '-Werror' in dramsys['CCFLAGS']: + dramsys['CCFLAGS'].remove('-Werror') + +dramsys.Prepend(CPPPATH=[ + src_root + "/src/common/third_party/sqlite-amalgamation", + build_root + "/systemc/ext" +]) + +dramsys.Prepend(CPPDEFINES=[("SQLITE_ENABLE_RTREE", "1")]) + +dramsys_configuration = env.Clone() + +dramsys.Library('dramsys', dramsys_files) + +env.Append(LIBS=['dramsys', 'dl']) +env.Append(LIBPATH=[Dir('.')]) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/62911?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: If5c723db61a3151c9155190f968c66927d7bfaa3 Gerrit-Change-Number: 62911 Gerrit-PatchSet: 9 Gerrit-Owner: Derek C. <christ.derek@gmail.com> Gerrit-Reviewer: Bobby Bruce <bbruce@ucdavis.edu> Gerrit-Reviewer: Derek C. <christ.derek@gmail.com> Gerrit-Reviewer: Jason Lowe-Power <jason@lowepower.com> Gerrit-Reviewer: Jason Lowe-Power <power.jg@gmail.com> Gerrit-Reviewer: Nikos Nikoleris <nikos.nikoleris@arm.com> Gerrit-Reviewer: kokoro <noreply+kokoro@google.com> Gerrit-MessageType: merged