[gem5-dev] Change in gem5/gem5[develop]: scons: Streamline the LTO option setting code and add options for clang.

2021-04-02 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40962 )


Change subject: scons: Streamline the LTO option setting code and add  
options for clang.

..

scons: Streamline the LTO option setting code and add options for clang.

Clang also supports an -flto option, although not with a thread count.

Change-Id: Ifc783ac3ab2e0ea93fad0402b288605a20725aa0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40962
Reviewed-by: Gabe Black 
Maintainer: Gabe Black 
Tested-by: kokoro 
---
M SConstruct
1 file changed, 9 insertions(+), 10 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/SConstruct b/SConstruct
index 31f9902..c8e685f 100755
--- a/SConstruct
+++ b/SConstruct
@@ -349,8 +349,7 @@
 error('gcc version 5 or newer required.\n'
   'Installed version:', main['CXXVERSION'])

-# Add the appropriate Link-Time Optimization (LTO) flags
-# unless LTO is explicitly turned off.
+# If not disabled, set the Link-Time Optimization (LTO) flags.
 if not GetOption('no_lto'):
 # g++ uses "make" to parallelize LTO. The program can be overriden  
with
 # the environment variable "MAKE", but we currently make no  
attempt to

@@ -362,14 +361,9 @@
 warning('"make" not found, link time optimization will be '
 'single threaded.')

-# Pass the LTO flag when compiling to produce GIMPLE
-# output, we merely create the flags here and only append
-# them later
-main['LTO_CCFLAGS'] = ['-flto%s' % parallelism]
-
-# Use the same amount of jobs for LTO as we are running
-# scons with
-main['LTO_LDFLAGS'] = ['-flto%s' % parallelism]
+for var in 'LTO_CCFLAGS', 'LTO_LDFLAGS':
+# Use the same amount of jobs for LTO as we are running scons  
with.

+main[var] = ['-flto%s' % parallelism]

  
main.Append(TCMALLOC_CCFLAGS=['-fno-builtin-malloc', '-fno-builtin-calloc',

   '-fno-builtin-realloc', '-fno-builtin-free'])
@@ -379,6 +373,11 @@
 error('clang version 3.9 or newer required.\n'
   'Installed version:', main['CXXVERSION'])

+# If not disabled, set the Link-Time Optimization (LTO) flags.
+if not GetOption('no_lto'):
+for var in 'LTO_CCFLAGS', 'LTO_LDFLAGS':
+main[var] = ['-flto']
+
 # clang has a few additional warnings that we disable.
 conf.CheckCxxFlag('-Wno-c99-designator')
 conf.CheckCxxFlag('-Wno-defaulted-function-deleted')



13 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the  
submitted one.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40962
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: Ifc783ac3ab2e0ea93fad0402b288605a20725aa0
Gerrit-Change-Number: 40962
Gerrit-PatchSet: 15
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: scons: Include libthr on freebsd no matter what compiler you're using.

2021-04-02 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40960 )


Change subject: scons: Include libthr on freebsd no matter what compiler  
you're using.

..

scons: Include libthr on freebsd no matter what compiler you're using.

The compiler won't change where the thread library is implemented.

Change-Id: Ic6fbaae2ff9c4a91ce86b06d62049b9d9a0e3132
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40960
Reviewed-by: Gabe Black 
Reviewed-by: B.A. Zeeb 
Maintainer: Gabe Black 
Tested-by: kokoro 
---
M SConstruct
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  B.A. Zeeb: Looks good to me, but someone else must approve
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/SConstruct b/SConstruct
index bb523da..31f9902 100755
--- a/SConstruct
+++ b/SConstruct
@@ -305,15 +305,20 @@
 # As gcc and clang share many flags, do the common parts here
 main.Append(CCFLAGS=['-pipe'])
 main.Append(CCFLAGS=['-fno-strict-aliasing'])
+
 # Enable -Wall and -Wextra and then disable the few warnings that
 # we consistently violate
 main.Append(CCFLAGS=['-Wall', '-Wundef', '-Wextra',
  '-Wno-sign-compare', '-Wno-unused-parameter'])
+
 # We always compile using C++14
 main.Append(CXXFLAGS=['-std=c++14'])
+
 if sys.platform.startswith('freebsd'):
 main.Append(CCFLAGS=['-I/usr/local/include'])
 main.Append(CXXFLAGS=['-I/usr/local/include'])
+# On FreeBSD we need libthr.
+main.Append(LIBS=['thr'])

 conf.CheckLinkFlag('-Wl,--as-needed')
 if GetOption('gold_linker'):
@@ -386,10 +391,6 @@
 main.Append(CXXFLAGS=['-stdlib=libc++'])
 main.Append(LIBS=['c++'])

-# On FreeBSD we need libthr.
-if sys.platform.startswith('freebsd'):
-main.Append(LIBS=['thr'])
-
 # Add sanitizers flags
 sanitizers=[]
 if GetOption('with_ubsan'):



13 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the  
submitted one.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40960
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: Ic6fbaae2ff9c4a91ce86b06d62049b9d9a0e3132
Gerrit-Change-Number: 40960
Gerrit-PatchSet: 15
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: B.A. Zeeb 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: scons: Narrow the scope of the -Wno-parentheses flag.

2021-04-02 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40958 )


Change subject: scons: Narrow the scope of the -Wno-parentheses flag.
..

scons: Narrow the scope of the -Wno-parentheses flag.

This was added to avoid warnings from code generated as part of Ruby's
AST. Instead of applying this to all of gem5, apply it only to files
generated by Ruby.

Change-Id: I2b11d2df3cb631debdc594059d9d480a0e695c59
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40958
Reviewed-by: Gabe Black 
Maintainer: Gabe Black 
Tested-by: kokoro 
---
M SConstruct
M src/mem/ruby/protocol/SConscript
2 files changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/SConstruct b/SConstruct
index 9167acc..bb523da 100755
--- a/SConstruct
+++ b/SConstruct
@@ -374,9 +374,7 @@
 error('clang version 3.9 or newer required.\n'
   'Installed version:', main['CXXVERSION'])

-# clang has a few additional warnings that we disable, extraneous
-# parantheses are allowed due to Ruby's printing of the AST.
-main.Append(CCFLAGS=['-Wno-parentheses'])
+# clang has a few additional warnings that we disable.
 conf.CheckCxxFlag('-Wno-c99-designator')
 conf.CheckCxxFlag('-Wno-defaulted-function-deleted')

diff --git a/src/mem/ruby/protocol/SConscript  
b/src/mem/ruby/protocol/SConscript

index 8f96c7c..6966489 100644
--- a/src/mem/ruby/protocol/SConscript
+++ b/src/mem/ruby/protocol/SConscript
@@ -105,10 +105,13 @@
 nodes = env.SLICC([], sources)
 env.Depends(nodes, slicc_depends)

+append = {}
+if env['CLANG']:
+append['CCFLAGS'] = '-Wno-parentheses'
 for f in nodes:
 s = str(f)
 if s.endswith('.cc'):
-Source(f)
+Source(f, append=append)
 elif s.endswith('.py'):
 SimObject(f)




13 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the  
submitted one.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40958
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: I2b11d2df3cb631debdc594059d9d480a0e695c59
Gerrit-Change-Number: 40958
Gerrit-PatchSet: 15
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: ext: Fix an operator precedence bug in the nomali library.

2021-04-02 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40954 )


Change subject: ext: Fix an operator precedence bug in the nomali library.
..

ext: Fix an operator precedence bug in the nomali library.

An expression in that library intended to create a bitmask by checking
if a bit should be set, and then using ?: to select between a bitmask
with that bit, or 0. Unfortunately | is higher precedence than ?:, and
so 0 would be |-ed with the condition of the next ?: instead. This CL
fixes the bug by adding some parenthesis.

Change-Id: Ib7e06f261e07a6ad00b9a96939d07b64c3a50409
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40954
Reviewed-by: Gabe Black 
Maintainer: Gabe Black 
Tested-by: kokoro 
---
M ext/nomali/lib/jobcontrol.cc
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/ext/nomali/lib/jobcontrol.cc b/ext/nomali/lib/jobcontrol.cc
index 558cf3a..c62cd3d 100644
--- a/ext/nomali/lib/jobcontrol.cc
+++ b/ext/nomali/lib/jobcontrol.cc
@@ -132,8 +132,8 @@
 for (int i = 0; i < 16; ++i) {
 const JobSlot (slots[i]);
 if (jobs & (1 << i)) {
-js_state |= slot.active() ? (1 << i) : 0 |
-slot.activeNext() ? (0x1 << i) : 0;
+js_state |= (slot.active() ? (1 << i) : 0) |
+(slot.activeNext() ? (0x1 << i) : 0);
 }
 }
 regs[RegAddr(JOB_IRQ_JS_STATE)] = js_state;



13 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the  
submitted one.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40954
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: Ib7e06f261e07a6ad00b9a96939d07b64c3a50409
Gerrit-Change-Number: 40954
Gerrit-PatchSet: 15
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Bobby R. Bruce 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: scons: More narrowly target -Wno-self-assign.

2021-04-02 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40952 )


Change subject: scons: More narrowly target -Wno-self-assign.
..

scons: More narrowly target -Wno-self-assign.

This flag was necessary because of self assignments in the ISA parser
where self assignments are often hints to the parser itself, and in one
case because a pybind-ism used to attach the -= operator looked like a
self assignment.

This change narrows the scope of the flag that disables this warning to
only files generated by the ISA parser, and the single file in the
systemc code which uses that operator overload.

Change-Id: Ib64fc72e46f894cba9064afcdbdcc5859c30e745
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40952
Reviewed-by: Gabe Black 
Maintainer: Gabe Black 
Tested-by: kokoro 
---
M SConstruct
M src/arch/SConscript
M src/systemc/core/SConscript
3 files changed, 10 insertions(+), 6 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/SConstruct b/SConstruct
index 55ca0ef..9167acc 100755
--- a/SConstruct
+++ b/SConstruct
@@ -375,10 +375,8 @@
   'Installed version:', main['CXXVERSION'])

 # clang has a few additional warnings that we disable, extraneous
-# parantheses are allowed due to Ruby's printing of the AST,
-# finally self assignments are allowed as the generated CPU code
-# is relying on this
-main.Append(CCFLAGS=['-Wno-parentheses', '-Wno-self-assign'])
+# parantheses are allowed due to Ruby's printing of the AST.
+main.Append(CCFLAGS=['-Wno-parentheses'])
 conf.CheckCxxFlag('-Wno-c99-designator')
 conf.CheckCxxFlag('-Wno-defaulted-function-deleted')

diff --git a/src/arch/SConscript b/src/arch/SConscript
index 3c7d6cf..73c6afb 100644
--- a/src/arch/SConscript
+++ b/src/arch/SConscript
@@ -191,7 +191,10 @@
 # These generated files are also top level sources.
 def source_gen(name):
 add_gen(name)
-Source(gen_file(name))
+append = {}
+if env['CLANG']:
+append['CCFLAGS'] = ['-Wno-self-assign']
+Source(gen_file(name), append=append)

 source_gen('decoder.cc')

diff --git a/src/systemc/core/SConscript b/src/systemc/core/SConscript
index 0373046..b5d0ea9 100644
--- a/src/systemc/core/SConscript
+++ b/src/systemc/core/SConscript
@@ -62,4 +62,7 @@
 if env['USE_PYTHON']:
 Source('python.cc')
 Source('sc_main_python.cc')
-Source('sc_time_python.cc')
+append = {}
+if env['CLANG']:
+append['CCFLAGS'] = '-Wno-self-assign-overloaded'
+Source('sc_time_python.cc', append=append)



13 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the  
submitted one.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40952
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: Ib64fc72e46f894cba9064afcdbdcc5859c30e745
Gerrit-Change-Number: 40952
Gerrit-PatchSet: 15
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: scons: Delete unnecessary imports from SConstruct.

2021-04-02 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40874 )


Change subject: scons: Delete unnecessary imports from SConstruct.
..

scons: Delete unnecessary imports from SConstruct.

Also get rid of the joinpath and splitpath aliases for os.path.join and
os.path.split. The aliases are only slightly shorter, and obscure these
extremely common python methods.

Change-Id: I0784e2d8dbaacb0690a59e9fa8c8258c1df0e6c3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40874
Reviewed-by: Gabe Black 
Maintainer: Gabe Black 
Tested-by: kokoro 
---
M SConstruct
1 file changed, 18 insertions(+), 18 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/SConstruct b/SConstruct
index af784aa..55ca0ef 100755
--- a/SConstruct
+++ b/SConstruct
@@ -77,15 +77,13 @@

 # Global Python includes
 import atexit
-import collections
-import itertools
 import os
 import sys

 from os import mkdir, environ
-from os.path import abspath, basename, dirname, expanduser, normpath
-from os.path import exists,  isdir, isfile
-from os.path import join as joinpath, split as splitpath
+from os.path import abspath, dirname, expanduser
+from os.path import isdir, isfile
+from os.path import join, split
 from re import match

 # SCons includes
@@ -165,7 +163,7 @@
 # paths made absolute and ~-expanded.  Paths will be interpreted
 # relative to the launch directory unless a different root is provided
 def makePathListAbsolute(path_list, root=GetLaunchDir()):
-return [abspath(joinpath(root, expanduser(str(p
+return [abspath(os.path.join(root, expanduser(str(p
 for p in path_list]

 # Each target must have 'build' in the interior of the path; the
@@ -203,7 +201,7 @@

 Export('main')

-main.SConsignFile(joinpath(build_root, "sconsign"))
+main.SConsignFile(os.path.join(build_root, "sconsign"))

 # Default duplicate option is to use hard links, but this messes up
 # when you use emacs to edit a file in the target dir, as emacs moves
@@ -216,7 +214,7 @@
 # tree (not specific to a particular build like X86)
 #

-global_vars_file = joinpath(build_root, 'variables.global')
+global_vars_file = os.path.join(build_root, 'variables.global')

 global_vars = Variables(global_vars_file, args=ARGUMENTS)

@@ -603,8 +601,8 @@
 for root, dirs, files in os.walk(bdir):
 if 'SConsopts' in files:
 if GetOption('verbose'):
-print("Reading", joinpath(root, 'SConsopts'))
-SConscript(joinpath(root, 'SConsopts'))
+print("Reading", os.path.join(root, 'SConsopts'))
+SConscript(os.path.join(root, 'SConsopts'))

 for cb in after_sconsopts_callbacks:
 cb()
@@ -687,10 +685,10 @@
 if 'SConscript' in files:
 build_dir = os.path.relpath(root, ext_dir)
 ext_build_dirs.append(build_dir)
-main.SConscript(joinpath(root, 'SConscript'),
-variant_dir=joinpath(build_root, build_dir))
+main.SConscript(os.path.join(root, 'SConscript'),
+variant_dir=os.path.join(build_root, build_dir))

-gdb_xml_dir = joinpath(ext_dir, 'gdb-xml')
+gdb_xml_dir = os.path.join(ext_dir, 'gdb-xml')
 Export('gdb_xml_dir')

 ###
@@ -742,14 +740,14 @@

 # variant_dir is the tail component of build path, and is used to
 # determine the build parameters (e.g., 'X86')
-(build_root, variant_dir) = splitpath(variant_path)
+(build_root, variant_dir) = os.path.split(variant_path)

 # Set env variables according to the build directory config.
 sticky_vars.files = []
 # Variables for $BUILD_ROOT/$VARIANT_DIR are stored in
 # $BUILD_ROOT/variables/$VARIANT_DIR so you can nuke
 # $BUILD_ROOT/$VARIANT_DIR without losing your variables settings.
-current_vars_file = joinpath(build_root, 'variables', variant_dir)
+current_vars_file = os.path.join(build_root, 'variables', variant_dir)
 if isfile(current_vars_file):
 sticky_vars.files.append(current_vars_file)
 if not GetOption('silent'):
@@ -771,10 +769,12 @@
 default = GetOption('default')
 opts_dir = Dir('#build_opts').abspath
 if default:
-default_vars_files = [joinpath(build_root, 'variables',  
default),

-  joinpath(opts_dir, default)]
+default_vars_files = [
+os.path.join(build_root, 'variables', default),
+os.path.join(opts_dir, default)
+]
 else:
-default_vars_files = [joinpath(opts_dir, variant_dir)]
+default_vars_files = [os.path.join(opts_dir, variant_dir)]
 existing_files = list(filter(isfile, default_vars_files))
 if existing_files:
 default_vars_file = existing_files[0]


[gem5-dev] Change in gem5/gem5[develop]: dev-hsa,gpu-compute: Fix override for updateHsaSignal

2021-04-02 Thread Matt Sinclair (Gerrit) via gem5-dev
Matt Sinclair has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/44046 )


Change subject: dev-hsa,gpu-compute: Fix override for updateHsaSignal
..

dev-hsa,gpu-compute: Fix override for updateHsaSignal

Change 965ad12 removed a parameter from the updateHsaSignal
function. Change 25e8a14 added the parameter back, but only for the
derived class, breaking the override. This patch adds that parameter
back to the base class, fixing the override.

Change-Id: Id1e96e29ca4be7f3ce244bac83a112e3250812d1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44046
Reviewed-by: Jason Lowe-Power 
Reviewed-by: Alex Dutu 
Reviewed-by: Matt Sinclair 
Tested-by: kokoro 
Maintainer: Matt Sinclair 
---
M src/dev/hsa/hsa_device.hh
M src/gpu-compute/gpu_command_processor.hh
2 files changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Alex Dutu: Looks good to me, approved
  Matt Sinclair: Looks good to me, but someone else must approve; Looks  
good to me, approved

  kokoro: Regressions pass



diff --git a/src/dev/hsa/hsa_device.hh b/src/dev/hsa/hsa_device.hh
index 157c459..5b6f388 100644
--- a/src/dev/hsa/hsa_device.hh
+++ b/src/dev/hsa/hsa_device.hh
@@ -101,7 +101,8 @@
 fatal("%s does not need HSA driver\n", name());
 }
 virtual void
-updateHsaSignal(Addr signal_handle, uint64_t signal_value)
+updateHsaSignal(Addr signal_handle, uint64_t signal_value,
+HsaSignalCallbackFunction function = [] (const uint64_t &) { })
 {
 fatal("%s does not have HSA signal update functionality.\n",  
name());

 }
diff --git a/src/gpu-compute/gpu_command_processor.hh  
b/src/gpu-compute/gpu_command_processor.hh

index c78ae0b..67cda7d 100644
--- a/src/gpu-compute/gpu_command_processor.hh
+++ b/src/gpu-compute/gpu_command_processor.hh
@@ -90,7 +90,7 @@

 void updateHsaSignal(Addr signal_handle, uint64_t signal_value,
  HsaSignalCallbackFunction function =
-[] (const uint64_t &) { });
+[] (const uint64_t &) { }) override;

 uint64_t functionalReadHsaSignal(Addr signal_handle) override;


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44046
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: Id1e96e29ca4be7f3ce244bac83a112e3250812d1
Gerrit-Change-Number: 44046
Gerrit-PatchSet: 4
Gerrit-Owner: Kyle Roarty 
Gerrit-Reviewer: Alex Dutu 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Matt Sinclair 
Gerrit-Reviewer: Matthew Poremba 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: arch-arm: Use src/base/fenv.hh instead of raw fenv.h.

2021-04-02 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/41214 )


Change subject: arch-arm: Use src/base/fenv.hh instead of raw fenv.h.
..

arch-arm: Use src/base/fenv.hh instead of raw fenv.h.

This provides a layer of indirection where the rounding mode
setting/getting code will do nothing if fenv.h isn't available. At build
time, if fenv.h can't be found, a warning is printed.

Also, the include for fenv.h was guarded in the includes in the ISA
header, but the functions from it weren't guarded in the actual code.

Finally, the code was setting the rounding mode, but not setting it
back. That would mean running these instructions would set the rounding
mode in gem5 as a whole, affecting its other behaviors and any other
instructions that might expect the default rounding mode.

Change-Id: Ic5cc32773652f423e66d78f31b80c6604f2c4a49
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41214
Tested-by: kokoro 
Reviewed-by: Andreas Sandberg 
Maintainer: Andreas Sandberg 
---
M src/arch/arm/isa/includes.isa
M src/arch/arm/isa/insts/fp.isa
2 files changed, 14 insertions(+), 11 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/arch/arm/isa/includes.isa b/src/arch/arm/isa/includes.isa
index 16d4c1c..a09655b 100644
--- a/src/arch/arm/isa/includes.isa
+++ b/src/arch/arm/isa/includes.isa
@@ -108,17 +108,12 @@
 #include "arch/generic/memhelpers.hh"
 #include "base/condcodes.hh"
 #include "base/crc.hh"
+#include "base/fenv.hh"
 #include "cpu/base.hh"
-#include "sim/pseudo_inst.hh"
-
-#if defined(linux)
-#include 
-
-#endif
-
 #include "debug/Arm.hh"
 #include "mem/packet.hh"
 #include "mem/packet_access.hh"
+#include "sim/pseudo_inst.hh"
 #include "sim/sim_exit.hh"

 using namespace ArmISA;
diff --git a/src/arch/arm/isa/insts/fp.isa b/src/arch/arm/isa/insts/fp.isa
index 07be0e1..a32b396 100644
--- a/src/arch/arm/isa/insts/fp.isa
+++ b/src/arch/arm/isa/insts/fp.isa
@@ -1106,11 +1106,13 @@
 FPSCR fpscr = (FPSCR) FpscrExc;
 vfpFlushToZero(fpscr, FpOp1);
 VfpSavedState state = prepFpState(fpscr.rMode);
-fesetround(FeRoundZero);
+Gem5::RoundingMode old_rm = Gem5::getFpRound();
+Gem5::setFpRound(Gem5::RoundingMode::TowardZero);
 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
 FpDest_uw = vfpFpToFixed(
 FpOp1, false, 32, 0, true, {round_mode});
 __asm__ __volatile__("" :: "m" (FpDest_uw));
+Gem5::setFpRound(old_rm);
 finishVfp(fpscr, state, fpscr.fz);
 FpscrExc = fpscr;
 '''
@@ -1122,11 +1124,13 @@
 double cOp1 = dbl(FpOp1P0_uw, FpOp1P1_uw);
 vfpFlushToZero(fpscr, cOp1);
 VfpSavedState state = prepFpState(fpscr.rMode);
-fesetround(FeRoundZero);
+Gem5::RoundingMode old_rm = Gem5::getFpRound();
+Gem5::setFpRound(Gem5::RoundingMode::TowardZero);
 __asm__ __volatile__("" : "=m" (cOp1) : "m" (cOp1));
 uint64_t result = vfpFpToFixed(
 cOp1, false, 32, 0, true, {round_mode});
 __asm__ __volatile__("" :: "m" (result));
+Gem5::setFpRound(old_rm);
 finishVfp(fpscr, state, fpscr.fz);
 FpDestP0_uw = result;
 FpscrExc = fpscr;
@@ -1138,11 +1142,13 @@
 FPSCR fpscr = (FPSCR) FpscrExc;
 vfpFlushToZero(fpscr, FpOp1);
 VfpSavedState state = prepFpState(fpscr.rMode);
-fesetround(FeRoundZero);
+Gem5::RoundingMode old_rm = Gem5::getFpRound();
+Gem5::setFpRound(Gem5::RoundingMode::TowardZero);
 __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
 FpDest_sw = vfpFpToFixed(
 FpOp1, true, 32, 0, true, {round_mode});
 __asm__ __volatile__("" :: "m" (FpDest_sw));
+Gem5::setFpRound(old_rm);
 finishVfp(fpscr, state, fpscr.fz);
 FpscrExc = fpscr;
 '''
@@ -1154,11 +1160,13 @@
 double cOp1 = dbl(FpOp1P0_uw, FpOp1P1_uw);
 vfpFlushToZero(fpscr, cOp1);
 VfpSavedState state = prepFpState(fpscr.rMode);
-fesetround(FeRoundZero);
+Gem5::RoundingMode old_rm = Gem5::getFpRound();
+Gem5::setFpRound(Gem5::RoundingMode::TowardZero);
 __asm__ __volatile__("" : "=m" (cOp1) : "m" (cOp1));
 int64_t result = vfpFpToFixed(
 cOp1, true, 32, 0, true, {round_mode});
 __asm__ __volatile__("" :: "m" (result));
+Gem5::setFpRound(old_rm);
 finishVfp(fpscr, state, fpscr.fz);
 FpDestP0_uw = result;
 FpscrExc = fpscr;



8 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the  
submitted one.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/41214
To unsubscribe, or for help writing mail filters, visit  

[gem5-dev] Change in gem5/gem5[develop]: python: Improve type annotations in pystats

2021-04-02 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/42644 )


Change subject: python: Improve type annotations in pystats
..

python: Improve type annotations in pystats

This fixes some errors and warning when running mypy.

`gem5/src/python/m5/ext> mypy pystats`

There is one error that is ignored, which is a bug in mypy. See
https://github.com/python/mypy/issues/6040

Change-Id: I18b648c059da12bd30d612f0e265930b976f22b4
Signed-off-by: Jason Lowe-Power 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42644
Reviewed-by: Andreas Sandberg 
Maintainer: Bobby R. Bruce 
Tested-by: kokoro 
---
M src/python/m5/ext/pystats/group.py
M src/python/m5/ext/pystats/jsonloader.py
M src/python/m5/ext/pystats/statistic.py
3 files changed, 31 insertions(+), 19 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved
  Bobby R. Bruce: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/python/m5/ext/pystats/group.py  
b/src/python/m5/ext/pystats/group.py

index 22d11b2..cc9fcd3 100644
--- a/src/python/m5/ext/pystats/group.py
+++ b/src/python/m5/ext/pystats/group.py
@@ -25,7 +25,8 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 import re
-from typing import Callable, Dict, Iterator, List, Optional, Pattern, Union
+from typing import Callable, Dict, Iterator, List, Mapping, Optional,  
Pattern,\

+   Union

 from .jsonserializable import JsonSerializable
 from .statistic import Scalar, Statistic
@@ -118,8 +119,10 @@
 precompiled regex or a string in regex format
 """
 if isinstance(regex, str):
-regex = re.compile(regex)
-yield from self.children(lambda _name: regex.search(_name))
+pattern = re.compile(regex)
+else:
+pattern = regex
+yield from self.children(lambda _name: bool(pattern.search(_name)))

 class Vector(Group):
 """
@@ -129,7 +132,7 @@
 accordance to decisions made in relation to
 https://gem5.atlassian.net/browse/GEM5-867.
 """
-def __init__(self, scalar_map: Dict[str,Scalar]):
+def __init__(self, scalar_map: Mapping[str,Scalar]):
 super(Vector, self).__init__(
  type="Vector",
  time_conversion=None,
diff --git a/src/python/m5/ext/pystats/jsonloader.py  
b/src/python/m5/ext/pystats/jsonloader.py

index a8261f3..35873e4 100644
--- a/src/python/m5/ext/pystats/jsonloader.py
+++ b/src/python/m5/ext/pystats/jsonloader.py
@@ -24,11 +24,12 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+from json.decoder import JSONDecodeError
 from .simstat import SimStat
-from .statistic import Scalar, Distribution, Accumulator
+from .statistic import Scalar, Distribution, Accumulator, Statistic
 from .group import Group, Vector
 import json
-from typing import IO
+from typing import IO, Union

 class JsonLoader(json.JSONDecoder):
 """
@@ -46,9 +47,11 @@
 """

 def __init__(self):
-json.JSONDecoder.__init__(self, object_hook=self.__json_to_simstat)
+super(JsonLoader, self).__init__(self,
+object_hook=self.__json_to_simstat
+)

-def __json_to_simstat(self, d: dict) -> SimStat:
+def __json_to_simstat(self, d: dict) -> Union[SimStat,Statistic,Group]:
 if 'type' in d:
 if d['type'] == 'Scalar':
 d.pop('type', None)
@@ -69,6 +72,11 @@
 d.pop('type', None)
 d.pop('time_conversion', None)
 return Vector(d)
+
+else:
+raise ValueError(
+f"SimStat object has invalid type {d['type']}"
+)
 else:
 return SimStat(**d)

diff --git a/src/python/m5/ext/pystats/statistic.py  
b/src/python/m5/ext/pystats/statistic.py

index 00d479d..15490a0 100644
--- a/src/python/m5/ext/pystats/statistic.py
+++ b/src/python/m5/ext/pystats/statistic.py
@@ -25,7 +25,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 from abc import ABC
-from typing import Any, Optional, Union, List
+from typing import Any, Iterable, Optional, Union, List

 from .jsonserializable import JsonSerializable
 from .storagetype import StorageType
@@ -76,13 +76,13 @@
 """
 value: List[Union[int,float]]

-def __init__(self, value: List[Union[int,float]],
+def __init__(self, value: Iterable[Union[int,float]],
  type: Optional[str] = None,
  unit: Optional[str] = None,
  description: Optional[str] = None,
  datatype: Optional[StorageType] = None):
 super(BaseScalarVector, self).__init__(
-   value=value,
+  

[gem5-dev] Change in gem5/gem5[develop]: arch-riscv,util: update riscv crosstool-ng config and m5 README entry

2021-04-02 Thread Ayaz Akram (Gerrit) via gem5-dev
Ayaz Akram has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/44032 )


Change subject: arch-riscv,util: update riscv crosstool-ng config and m5  
README entry

..

arch-riscv,util: update riscv crosstool-ng config and m5 README entry

Change-Id: I751a6c97a0ac97f7b3fce360577d0ee16f29fda4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44032
Reviewed-by: Gabe Black 
Reviewed-by: Jason Lowe-Power 
Maintainer: Gabe Black 
Tested-by: kokoro 
---
R util/crosstool-ng/riscv64-unknown-linux-gnu.defconfig
M util/m5/README.md
2 files changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/util/crosstool-ng/riscv-linux-gnu.defconfig  
b/util/crosstool-ng/riscv64-unknown-linux-gnu.defconfig

similarity index 90%
rename from util/crosstool-ng/riscv-linux-gnu.defconfig
rename to util/crosstool-ng/riscv64-unknown-linux-gnu.defconfig
index f458630..2fff658 100644
--- a/util/crosstool-ng/riscv-linux-gnu.defconfig
+++ b/util/crosstool-ng/riscv64-unknown-linux-gnu.defconfig
@@ -1,7 +1,6 @@
 CT_CONFIG_VERSION="3"
 CT_EXPERIMENTAL=y
 CT_ARCH_RISCV=y
-CT_OMIT_TARGET_VENDOR=y
 CT_ARCH_USE_MMU=y
 CT_ARCH_64=y
 CT_KERNEL_LINUX=y
diff --git a/util/m5/README.md b/util/m5/README.md
index 9bae153..0257d13 100644
--- a/util/m5/README.md
+++ b/util/m5/README.md
@@ -167,7 +167,7 @@
  thumb   | arm   | arm-linux-gnueabihf-
  sparc   | sparc64   | sparc64-linux-gnu-
  x86 | x86_64|
- riscv   | riscv64   | riscv64-linux-gnu-
+ riscv   | riscv64   | riscv64-unknown-linux-gnu-

 Note that the default setting for the x86 cross compiler prefix is blank,
 meaning that the native/host compiler will be used. If building on a  
non-x86


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44032
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: I751a6c97a0ac97f7b3fce360577d0ee16f29fda4
Gerrit-Change-Number: 44032
Gerrit-PatchSet: 3
Gerrit-Owner: Ayaz Akram 
Gerrit-Reviewer: Ayaz Akram 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: gpu-compute: Fix scalar register ready check

2021-04-02 Thread Alex Dutu (Gerrit) via gem5-dev
Alex Dutu has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/44045 )


Change subject: gpu-compute: Fix scalar register ready check
..

gpu-compute: Fix scalar register ready check

Replaces some curly braces that were accidentally removed
causing the function to return false even when it shouldn't

Change-Id: I15fb4167468c8e3dd1107f1ca3dc98c48df4611b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44045
Reviewed-by: Jason Lowe-Power 
Reviewed-by: Matt Sinclair 
Reviewed-by: Alex Dutu 
Maintainer: Jason Lowe-Power 
Maintainer: Matt Sinclair 
Tested-by: kokoro 
---
M src/gpu-compute/scalar_register_file.cc
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Alex Dutu: Looks good to me, approved
  Matt Sinclair: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/gpu-compute/scalar_register_file.cc  
b/src/gpu-compute/scalar_register_file.cc

index 5fa7a62..14ea3fe 100644
--- a/src/gpu-compute/scalar_register_file.cc
+++ b/src/gpu-compute/scalar_register_file.cc
@@ -52,11 +52,12 @@
 {
 for (const auto& srcScalarOp : ii->srcScalarRegOperands()) {
 for (const auto& physIdx : srcScalarOp.physIndices()) {
-if (regBusy(physIdx))
+if (regBusy(physIdx)) {
 DPRINTF(GPUSRF, "RAW stall: WV[%d]: %s: physReg[%d]\n",
 w->wfDynId, ii->disassemble(), physIdx);
 w->stats.numTimesBlockedDueRAWDependencies++;
 return false;
+}
 }
 }


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44045
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: I15fb4167468c8e3dd1107f1ca3dc98c48df4611b
Gerrit-Change-Number: 44045
Gerrit-PatchSet: 2
Gerrit-Owner: Kyle Roarty 
Gerrit-Reviewer: Alex Dutu 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Matt Sinclair 
Gerrit-Reviewer: Matthew Poremba 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: configs: Make MemConfig.py compatible with Python3

2021-04-02 Thread Hoa Nguyen (Gerrit) via gem5-dev
Hoa Nguyen has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/44047 )


Change subject: configs: Make MemConfig.py compatible with Python3
..

configs: Make MemConfig.py compatible with Python3

Change-Id: I0c180fca18a19412348cbb90837825e7b6b544c6
Signed-off-by: Hoa Nguyen 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44047
Reviewed-by: Jason Lowe-Power 
Maintainer: Jason Lowe-Power 
Tested-by: kokoro 
---
M configs/common/MemConfig.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/configs/common/MemConfig.py b/configs/common/MemConfig.py
index b38d3c9..fa1f084 100644
--- a/configs/common/MemConfig.py
+++ b/configs/common/MemConfig.py
@@ -249,7 +249,7 @@
 for i in range(len(mem_ctrls)):
 if opt_mem_type == "HMC_2500_1x32":
 # Connect the controllers to the membus
-mem_ctrls[i].port = xbar[i/4].mem_side_ports
+mem_ctrls[i].port = xbar[i//4].mem_side_ports
 # Set memory device size. There is an independent controller
 # for each vault. All vaults are same size.
 mem_ctrls[i].dram.device_size = options.hmc_dev_vault_size

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44047
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: I0c180fca18a19412348cbb90837825e7b6b544c6
Gerrit-Change-Number: 44047
Gerrit-PatchSet: 2
Gerrit-Owner: Hoa Nguyen 
Gerrit-Reviewer: Hoa Nguyen 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: base: Generalize remote GDB query commands.

2021-04-02 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/44028 )


Change subject: base: Generalize remote GDB query commands.
..

base: Generalize remote GDB query commands.

Dispatching qFoo style commands now use a lookup table instead of a
hand coded sequence of one off checks. It also splits the handling of
different queries into different functions.

Change-Id: I8f774760e856377c5cce90b23e57de6a7f828395
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44028
Reviewed-by: Daniel Carvalho 
Maintainer: Gabe Black 
Tested-by: kokoro 
---
M src/base/remote_gdb.cc
M src/base/remote_gdb.hh
2 files changed, 136 insertions(+), 36 deletions(-)

Approvals:
  Daniel Carvalho: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc
index 5a44d78..432943e 100644
--- a/src/base/remote_gdb.cc
+++ b/src/base/remote_gdb.cc
@@ -137,6 +137,7 @@
 #include 
 #include 
 #include 
+#include 

 #include "base/intmath.hh"
 #include "base/socket.hh"
@@ -916,48 +917,120 @@
 return true;
 }

+namespace {
+
+std::pair
+splitAt(std::string str, const char * const delim)
+{
+size_t pos = str.find_first_of(delim);
+if (pos == std::string::npos)
+return std::pair(str, "");
+else
+return std::pair(
+str.substr(0, pos), str.substr(pos + 1));
+}
+
+} // anonymous namespace
+
+std::map
+BaseRemoteGDB::queryMap = {
+{ "C", { ::queryC } },
+{ "Supported", { ::querySupported, ";" } },
+{ "Xfer", { ::queryXfer } },
+};
+
+void
+BaseRemoteGDB::queryC(QuerySetCommand::Context )
+{
+send("QC0");
+}
+
+void
+BaseRemoteGDB::querySupported(QuerySetCommand::Context )
+{
+std::ostringstream oss;
+// This reply field mandatory. We can receive arbitrarily
+// long packets, so we could choose it to be arbitrarily large.
+// This is just an arbitrary filler value that seems to work.
+oss << "PacketSize=1024";
+for (const auto& feature : availableFeatures())
+oss << ';' << feature;
+send(oss.str().c_str());
+}
+
+void
+BaseRemoteGDB::queryXfer(QuerySetCommand::Context )
+{
+auto split = splitAt(ctx.args.at(0), ":");
+auto object = split.first;
+
+split = splitAt(split.second, ":");
+auto operation = split.first;
+
+// Only the "features" object and "read"ing are supported currently.
+if (object != "features" || operation != "read")
+throw Unsupported();
+
+// Extract the annex name.
+split = splitAt(split.second, ":");
+auto annex = split.first;
+
+// Read the contents of the annex.
+std::string content;
+if (!getXferFeaturesRead(annex, content))
+throw CmdError("E00");
+
+// Extract the offset and length.
+split = splitAt(split.second, ",");
+auto offset_str = split.first;
+auto length_str = split.second;
+
+const char *offset_ptr = offset_str.c_str();
+const char *length_ptr = length_str.c_str();
+auto offset = hex2i(_ptr);
+auto length = hex2i(_ptr);
+if (offset_ptr != offset_str.c_str() + offset_str.length() ||
+length_ptr != length_str.c_str() + length_str.length()) {
+throw CmdError("E00");
+}
+
+std::string encoded;
+encodeXferResponse(content, encoded, offset, length);
+send(encoded.c_str());
+}
+
 bool
 BaseRemoteGDB::cmdQueryVar(GdbCommand::Context )
 {
+// The query command goes until the first ':', or the end of the  
string.

 std::string s(ctx.data, ctx.len);
-std::string xfer_read_prefix = "Xfer:features:read:";
-if (s.rfind("Supported:", 0) == 0) {
-std::ostringstream oss;
-// This reply field mandatory. We can receive arbitrarily
-// long packets, so we could choose it to be arbitrarily large.
-// This is just an arbitrary filler value that seems to work.
-oss << "PacketSize=1024";
-for (const auto& feature : availableFeatures())
-oss << ';' << feature;
-send(oss.str().c_str());
-} else if (s.rfind(xfer_read_prefix, 0) == 0) {
-size_t offset, length;
-auto value_string = s.substr(xfer_read_prefix.length());
-auto colon_pos = value_string.find(':');
-auto comma_pos = value_string.find(',');
-if (colon_pos == std::string::npos || comma_pos ==  
std::string::npos)

-throw CmdError("E00");
-std::string annex;
-if (!getXferFeaturesRead(value_string.substr(0, colon_pos), annex))
-throw CmdError("E00");
-try {
-offset = std::stoull(
-value_string.substr(colon_pos + 1, comma_pos), NULL, 16);
-length = std::stoull(
-value_string.substr(comma_pos + 1), NULL, 16);
-} catch (std::invalid_argument& e) {
-throw CmdError("E00");
-} catch 

[gem5-dev] Change in gem5/gem5[develop]: base: Fix the syntax of the remote GDB command implementations.

2021-04-02 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/44027 )


Change subject: base: Fix the syntax of the remote GDB command  
implementations.

..

base: Fix the syntax of the remote GDB command implementations.

Since these are methods, they should be camel case, not underscores. The
command map should also be camel case.

Change-Id: Ie646a19b6e2fc022078722c67a11d370af4e84fe
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44027
Reviewed-by: Daniel Carvalho 
Maintainer: Gabe Black 
Tested-by: kokoro 
---
M src/base/remote_gdb.cc
M src/base/remote_gdb.hh
2 files changed, 90 insertions(+), 90 deletions(-)

Approvals:
  Daniel Carvalho: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc
index 5822309..5a44d78 100644
--- a/src/base/remote_gdb.cc
+++ b/src/base/remote_gdb.cc
@@ -216,14 +216,14 @@
 else if (c >= 'A' && c <= 'F')
 return (c - 'A' + 10);
 else
-return (-1);
+return -1;
 }

 // Convert the low 4 bits of an integer into an hex digit.
 char
 i2digit(int n)
 {
-return ("0123456789abcdef"[n & 0x0f]);
+return "0123456789abcdef"[n & 0x0f];
 }

 // Convert a byte array into an hex string.
@@ -245,12 +245,12 @@
 // hex digit. If the string ends in the middle of a byte, NULL is
 // returned.
 const char *
-hex2mem(char *vdst, const char *src, int maxlen)
+hex2mem(char *vdst, const char *src, int max_len)
 {
 char *dst = vdst;
 int msb, lsb;

-while (*src && maxlen--) {
+while (*src && max_len--) {
 msb = digit2i(*src++);
 if (msb < 0)
 return (src - 1);
@@ -292,7 +292,7 @@

 #ifndef NDEBUG
 const char *
-break_type(char c)
+breakType(char c)
 {
 switch(c) {
   case GdbSoftBp: return "software breakpoint";
@@ -434,8 +434,8 @@
 regCachePtr = gdbRegs();
 regCachePtr->getRegs(tc);

-GdbCommand::Context cmdCtx;
-cmdCtx.type = type;
+GdbCommand::Context cmd_ctx;
+cmd_ctx.type = type;
 std::vector data;

 for (;;) {
@@ -443,20 +443,20 @@
 recv(data);
 if (data.size() == 1)
 throw BadClient();
-cmdCtx.cmd_byte = data[0];
-cmdCtx.data = data.data() + 1;
-// One for sentinel, one for cmd_byte.
-cmdCtx.len = data.size() - 2;
+cmd_ctx.cmdByte = data[0];
+cmd_ctx.data = data.data() + 1;
+// One for sentinel, one for cmdByte.
+cmd_ctx.len = data.size() - 2;

-auto cmdIt = command_map.find(cmdCtx.cmd_byte);
-if (cmdIt == command_map.end()) {
+auto cmd_it = commandMap.find(cmd_ctx.cmdByte);
+if (cmd_it == commandMap.end()) {
 DPRINTF(GDBMisc, "Unknown command: %c(%#x)\n",
-cmdCtx.cmd_byte, cmdCtx.cmd_byte);
+cmd_ctx.cmdByte, cmd_ctx.cmdByte);
 throw Unsupported();
 }
-cmdCtx.cmd = &(cmdIt->second);
+cmd_ctx.cmd = &(cmd_it->second);

-if (!(this->*(cmdCtx.cmd->func))(cmdCtx))
+if (!(this->*(cmd_ctx.cmd->func))(cmd_ctx))
 break;

 } catch (BadClient ) {
@@ -723,61 +723,61 @@
 tc->descheduleInstCountEvent(ev);
 }

-std::map BaseRemoteGDB::command_map = {
+std::map BaseRemoteGDB::commandMap = {
 // last signal
-{ '?', { "KGDB_SIGNAL", ::cmd_signal } },
+{ '?', { "KGDB_SIGNAL", ::cmdSignal } },
 // set baud (deprecated)
-{ 'b', { "KGDB_SET_BAUD", ::cmd_unsupported } },
+{ 'b', { "KGDB_SET_BAUD", ::cmdUnsupported } },
 // set breakpoint (deprecated)
-{ 'B', { "KGDB_SET_BREAK", ::cmd_unsupported } },
+{ 'B', { "KGDB_SET_BREAK", ::cmdUnsupported } },
 // resume
-{ 'c', { "KGDB_CONT", ::cmd_cont } },
+{ 'c', { "KGDB_CONT", ::cmdCont } },
 // continue with signal
-{ 'C', { "KGDB_ASYNC_CONT", ::cmd_async_cont } },
+{ 'C', { "KGDB_ASYNC_CONT", ::cmdAsyncCont } },
 // toggle debug flags (deprecated)
-{ 'd', { "KGDB_DEBUG", ::cmd_unsupported } },
+{ 'd', { "KGDB_DEBUG", ::cmdUnsupported } },
 // detach remote gdb
-{ 'D', { "KGDB_DETACH", ::cmd_detach } },
+{ 'D', { "KGDB_DETACH", ::cmdDetach } },
 // read general registers
-{ 'g', { "KGDB_REG_R", ::cmd_reg_r } },
+{ 'g', { "KGDB_REG_R", ::cmdRegR } },
 // write general registers
-{ 'G', { "KGDB_REG_W", ::cmd_reg_w } },
+{ 'G', { "KGDB_REG_W", ::cmdRegW } },
 // set thread
-{ 'H', { "KGDB_SET_THREAD", ::cmd_set_thread } },
+{ 'H', { "KGDB_SET_THREAD", ::cmdSetThread } },
 // step a single cycle
-{ 'i', { "KGDB_CYCLE_STEP", ::cmd_unsupported } },
+{ 'i', { "KGDB_CYCLE_STEP", ::cmdUnsupported } },
 // signal then cycle step
-{ 'I', { 

[gem5-dev] Build failed in Jenkins: Weekly #15

2021-04-02 Thread jenkins-no-reply--- via gem5-dev
See 

Changes:

[tiago.muck] configs: changed CHI --noc-config format

[tiago.muck] scons: change ARM default protocol to CHI

[Bobby R. Bruce] tests: Remove references to resolved Jira Issues in asmtests

[Bobby R. Bruce] misc: Update version number to v21.0.0.0

[Bobby R. Bruce] scons: Remove -Werror for the gem5 21.0 release

[petery.hin] arch-riscv: Added DTB Generation Functionality to RISC-V FS

[petery.hin] arch-riscv: Fix Clint and SATP write side effects

[Giacomo Travaglini] configs: Use integer division in MESI_Three_Level.py

[Jason Lowe-Power] misc: Add util-gem5art maintainer tag

[Jason Lowe-Power] util-gem5art: Add gem5art packages

[Giacomo Travaglini] system: Fix PCI Mem range for VExpress_GEM5_VX DTS

[Jason Lowe-Power] misc: Add release notes for v21.0.0.0

[Bobby R. Bruce] scons: revert removal of -Werror for gem5 21.0

[Bobby R. Bruce] misc: Update version to "DEVELOP-FOR-V21.1"

[Giacomo Travaglini] configs: Fix signature in GPU_VIPER and Garnet_standalone

[Giacomo Travaglini] util: Stop providing support for linux-arm-legacy

[gabe.black] dev,cpu,configs: Get rid of the IntrControl device.

[gabe.black] dev: Remove cruft from the Platform devices.

[mattdsinclair] arch-gcn3: Modify directory structure as prep for adding vega 
isa

[gabe.black] scons,gpu: Use a config header for the BUILD_GPU setting.

[gabe.black] scons: Eliminate the redundant "--colors" scons command line 
option.

[gabe.black] x86: Minor cleanup of the ISA class.

[gabe.black] arch,dev,gpu-compute,sim: Rename isa_traits.hh page_size.hh.

[odanrc] misc: Add a file to ignore revisions on git blame

[gabe.black] dev: Fix style in the south bridge device.

[klynguyen] python: Fix optional parameters with default None

[klynguyen] python: Add JsonLoader to pystats

[klynguyen] mem: Unclear MemoryAccess debug message

[gabe.black] util: Add a logroll utility.

[Giacomo Travaglini] cpu: Improve MemTest

[gabe.black] mem: Ensure that RangeAddrMapper publishes its address range.

[gabe.black] dev,arch-x86: Simplify the relationship between the PC and 
SouthBridge.

[gabe.black] arch-riscv: Clean up new FP code in arch/registers.hh.

[gabe.black] arch-mips: Pull non-public values out of registers.hh.

[gabe.black] arch-x86: Move (most) non-public values out of registers.hh.

[gabe.black] arch-sparc: Move non-public values out of registers.hh.

[mattdsinclair] arch-vega: Add Vega ISA as a copy of GCN3

[mattdsinclair] arch-vega: Update instruction encodings

[mattdsinclair] arch-vega: Add decodings for Flat, Global, Scratch

[mattdsinclair] arch-vega: Order pointer functions by opcode

[mattdsinclair] arch-vega: Add Vega-specific opcodes

[mattdsinclair] gpu-compute: Add operand info class to GPUDynInst

[mattdsinclair] arch-gcn3, gpu-compute: Update getRegisterIndex() API

[mattdsinclair] arch-vega, gpu-compute: Add vectors to hold op info

[mattdsinclair] gpu-compute: remove index-based operand access

[mattdsinclair] arch-vega: Update FLAT instructions to use offset

[gabe.black] base: Use the correct string size in BaseRemoteGDB::cmd_query_var.

[gabe.black] base: Get rid of the unused "debuggers" vector in the remote GDB 
stub.

[gabe.black] sim,base: Get rid of the system/gdb "breakpoint" methods.

[gabe.black] arch-x86: Clean up tags used in the x87 decoder.


--
[...truncated 997.72 KB...]
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall mprotect(...)
build/GCN3_X86/sim/syscall_emul.cc:71: warn: ignoring syscall 
set_robust_list(...)
build/GCN3_X86/sim/syscall_emul.cc:83: warn: ignoring syscall rt_sigaction(...)
  (further warnings will be suppressed)
build/GCN3_X86/sim/syscall_emul.cc:83: warn: ignoring syscall 
rt_sigprocmask(...)
  (further warnings will be 

[gem5-dev] Change in gem5/gem5[develop]: configs: Make MemConfig.py compatible with Python3

2021-04-02 Thread Hoa Nguyen (Gerrit) via gem5-dev
Hoa Nguyen has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/44047 )



Change subject: configs: Make MemConfig.py compatible with Python3
..

configs: Make MemConfig.py compatible with Python3

Change-Id: I0c180fca18a19412348cbb90837825e7b6b544c6
Signed-off-by: Hoa Nguyen 
---
M configs/common/MemConfig.py
1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/configs/common/MemConfig.py b/configs/common/MemConfig.py
index b38d3c9..fa1f084 100644
--- a/configs/common/MemConfig.py
+++ b/configs/common/MemConfig.py
@@ -249,7 +249,7 @@
 for i in range(len(mem_ctrls)):
 if opt_mem_type == "HMC_2500_1x32":
 # Connect the controllers to the membus
-mem_ctrls[i].port = xbar[i/4].mem_side_ports
+mem_ctrls[i].port = xbar[i//4].mem_side_ports
 # Set memory device size. There is an independent controller
 # for each vault. All vaults are same size.
 mem_ctrls[i].dram.device_size = options.hmc_dev_vault_size

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44047
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: I0c180fca18a19412348cbb90837825e7b6b544c6
Gerrit-Change-Number: 44047
Gerrit-PatchSet: 1
Gerrit-Owner: Hoa Nguyen 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: gpu-compute: Fix scalar register ready check

2021-04-02 Thread Kyle Roarty (Gerrit) via gem5-dev
Kyle Roarty has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/44045 )



Change subject: gpu-compute: Fix scalar register ready check
..

gpu-compute: Fix scalar register ready check

Replaces some curly braces that were accidentally removed
causing the function to return false even when it shouldn't

Change-Id: I15fb4167468c8e3dd1107f1ca3dc98c48df4611b
---
M src/gpu-compute/scalar_register_file.cc
1 file changed, 2 insertions(+), 1 deletion(-)



diff --git a/src/gpu-compute/scalar_register_file.cc  
b/src/gpu-compute/scalar_register_file.cc

index 5fa7a62..14ea3fe 100644
--- a/src/gpu-compute/scalar_register_file.cc
+++ b/src/gpu-compute/scalar_register_file.cc
@@ -52,11 +52,12 @@
 {
 for (const auto& srcScalarOp : ii->srcScalarRegOperands()) {
 for (const auto& physIdx : srcScalarOp.physIndices()) {
-if (regBusy(physIdx))
+if (regBusy(physIdx)) {
 DPRINTF(GPUSRF, "RAW stall: WV[%d]: %s: physReg[%d]\n",
 w->wfDynId, ii->disassemble(), physIdx);
 w->stats.numTimesBlockedDueRAWDependencies++;
 return false;
+}
 }
 }


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44045
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: I15fb4167468c8e3dd1107f1ca3dc98c48df4611b
Gerrit-Change-Number: 44045
Gerrit-PatchSet: 1
Gerrit-Owner: Kyle Roarty 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: dev-hsa,gpu-compute: Fix override for updateHsaSignal

2021-04-02 Thread Kyle Roarty (Gerrit) via gem5-dev
Kyle Roarty has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/44046 )



Change subject: dev-hsa,gpu-compute: Fix override for updateHsaSignal
..

dev-hsa,gpu-compute: Fix override for updateHsaSignal

Change 965ad12 removed a parameter from the updateHsaSignal
function. Change 25e8a14 added the parameter back, but only for the
derived class, breaking the override. This patch adds that parameter
back to the base class, fixing the override.

Change-Id: Id1e96e29ca4be7f3ce244bac83a112e3250812d1
---
M src/dev/hsa/hsa_device.hh
M src/gpu-compute/gpu_command_processor.hh
2 files changed, 3 insertions(+), 2 deletions(-)



diff --git a/src/dev/hsa/hsa_device.hh b/src/dev/hsa/hsa_device.hh
index 157c459..d722a5d 100644
--- a/src/dev/hsa/hsa_device.hh
+++ b/src/dev/hsa/hsa_device.hh
@@ -101,7 +101,8 @@
 fatal("%s does not need HSA driver\n", name());
 }
 virtual void
-updateHsaSignal(Addr signal_handle, uint64_t signal_value)
+updateHsaSignal(Addr signal_handle, uint64_t signal_value,
+HsaSignalCallbackFunction function = [ = ] (const uint64_t &) { })
 {
 fatal("%s does not have HSA signal update functionality.\n",  
name());

 }
diff --git a/src/gpu-compute/gpu_command_processor.hh  
b/src/gpu-compute/gpu_command_processor.hh

index c78ae0b..67cda7d 100644
--- a/src/gpu-compute/gpu_command_processor.hh
+++ b/src/gpu-compute/gpu_command_processor.hh
@@ -90,7 +90,7 @@

 void updateHsaSignal(Addr signal_handle, uint64_t signal_value,
  HsaSignalCallbackFunction function =
-[] (const uint64_t &) { });
+[] (const uint64_t &) { }) override;

 uint64_t functionalReadHsaSignal(Addr signal_handle) override;


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44046
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: Id1e96e29ca4be7f3ce244bac83a112e3250812d1
Gerrit-Change-Number: 44046
Gerrit-PatchSet: 1
Gerrit-Owner: Kyle Roarty 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s