Re: [gem5-dev] systemc build on ARM

2017-05-19 Thread Gabe Black
Ah, that uint64 problem was relatively easy to fix. There are a couple
other things to fix too, and hopefully I'll send out a few patches later on
to get everything to build.

Gabe

On Fri, May 19, 2017 at 5:10 PM, Gabe Black  wrote:

> To clarify, I think this fixes the build problem when attempting to build
> gem5.opt, although we're running into other issues with pybind which I
> think might be specific to the version of Ubuntu we're trying to use. It
> "works" because while the systemc SConscript is processed, none of the
> build outputs are pulled into the dependency tree and so none are built.
> That's why my one change makes it possible to build things in ext/
> explicitly if you wanted to for, for example, testing the build.
>
> Gabe
>
> On Fri, May 19, 2017 at 5:03 PM, Gabe Black  wrote:
>
>> I made a pass at fixing this with these two CLs:
>>
>> https://gem5-review.googlesource.com/#/c/3460/
>> https://gem5-review.googlesource.com/#/c/3461/
>>
>> With those applied, I'm still running into compile errors, I think
>> because the underlying type for uint64 is unsigned long, and there are
>> operators which override for both types. I think g++ gets cranky because
>> those are equivalent or at least ambiguous, so you're not allowed to have
>> both. I'm not sure why that would blow up on 64 it ARM and not 64 bit x86,
>> but then again I'm not super familiar with this code base.
>>
>> Gabe
>>
>> On Fri, May 19, 2017 at 2:05 AM, Christian Menard <
>> christian.men...@tu-dresden.de> wrote:
>>
>>> Hi Gabe,
>>>
>>> thanks for reporting this. I will look into it and hopefully post a patch
>>> soon. Maybe it would be best to leave QT threads out completely and use
>>> pthreads on all platforms. However, in the past, this caused some
>>> trouble on
>>> x86 when linking to gem5.
>>>
>>> Kind regards,
>>> Christian
>>>
>>> On Friday, 19 May 2017 09:25:51 CEST Gabe Black wrote:
>>> > Hi folks. We've just started to run into some problems building on ARM
>>> > because the systemc build fails out. While investigating, I found a
>>> couple
>>> > problems which are to blame.
>>> >
>>> > First, the SConscript seems to be assuming that it should be using the
>>> QT
>>> > threading implementation which requires architecture specific assembly
>>> > files. There is no file for ARM, so that will fail on ARM. Some
>>> Googling
>>> > suggests that systemc can in fact be built for ARM, but it needs to use
>>> > pthreads for its threading implementation.
>>> >
>>> > That led me to discover that the files which should be used with
>>> pthreads,
>>> > src/sysc/kernel/sc_cor_pthread.cpp, are already being included, and
>>> the
>>> > -pthread flag is being enabled unconditionally. I think those things
>>> should
>>> > be left out when using the QT threading library, and similarly the
>>> assembly
>>> > file shouldn't be required when building on ARM with pthreads.
>>> >
>>> > Gabe
>>> > ___
>>> > gem5-dev mailing list
>>> > gem5-dev@gem5.org
>>> > http://m5sim.org/mailman/listinfo/gem5-dev
>>>
>>>
>>> --
>>> Dipl.-Ing. Christian Menard
>>> Research Assistant
>>>
>>> TU Dresden
>>> Faculty of Computer Science
>>> Chair for Compiler Construction
>>> 01062 Dresden
>>>
>>> Phone: +49 351 463-42441
>>> e-Mail: christian.men...@tu-dresden.de
>>>
>>> ___
>>> gem5-dev mailing list
>>> gem5-dev@gem5.org
>>> http://m5sim.org/mailman/listinfo/gem5-dev
>>
>>
>>
>
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Re: [gem5-dev] systemc build on ARM

2017-05-19 Thread Gabe Black
To clarify, I think this fixes the build problem when attempting to build
gem5.opt, although we're running into other issues with pybind which I
think might be specific to the version of Ubuntu we're trying to use. It
"works" because while the systemc SConscript is processed, none of the
build outputs are pulled into the dependency tree and so none are built.
That's why my one change makes it possible to build things in ext/
explicitly if you wanted to for, for example, testing the build.

Gabe

On Fri, May 19, 2017 at 5:03 PM, Gabe Black  wrote:

> I made a pass at fixing this with these two CLs:
>
> https://gem5-review.googlesource.com/#/c/3460/
> https://gem5-review.googlesource.com/#/c/3461/
>
> With those applied, I'm still running into compile errors, I think because
> the underlying type for uint64 is unsigned long, and there are operators
> which override for both types. I think g++ gets cranky because those are
> equivalent or at least ambiguous, so you're not allowed to have both. I'm
> not sure why that would blow up on 64 it ARM and not 64 bit x86, but then
> again I'm not super familiar with this code base.
>
> Gabe
>
> On Fri, May 19, 2017 at 2:05 AM, Christian Menard <
> christian.men...@tu-dresden.de> wrote:
>
>> Hi Gabe,
>>
>> thanks for reporting this. I will look into it and hopefully post a patch
>> soon. Maybe it would be best to leave QT threads out completely and use
>> pthreads on all platforms. However, in the past, this caused some trouble
>> on
>> x86 when linking to gem5.
>>
>> Kind regards,
>> Christian
>>
>> On Friday, 19 May 2017 09:25:51 CEST Gabe Black wrote:
>> > Hi folks. We've just started to run into some problems building on ARM
>> > because the systemc build fails out. While investigating, I found a
>> couple
>> > problems which are to blame.
>> >
>> > First, the SConscript seems to be assuming that it should be using the
>> QT
>> > threading implementation which requires architecture specific assembly
>> > files. There is no file for ARM, so that will fail on ARM. Some Googling
>> > suggests that systemc can in fact be built for ARM, but it needs to use
>> > pthreads for its threading implementation.
>> >
>> > That led me to discover that the files which should be used with
>> pthreads,
>> > src/sysc/kernel/sc_cor_pthread.cpp, are already being included, and the
>> > -pthread flag is being enabled unconditionally. I think those things
>> should
>> > be left out when using the QT threading library, and similarly the
>> assembly
>> > file shouldn't be required when building on ARM with pthreads.
>> >
>> > Gabe
>> > ___
>> > gem5-dev mailing list
>> > gem5-dev@gem5.org
>> > http://m5sim.org/mailman/listinfo/gem5-dev
>>
>>
>> --
>> Dipl.-Ing. Christian Menard
>> Research Assistant
>>
>> TU Dresden
>> Faculty of Computer Science
>> Chair for Compiler Construction
>> 01062 Dresden
>>
>> Phone: +49 351 463-42441
>> e-Mail: christian.men...@tu-dresden.de
>>
>> ___
>> gem5-dev mailing list
>> gem5-dev@gem5.org
>> http://m5sim.org/mailman/listinfo/gem5-dev
>
>
>
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Re: [gem5-dev] systemc build on ARM

2017-05-19 Thread Gabe Black
I made a pass at fixing this with these two CLs:

https://gem5-review.googlesource.com/#/c/3460/
https://gem5-review.googlesource.com/#/c/3461/

With those applied, I'm still running into compile errors, I think because
the underlying type for uint64 is unsigned long, and there are operators
which override for both types. I think g++ gets cranky because those are
equivalent or at least ambiguous, so you're not allowed to have both. I'm
not sure why that would blow up on 64 it ARM and not 64 bit x86, but then
again I'm not super familiar with this code base.

Gabe

On Fri, May 19, 2017 at 2:05 AM, Christian Menard <
christian.men...@tu-dresden.de> wrote:

> Hi Gabe,
>
> thanks for reporting this. I will look into it and hopefully post a patch
> soon. Maybe it would be best to leave QT threads out completely and use
> pthreads on all platforms. However, in the past, this caused some trouble
> on
> x86 when linking to gem5.
>
> Kind regards,
> Christian
>
> On Friday, 19 May 2017 09:25:51 CEST Gabe Black wrote:
> > Hi folks. We've just started to run into some problems building on ARM
> > because the systemc build fails out. While investigating, I found a
> couple
> > problems which are to blame.
> >
> > First, the SConscript seems to be assuming that it should be using the QT
> > threading implementation which requires architecture specific assembly
> > files. There is no file for ARM, so that will fail on ARM. Some Googling
> > suggests that systemc can in fact be built for ARM, but it needs to use
> > pthreads for its threading implementation.
> >
> > That led me to discover that the files which should be used with
> pthreads,
> > src/sysc/kernel/sc_cor_pthread.cpp, are already being included, and the
> > -pthread flag is being enabled unconditionally. I think those things
> should
> > be left out when using the QT threading library, and similarly the
> assembly
> > file shouldn't be required when building on ARM with pthreads.
> >
> > Gabe
> > ___
> > gem5-dev mailing list
> > gem5-dev@gem5.org
> > http://m5sim.org/mailman/listinfo/gem5-dev
>
>
> --
> Dipl.-Ing. Christian Menard
> Research Assistant
>
> TU Dresden
> Faculty of Computer Science
> Chair for Compiler Construction
> 01062 Dresden
>
> Phone: +49 351 463-42441
> e-Mail: christian.men...@tu-dresden.de
>
> ___
> gem5-dev mailing list
> gem5-dev@gem5.org
> http://m5sim.org/mailman/listinfo/gem5-dev
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in public/gem5[master]: scons: Enable explicitly building something with no variant.

2017-05-19 Thread Gabe Black (Gerrit)
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/3460



Change subject: scons: Enable explicitly building something with no variant.
..

scons: Enable explicitly building something with no variant.

The SConstruct currently expects all explicit targets to be under a
variant directory like ARM or X86 which tells it what settings to use,
etc. There are things which scons knows how to build however, which do not
live under a variant directory, specifically everything under ext.

This change makes scons not look for a variant directory when it
encounters a target which is built by something in ext. This enables
things like explicitly building the systemc libraries, for example.

Change-Id: I8982a96fe49e3cb970ec78e11cea08703990c686
---
M SConstruct
1 file changed, 5 insertions(+), 0 deletions(-)



diff --git a/SConstruct b/SConstruct
index 30f99c7..65179f1 100755
--- a/SConstruct
+++ b/SConstruct
@@ -1314,9 +1314,11 @@

 # builds in ext are shared across all configs in the build root.
 ext_dir = abspath(joinpath(str(main.root), 'ext'))
+ext_build_dirs = []
 for root, dirs, files in os.walk(ext_dir):
 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))

@@ -1412,6 +1414,9 @@
 sticky_vars.files.append(current_vars_file)
 if not GetOption('silent'):
 print "Using saved variables file %s" % current_vars_file
+elif variant_dir in ext_build_dirs:
+# Things in ext are built without a variant directory.
+continue
 else:
 # Build dir-specific variables file doesn't exist.


--
To view, visit https://gem5-review.googlesource.com/3460
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8982a96fe49e3cb970ec78e11cea08703990c686
Gerrit-Change-Number: 3460
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in public/gem5[master]: ext: Revamp the systemc SConscripts.

2017-05-19 Thread Gabe Black (Gerrit)
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/3461



Change subject: ext: Revamp the systemc SConscripts.
..

ext: Revamp the systemc SConscripts.

The existing scripts were including pthread code and QT code at the same
time, and also insisting on an having a set of architecture specific
source files for whatever the current architecture is.

This change selects using either QT or pthreads based on the host
architecture, distributes accumulating source files, list source files
explicitly (to avoid including redundant coroutine libraries) and makes
scons insist on an architecture specific QT implementation only if QT is
being used.

Change-Id: I1a40123a11e49e02922a054f093246cf197087bf
---
M ext/systemc/SConscript
A ext/systemc/src/sysc/communication/SConscript.sc
A ext/systemc/src/sysc/datatypes/bit/SConscript.sc
A ext/systemc/src/sysc/datatypes/fx/SConscript.sc
A ext/systemc/src/sysc/datatypes/int/SConscript.sc
A ext/systemc/src/sysc/datatypes/misc/SConscript.sc
A ext/systemc/src/sysc/kernel/SConscript.sc
A ext/systemc/src/sysc/qt/SConscript.sc
A ext/systemc/src/sysc/tracing/SConscript.sc
A ext/systemc/src/sysc/utils/SConscript.sc
10 files changed, 398 insertions(+), 26 deletions(-)



diff --git a/ext/systemc/SConscript b/ext/systemc/SConscript
index 804f7ab..f200fcc 100644
--- a/ext/systemc/SConscript
+++ b/ext/systemc/SConscript
@@ -26,39 +26,44 @@
 import os

 Import('main')
+systemc = main.Clone()

-main.Prepend(CPPPATH=Dir('./src'))
-main.Prepend(CPATH=Dir('./src'))
+systemc.Prepend(CPPPATH=Dir('./src'))
+systemc.Prepend(CPATH=Dir('./src'))

-main.Prepend(CXXFLAGS=['-DSC_INCLUDE_FX', '-pthread'])
-main.Prepend(CFLAGS=['-DSC_INCLUDE_FX', '-pthread'])
+systemc.Prepend(CXXFLAGS=['-DSC_INCLUDE_FX'])
+systemc.Prepend(CFLAGS=['-DSC_INCLUDE_FX'])

-conf = Configure(main)
+conf = Configure(systemc)

-if main['PLATFORM'] == 'darwin':
-main.Append(LINKFLAGS=['-undefined', 'dynamic_lookup'])
+if systemc['PLATFORM'] == 'darwin':
+systemc.Append(LINKFLAGS=['-undefined', 'dynamic_lookup'])

-s_file = None
-if conf.CheckDeclaration("__i386__"):
-s_file = 'i386.s'
-if conf.CheckDeclaration("__x86_64__"):
-s_file = 'iX86_64.s'
+if conf.CheckDeclaration('__i386__'):
+systemc['COROUTINE_LIB'] = 'qt'
+systemc['QT_ARCH'] = 'i386'
+elif conf.CheckDeclaration('__x86_64__'):
+systemc['COROUTINE_LIB'] = 'qt'
+systemc['QT_ARCH'] = 'iX86_64'
+else:
+systemc['COROUTINE_LIB'] = 'pthreads'
+
 conf.Finish()

-if s_file is None:
-print 'Unsupported CPU architecture!'
-Exit(1)
+systemc_files = []
+def SystemCSource(*args):
+for arg in args:
+systemc_files.append(systemc.File(arg))

-systemc_files = Glob('src/sysc/kernel/*.cpp')
-systemc_files += ['src/sysc/qt/qt.c', 'src/sysc/qt/md/' + s_file]
-systemc_files += Glob('src/sysc/communication/*.cpp')
-systemc_files += Glob('src/sysc/tracing/*.cpp')
-systemc_files += Glob('src/sysc/utils/*.cpp')
-systemc_files += Glob('src/sysc/datatypes/bit/*.cpp')
-systemc_files += Glob('src/sysc/datatypes/fx/*.cpp')
-systemc_files += Glob('src/sysc/datatypes/int/*.cpp')
-systemc_files += Glob('src/sysc/datatypes/misc/*.cpp')
+build_root = Dir('.').abspath
+src_root = Dir('.').srcdir.abspath
+for root, dirs, files in os.walk(src_root):
+if 'SConscript.sc' in files:
+build_dir = os.path.relpath(root, src_root)
+systemc.SConscript(os.path.join(root, 'SConscript.sc'),
+   exports=['systemc', 'SystemCSource'],
+   variant_dir=os.path.join(build_root, build_dir))

-main.Library('libsystemc', systemc_files)
-main.SharedLibrary('libsystemc', systemc_files)
+systemc.Library('libsystemc', systemc_files)
+systemc.SharedLibrary('libsystemc', systemc_files)

diff --git a/ext/systemc/src/sysc/communication/SConscript.sc  
b/ext/systemc/src/sysc/communication/SConscript.sc

new file mode 100644
index 000..9526150
--- /dev/null
+++ b/ext/systemc/src/sysc/communication/SConscript.sc
@@ -0,0 +1,42 @@
+# Copyright (c) 2017, TU Dresden
+# Copyright (c) 2017, University of Kaiserslautern
+# All rights reserved.
+
+# Permission is hereby granted, free of charge, to any person obtaining a  
copy
+# of this software and associated documentation files (the "Software"), to  
deal
+# in the Software without restriction, including without limitation the  
rights

+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included  
in

+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  
OR

+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR 

[gem5-dev] Change in public/gem5[master]: dev, arm: add a9mpcore global timer device

2017-05-19 Thread Gedare Bloom (Gerrit)

Hello Curtis Dunham, Andreas Sandberg,

I'd like you to reexamine a change. Please visit

https://gem5-review.googlesource.com/3262

to look at the new patch set (#3).

Change subject: dev, arm: add a9mpcore global timer device
..

dev, arm: add a9mpcore global timer device

Change-Id: I6d8a5e3795291b2a4cce022f555cf4b04f997538
Signed-off-by: Gedare Bloom 
---
M src/dev/arm/RealView.py
M src/dev/arm/SConscript
A src/dev/arm/timer_a9global.cc
A src/dev/arm/timer_a9global.hh
4 files changed, 508 insertions(+), 1 deletion(-)


--
To view, visit https://gem5-review.googlesource.com/3262
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I6d8a5e3795291b2a4cce022f555cf4b04f997538
Gerrit-Change-Number: 3262
Gerrit-PatchSet: 3
Gerrit-Owner: Gedare Bloom 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Curtis Dunham 
Gerrit-Reviewer: Gedare Bloom 
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in public/gem5[master]: tests: add a stack printer test

2017-05-19 Thread Brandon Potter (Gerrit)
Brandon Potter has uploaded this change for review. (  
https://gem5-review.googlesource.com/3440



Change subject: tests: add a stack printer test
..

tests: add a stack printer test

Add a test to print out stack contents for SE mode programs.
The test will print out argc, argv, envp, and some auxiliary
vectors.

Change-Id: I489d752ee40fde24c531d8918d0c050f4df936c5
---
A tests/test-progs/stack-print/bin/x86/linux/stack-print
A tests/test-progs/stack-print/src/stack-print.c
2 files changed, 165 insertions(+), 0 deletions(-)



diff --git a/tests/test-progs/stack-print/bin/x86/linux/stack-print  
b/tests/test-progs/stack-print/bin/x86/linux/stack-print

new file mode 100755
index 000..e40dc48
--- /dev/null
+++ b/tests/test-progs/stack-print/bin/x86/linux/stack-print
Binary files differ
diff --git a/tests/test-progs/stack-print/src/stack-print.c  
b/tests/test-progs/stack-print/src/stack-print.c

new file mode 100644
index 000..9fbf962
--- /dev/null
+++ b/tests/test-progs/stack-print/src/stack-print.c
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2017 Advanced Micro Devices, Inc.
+ * All rights reserved.
+ *
+ * For use for simulation and test purposes only
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are  
met:

+ *
+ * 1. Redistributions of source code must retain the above copyright  
notice,

+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright  
notice,
+ * this list of conditions and the following disclaimer in the  
documentation

+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its
+ * contributors may be used to endorse or promote products derived from  
this

+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS  
IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,  
THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR  
PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS  
BE

+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF  
THE

+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Author: Brandon Potter
+ */
+
+#include 
+#include 
+
+int main(int argc, char **argv, char **envp)
+{
+int i;
+
+printf("%p: argc: [%d]\n", , argc);
+printf("\n");
+
+for (i = 0; i < argc; i++)
+printf("%p: argv[%d]: [%s]\n", [i], i, argv[i]);
+printf("\n");
+
+i = 0;
+while (envp[i] != NULL) {
+printf("%p: envp[%d]: [%s]\n", [i], i, envp[i]);
+i++;
+}
+printf("\n");
+
+Elf64_auxv_t *auxv = (Elf64_auxv_t*)[--i];
+while (auxv++) {
+char *type;
+switch(auxv->a_type) {
+case AT_IGNORE:
+type = "AT_IGNORE";
+break;
+case AT_EXECFD:
+type = "AT_EXECFD";
+break;
+case AT_PHDR:
+type = "AT_PHDR";
+break;
+case AT_PHENT:
+type = "AT_PHENT";
+break;
+case AT_PHNUM:
+type = "AT_PHNUM";
+break;
+case AT_PAGESZ:
+type = "AT_PAGESZ";
+break;
+case AT_BASE:
+type = "AT_BASE";
+break;
+case AT_FLAGS:
+type = "AT_FLAGS";
+break;
+case AT_ENTRY:
+type = "AT_ENTRY";
+break;
+case AT_NOTELF:
+type = "AT_NOTELF";
+break;
+case AT_UID:
+type = "AT_UID";
+break;
+case AT_EUID:
+type = "AT_EUID";
+break;
+case AT_GID:
+type = "AT_GID";
+break;
+case AT_EGID:
+type = "AT_EGID";
+break;
+case AT_CLKTCK:
+type = "AT_CLKTCK";
+break;
+case AT_PLATFORM:
+type = "AT_PLATFORM";
+break;
+case AT_HWCAP:
+type = "AT_HWCAP";
+break;
+case AT_FPUCW:
+type = "AT_FPUCW";
+break;
+case AT_DCACHEBSIZE:
+

[gem5-dev] gem5 does not compile on Mac OS Sierra

2017-05-19 Thread Matthias Jung
Hey,

I get the following compiling issue with gem5 on macOS Sierra (10.12.4) with 
clang Apple LLVM 8.1.0:



In file included from build/ARM/arch/arm/generated/generic_cpu_exec_6.cc:11:
build/ARM/arch/arm/generated/exec-ns.cc.inc:189454:39: error: implicit 
conversion from 'int' to 'Element' (aka 'signed char') changes value from 128 
to -128
  [-Werror,-Wconstant-conversion]
destElem = (Element)1 << (sizeof(Element) * 8 - 1);
 ~ ~~~^~~~
build/ARM/arch/arm/generated/exec-ns.cc.inc:189506:28: note: in instantiation 
of member function 'ArmISAInst::SqaddDX::execute' requested here
Fault SqaddDX::execute(
   ^
build/ARM/arch/arm/generated/exec-ns.cc.inc:189454:39: error: implicit 
conversion from 'int' to 'Element' (aka 'short') changes value from 32768 to 
-32768
  [-Werror,-Wconstant-conversion]
destElem = (Element)1 << (sizeof(Element) * 8 - 1);
 ~ ~~~^~~~
build/ARM/arch/arm/generated/exec-ns.cc.inc:189510:29: note: in instantiation 
of member function 'ArmISAInst::SqaddDX::execute' requested here
Fault SqaddDX::execute(
^
build/ARM/arch/arm/generated/exec-ns.cc.inc:189601:39: error: implicit 
conversion from 'int' to 'Element' (aka 'signed char') changes value from 128 
to -128
  [-Werror,-Wconstant-conversion]
destElem = (Element)1 << (sizeof(Element) * 8 - 1);
 ~ ~~~^~~~
build/ARM/arch/arm/generated/exec-ns.cc.inc:189653:28: note: in instantiation 
of member function 'ArmISAInst::SqaddQX::execute' requested here
Fault SqaddQX::execute(
   ^
build/ARM/arch/arm/generated/exec-ns.cc.inc:189601:39: error: implicit 
conversion from 'int' to 'Element' (aka 'short') changes value from 32768 to 
-32768
  [-Werror,-Wconstant-conversion]
destElem = (Element)1 << (sizeof(Element) * 8 - 1);
 ~ ~~~^~~~
build/ARM/arch/arm/generated/exec-ns.cc.inc:189657:29: note: in instantiation 
of member function 'ArmISAInst::SqaddQX::execute' requested here
Fault SqaddQX::execute(
^
build/ARM/arch/arm/generated/exec-ns.cc.inc:189757:39: error: implicit 
conversion from 'int' to 'Element' (aka 'signed char') changes value from 128 
to -128
  [-Werror,-Wconstant-conversion]
destElem = (Element)1 << (sizeof(Element) * 8 - 1);
 ~ ~~~^~~~
build/ARM/arch/arm/generated/exec-ns.cc.inc:189809:29: note: in instantiation 
of member function 'ArmISAInst::SqaddScX::execute' requested here
Fault SqaddScX::execute(
^
build/ARM/arch/arm/generated/exec-ns.cc.inc:189757:39: error: implicit 
conversion from 'int' to 'Element' (aka 'short') changes value from 32768 to 
-32768
  [-Werror,-Wconstant-conversion]
destElem = (Element)1 << (sizeof(Element) * 8 - 1);
 ~ ~~~^~~~
build/ARM/arch/arm/generated/exec-ns.cc.inc:189813:30: note: in instantiation 
of member function 'ArmISAInst::SqaddScX::execute' requested here
Fault SqaddScX::execute(
 ^
build/ARM/arch/arm/generated/exec-ns.cc.inc:189919:37: error: implicit 
conversion from 'int' to 'Element' (aka 'short') changes value from 32768 to 
-32768
  [-Werror,-Wconstant-conversion]
Element maxNeg = (Element)1 << (sizeof(Element) * 8 - 1);
~~   ~~~^~~~
build/ARM/arch/arm/generated/exec-ns.cc.inc:189984:34: note: in instantiation 
of member function 'ArmISAInst::SqdmlalElemX::execute' requested here
Fault SqdmlalElemX::execute(
 ^
build/ARM/arch/arm/generated/exec-ns.cc.inc:190086:37: error: implicit 
conversion from 'int' to 'Element' (aka 'short') changes value from 32768 to 
-32768
  [-Werror,-Wconstant-conversion]
Element maxNeg = (Element)1 << (sizeof(Element) * 8 - 1);
~~   ~~~^~~~
build/ARM/arch/arm/generated/exec-ns.cc.inc:190151:35: note: in instantiation 
of member function 'ArmISAInst::SqdmlalElem2X::execute' requested here
Fault SqdmlalElem2X::execute(
  ^
build/ARM/arch/arm/generated/exec-ns.cc.inc:190258:37: error: implicit 
conversion from 'int' to 'Element' (aka 'short') changes value from 32768 to 
-32768
  [-Werror,-Wconstant-conversion]
Element maxNeg = (Element)1 << (sizeof(Element) * 8 - 1);
~~   ~~~^~~~
build/ARM/arch/arm/generated/exec-ns.cc.inc:190323:36: note: in instantiation 
of member function 'ArmISAInst::SqdmlalElemScX::execute' requested here
Fault SqdmlalElemScX::execute(
 

[gem5-dev] Cron <m5test@zizzer> /z/m5/regression/do-regression quick

2017-05-19 Thread Cron Daemon
* build/RISCV/tests/opt/quick/se/00.hello/riscv/linux/o3-timing: CHANGED!
* build/RISCV/tests/opt/quick/se/00.hello/riscv/linux/simple-atomic: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64a/simple-timing: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64m/simple-atomic: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64m/minor-timing: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64f/simple-atomic: 
CHANGED!
* build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64f/o3-timing: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64m/simple-timing-ruby:
 CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64m/simple-timing: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64d/minor-timing: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64f/minor-timing: 
CHANGED!
* build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64m/o3-timing: 
CHANGED!
* build/RISCV/tests/opt/quick/se/00.hello/riscv/linux/minor-timing: CHANGED!
* build/RISCV/tests/opt/quick/se/00.hello/riscv/linux/simple-timing: 
CHANGED!
* build/RISCV/tests/opt/quick/se/00.hello/riscv/linux/simple-timing-ruby: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64f/simple-timing-ruby:
 CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64d/simple-timing-ruby:
 CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64d/simple-timing: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64d/simple-atomic: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64a/minor-timing: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64a/simple-atomic: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64f/simple-timing: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64a/simple-timing-ruby:
 CHANGED!
scons: *** [build/ALPHA/encumbered/eio/libexo.do] Error 1
scons: *** [build/ALPHA/encumbered/eio/eio.do] Error 1
scons: *** [build/ALPHA/encumbered/eio/libexo.fo] Error 1
scons: *** [build/ALPHA/encumbered/eio/eio.fo] Error 1
scons: *** [build/ALPHA/encumbered/eio/libexo.o] Error 1
scons: *** [build/ALPHA/encumbered/eio/eio.o] Error 1
* build/MIPS/tests/opt/quick/se/00.hello/mips/linux/o3-timing: passed.
* build/MIPS/tests/opt/quick/se/00.hello/mips/linux/simple-timing: passed.
* build/MIPS/tests/opt/quick/se/00.hello/mips/linux/simple-timing-ruby: 
passed.
* build/MIPS/tests/opt/quick/se/00.hello/mips/linux/simple-atomic: passed.
* 
build/MIPS/tests/opt/quick/se/03.learning-gem5/mips/linux/learning-gem5-p1-two-level:
 passed.
 * 
build/MIPS/tests/opt/quick/se/03.learning-gem5/mips/linux/learning-gem5-p1-simple:
 passed.
* build/NULL/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby: passed.
* build/NULL/tests/opt/quick/se/70.tgen/null/none/tgen-simple-mem: passed.
* build/NULL/tests/opt/quick/se/50.memtest/null/none/memtest-filter: passed.
* build/NULL/tests/opt/quick/se/50.memtest/null/none/memtest: passed.
* build/NULL/tests/opt/quick/se/70.tgen/null/none/tgen-dram-ctrl: passed.
* build/NULL/tests/opt/quick/se/51.memcheck/null/none/memcheck: passed.
* 
build/NULL_MOESI_hammer/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MOESI_hammer:
 passed.
* 
build/NULL_MESI_Two_Level/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MESI_Two_Level:
 passed.
* 
build/NULL_MOESI_CMP_directory/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MOESI_CMP_directory:
 passed.
* 
build/NULL_MOESI_CMP_token/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MOESI_CMP_token:
 passed.
* build/POWER/tests/opt/quick/se/00.hello/power/linux/simple-atomic: passed.
* build/POWER/tests/opt/quick/se/00.hello/power/linux/o3-timing: passed.
* build/SPARC/tests/opt/quick/se/02.insttest/sparc/linux/simple-timing: 
passed.
* build/SPARC/tests/opt/quick/se/02.insttest/sparc/linux/o3-timing: 
passed.Delete("build/SPARC/tests/opt/quick/se/70.twolf/sparc/linux/simple-atomic/simout")
* 
build/SPARC/tests/opt/quick/se/03.learning-gem5/sparc/linux/learning-gem5-p1-two-level:
 passed.
* 
build/SPARC/tests/opt/quick/se/40.m5threads-test-atomic/sparc/linux/simple-atomic-mp:
 passed.
* build/SPARC/tests/opt/quick/se/00.hello/sparc/linux/simple-timing: passed.
* 
build/SPARC/tests/opt/quick/se/40.m5threads-test-atomic/sparc/linux/simple-timing-mp:
 passed.
* 
build/SPARC/tests/opt/quick/se/03.learning-gem5/sparc/linux/learning-gem5-p1-simple:
 passed.
* build/SPARC/tests/opt/quick/se/00.hello/sparc/linux/simple-atomic: passed.
* build/SPARC/tests/opt/quick/se/00.hello/sparc/linux/simple-timing-ruby: 
passed.
* 

Re: [gem5-dev] systemc build on ARM

2017-05-19 Thread Christian Menard
Hi Gabe,

thanks for reporting this. I will look into it and hopefully post a patch 
soon. Maybe it would be best to leave QT threads out completely and use 
pthreads on all platforms. However, in the past, this caused some trouble on 
x86 when linking to gem5.

Kind regards,
Christian

On Friday, 19 May 2017 09:25:51 CEST Gabe Black wrote:
> Hi folks. We've just started to run into some problems building on ARM
> because the systemc build fails out. While investigating, I found a couple
> problems which are to blame.
> 
> First, the SConscript seems to be assuming that it should be using the QT
> threading implementation which requires architecture specific assembly
> files. There is no file for ARM, so that will fail on ARM. Some Googling
> suggests that systemc can in fact be built for ARM, but it needs to use
> pthreads for its threading implementation.
> 
> That led me to discover that the files which should be used with pthreads,
> src/sysc/kernel/sc_cor_pthread.cpp, are already being included, and the
> -pthread flag is being enabled unconditionally. I think those things should
> be left out when using the QT threading library, and similarly the assembly
> file shouldn't be required when building on ARM with pthreads.
> 
> Gabe
> ___
> gem5-dev mailing list
> gem5-dev@gem5.org
> http://m5sim.org/mailman/listinfo/gem5-dev


-- 
Dipl.-Ing. Christian Menard
Research Assistant

TU Dresden
Faculty of Computer Science
Chair for Compiler Construction
01062 Dresden

Phone: +49 351 463-42441
e-Mail: christian.men...@tu-dresden.de

___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in public/gem5[master]: python: Remove unused readline import

2017-05-19 Thread Andreas Sandberg (Gerrit)
Andreas Sandberg has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/3421 )


Change subject: python: Remove unused readline import
..

python: Remove unused readline import

The readline module is imported by main.py but doesn't seem to be
used.

Change-Id: I7888e3b6ad0a0fedc14b0feec2adf0a39883bbf8
Signed-off-by: Andreas Sandberg 
Reviewed-on: https://gem5-review.googlesource.com/3421
Reviewed-by: Jason Lowe-Power 
---
M src/python/m5/main.py
1 file changed, 0 insertions(+), 4 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Andreas Sandberg: Looks good to me, approved



diff --git a/src/python/m5/main.py b/src/python/m5/main.py
index 4931430..ad45288 100644
--- a/src/python/m5/main.py
+++ b/src/python/m5/main.py
@@ -410,10 +410,6 @@
 scope = { '__file__' : filename,
   '__name__' : '__m5_main__' }

-# we want readline if we're doing anything interactive
-if options.interactive or options.pdb:
-exec "import readline" in scope
-
 # if pdb was requested, execfile the thing under pdb, otherwise,
 # just do the execfile normally
 if options.pdb:

--
To view, visit https://gem5-review.googlesource.com/3421
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7888e3b6ad0a0fedc14b0feec2adf0a39883bbf8
Gerrit-Change-Number: 3421
Gerrit-PatchSet: 2
Gerrit-Owner: Andreas Sandberg 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Weiping Liao 
Gerrit-CC: Nathan Binkert 
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in public/gem5[master]: base, sim, arch: Fix clang 5.0 warnings

2017-05-19 Thread Andreas Sandberg (Gerrit)
Andreas Sandberg has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/3420 )


Change subject: base, sim, arch: Fix clang 5.0 warnings
..

base, sim, arch: Fix clang 5.0 warnings

Compiling gem5 with recent version of clang (4 and 5) triggers
warnings that are treated as errors:

  * Global templatized static functions result in a warning if they
are not used. These should either be declared as static inline or
without the static identifier to avoid the warning.

  * Some templatized classes contain static variables. The
instantiated versions of these variables / templates need to be
explicitly declared to avoid a compiler warning.

Change-Id: Ie8261144836e94ebab7ea04b90927672c257
Signed-off-by: Andreas Sandberg 
Reviewed-by: Curtis Dunham 
Reviewed-on: https://gem5-review.googlesource.com/3420
Reviewed-by: Jason Lowe-Power 
---
M src/arch/arm/faults.hh
M src/arch/arm/insts/vfp.hh
M src/arch/arm/isa/insts/fp.isa
M src/arch/hsail/insts/decl.hh
M src/arch/mips/faults.hh
M src/arch/sparc/faults.hh
M src/base/circlebuf.hh
M src/sim/syscall_emul.hh
8 files changed, 125 insertions(+), 15 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Andreas Sandberg: Looks good to me, approved



diff --git a/src/arch/arm/faults.hh b/src/arch/arm/faults.hh
index ab4c675..6e7c92c 100644
--- a/src/arch/arm/faults.hh
+++ b/src/arch/arm/faults.hh
@@ -567,7 +567,8 @@
 };

 /*
- * Explicitly declare template static member variables avoid warnings in  
some clang versions

+ * Explicitly declare template static member variables to avoid warnings
+ * in some clang versions
  */
 template<> ArmFault::FaultVals ArmFaultVals::vals;
 template<> ArmFault::FaultVals ArmFaultVals::vals;
diff --git a/src/arch/arm/insts/vfp.hh b/src/arch/arm/insts/vfp.hh
index de0c621..caa2237 100644
--- a/src/arch/arm/insts/vfp.hh
+++ b/src/arch/arm/insts/vfp.hh
@@ -201,7 +201,7 @@
 }

 template 
-static bool
+static inline bool
 isSnan(fpType val)
 {
 const bool single = (sizeof(fpType) == sizeof(float));
diff --git a/src/arch/arm/isa/insts/fp.isa b/src/arch/arm/isa/insts/fp.isa
index 0f10a05..dc2f307 100644
--- a/src/arch/arm/isa/insts/fp.isa
+++ b/src/arch/arm/isa/insts/fp.isa
@@ -65,7 +65,7 @@
 };

 template 
-static StaticInstPtr
+StaticInstPtr
 decodeVfpRegRegOp(ExtMachInst machInst,
 IntRegIndex dest, IntRegIndex op1, bool wide)
 {
@@ -101,7 +101,7 @@
 };

 template 
-static StaticInstPtr
+StaticInstPtr
 decodeVfpRegImmOp(ExtMachInst machInst,
 IntRegIndex dest, uint64_t imm, bool wide)
 {
@@ -137,7 +137,7 @@
 };

 template 
-static StaticInstPtr
+StaticInstPtr
 decodeVfpRegRegImmOp(ExtMachInst machInst, IntRegIndex dest,
  IntRegIndex op1, uint64_t imm, bool wide)
 {
@@ -173,7 +173,7 @@
 };

 template 
-static StaticInstPtr
+StaticInstPtr
 decodeVfpRegRegRegOp(ExtMachInst machInst, IntRegIndex dest,
  IntRegIndex op1, IntRegIndex op2, bool wide)
 {
diff --git a/src/arch/hsail/insts/decl.hh b/src/arch/hsail/insts/decl.hh
index f84cb61..3132a42 100644
--- a/src/arch/hsail/insts/decl.hh
+++ b/src/arch/hsail/insts/decl.hh
@@ -1272,6 +1272,27 @@

 template T heynot(T arg) { return ~arg; }
 template<> inline bool heynot(bool arg) { return !arg; }
+
+
+/* Explicitly declare template static member variables to avoid
+ * warnings in some clang versions
+ */
+template<> const char *B1::label;
+template<> const char *B8::label;
+template<> const char *B16::label;
+template<> const char *B32::label;
+template<> const char *B64::label;
+template<> const char *S8::label;
+template<> const char *S16::label;
+template<> const char *S32::label;
+template<> const char *S64::label;
+template<> const char *U8::label;
+template<> const char *U16::label;
+template<> const char *U32::label;
+template<> const char *U64::label;
+template<> const char *F32::label;
+template<> const char *F64::label;
+
 } // namespace HsailISA

 #endif // __ARCH_HSAIL_INSTS_DECL_HH__
diff --git a/src/arch/mips/faults.hh b/src/arch/mips/faults.hh
index 1ec726d..dcce764 100644
--- a/src/arch/mips/faults.hh
+++ b/src/arch/mips/faults.hh
@@ -303,6 +303,30 @@
 ExcCode code() const { return MipsFault::code(); }
 };

+/*
+ * Explicitly declare template static member variables to avoid warnings
+ * in some clang versions
+ */
+template<> MipsFaultBase::FaultVals MipsFault::vals;
+template<> MipsFaultBase::FaultVals  
MipsFault::vals;

+template<> MipsFaultBase::FaultVals MipsFault::vals;
+template<> MipsFaultBase::FaultVals MipsFault::vals;
+template<> MipsFaultBase::FaultVals MipsFault::vals;
+template<> MipsFaultBase::FaultVals MipsFault::vals;
+template<> MipsFaultBase::FaultVals MipsFault::vals;
+template<> MipsFaultBase::FaultVals 

[gem5-dev] systemc build on ARM

2017-05-19 Thread Gabe Black
Hi folks. We've just started to run into some problems building on ARM
because the systemc build fails out. While investigating, I found a couple
problems which are to blame.

First, the SConscript seems to be assuming that it should be using the QT
threading implementation which requires architecture specific assembly
files. There is no file for ARM, so that will fail on ARM. Some Googling
suggests that systemc can in fact be built for ARM, but it needs to use
pthreads for its threading implementation.

That led me to discover that the files which should be used with pthreads,
src/sysc/kernel/sc_cor_pthread.cpp, are already being included, and the
-pthread flag is being enabled unconditionally. I think those things should
be left out when using the QT threading library, and similarly the assembly
file shouldn't be required when building on ARM with pthreads.

Gabe
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev