[gem5-dev] Change in gem5/gem5[develop]: arch-arm: Modify the AAPCS32 ABI implementation to use VecElems.

2021-09-09 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/50207 )



Change subject: arch-arm: Modify the AAPCS32 ABI implementation to use  
VecElems.

..

arch-arm: Modify the AAPCS32 ABI implementation to use VecElems.

Use the VecElem register file when using the 32 bit ARM ABI. This is not
only consistent with an upcoming change which will make the 64 bit
vector registers and the 32 bit vector elements no longer act as views
into the same data, it also simplifies the implementation a little.

Change-Id: Ie8f17b764402a6331012f13b7605520512c2d5c9
---
M src/arch/arm/aapcs32.hh
1 file changed, 14 insertions(+), 13 deletions(-)



diff --git a/src/arch/arm/aapcs32.hh b/src/arch/arm/aapcs32.hh
index 75c8593..5cb1c8e 100644
--- a/src/arch/arm/aapcs32.hh
+++ b/src/arch/arm/aapcs32.hh
@@ -475,10 +475,11 @@
 return;
 }

-RegId id(VecRegClass, 0);
-auto reg = tc->readVecReg(id);
-reg.as()[0] = f;
-tc->setVecReg(id, reg);
+auto bytes = floatToBits(f);
+auto *vec_elems = static_cast();
+constexpr int chunks = sizeof(Float) / sizeof(ArmISA::VecElem);
+for (int chunk = 0; chunk < chunks; chunk++)
+tc->setVecElem(RegId(VecElemClass, chunk), vec_elems[chunk]);
 };
 };

@@ -494,17 +495,17 @@

 const int index = state.allocate(Float{}, 1);

-if (index >= 0) {
-constexpr int lane_per_reg = 16 / sizeof(Float);
-const int reg = index / lane_per_reg;
-const int lane = index % lane_per_reg;
+if (index < 0)
+return loadFromStack(tc, state);

-RegId id(VecRegClass, reg);
-auto val = tc->readVecReg(id);
-return val.as()[lane];
-}
+decltype(floatToBits(Float{})) result;
+auto *vec_elems = static_cast();

-return loadFromStack(tc, state);
+constexpr int chunks = sizeof(Float) / sizeof(ArmISA::VecElem);
+for (int chunk = 0; chunk < chunks; chunk++)
+vec_elems[chunk] = tc->readVecElem(RegId(VecElemClass, chunk));
+
+return bitsToFloat(result);
 }
 };


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50207
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: Ie8f17b764402a6331012f13b7605520512c2d5c9
Gerrit-Change-Number: 50207
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: scons: Pull some python related mechanisms out of USE_PYTHON guards.

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


Change subject: scons: Pull some python related mechanisms out of  
USE_PYTHON guards.

..

scons: Pull some python related mechanisms out of USE_PYTHON guards.

We don't want to build certain files if USE_PYTHON is disabled, but we
can still tell scons how to.

Change-Id: I38c7c93f609cfcedc350f8270f0b239b69c4f101
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48367
Tested-by: kokoro 
Reviewed-by: Bobby R. Bruce 
Maintainer: Bobby R. Bruce 
---
M SConstruct
M src/SConscript
2 files changed, 72 insertions(+), 73 deletions(-)

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




diff --git a/SConstruct b/SConstruct
index 396dc59..4e2ed47 100755
--- a/SConstruct
+++ b/SConstruct
@@ -516,12 +516,6 @@
 if not py_version:
 error("Can't find a working Python installation")

-marshal_env = main.Clone()
-
-# Bare minimum environment that only includes python
-marshal_env.Append(CCFLAGS='$MARSHAL_CCFLAGS_EXTRA')
-marshal_env.Append(LINKFLAGS='$MARSHAL_LDFLAGS_EXTRA')
-
 # Found a working Python installation. Check if it meets minimum
 # requirements.
 ver_string = '.'.join(map(str, py_version))
@@ -532,6 +526,12 @@
 warning('Embedded python library too new. '
 'Python 3 expected, found %s.' % ver_string)

+marshal_env = main.Clone()
+
+# Bare minimum environment that only includes python
+marshal_env.Append(CCFLAGS='$MARSHAL_CCFLAGS_EXTRA')
+marshal_env.Append(LINKFLAGS='$MARSHAL_LDFLAGS_EXTRA')
+
 main['HAVE_PKG_CONFIG'] = main.Detect('pkg-config')

 with gem5_scons.Configure(main) as conf:
@@ -704,9 +704,7 @@
 env.Append(CCFLAGS='$CCFLAGS_EXTRA')
 env.Append(LINKFLAGS='$LDFLAGS_EXTRA')

-exports=['env']
-if main['USE_PYTHON']:
-exports.append('marshal_env')
+exports=['env', 'marshal_env']

 # The src/SConscript file sets up the build rules in 'env' according
 # to the configured variables.  It returns a list of environments,
diff --git a/src/SConscript b/src/SConscript
index db11f44..6fc3276 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -349,6 +349,67 @@
 class Source(SourceFile):
 pass

+# Build a small helper that marshals the Python code using the same version
+# of Python as gem5. This is in an unorthodox location to avoid building it
+# for every variant.
+py_marshal = marshal_env.Program('marshal', 'python/marshal.cc')[0]
+
+# Embed python files.  All .py files that have been indicated by a
+# PySource() call in a SConscript need to be embedded into the M5
+# library.  To do that, we compile the file to byte code, marshal the
+# byte code, compress it, and then generate a c++ file that
+# inserts the result into an array.
+def embedPyFile(target, source, env):
+def c_str(string):
+if string is None:
+return "0"
+return '"%s"' % string
+
+'''Action function to compile a .py into a code object, marshal it,
+compress it, and stick it into an asm file so the code appears as
+just bytes with a label in the data section. The action takes two
+sources:
+
+source[0]: Binary used to marshal Python sources
+source[1]: Python script to marshal
+'''
+
+import subprocess
+
+marshalled = subprocess.check_output(
+[source[0].abspath, str(source[1])], env=env['ENV'])
+
+compressed = zlib.compress(marshalled)
+data = compressed
+pysource = PySource.tnodes[source[1]]
+
+code = code_formatter()
+code('''\
+#include "sim/init.hh"
+
+namespace gem5
+{
+namespace
+{
+
+''')
+bytesToCppArray(code, 'embedded_module_data', data)
+# The name of the EmbeddedPython object doesn't matter since it's in an
+# anonymous namespace, and it's constructor takes care of installing it
+# into a global list.
+code('''
+EmbeddedPython embedded_module_info(
+${{c_str(pysource.abspath)}},
+${{c_str(pysource.modpath)}},
+embedded_module_data,
+${{len(data)}},
+${{len(marshalled)}});
+
+} // anonymous namespace
+} // namespace gem5
+''')
+code.write(str(target[0]))
+
 class PySource(SourceFile):
 '''Add a python source file to the named package'''
 modules = {}
@@ -384,6 +445,9 @@
 PySource.modules[modpath] = self
 PySource.tnodes[self.tnode] = self

+marshal_env.Command(self.cpp, [ py_marshal, self.tnode ],
+MakeAction(embedPyFile, Transform("EMBED PY")))
+
 class SimObject(PySource):
 '''Add a SimObject python file as a python source object and add
 it to a list of sim object modules'''
@@ -1037,7 +1101,7 @@
 MakeAction(createSimObjectWrappers,
 Transform("SO PyB/C")))
 env.Depends(cc_file, depends + extra_deps)
-Source(cc_file)

[gem5-dev] Change in gem5/gem5[develop]: scons: Change how the test object file suffix is applied.

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


Change subject: scons: Change how the test object file suffix is applied.
..

scons: Change how the test object file suffix is applied.

This had been done by prepending the letter "t" to the suffix, with the
intention of turning a suffix like ".o" to ".to". Unfortunately SCons
stores both the actual suffix and the "." in that variable, so what we
ended up with was ".o" => "t.o", so test.o would become testt.o.

This change updates that logic to prepend a ".t" in front of the
existing suffix, skipping over it's first character which is assumed to
be a ".".

Change-Id: Id8c5f893413284868c2dc2a1a5e879b86790ed76
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50067
Reviewed-by: Bobby R. Bruce 
Maintainer: Bobby R. Bruce 
Tested-by: kokoro 
---
M src/SConscript
1 file changed, 2 insertions(+), 2 deletions(-)

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




diff --git a/src/SConscript b/src/SConscript
index 838c3cd..db11f44 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -541,8 +541,8 @@
 @classmethod
 def declare_all(cls, env):
 env = env.Clone()
-env['OBJSUFFIX'] = 't' + env['OBJSUFFIX']
-env['SHOBJSUFFIX'] = 't' + env['SHOBJSUFFIX']
+env['OBJSUFFIX'] = '.t' + env['OBJSUFFIX'][1:]
+env['SHOBJSUFFIX'] = '.t' + env['SHOBJSUFFIX'][1:]
 env.Append(LIBS=env['GTEST_LIBS'])
 env.Append(CPPFLAGS=env['GTEST_CPPFLAGS'])
 env['GTEST_LIB_SOURCES'] = Source.all.with_tag(env, 'gtest lib')

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50067
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: Id8c5f893413284868c2dc2a1a5e879b86790ed76
Gerrit-Change-Number: 50067
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Bobby R. Bruce 
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]: tests,gpu-compute: Add GCN3 Square test to Nightly

2021-09-09 Thread Bobby R. Bruce (Gerrit) via gem5-dev
Bobby R. Bruce has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/50167 )


Change subject: tests,gpu-compute: Add GCN3 Square test to Nightly
..

tests,gpu-compute: Add GCN3 Square test to Nightly

Change-Id: I734a470d481f4012148820f62fdc3f535ea3d8f8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50167
Reviewed-by: Matt Sinclair 
Reviewed-by: Matthew Poremba 
Maintainer: Matt Sinclair 
Maintainer: Matthew Poremba 
Tested-by: kokoro 
---
M tests/nightly.sh
1 file changed, 18 insertions(+), 1 deletion(-)

Approvals:
  Matthew Poremba: Looks good to me, approved; Looks good to me, approved
  Matt Sinclair: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/tests/nightly.sh b/tests/nightly.sh
index b2c226f..3ffdbcd 100755
--- a/tests/nightly.sh
+++ b/tests/nightly.sh
@@ -80,4 +80,21 @@
 # Run the gem5 long tests.
 docker run -u $UID:$GID --volume "${gem5_root}":"${gem5_root}" -w \
 "${gem5_root}"/tests --rm  
gcr.io/gem5-test/ubuntu-20.04_all-dependencies \

-./main.py run --length long -j${threads} -t${threads}
\ No newline at end of file
+./main.py run --length long -j${threads} -t${threads}
+
+# Run the GPU tests.
+
+# For the GPU tests we compile and run GCN3_X86 inside a gcn-gpu container.
+docker pull gcr.io/gem5-test/gcn-gpu:latest
+docker run --rm -u $UID:$GUID --volume "${gem5_root}":"${gem5_root}" -w \
+"${gem5_root}" gcr.io/gem5-test/gcn-gpu:latest bash -c \
+"scons build/GCN3_X86/gem5.opt -j${threads} \
+|| (rm -rf build && scons build/GCN3_X86/gem5.opt -j${threads})"
+
+wget -qN http://dist.gem5.org/dist/develop/test-progs/square/square
+
+mkdir -p tests/testing-results
+
+docker run --rm -u $UID:$GUID --volume "${gem5_root}":"${gem5_root}" -w \
+"${gem5_root}" gcr.io/gem5-test/gcn-gpu:latest build/GCN3_X86/gem5.opt  
\

+configs/example/apu_se.py -n3 -c square

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50167
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: I734a470d481f4012148820f62fdc3f535ea3d8f8
Gerrit-Change-Number: 50167
Gerrit-PatchSet: 2
Gerrit-Owner: Bobby R. Bruce 
Gerrit-Reviewer: Alex Dutu 
Gerrit-Reviewer: Bobby R. Bruce 
Gerrit-Reviewer: Matt Sinclair 
Gerrit-Reviewer: Matthew Poremba 
Gerrit-Reviewer: kokoro 
Gerrit-CC: Kyle Roarty 
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]: python: Remove 'is_ruby' function

2021-09-09 Thread Bobby R. Bruce (Gerrit) via gem5-dev
Bobby R. Bruce has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/50168 )



Change subject: python: Remove 'is_ruby' function
..

python: Remove 'is_ruby' function

This function is not used and should not be used. It does not really
make any sense.

Change-Id: I79ee7283ddbc282b9b803df33ad266b7a88a9c67
---
M src/python/gem5/coherence_protocol.py
1 file changed, 1 insertion(+), 21 deletions(-)



diff --git a/src/python/gem5/coherence_protocol.py  
b/src/python/gem5/coherence_protocol.py

index 06375e3..275a304 100644
--- a/src/python/gem5/coherence_protocol.py
+++ b/src/python/gem5/coherence_protocol.py
@@ -42,24 +42,4 @@
 MOESI_AMD_BASE = 8
 MI_EXAMPLE = 9
 GPU_VIPER = 10
-CHI = 11
-
-
-def is_ruby(protocol: CoherenceProtocol) -> bool:
-"""Specifies if a given protocol is Ruby or not
-
-:returns: True if the given protocol is Ruby, otherwise false
-"""
-ruby = (
-CoherenceProtocol.MESI_THREE_LEVEL,
-CoherenceProtocol.MESI_THREE_LEVEL_HTM,
-CoherenceProtocol.ARM_MOESI_HAMMER,
-CoherenceProtocol.GARNET_STANDALONE,
-CoherenceProtocol.MESI_TWO_LEVEL,
-CoherenceProtocol.MOESI_CMP_DIRECTORY,
-CoherenceProtocol.MOESI_CMP_TOKEN,
-CoherenceProtocol.MOESI_AMD_BASE,
-CoherenceProtocol.GPU_VIPER,
-)
-
-return protocol in ruby
+CHI = 11
\ No newline at end of file

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50168
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: I79ee7283ddbc282b9b803df33ad266b7a88a9c67
Gerrit-Change-Number: 50168
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby R. Bruce 
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]: util: Make gerrit bot respect reviewer removal

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



Change subject: util: Make gerrit bot respect reviewer removal
..

util: Make gerrit bot respect reviewer removal

Currently, if a maintainer is removed from a change, the maintainer
will be added again. This change prevents the bot from adding the
removed maintainer again.

The bot will query all updates related to reviewer addition/removal
for each new change. If a reviewer has ever been added/removed
from a change, that reviewer won't be added to that change again.

Change-Id: Ifaab5ebd7ebf3e6453b2551d3e37c1b9e214c906
Signed-off-by: Hoa Nguyen 
---
M util/gerrit-bot/bot.py
M util/gerrit-bot/util.py
2 files changed, 14 insertions(+), 3 deletions(-)



diff --git a/util/gerrit-bot/bot.py b/util/gerrit-bot/bot.py
index 709279c..6f6b018 100755
--- a/util/gerrit-bot/bot.py
+++ b/util/gerrit-bot/bot.py
@@ -170,9 +170,10 @@
 def __query_new_changes(self, query_age):
 query = (f"projects:{self.config.projects_prefix} "
  f"status:open -is:wip -age:{query_age}")
-response = self.gerrit_api.query_changes(query,
- self.config.query_limit,
- "CURRENT_REVISION")
+response = self.gerrit_api.query_changes(
+query, self.config.query_limit,
+["CURRENT_REVISION", "REVIEWER_UPDATES", "DETAILED_ACCOUNTS"]
+)

 if response.status_code >= 300:
 print("Error: Couldn't query new Gerrit changes")
diff --git a/util/gerrit-bot/util.py b/util/gerrit-bot/util.py
index d836690..a5142e4 100644
--- a/util/gerrit-bot/util.py
+++ b/util/gerrit-bot/util.py
@@ -60,6 +60,14 @@
 tags, message = parse_commit_subject(change["subject"])
 change_id = change["id"]
 maintainer_emails = set()
+
+# There are cases that a reviewer being removed from the reviewer list
+# by another reviewer. We want to respect this removal. To do this,
+# we can avoid adding reviewers that have been added/removed to the
+# reviewer list.
+avoid_emails = set()
+for update in change["reviewer_updates"]:
+avoid_emails = update["reviewer"]["email"]
 for tag in tags:
 try:
 for name, email in maintainers[tag].maintainers:
@@ -68,6 +76,8 @@
 print((f"warning: `change-{change_id}` has an unknown tag: "
f"`{tag}`"))
 for email in maintainer_emails:
+if email in avoid_emails:
+continue
 try:
 account_id = maintainers_account_ids[email]
 gerrit_api.add_reviewer(change_id, account_id)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50187
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: Ifaab5ebd7ebf3e6453b2551d3e37c1b9e214c906
Gerrit-Change-Number: 50187
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]: tests,gpu-compute: Add GCN3 Square test to Nightly

2021-09-09 Thread Bobby R. Bruce (Gerrit) via gem5-dev
Bobby R. Bruce has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/50167 )



Change subject: tests,gpu-compute: Add GCN3 Square test to Nightly
..

tests,gpu-compute: Add GCN3 Square test to Nightly

Change-Id: I734a470d481f4012148820f62fdc3f535ea3d8f8
---
M tests/nightly.sh
1 file changed, 18 insertions(+), 1 deletion(-)



diff --git a/tests/nightly.sh b/tests/nightly.sh
index b2c226f..3ffdbcd 100755
--- a/tests/nightly.sh
+++ b/tests/nightly.sh
@@ -80,4 +80,21 @@
 # Run the gem5 long tests.
 docker run -u $UID:$GID --volume "${gem5_root}":"${gem5_root}" -w \
 "${gem5_root}"/tests --rm  
gcr.io/gem5-test/ubuntu-20.04_all-dependencies \

-./main.py run --length long -j${threads} -t${threads}
\ No newline at end of file
+./main.py run --length long -j${threads} -t${threads}
+
+# Run the GPU tests.
+
+# For the GPU tests we compile and run GCN3_X86 inside a gcn-gpu container.
+docker pull gcr.io/gem5-test/gcn-gpu:latest
+docker run --rm -u $UID:$GUID --volume "${gem5_root}":"${gem5_root}" -w \
+"${gem5_root}" gcr.io/gem5-test/gcn-gpu:latest bash -c \
+"scons build/GCN3_X86/gem5.opt -j${threads} \
+|| (rm -rf build && scons build/GCN3_X86/gem5.opt -j${threads})"
+
+wget -qN http://dist.gem5.org/dist/develop/test-progs/square/square
+
+mkdir -p tests/testing-results
+
+docker run --rm -u $UID:$GUID --volume "${gem5_root}":"${gem5_root}" -w \
+"${gem5_root}" gcr.io/gem5-test/gcn-gpu:latest build/GCN3_X86/gem5.opt  
\

+configs/example/apu_se.py -n3 -c square

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50167
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: I734a470d481f4012148820f62fdc3f535ea3d8f8
Gerrit-Change-Number: 50167
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby R. Bruce 
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]: cpu: Fix TME for dyn_o3_cpu

2021-09-09 Thread Giacomo Travaglini (Gerrit) via gem5-dev
Giacomo Travaglini has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/50147 )



Change subject: cpu: Fix TME for dyn_o3_cpu
..

cpu: Fix TME for dyn_o3_cpu

Commit c417b76 changed the behaviour of addRequest(),
but did not update documentation or the HTM-related logic that used it.

Updates documentation for addRequest() in light of c417b76,
refactors request class to be idiomatic and use assigned byteEnable,
made HTM cmds pass in a correct byteEnable.

Change-Id: I7aa8c127df896e81caf915fbfea93e7b4bcc53b7
---
M src/cpu/o3/dyn_inst.cc
M src/cpu/o3/lsq.cc
M src/cpu/o3/lsq.hh
3 files changed, 27 insertions(+), 26 deletions(-)



diff --git a/src/cpu/o3/dyn_inst.cc b/src/cpu/o3/dyn_inst.cc
index 1bd37cc..edbaa04 100644
--- a/src/cpu/o3/dyn_inst.cc
+++ b/src/cpu/o3/dyn_inst.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011 ARM Limited
+ * Copyright (c) 2010-2011, 2021 ARM Limited
  * All rights reserved
  *
  * The license below extends only to copyright in the software and shall
@@ -301,9 +301,11 @@
 Fault
 DynInst::initiateHtmCmd(Request::Flags flags)
 {
+const unsigned int size = 8;
 return cpu->pushRequest(
 dynamic_cast(this),
-/* ld */ true, nullptr, 8, 0x0ul, flags, nullptr, nullptr);
+/* ld */ true, nullptr, size, 0x0ul, flags, nullptr, nullptr,
+std::vector(size, true));
 }

 Fault
diff --git a/src/cpu/o3/lsq.cc b/src/cpu/o3/lsq.cc
index 359b54d..110c58a 100644
--- a/src/cpu/o3/lsq.cc
+++ b/src/cpu/o3/lsq.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2012, 2014, 2017-2019 ARM Limited
+ * Copyright (c) 2011-2012, 2014, 2017-2019, 2021 ARM Limited
  * Copyright (c) 2013 Advanced Micro Devices, Inc.
  * All rights reserved
  *
@@ -1374,6 +1374,16 @@
 SingleDataRequest(port, inst, true, 0x0lu, 8, flags_,
 nullptr, nullptr, nullptr)
 {
+}
+
+void
+LSQ::HtmCmdRequest::initiateTranslation()
+{
+// Special commands are implemented as loads to avoid significant
+// changes to the cpu and memory interfaces
+// The virtual and physical address uses a dummy value of 0x00
+// Address translation does not really occur thus the code below
+
 assert(_requests.size() == 0);

 addRequest(_addr, _size, _byteEnable);
@@ -1390,34 +1400,23 @@
 _inst->memReqFlags = _requests.back()->getFlags();
 _inst->savedReq = this;

-setState(State::Translation);
+flags.set(Flag::TranslationStarted);
+flags.set(Flag::TranslationFinished);
+
+_inst->translationStarted(true);
+_inst->translationCompleted(true);
+
+setState(State::Request);
 } else {
-panic("unexpected behaviour");
+panic("unexpected behaviour in initiateTranslation()");
 }
 }

 void
-LSQ::HtmCmdRequest::initiateTranslation()
-{
-// Transaction commands are implemented as loads to avoid significant
-// changes to the cpu and memory interfaces
-// The virtual and physical address uses a dummy value of 0x00
-// Address translation does not really occur thus the code below
-
-flags.set(Flag::TranslationStarted);
-flags.set(Flag::TranslationFinished);
-
-_inst->translationStarted(true);
-_inst->translationCompleted(true);
-
-setState(State::Request);
-}
-
-void
 LSQ::HtmCmdRequest::finish(const Fault , const RequestPtr ,
 gem5::ThreadContext* tc, BaseMMU::Mode mode)
 {
-panic("unexpected behaviour");
+panic("unexpected behaviour - finish()");
 }

 Fault
diff --git a/src/cpu/o3/lsq.hh b/src/cpu/o3/lsq.hh
index e5e519a..f843e64 100644
--- a/src/cpu/o3/lsq.hh
+++ b/src/cpu/o3/lsq.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2012, 2014, 2018-2019 ARM Limited
+ * Copyright (c) 2011-2012, 2014, 2018-2019, 2021 ARM Limited
  * Copyright (c) 2013 Advanced Micro Devices, Inc.
  * All rights reserved
  *
@@ -362,8 +362,8 @@
 /** Helper function used to add a (sub)request, given its address
  * `addr`, size `size` and byte-enable mask `byteEnable`.
  *
- * The request is only added if the mask is empty or if there is at
- * least an active element in it.
+ * The request is only added if there is at least one active
+ * element in the mask.
  */
 void addRequest(Addr addr, unsigned size,
 const std::vector& byte_enable);

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50147
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: I7aa8c127df896e81caf915fbfea93e7b4bcc53b7
Gerrit-Change-Number: 50147
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org

[gem5-dev] Change in gem5/gem5[develop]: tests: Fix x86-boot-tests nightly tests

2021-09-09 Thread Bobby R. Bruce (Gerrit) via gem5-dev
Bobby R. Bruce has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/50128 )


Change subject: tests: Fix x86-boot-tests nightly tests
..

tests: Fix x86-boot-tests nightly tests

The nightly tests were failing as reported here:
https://www.mail-archive.com/gem5-dev@gem5.org/msg40394.html.

This was due to the tests trying to run our MI_Example test against
GCN3_X86 instead of the X86 ISA target. This patch fixes the issue.

Change-Id: I8ea692ffc06e3d7c4150074ed22e16096b3dbb5e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50128
Reviewed-by: Bobby R. Bruce 
Reviewed-by: Jason Lowe-Power 
Maintainer: Bobby R. Bruce 
Tested-by: kokoro 
---
M tests/gem5/x86-boot-tests/test_linux_boot.py
1 file changed, 3 insertions(+), 0 deletions(-)

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




diff --git a/tests/gem5/x86-boot-tests/test_linux_boot.py  
b/tests/gem5/x86-boot-tests/test_linux_boot.py

index b3e3064..53af891 100644
--- a/tests/gem5/x86-boot-tests/test_linux_boot.py
+++ b/tests/gem5/x86-boot-tests/test_linux_boot.py
@@ -64,6 +64,9 @@
 if mem_system == "mesi_two_level":
 protocol_to_use="MESI_Two_Level"
 isa_to_use=constants.x86_tag
+elif mem_system == "mi_example":
+protocol_to_use=None
+isa_to_use=constants.x86_tag
 else:
 protocol_to_use=None
 isa_to_use=constants.gcn3_x86_tag

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50128
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: I8ea692ffc06e3d7c4150074ed22e16096b3dbb5e
Gerrit-Change-Number: 50128
Gerrit-PatchSet: 3
Gerrit-Owner: Bobby R. Bruce 
Gerrit-Reviewer: Bobby R. Bruce 
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]: cpu: Generalize the vec reg types out of InstResult.

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


Change subject: cpu: Generalize the vec reg types out of InstResult.
..

cpu: Generalize the vec reg types out of InstResult.

Use templates to delegate knowing what these types are to whatever is using
InstResult. This will need to be even more generalized at these call
sights so that we don't just push around the dependencies, but that will
have to be handled later.

Change-Id: I45915d70ea06caed06f0ccf356f9e2e1acbd6c61
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49131
Reviewed-by: Yu-hsin Wang 
Maintainer: Gabe Black 
Tested-by: kokoro 
---
M src/cpu/checker/cpu_impl.hh
M src/cpu/inst_res.hh
2 files changed, 48 insertions(+), 67 deletions(-)

Approvals:
  Yu-hsin Wang: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/cpu/checker/cpu_impl.hh b/src/cpu/checker/cpu_impl.hh
index 638a737..9d5c260 100644
--- a/src/cpu/checker/cpu_impl.hh
+++ b/src/cpu/checker/cpu_impl.hh
@@ -471,7 +471,6 @@
 int idx = -1;
 bool result_mismatch = false;
 bool scalar_mismatch = false;
-bool vector_mismatch = false;

 if (inst->isUnverifiable()) {
 // Unverifiable instructions assume they were executed
@@ -488,10 +487,7 @@
 if (checker_val != inst_val) {
 result_mismatch = true;
 idx = i;
-scalar_mismatch = checker_val.isScalar();
-vector_mismatch = checker_val.isVector();
-panic_if(!(scalar_mismatch || vector_mismatch),
-"Unknown type of result\n");
+scalar_mismatch = checker_val.is();
 }
 }
 } // Checker CPU checks all the saved results in the dyninst passed by
@@ -504,8 +500,8 @@
 if (scalar_mismatch) {
 warn("%lli: Instruction results (%i) do not match! (Values may"
  " not actually be integers) Inst: %#x, checker: %#x",
- curTick(), idx, inst_val.asIntegerNoAssert(),
- checker_val.asInteger());
+ curTick(), idx, inst_val.asNoAssert(),
+ checker_val.as());
 }

 // It's useful to verify load values from memory, but in MP
@@ -590,28 +586,22 @@
 const RegId& idx = inst->destRegIdx(start_idx);
 switch (idx.classValue()) {
   case IntRegClass:
-panic_if(!mismatch_val.isScalar(), "Unexpected type of  
result");

-thread->setIntReg(idx.index(), mismatch_val.asInteger());
+thread->setIntReg(idx.index(), mismatch_val.as());
 break;
   case FloatRegClass:
-panic_if(!mismatch_val.isScalar(), "Unexpected type of  
result");

-thread->setFloatReg(idx.index(), mismatch_val.asInteger());
+thread->setFloatReg(idx.index(), mismatch_val.as());
 break;
   case VecRegClass:
-panic_if(!mismatch_val.isVector(), "Unexpected type of  
result");

-thread->setVecReg(idx, mismatch_val.asVector());
+thread->setVecReg(idx,  
mismatch_val.as());

 break;
   case VecElemClass:
-panic_if(!mismatch_val.isScalar(), "Unexpected type of  
result");

-thread->setVecElem(idx, mismatch_val.asInteger());
+thread->setVecElem(idx, mismatch_val.as());
 break;
   case CCRegClass:
-panic_if(!mismatch_val.isScalar(), "Unexpected type of  
result");

-thread->setCCReg(idx.index(), mismatch_val.asInteger());
+thread->setCCReg(idx.index(), mismatch_val.as());
 break;
   case MiscRegClass:
-panic_if(!mismatch_val.isScalar(), "Unexpected type of  
result");

-thread->setMiscReg(idx.index(), mismatch_val.asInteger());
+thread->setMiscReg(idx.index(), mismatch_val.as());
 break;
   default:
 panic("Unknown register class: %d", (int)idx.classValue());
@@ -624,27 +614,21 @@
 res = inst->popResult();
 switch (idx.classValue()) {
   case IntRegClass:
-panic_if(!res.isScalar(), "Unexpected type of result");
-thread->setIntReg(idx.index(), res.asInteger());
+thread->setIntReg(idx.index(), res.as());
 break;
   case FloatRegClass:
-panic_if(!res.isScalar(), "Unexpected type of result");
-thread->setFloatReg(idx.index(), res.asInteger());
+thread->setFloatReg(idx.index(), res.as());
 break;
   case VecRegClass:
-panic_if(!res.isVector(), "Unexpected type of result");
-thread->setVecReg(idx, res.asVector());
+thread->setVecReg(idx, res.as());
 break;
   case VecElemClass:
-

[gem5-dev] Change in gem5/gem5[develop]: arch-riscv: Remove unused stats

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


Change subject: arch-riscv: Remove unused stats
..

arch-riscv: Remove unused stats

These stats were unused and caused a warning about legacy stats. From
what I can tell looking at the blame, they were never used.

Change-Id: If2886e91dd776c34354a79a4cbc447ffe5988982
Signed-off-by: Jason Lowe-Power 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50068
Reviewed-by: Hoa Nguyen 
Maintainer: Jason Lowe-Power 
Tested-by: kokoro 
---
M src/arch/riscv/tlb.hh
1 file changed, 0 insertions(+), 2 deletions(-)

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




diff --git a/src/arch/riscv/tlb.hh b/src/arch/riscv/tlb.hh
index 26b6afa..f37143d 100644
--- a/src/arch/riscv/tlb.hh
+++ b/src/arch/riscv/tlb.hh
@@ -75,11 +75,9 @@

 statistics::Scalar readHits;
 statistics::Scalar readMisses;
-statistics::Scalar read_acv;
 statistics::Scalar readAccesses;
 statistics::Scalar writeHits;
 statistics::Scalar writeMisses;
-statistics::Scalar write_acv;
 statistics::Scalar writeAccesses;

 statistics::Formula hits;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50068
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: If2886e91dd776c34354a79a4cbc447ffe5988982
Gerrit-Change-Number: 50068
Gerrit-PatchSet: 2
Gerrit-Owner: Jason Lowe-Power 
Gerrit-Reviewer: Ayaz Akram 
Gerrit-Reviewer: Hoa Nguyen 
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] Build failed in Jenkins: nightly #441

2021-09-09 Thread jenkins-no-reply--- via gem5-dev
See 

Changes:

[Bobby R. Bruce] configs,python: Update simple_binary_run.py for testing

[Bobby R. Bruce] tests: Update hello_se to use simple_binary_run.py

[Bobby R. Bruce] tests: Update the insttest to use simple_binary_run.py

[Bobby R. Bruce] tests: Updates test_hdf5.py to use simple_binary_run.py

[Bobby R. Bruce] tests: Update test_exit.py to run with simple_binary_run.py

[Bobby R. Bruce] configs,test: Move components-lib scripts to tests

[Bobby R. Bruce] configs,python: Fix test_board 'setup_memory_ranges()' call

[Bobby R. Bruce] tests: Add memory traffic generation tests

[Bobby R. Bruce] tests: Add weekly.sh for Weekly tests

[austin.dane.harris] python: Update switchable processor to support KVM


--
[...truncated 677.00 KB...]
*** Summary of Warnings ***
Warning: Deprecated namespaces are not supported by this compiler.
 Please make sure to check the mailing list for deprecation
 announcements.
+ docker run -u 115: --volume 
:
 -w  --rm 
gcr.io/gem5-test/ubuntu-20.04_all-dependencies ./main.py run --length long -j12 
-t12
Running the new gem5 testing script.
For more information see TESTING.md.
To see details as the testing scripts are running, use the option -v, -vv, or 
-vvv

Loading Tests
Discovered 2856 tests and 2856 suites in 

Discovered 264 tests and 132 suites in 

Discovered 24 tests and 12 suites in 

Discovered 192 tests and 162 suites in 

Discovered 186 tests and 93 suites in 

Discovered 24 tests and 12 suites in 

Discovered 36 tests and 36 suites in 

Discovered 48 tests and 24 suites in 

Discovered 18 tests and 9 suites in 

Discovered 12 tests and 6 suites in 

Discovered 0 tests and 0 suites in 

Discovered 72 tests and 72 suites in 

Discovered 0 tests and 0 suites in 

Discovered 18 tests and 6 suites in 

Discovered 21 tests and 21 suites in 

Discovered 30 tests and 30 suites in 

Discovered 150 tests and 126 suites in 

Discovered 6 tests and 6 suites in 


Running Tests from 38 suites
Results will be stored in 


Building the following targets. This may take a while.

You may want to run with only a single ISA(--isa=), use --skip-build, or use 
'rerun'.
Building the following targets. This may take a while.

You may want to run with only a single ISA(--isa=), use --skip-build, or use 
'rerun'.
Building the following targets. This may take a while.

You may want to run with only a single ISA(--isa=), use --skip-build, or use 
'rerun'.
Building the following targets. This may take a while.

You may want to run with only a single ISA(--isa=), use --skip-build, or use 
'rerun'.
Building the following targets. This may take a while.

You may want to run with only a single ISA(--isa=), use --skip-build, or use 
'rerun'.
Building 

[gem5-dev] Change in gem5/gem5[develop]: python: Update switchable processor to support KVM

2021-09-09 Thread Austin Harris (Gerrit) via gem5-dev
Austin Harris has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/50127 )


Change subject: python: Update switchable processor to support KVM
..

python: Update switchable processor to support KVM

Change-Id: Ie843e2b4ab6e506bb195bfcef33cead9a6273901
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50127
Maintainer: Bobby R. Bruce 
Reviewed-by: Jason Lowe-Power 
Tested-by: kokoro 
---
M components_library/processors/simple_switchable_processor.py
M components_library/processors/switchable_processor.py
2 files changed, 22 insertions(+), 7 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Bobby R. Bruce: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/components_library/processors/simple_switchable_processor.py  
b/components_library/processors/simple_switchable_processor.py

index 8dee013..a875817 100644
--- a/components_library/processors/simple_switchable_processor.py
+++ b/components_library/processors/simple_switchable_processor.py
@@ -56,10 +56,6 @@
 self._start_key = "start"
 self._switch_key = "switch"
 self._current_is_start = True
-self._prepare_kvm = CPUTypes.KVM in (
-starting_core_type,
-switch_core_type,
-)

 if starting_core_type in (CPUTypes.TIMING, CPUTypes.O3):
 self._mem_mode = MemMode.TIMING
@@ -90,9 +86,6 @@
 def incorporate_processor(self, board: AbstractBoard) -> None:
 super().incorporate_processor(board=board)

-if self._prepare_kvm:
-board.kvm_vm = KvmVM()
-
 board.set_mem_mode(self._mem_mode)

 def switch(self):
diff --git a/components_library/processors/switchable_processor.py  
b/components_library/processors/switchable_processor.py

index cb15803..e764717 100644
--- a/components_library/processors/switchable_processor.py
+++ b/components_library/processors/switchable_processor.py
@@ -26,6 +26,9 @@

 from components_library.processors.simple_core import SimpleCore
 from components_library.processors.abstract_core import AbstractCore
+
+from .cpu_types import CPUTypes
+
 import m5

 from typing import Dict, Any, List
@@ -65,6 +68,15 @@
 core.set_switched_out(core not in self._current_cores)
 all_cores.append(core)

+self._prepare_kvm = CPUTypes.KVM in [
+core.get_type() for core in all_cores
+]
+
+if self._prepare_kvm:
+from m5.objects import KvmVM
+
+self.kvm_vm = KvmVM()
+
 super(SwitchableProcessor, self).__init__(cores=all_cores)

 @overrides(AbstractProcessor)
@@ -76,6 +88,16 @@
 # procsesor
 self._board = board

+if self._prepare_kvm:
+board.kvm_vm = self.kvm_vm
+
+# To get the KVM CPUs to run on different host CPUs
+# Specify a different event queue for each CPU
+for i, core in enumerate(self.cores):
+for obj in core.get_simobject().descendants():
+obj.eventq_index = 0
+core.get_simobject().eventq_index = i + 1
+
 @overrides(AbstractProcessor)
 def get_num_cores(self) -> int:
 # Note: This is a special case where the total number of cores in  
the


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50127
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: Ie843e2b4ab6e506bb195bfcef33cead9a6273901
Gerrit-Change-Number: 50127
Gerrit-PatchSet: 3
Gerrit-Owner: Austin Harris 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Austin Harris 
Gerrit-Reviewer: Bobby R. Bruce 
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