[gem5-dev] uninitialized union?

2017-05-17 Thread Álvaro Martínez López
Hi all,

this is the first time I write here, so apologize me in advance if this
question is not the kind of questions you ask here :) Besides, I'm not an
expert on the internal workings of GEM5, so I want to ask you guys:

if I open the generated file build/ARM/arch/arm/generated/exec-ns.cc.inc
and then go to the function MicroNeonLoad64,the data type union MemUnion is
defined:

const int MaxNumBytes = 16;
union MemUnion {
uint8_t bytes[MaxNumBytes];
uint32_t floatRegBits[MaxNumBytes / 4];
};


Some lines below that, we declare memUnion of type MemUnion, and initialize
only the first 8 bytes by calling readMem (accSize is 8)

MemUnion memUnion;
uint8_t *dataPtr = memUnion.bytes;

if (fault == NoFault) {
fault = xc->readMem(EA, dataPtr, accSize, memAccessFlags);


just below that line we declare VReg x and use memUnion.floatRegBits[2] and
memUnion.floatRegBits[3] to initialize x.hi.

VReg x = {0, 0};
x.lo = (((XReg) memUnion.floatRegBits[1]) << 32) |
(XReg) memUnion.floatRegBits[0];
x.hi = (((XReg) memUnion.floatRegBits[3]) << 32) |
(XReg) memUnion.floatRegBits[2];


However, presumably, memUnion.floatRegBits[2] and memUnion.floatRegBits[3]
have not been initialized by readMem, therefore, x.hi gets random data.


The checker is complaining about this. If I add the following line just
after declaring memUnion, the problem seems to be solved.

memset(, 0x0, sizeof(MemUnion));


Any suggestion?

Thanks,

Regards,

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

[gem5-dev] clang-format tool for C++ code auto-formatting

2017-05-17 Thread Rahul Thakur
Hi all,

Re:
misc: Add .clang-format for C++ autoformat tools
https://gem5-review.googlesource.com/#/c/3382/

Gabe uploaded this change set which is an internal version of .clang-format
configuration which IMO formats closest to gem5 style guide definitions.

I have happily used clang-format for ~2 years now (still learning) and it
has saved me time developing C++ code and humiliating code reviews.
So I start this discussion, hopefully we can mutually agree if and how we
can adopt clang-format for gem5 project.

It seems folks agree that there is considerable advantage of using
clang-format for C++ code auto-formatting but there exist some specific C++
code in gem5 that is incompatible. I list a few known issues and possible
remedy.
1) BitUnion or any other macros:
The ideal solution is to implement support for macro in clang-format but
IMO this is quite complicated and unlikely to happen without significantly
changing clang-format tool itself.
A simple work around for this issue is to use:
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#disabling-formatting-on-a-piece-of-code

2) switch case label indentation:
Since switch case indentation has many observed rules depending on
different SW project, we can define the gem5 style guide to either keep
case label indentation same as switch statement or 4 spaces indented. Both
these are programmable in clang-format configuration via IndentCaseLabels
parameter.

3) clang-format doesn't check "naming" convention:
This is out of scope of clang-format
Internally at Google we use cpplint
 and gem5 style
checker can incorporate checking naming convention.

4) Accepting on a certain .clang-format configuration for gem5 and then
revising the gem5 code base:
e.g. following a specific rule on how constructor initialization list is
formatted and revising existing code base to comply with agreed upon
.clang-format configuration

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

[gem5-dev] Change in public/gem5[master]: sim: Add hooks to implement event reference counting

2017-05-17 Thread Andreas Sandberg (Gerrit)

Hello Gabe Black, Jason Lowe-Power, Nathan Binkert, Curtis Dunham,

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

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

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

Change subject: sim: Add hooks to implement event reference counting
..

sim: Add hooks to implement event reference counting

We currently only support deleting an event if it is triggered and not
re-scheduled. This is fine for most native code. However, there are
cases where Python needs to count references to make sure that the
Python object stays live while the native object is live.

Generalise the mechanism used to implement by adding reference
counting hooks to the event base class:

  * Event::incref()
  * Event::decref()

These calls are used to increase and decrease the reference count of
an object. The default implementation in Event maintains backwards
compatibility with the existing AutoDelete feature by ignoring
incref() and deleting the event on decref() if it isn't scheduled
anymore.

For performance and backwards-compatibility reasons, these methods are
only called when the Managed/AutoDelete flag is set.

Change-Id: I5637984c906a9d44c22780712cf1c521b8297149
Signed-off-by: Andreas Sandberg 
Reviewed-by: Curtis Dunham 
---
M src/sim/eventq.cc
M src/sim/eventq.hh
M src/sim/eventq_impl.hh
3 files changed, 53 insertions(+), 7 deletions(-)


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

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I5637984c906a9d44c22780712cf1c521b8297149
Gerrit-Change-Number: 3221
Gerrit-PatchSet: 2
Gerrit-Owner: Andreas Sandberg 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Curtis Dunham 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Nathan Binkert 
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in public/gem5[master]: python: Fix PyEvent reference counting bug

2017-05-17 Thread Andreas Sandberg (Gerrit)

Hello Gabe Black, Jason Lowe-Power, Nathan Binkert, Curtis Dunham,

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

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

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

Change subject: python: Fix PyEvent reference counting bug
..

python: Fix PyEvent reference counting bug

The current implementation of reference counting for PyEvents only
partially works. The native object is currently kept alive while it is
in the event queue. However, if the Python object goes out of scope,
the Python side of this object is garbage collected which leaves a
"dangling" native object. This results in confusing error messages
where PyBind is unable to find the Python implementation of an event
when it is triggered.

Implement reference counting using the generalized reference counting
API instead.

Change-Id: I4e8e04abc4f61dff238d718065f5371e73b38ab3
Signed-off-by: Andreas Sandberg 
Reviewed-by: Curtis Dunham 
---
M src/python/m5/event.py
M src/python/pybind11/event.cc
2 files changed, 46 insertions(+), 46 deletions(-)


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

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4e8e04abc4f61dff238d718065f5371e73b38ab3
Gerrit-Change-Number: 3222
Gerrit-PatchSet: 2
Gerrit-Owner: Andreas Sandberg 
Gerrit-Reviewer: Curtis Dunham 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Nathan Binkert 
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in public/gem5[master]: config: Changes to boot Android N

2017-05-17 Thread Gabe Black (Gerrit)
Gabe Black has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/3320 )


Change subject: config: Changes to boot Android N
..

config: Changes to boot Android N

necessary kernel command line options in FSConfig.py

Change-Id: Id66f640b6beb4efa9c23080c3d2516eda688c72d
Reviewed-on: https://gem5-review.googlesource.com/3320
Reviewed-by: Andreas Sandberg 
Maintainer: Andreas Sandberg 
---
M configs/common/FSConfig.py
1 file changed, 10 insertions(+), 2 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved



diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py
index 3a169a4..cf9f034 100644
--- a/configs/common/FSConfig.py
+++ b/configs/common/FSConfig.py
@@ -53,7 +53,8 @@
  'android-gingerbread',
  'android-ics',
  'android-jellybean',
- 'android-kitkat' ],
+ 'android-kitkat',
+ 'android-nougat', ],
}

 class CowIdeDisk(IdeDisk):
@@ -347,7 +348,14 @@
 # release-specific tweaks
 if 'kitkat' in mdesc.os_type():
 cmdline += " androidboot.hardware=gem5 qemu=1  
qemu.gles=0 " + \

-   "android.bootanim=0"
+   "android.bootanim=0 "
+elif 'nougat' in mdesc.os_type():
+cmdline += " androidboot.hardware=gem5 qemu=1  
qemu.gles=0 " + \

+   "android.bootanim=0 " + \
+   "vmalloc=640MB " + \
+   "android.early.fstab=/fstab.gem5 " + \
+   "androidboot.selinux=permissive " + \
+   "video=Virtual-1:1920x1080-16"

 self.boot_osflags = fillInCmdline(mdesc, cmdline)


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

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id66f640b6beb4efa9c23080c3d2516eda688c72d
Gerrit-Change-Number: 3320
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Weiping Liao 
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

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

2017-05-17 Thread Cron Daemon
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64m/minor-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-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-rv64f/minor-timing: 
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: 
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-rv64m/o3-timing: 
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-rv64d/simple-timing-ruby:
 CHANGED!
* build/RISCV/tests/opt/quick/se/00.hello/riscv/linux/minor-timing: 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-rv64f/o3-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-rv64a/simple-atomic: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64a/simple-timing-ruby:
 CHANGED!
* build/RISCV/tests/opt/quick/se/00.hello/riscv/linux/simple-timing: 
CHANGED!
* build/RISCV/tests/opt/quick/se/00.hello/riscv/linux/o3-timing: CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64a/simple-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-rv64f/simple-atomic: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64m/simple-atomic: 
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/NULL_MESI_Two_Level/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MESI_Two_Level:
 passed.
* 
build/NULL_MOESI_hammer/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MOESI_hammer:
 passed.
* build/NULL/tests/opt/quick/se/70.tgen/null/none/tgen-simple-mem: passed.
* 
build/NULL_MOESI_CMP_directory/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MOESI_CMP_directory:
 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/60.rubytest/null/none/rubytest-ruby: 
passed.Delete("build/NULL_MOESI_CMP_token/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MOESI_CMP_token/stats.txt")
* 
build/NULL_MOESI_CMP_token/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MOESI_CMP_token:
 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/MIPS/tests/opt/quick/se/00.hello/mips/linux/o3-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-timing: 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-simple:
 passed.
* 
build/MIPS/tests/opt/quick/se/03.learning-gem5/mips/linux/learning-gem5-p1-two-level:
 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/00.hello/sparc/linux/simple-timing-ruby: 
passed.
* build/SPARC/tests/opt/quick/se/02.insttest/sparc/linux/o3-timing: 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-timing: passed.
* 
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/40.m5threads-test-atomic/sparc/linux/simple-timing-mp:
 passed.
* build/SPARC/tests/opt/quick/se/00.hello/sparc/linux/simple-atomic: passed.
* 
build/SPARC/tests/opt/quick/se/40.m5threads-test-atomic/sparc/linux/o3-timing-mp:
 passed.
*