[gem5-dev] Cron /z/m5/regression/do-regression quick

2019-02-21 Thread Cron Daemon
* build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64f/o3-timing: 
FAILED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64c/simple-atomic: 
FAILED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64c/simple-timing: 
FAILED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64c/minor-timing: 
FAILED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64c/simple-timing-ruby:
 FAILED!
* build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64c/o3-timing: 
FAILED!
* build/ALPHA/tests/opt/quick/se/00.hello/alpha/linux/simple-timing-ruby: 
CHANGED!
* build/MIPS/tests/opt/quick/se/00.hello/mips/linux/o3-timing: CHANGED!
* build/MIPS/tests/opt/quick/se/00.hello/mips/linux/simple-timing-ruby: 
CHANGED!
* build/MIPS/tests/opt/quick/se/00.hello/mips/linux/simple-timing: CHANGED!
* 
build/MIPS/tests/opt/quick/se/03.learning-gem5/mips/linux/learning-gem5-p1-two-level:
 CHANGED!
* build/MIPS/tests/opt/quick/se/00.hello/mips/linux/simple-atomic: CHANGED!
* 
build/MIPS/tests/opt/quick/se/03.learning-gem5/mips/linux/learning-gem5-p1-simple:
 CHANGED!
* 
build/NULL_MOESI_hammer/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MOESI_hammer:
 CHANGED!
* build/ALPHA/tests/opt/quick/se/00.hello/alpha/linux/o3-timing: CHANGED!
* 
build/ALPHA/tests/opt/quick/fs/10.linux-boot/alpha/linux/tsunami-simple-atomic: 
CHANGED!
* build/ALPHA/tests/opt/quick/se/01.hello-2T-smt/alpha/linux/o3-timing-mt: 
CHANGED!
* build/NULL/tests/opt/quick/se/80.dram-openpage/null/none/dram-lowp: 
CHANGED!
* 
build/NULL_MESI_Two_Level/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MESI_Two_Level:
 CHANGED!
* build/NULL/tests/opt/quick/se/80.dram-closepage/null/none/dram-lowp: 
CHANGED!
* build/NULL/tests/opt/quick/se/70.tgen/null/none/tgen-simple-mem: CHANGED!
* build/NULL/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby: 
CHANGED!
* build/NULL/tests/opt/quick/se/70.tgen/null/none/tgen-dram-ctrl: CHANGED!
* 
build/NULL_MOESI_CMP_directory/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MOESI_CMP_directory:
 CHANGED!
* 
build/ALPHA/tests/opt/quick/se/03.learning-gem5/alpha/linux/learning-gem5-p1-two-level:
 CHANGED!
* build/ALPHA/tests/opt/quick/se/00.hello/alpha/linux/simple-timing: 
CHANGED!
* build/ALPHA/tests/opt/quick/se/00.hello/alpha/linux/simple-atomic: 
CHANGED!
* build/ALPHA/tests/opt/quick/se/00.hello/alpha/linux/minor-timing: CHANGED!
* 
build/ALPHA/tests/opt/quick/se/03.learning-gem5/alpha/linux/learning-gem5-p1-simple:
 CHANGED!
* 
build/NULL_MOESI_CMP_token/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MOESI_CMP_token:
 CHANGED!
* 
build/ALPHA/tests/opt/quick/fs/10.linux-boot/alpha/linux/tsunami-simple-atomic-dual:
 CHANGED!
* 
build/ALPHA/tests/opt/quick/fs/10.linux-boot/alpha/linux/tsunami-simple-timing: 
CHANGED!
* 
build/ALPHA/tests/opt/quick/fs/10.linux-boot/alpha/linux/tsunami-simple-timing-dual:
 CHANGED!
* build/POWER/tests/opt/quick/se/00.hello/power/linux/simple-atomic: 
CHANGED!
* build/POWER/tests/opt/quick/se/00.hello/power/linux/o3-timing: CHANGED!
* build/SPARC/tests/opt/quick/se/02.insttest/sparc/linux/simple-atomic: 
CHANGED!
* build/ARM/tests/opt/quick/se/00.hello/arm/linux/simple-atomic: CHANGED!
* 
build/HSAIL_X86/tests/opt/quick/se/60.gpu-randomtest/x86/linux/gpu-randomtest-ruby-GPU_RfO:
 CHANGED!
* build/HSAIL_X86/tests/opt/quick/se/04.gpu/x86/linux/gpu-ruby-GPU_RfO: 
CHANGED!
* build/SPARC/tests/opt/quick/se/50.vortex/sparc/linux/simple-atomic: 
CHANGED!
* 
build/ARM/tests/opt/quick/se/03.learning-gem5/arm/linux/learning-gem5-p1-simple:
 CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64i/simple-timing-ruby:
 CHANGED!
* build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64a/o3-timing: 
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-rv64i/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-rv64i/minor-timing: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64a/simple-timing-ruby:
 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/minor-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-rv64d/minor-timing: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64i/simple-atomic: 
CHANGED!
* 
build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64f/simple-timing-ruby:
 CHANGED!
* build/RISCV/tests/opt/quick

Re: [gem5-dev] pybind11 _m5 submodules vs. m5 submodules

2019-02-21 Thread Andreas Sandberg
You should be able to include Python modules in any package using PySource in 
SCons. The first parameter informs the build system of the package name, so it 
should work just fine in EXTRAS.

Cheers,
Andreas

On 20/02/2019 23:04, Gabe Black wrote:
Oh, I see one point of confusion I had. I had thought the built in module 
initialization functions (pybind_init_core, pybind_init_stats, etc) were 
installing things under the m5 module, but they're really installing things 
under the _m5 module. I think I missed that since the _ isn't obvious in the 
variable that holds the module, m_m5.

It seems fine to me to add a purely python m5 submodule (like m5.systemc and/or 
m5.tlm) and have that if nothing else just import and pass through the _m5 
versions of the same. I think the problem then becomes, how do I add a systemc 
or tlm submodule to m5 without adding the code under src/python/m5? Putting the 
code there would be mostly ok since systemc and tlm are part of the main gem5 
code base, but is there a way to bring that sort of thing in with EXTRAS? Maybe 
that's overkill for something that may not be that important, ie major bits of 
functionality that deserve highly integrated python interfaces but are still 
not part of the primary code base.

Anyway, I think I know how to make what I was initially after work without 
having to do anything overly weird and without any additional machinery. Thanks!

Gabe

On Wed, Feb 20, 2019 at 8:38 AM Andreas Sandberg 
mailto:andreas.sandb...@arm.com>> wrote:
Hi Gabe,

I think this might make sense. As you have probably seen already, the
main intention of the _m5 namespace is to hide the potentially clunky
C++-like interfaces from the normal m5 namespace. A common design
pattern for native Python packages used to be to have a native namespace
that provides a low-level API and then wrap it using Python code to
provide a more high-level API. "m5/event.py" is a pretty good example of
this design pattern.

I'm not entirely sure how well it would work to combine native code and
Python code in the same namespace. Importing the m5 module and adding to
it could work, but it depends on the initialization order and seems a
bit scary. What we used to do in the past for this was to add a
pseudo-package in native Python code that just re-exports the native
functionality. Would this solve the problem?

Cheers,
Andreas

On 15/02/2019 02:10, Gabe Black wrote:
> Hey folks. For the systemc stuff I currently use our pybind11
> infrastructure to define and populate a _m5.systemc submodule, but I'd like
> to make that m5.systemc so it seems less hacky to use explicitly, and
> perhaps even an m5.tlm.
>
> Is this something that makes sense to do? There aren't hooks for it atm,
> but I'm thinking I can get it to work by importing the m5 module in my
> EmbeddedPyBind hook and then adding things to it that way. That also seems
> hacky, but should it work? Would it be worth adding hooks to add submodules
> to the non-internal m5 module?
>
> Gabe
> ___
> gem5-dev mailing list
> gem5-dev@gem5.org
> http://m5sim.org/mailman/listinfo/gem5-dev
IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: scons: Add support for specifying Python version

2019-02-21 Thread Andreas Sandberg (Gerrit)
Hello Gabe Black, Jason Lowe-Power, Juha Jäykkä, Giacomo Travaglini, Ciro  
Santilli,


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

https://gem5-review.googlesource.com/c/public/gem5/+/16003

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

Change subject: scons: Add support for specifying Python version
..

scons: Add support for specifying Python version

Add a sticky variable (PYTHON_CONFIG) to select which python-config
version to use. This can, for example, be used to build with Python 3
or with Python 2.7 in a custom location.

Change-Id: I1f4c00d66f85a9c99f50fe4d746b69dd82b60b4b
Signed-off-by: Andreas Sandberg 
---
M SConstruct
1 file changed, 23 insertions(+), 7 deletions(-)


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


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I1f4c00d66f85a9c99f50fe4d746b69dd82b60b4b
Gerrit-Change-Number: 16003
Gerrit-PatchSet: 7
Gerrit-Owner: Andreas Sandberg 
Gerrit-Assignee: Gabe Black 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Ciro Santilli 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Juha Jäykkä 
Gerrit-MessageType: newpatchset
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: scons: Marshal Python sources using the same Python as gem5

2019-02-21 Thread Andreas Sandberg (Gerrit)

Hello Gabe Black, Giacomo Travaglini,

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

https://gem5-review.googlesource.com/c/public/gem5/+/16422

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

Change subject: scons: Marshal Python sources using the same Python as gem5
..

scons: Marshal Python sources using the same Python as gem5

We currently use the Python version used by scons to marshal Python
code. This doesn't work when building gem5 with Python 3 support since
scons typically runs in Python 2.7. Add a custom marshal helper that
links with the same library as gem5 to generate byte code that is
guaranteed to work in gem5's Python interpreter.

Change-Id: I665b0f2078726d4c055d74a3e668a580fc613b59
Signed-off-by: Andreas Sandberg 
---
M SConstruct
M src/SConscript
A src/python/marshal.cc
3 files changed, 82 insertions(+), 7 deletions(-)


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


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I665b0f2078726d4c055d74a3e668a580fc613b59
Gerrit-Change-Number: 16422
Gerrit-PatchSet: 3
Gerrit-Owner: Andreas Sandberg 
Gerrit-Assignee: Gabe Black 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-MessageType: newpatchset
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Re: [gem5-dev] pybind11 _m5 submodules vs. m5 submodules

2019-02-21 Thread Gabe Black
Yeah, I thought that was going to be true after I'd sent my earlier email
and after I started working on it more, but it seemed that I had to import
systemc and tlm in src/python/m5/__init__.py to get them to show up in the
scripts. Is it some sort of thing where I'd have to import m5.systemc and
not just m5?

In any case I think it's working well enough for my purposes, one way or
the other.

Gabe

On Thu, Feb 21, 2019 at 2:29 AM Andreas Sandberg 
wrote:

> You should be able to include Python modules in any package using PySource
> in SCons. The first parameter informs the build system of the package name,
> so it should work just fine in EXTRAS.
>
> Cheers,
> Andreas
> On 20/02/2019 23:04, Gabe Black wrote:
>
> Oh, I see one point of confusion I had. I had thought the built in module
> initialization functions (pybind_init_core, pybind_init_stats, etc) were
> installing things under the m5 module, but they're really installing things
> under the _m5 module. I think I missed that since the _ isn't obvious in
> the variable that holds the module, m_m5.
>
> It seems fine to me to add a purely python m5 submodule (like m5.systemc
> and/or m5.tlm) and have that if nothing else just import and pass through
> the _m5 versions of the same. I think the problem then becomes, how do I
> add a systemc or tlm submodule to m5 without adding the code under
> src/python/m5? Putting the code there would be mostly ok since systemc and
> tlm are part of the main gem5 code base, but is there a way to bring that
> sort of thing in with EXTRAS? Maybe that's overkill for something that may
> not be that important, ie major bits of functionality that deserve highly
> integrated python interfaces but are still not part of the primary code
> base.
>
> Anyway, I think I know how to make what I was initially after work without
> having to do anything overly weird and without any additional machinery.
> Thanks!
>
> Gabe
>
> On Wed, Feb 20, 2019 at 8:38 AM Andreas Sandberg 
> wrote:
>
>> Hi Gabe,
>>
>> I think this might make sense. As you have probably seen already, the
>> main intention of the _m5 namespace is to hide the potentially clunky
>> C++-like interfaces from the normal m5 namespace. A common design
>> pattern for native Python packages used to be to have a native namespace
>> that provides a low-level API and then wrap it using Python code to
>> provide a more high-level API. "m5/event.py" is a pretty good example of
>> this design pattern.
>>
>> I'm not entirely sure how well it would work to combine native code and
>> Python code in the same namespace. Importing the m5 module and adding to
>> it could work, but it depends on the initialization order and seems a
>> bit scary. What we used to do in the past for this was to add a
>> pseudo-package in native Python code that just re-exports the native
>> functionality. Would this solve the problem?
>>
>> Cheers,
>> Andreas
>>
>> On 15/02/2019 02:10, Gabe Black wrote:
>> > Hey folks. For the systemc stuff I currently use our pybind11
>> > infrastructure to define and populate a _m5.systemc submodule, but I'd
>> like
>> > to make that m5.systemc so it seems less hacky to use explicitly, and
>> > perhaps even an m5.tlm.
>> >
>> > Is this something that makes sense to do? There aren't hooks for it atm,
>> > but I'm thinking I can get it to work by importing the m5 module in my
>> > EmbeddedPyBind hook and then adding things to it that way. That also
>> seems
>> > hacky, but should it work? Would it be worth adding hooks to add
>> submodules
>> > to the non-internal m5 module?
>> >
>> > Gabe
>> > ___
>> > gem5-dev mailing list
>> > gem5-dev@gem5.org
>> > http://m5sim.org/mailman/listinfo/gem5-dev
>> IMPORTANT NOTICE: The contents of this email and any attachments are
>> confidential and may also be privileged. If you are not the intended
>> recipient, please notify the sender immediately and do not disclose the
>> contents to any other person, use it for any purpose, or store or copy the
>> information in any medium. Thank you.
>>
> IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose the
> contents to any other person, use it for any purpose, or store or copy the
> information in any medium. Thank you.
>
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: mem-cache: A Best-Offset Prefetcher

2019-02-21 Thread Ivan Pizarro (Gerrit)

Hello Nikos Nikoleris, krishnendra nathella, Dam Sunwoo, Daniel Carvalho,

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

https://gem5-review.googlesource.com/c/public/gem5/+/14820

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

Change subject: mem-cache: A Best-Offset Prefetcher
..

mem-cache: A Best-Offset Prefetcher

Michaud, P. (2015, June). A best-offset prefetcher.
In 2nd Data Prefetching Championship.

Change-Id: I61bb89ca5639356d54aeb04e856d5bf6e8805c22
---
M src/mem/cache/base.cc
M src/mem/cache/base.hh
M src/mem/cache/prefetch/Prefetcher.py
M src/mem/cache/prefetch/SConscript
M src/mem/cache/prefetch/base.cc
M src/mem/cache/prefetch/base.hh
A src/mem/cache/prefetch/bop.cc
A src/mem/cache/prefetch/bop.hh
8 files changed, 465 insertions(+), 3 deletions(-)


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


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I61bb89ca5639356d54aeb04e856d5bf6e8805c22
Gerrit-Change-Number: 14820
Gerrit-PatchSet: 8
Gerrit-Owner: Ivan Pizarro 
Gerrit-Assignee: Nikos Nikoleris 
Gerrit-Reviewer: Dam Sunwoo 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Ivan Pizarro 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-Reviewer: krishnendra nathella 
Gerrit-CC: Andreas Sandberg 
Gerrit-CC: Juha Jäykkä 
Gerrit-MessageType: newpatchset
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: cpu-o3: Add cache read ports limit to LSQ

2019-02-21 Thread Gabor Dozsa (Gerrit)
Gabor Dozsa has uploaded a new patch set (#13) to the change originally  
created by Giacomo Gabrielli. (  
https://gem5-review.googlesource.com/c/public/gem5/+/13517 )


Change subject: cpu-o3: Add cache read ports limit to LSQ
..

cpu-o3: Add cache read ports limit to LSQ

This change introduces cache read ports to limit the number of
per-cycle loads. Previously only the number of per-cycle stores
could be limited.

Change-Id: I39bbd984056c5a696725ee2db462a55b2079e2d4
Signed-off-by: Gabor Dozsa 
Reviewed-by: Giacomo Gabrielli 
---
M src/cpu/o3/O3CPU.py
M src/cpu/o3/lsq.hh
M src/cpu/o3/lsq_impl.hh
M src/cpu/o3/lsq_unit_impl.hh
4 files changed, 42 insertions(+), 13 deletions(-)


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


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I39bbd984056c5a696725ee2db462a55b2079e2d4
Gerrit-Change-Number: 13517
Gerrit-PatchSet: 13
Gerrit-Owner: Giacomo Gabrielli 
Gerrit-Reviewer: Anthony Gutierrez 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Gabor Dozsa 
Gerrit-Reviewer: Giacomo Gabrielli 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-CC: Jason Lowe-Power 
Gerrit-MessageType: newpatchset
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: mem-cache: Added the Slim AMPM Prefetcher

2019-02-21 Thread Javier Bueno Hedo (Gerrit)
Javier Bueno Hedo has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/c/public/gem5/+/16383 )


Change subject: mem-cache: Added the Slim AMPM Prefetcher
..

mem-cache: Added the Slim AMPM Prefetcher

Reference:
Towards Bandwidth-Efficient Prefetching with Slim AMPM.
Young, V., & Krishna, A. (2015). The 2nd Data Prefetching Championship.

Slim AMPM is composed of two prefetchers, the DPCT and the AMPM (both  
already

in gem5).

Change-Id: I6e868faf216e3e75231cf181d59884ed6f0d382a
Reviewed-on: https://gem5-review.googlesource.com/c/16383
Reviewed-by: Nikos Nikoleris 
Maintainer: Nikos Nikoleris 
---
M src/mem/cache/prefetch/Prefetcher.py
M src/mem/cache/prefetch/SConscript
M src/mem/cache/prefetch/access_map_pattern_matching.cc
M src/mem/cache/prefetch/access_map_pattern_matching.hh
A src/mem/cache/prefetch/slim_ampm.cc
A src/mem/cache/prefetch/slim_ampm.hh
6 files changed, 214 insertions(+), 24 deletions(-)

Approvals:
  Nikos Nikoleris: Looks good to me, approved; Looks good to me, approved



diff --git a/src/mem/cache/prefetch/Prefetcher.py  
b/src/mem/cache/prefetch/Prefetcher.py

index 2c31de9..36e2541 100644
--- a/src/mem/cache/prefetch/Prefetcher.py
+++ b/src/mem/cache/prefetch/Prefetcher.py
@@ -204,11 +204,16 @@
 global_history_register_replacement_policy =  
Param.BaseReplacementPolicy(

 LRURP(), "Replacement policy of the global history register")

-class AccessMapPatternMatchingPrefetcher(QueuedPrefetcher):
-type = 'AccessMapPatternMatchingPrefetcher'
-cxx_class = 'AccessMapPatternMatchingPrefetcher'
+class AccessMapPatternMatching(ClockedObject):
+type = 'AccessMapPatternMatching'
+cxx_class = 'AccessMapPatternMatching'
 cxx_header = "mem/cache/prefetch/access_map_pattern_matching.hh"

+block_size = Param.Unsigned(Parent.block_size,
+"Cacheline size used by the prefetcher using this object")
+
+limit_stride = Param.Unsigned(0,
+"Limit the strides checked up to -X/X, if 0, disable the limit")
 start_degree = Param.Unsigned(4,
 "Initial degree (Maximum number of prefetches generated")
 hot_zone_size = Param.MemorySize("2kB", "Memory covered by a hot zone")
@@ -238,6 +243,13 @@
 offchip_memory_latency = Param.Latency("30ns",
 "Memory latency used to compute the required memory bandwidth")

+class AMPMPrefetcher(QueuedPrefetcher):
+type = 'AMPMPrefetcher'
+cxx_class = 'AMPMPrefetcher'
+cxx_header = "mem/cache/prefetch/access_map_pattern_matching.hh"
+ampm = Param.AccessMapPatternMatching( AccessMapPatternMatching(),
+"Access Map Pattern Matching object")
+
 class DeltaCorrelatingPredictionTables(SimObject):
 type = 'DeltaCorrelatingPredictionTables'
 cxx_class = 'DeltaCorrelatingPredictionTables'
@@ -309,3 +321,23 @@
 sp_address_map_cache_replacement_policy = Param.BaseReplacementPolicy(
 LRURP(),
 "Replacement policy of the Structural-to-Physical Address Map  
Cache")

+
+class SlimAccessMapPatternMatching(AccessMapPatternMatching):
+start_degree = 2
+limit_stride = 4
+
+class  
SlimDeltaCorrelatingPredictionTables(DeltaCorrelatingPredictionTables):

+table_entries = "256"
+table_assoc = 256
+deltas_per_entry = 9
+
+class SlimAMPMPrefetcher(QueuedPrefetcher):
+type = 'SlimAMPMPrefetcher'
+cxx_class = 'SlimAMPMPrefetcher'
+cxx_header = "mem/cache/prefetch/slim_ampm.hh"
+
+ampm = Param.AccessMapPatternMatching(SlimAccessMapPatternMatching(),
+"Access Map Pattern Matching object")
+dcpt = Param.DeltaCorrelatingPredictionTables(
+SlimDeltaCorrelatingPredictionTables(),
+"Delta Correlating Prediction Tables object")
diff --git a/src/mem/cache/prefetch/SConscript  
b/src/mem/cache/prefetch/SConscript

index 0a209ff..48ee218 100644
--- a/src/mem/cache/prefetch/SConscript
+++ b/src/mem/cache/prefetch/SConscript
@@ -39,5 +39,6 @@
 Source('queued.cc')
 Source('signature_path.cc')
 Source('signature_path_v2.cc')
+Source('slim_ampm.cc')
 Source('stride.cc')
 Source('tagged.cc')
diff --git a/src/mem/cache/prefetch/access_map_pattern_matching.cc  
b/src/mem/cache/prefetch/access_map_pattern_matching.cc

index 0f46eff..df2a9f7 100644
--- a/src/mem/cache/prefetch/access_map_pattern_matching.cc
+++ b/src/mem/cache/prefetch/access_map_pattern_matching.cc
@@ -32,11 +32,12 @@

 #include "debug/HWPrefetch.hh"
 #include "mem/cache/prefetch/associative_set_impl.hh"
-#include "params/AccessMapPatternMatchingPrefetcher.hh"
+#include "params/AMPMPrefetcher.hh"
+#include "params/AccessMapPatternMatching.hh"

-AccessMapPatternMatchingPrefetcher::AccessMapPatternMatchingPrefetcher(
-const AccessMapPatternMatchingPrefetcherParams *p)
-: QueuedPrefetcher(p),
+AccessMapPatternMatching::AccessMapPatternMatching(
+const AccessMapPatternMatchingParams *p)
+: ClockedObject(p), blkSize(p->block_size),  
limitStr

[gem5-dev] Change in gem5/gem5[master]: mem-cache: Added the Slim AMPM Prefetcher

2019-02-21 Thread Javier Bueno Hedo (Gerrit)

Hello Nikos Nikoleris, Daniel Carvalho, Andreas Sandberg,

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

https://gem5-review.googlesource.com/c/public/gem5/+/16383

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

Change subject: mem-cache: Added the Slim AMPM Prefetcher
..

mem-cache: Added the Slim AMPM Prefetcher

Reference:
Towards Bandwidth-Efficient Prefetching with Slim AMPM.
Young, V., & Krishna, A. (2015). The 2nd Data Prefetching Championship.

Slim AMPM is composed of two prefetchers, the DPCT and the AMPM (both  
already

in gem5).

Change-Id: I6e868faf216e3e75231cf181d59884ed6f0d382a
---
M src/mem/cache/prefetch/Prefetcher.py
M src/mem/cache/prefetch/SConscript
M src/mem/cache/prefetch/access_map_pattern_matching.cc
M src/mem/cache/prefetch/access_map_pattern_matching.hh
A src/mem/cache/prefetch/slim_ampm.cc
A src/mem/cache/prefetch/slim_ampm.hh
6 files changed, 214 insertions(+), 24 deletions(-)


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


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I6e868faf216e3e75231cf181d59884ed6f0d382a
Gerrit-Change-Number: 16383
Gerrit-PatchSet: 3
Gerrit-Owner: Javier Bueno Hedo 
Gerrit-Assignee: Nikos Nikoleris 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Javier Bueno Hedo 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-MessageType: newpatchset
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: mem-cache: Add a mechanism to iterate all entries of an AssociativeSet

2019-02-21 Thread Javier Bueno Hedo (Gerrit)
Javier Bueno Hedo has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/16582



Change subject: mem-cache: Add a mechanism to iterate all entries of an  
AssociativeSet

..

mem-cache: Add a mechanism to iterate all entries of an AssociativeSet

Added functions to obtain an iterator to access all entries of
an AssociativeSet container.

Change-Id: I1ec555bd97d97e3edaced2b8f61287e922279c26
---
M src/mem/cache/prefetch/associative_set.hh
1 file changed, 42 insertions(+), 0 deletions(-)



diff --git a/src/mem/cache/prefetch/associative_set.hh  
b/src/mem/cache/prefetch/associative_set.hh

index 99b6a6d..e4e1b04 100644
--- a/src/mem/cache/prefetch/associative_set.hh
+++ b/src/mem/cache/prefetch/associative_set.hh
@@ -195,6 +195,48 @@
  * @param entry pointer to the container entry to be inserted
  */
 void insertEntry(Addr addr, bool is_secure, Entry* entry);
+
+/** Iterator types */
+using const_iterator = typename std::vector::const_iterator;
+using iterator = typename std::vector::iterator;
+
+/**
+ * Returns an iterator to the first entry of the dictionary
+ * @result iterator to the first element
+ */
+iterator begin()
+{
+return entries.begin();
+}
+
+/**
+ * Returns an iterator pointing to the end of the the dictionary
+ * (placeholder element, should not be accessed)
+ * @result iterator to the end element
+ */
+iterator end()
+{
+return entries.end();
+}
+
+/**
+ * Returns an iterator to the first entry of the dictionary
+ * @result iterator to the first element
+ */
+const_iterator begin() const
+{
+return entries.begin();
+}
+
+/**
+ * Returns an iterator pointing to the end of the the dictionary
+ * (placeholder element, should not be accessed)
+ * @result iterator to the end element
+ */
+const_iterator end() const
+{
+return entries.end();
+}
 };

 #endif//__CACHE_PREFETCH_ASSOCIATIVE_SET_HH__

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


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I1ec555bd97d97e3edaced2b8f61287e922279c26
Gerrit-Change-Number: 16582
Gerrit-PatchSet: 1
Gerrit-Owner: Javier Bueno Hedo 
Gerrit-MessageType: newchange
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: mem-cache: Added extra information to PrefetchInfo

2019-02-21 Thread Javier Bueno Hedo (Gerrit)
Javier Bueno Hedo has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/16583



Change subject: mem-cache: Added extra information to PrefetchInfo
..

mem-cache: Added extra information to PrefetchInfo

Added additional information to the PrefetchInfo data structure
- Whether the event is triggered by a cache miss
- Whether the event is a write or a read
- Size of the data accessed
- Data accessed by the request

Change-Id: I070f3ffe837ea960a357388e7f2b8a61d7b2196c
---
M src/mem/cache/prefetch/base.cc
M src/mem/cache/prefetch/base.hh
2 files changed, 97 insertions(+), 23 deletions(-)



diff --git a/src/mem/cache/prefetch/base.cc b/src/mem/cache/prefetch/base.cc
index cd3eade..7cc2b30 100644
--- a/src/mem/cache/prefetch/base.cc
+++ b/src/mem/cache/prefetch/base.cc
@@ -56,23 +56,29 @@
 #include "params/BasePrefetcher.hh"
 #include "sim/system.hh"

-BasePrefetcher::PrefetchInfo::PrefetchInfo(PacketPtr pkt, Addr addr)
+BasePrefetcher::PrefetchInfo::PrefetchInfo(PacketPtr pkt, Addr addr, bool  
miss)

   : address(addr), pc(pkt->req->hasPC() ? pkt->req->getPC() : 0),
 masterId(pkt->req->masterId()), validPC(pkt->req->hasPC()),
-secure(pkt->isSecure())
+secure(pkt->isSecure()), size(pkt->req->getSize()),  
write(pkt->isWrite()),

+paddress(pkt->req->getPaddr()), cacheMiss(miss)
 {
+unsigned int req_size = pkt->req->getSize();
+data = new uint8_t[req_size];
+Addr offset = pkt->req->getPaddr() - pkt->getAddr();
+std::memcpy(data, &(pkt->getConstPtr()[offset]), req_size);
 }

 BasePrefetcher::PrefetchInfo::PrefetchInfo(PrefetchInfo const &pfi, Addr  
addr)
   : address(addr), pc(pfi.pc), masterId(pfi.masterId),  
validPC(pfi.validPC),

-secure(pfi.secure)
+secure(pfi.secure), size(pfi.size), write(pfi.write),
+paddress(pfi.paddress), cacheMiss(pfi.cacheMiss), data(nullptr)
 {
 }

 void
 BasePrefetcher::PrefetchListener::notify(const PacketPtr &pkt)
 {
-parent.probeNotify(pkt);
+parent.probeNotify(pkt, miss);
 }

 BasePrefetcher::BasePrefetcher(const BasePrefetcherParams *p)
@@ -110,13 +116,11 @@
 }

 bool
-BasePrefetcher::observeAccess(const PacketPtr &pkt) const
+BasePrefetcher::observeAccess(const PacketPtr &pkt, bool miss) const
 {
-Addr addr = pkt->getAddr();
 bool fetch = pkt->req->isInstFetch();
 bool read = pkt->isRead();
 bool inv = pkt->isInvalidate();
-bool is_secure = pkt->isSecure();

 if (pkt->req->isUncacheable()) return false;
 if (fetch && !onInst) return false;
@@ -127,8 +131,7 @@
 if (pkt->cmd == MemCmd::CleanEvict) return false;

 if (onMiss) {
-return !inCache(addr, is_secure) &&
-   !inMissQueue(addr, is_secure);
+return miss;
 }

 return true;
@@ -189,25 +192,26 @@
 }

 void
-BasePrefetcher::probeNotify(const PacketPtr &pkt)
+BasePrefetcher::probeNotify(const PacketPtr &pkt, bool miss)
 {
 // Don't notify prefetcher on SWPrefetch, cache maintenance
 // operations or for writes that we are coaslescing.
 if (pkt->cmd.isSWPrefetch()) return;
 if (pkt->req->isCacheMaintenance()) return;
 if (pkt->isWrite() && cache != nullptr && cache->coalesce()) return;
+if (!pkt->req->hasPaddr()) return;

 if (hasBeenPrefetched(pkt->getAddr(), pkt->isSecure())) {
 usefulPrefetches += 1;
 }

 // Verify this access type is observed by prefetcher
-if (observeAccess(pkt)) {
+if (observeAccess(pkt, miss)) {
 if (useVirtualAddresses && pkt->req->hasVaddr()) {
-PrefetchInfo pfi(pkt, pkt->req->getVaddr());
+PrefetchInfo pfi(pkt, pkt->req->getVaddr(), miss);
 notify(pkt, pfi);
-} else if (!useVirtualAddresses && pkt->req->hasPaddr()) {
-PrefetchInfo pfi(pkt, pkt->req->getPaddr());
+} else if (!useVirtualAddresses) {
+PrefetchInfo pfi(pkt, pkt->req->getPaddr(), miss);
 notify(pkt, pfi);
 }
 }
@@ -223,9 +227,9 @@
  */
 if (listeners.empty() && cache != nullptr) {
 ProbeManager *pm(cache->getProbeManager());
-listeners.push_back(new PrefetchListener(*this, pm, "Miss"));
+listeners.push_back(new PrefetchListener(*this, pm, "Miss", true));
 if (prefetchOnAccess) {
-listeners.push_back(new PrefetchListener(*this, pm, "Hit"));
+listeners.push_back(new PrefetchListener(*this, pm, "Hit",  
false));

 }
 }
 }
diff --git a/src/mem/cache/prefetch/base.hh b/src/mem/cache/prefetch/base.hh
index de275f8..3a45080 100644
--- a/src/mem/cache/prefetch/base.hh
+++ b/src/mem/cache/prefetch/base.hh
@@ -67,12 +67,13 @@
 {
   public:
 PrefetchListener(BasePrefetcher &_parent, ProbeManager *pm,
- const std::string &name)
+ const std::string &name, bool miss = false)
 : ProbeListenerArgBase(pm, name),

[gem5-dev] Change in gem5/gem5[master]: mem-cache: Added the Indirect Memory Prefetcher

2019-02-21 Thread Javier Bueno Hedo (Gerrit)

Hello Nikos Nikoleris, Daniel Carvalho, Andreas Sandberg,

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

https://gem5-review.googlesource.com/c/public/gem5/+/16223

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

Change subject: mem-cache: Added the Indirect Memory Prefetcher
..

mem-cache: Added the Indirect Memory Prefetcher

Reference:
Xiangyao Yu, Christopher J. Hughes, Nadathur Satish, and Srinivas  
Devadas.

2015. IMP: indirect memory prefetcher. In Proceedings of the 48th
International Symposium on Microarchitecture (MICRO-48). ACM,
New York, NY, USA, 178-190. DOI: https://doi.org/10.1145/2830772.2830807

Change-Id: I52790f69c13ec55b8c1c8b9396ef9a1fb1be9797
---
M src/mem/cache/prefetch/Prefetcher.py
M src/mem/cache/prefetch/SConscript
A src/mem/cache/prefetch/indirect_memory.cc
A src/mem/cache/prefetch/indirect_memory.hh
4 files changed, 494 insertions(+), 0 deletions(-)


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


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I52790f69c13ec55b8c1c8b9396ef9a1fb1be9797
Gerrit-Change-Number: 16223
Gerrit-PatchSet: 6
Gerrit-Owner: Javier Bueno Hedo 
Gerrit-Assignee: Nikos Nikoleris 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Javier Bueno Hedo 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-MessageType: newpatchset
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: mem-cache: Added the Indirect Memory Prefetcher

2019-02-21 Thread Javier Bueno Hedo (Gerrit)

Hello Nikos Nikoleris, Daniel Carvalho, Andreas Sandberg,

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

https://gem5-review.googlesource.com/c/public/gem5/+/16223

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

Change subject: mem-cache: Added the Indirect Memory Prefetcher
..

mem-cache: Added the Indirect Memory Prefetcher

Reference:
Xiangyao Yu, Christopher J. Hughes, Nadathur Satish, and Srinivas  
Devadas.

2015. IMP: indirect memory prefetcher. In Proceedings of the 48th
International Symposium on Microarchitecture (MICRO-48). ACM,
New York, NY, USA, 178-190. DOI: https://doi.org/10.1145/2830772.2830807

Change-Id: I52790f69c13ec55b8c1c8b9396ef9a1fb1be9797
---
M src/mem/cache/prefetch/Prefetcher.py
M src/mem/cache/prefetch/SConscript
A src/mem/cache/prefetch/indirect_memory.cc
A src/mem/cache/prefetch/indirect_memory.hh
4 files changed, 489 insertions(+), 0 deletions(-)


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


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I52790f69c13ec55b8c1c8b9396ef9a1fb1be9797
Gerrit-Change-Number: 16223
Gerrit-PatchSet: 7
Gerrit-Owner: Javier Bueno Hedo 
Gerrit-Assignee: Nikos Nikoleris 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Javier Bueno Hedo 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-MessageType: newpatchset
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: mem-cache: Added the Indirect Memory Prefetcher

2019-02-21 Thread Javier Bueno Hedo (Gerrit)

Hello Nikos Nikoleris, Daniel Carvalho, Andreas Sandberg,

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

https://gem5-review.googlesource.com/c/public/gem5/+/16223

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

Change subject: mem-cache: Added the Indirect Memory Prefetcher
..

mem-cache: Added the Indirect Memory Prefetcher

Reference:
Xiangyao Yu, Christopher J. Hughes, Nadathur Satish, and Srinivas  
Devadas.

2015. IMP: indirect memory prefetcher. In Proceedings of the 48th
International Symposium on Microarchitecture (MICRO-48). ACM,
New York, NY, USA, 178-190. DOI: https://doi.org/10.1145/2830772.2830807

Change-Id: I52790f69c13ec55b8c1c8b9396ef9a1fb1be9797
---
M src/mem/cache/prefetch/Prefetcher.py
M src/mem/cache/prefetch/SConscript
A src/mem/cache/prefetch/indirect_memory.cc
A src/mem/cache/prefetch/indirect_memory.hh
4 files changed, 475 insertions(+), 0 deletions(-)


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


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I52790f69c13ec55b8c1c8b9396ef9a1fb1be9797
Gerrit-Change-Number: 16223
Gerrit-PatchSet: 8
Gerrit-Owner: Javier Bueno Hedo 
Gerrit-Assignee: Nikos Nikoleris 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Javier Bueno Hedo 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-MessageType: newpatchset
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: arch: Add lookUpTiming to BaseTLB

2019-02-21 Thread Javier Bueno Hedo (Gerrit)

Hello Andreas Sandberg,

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

https://gem5-review.googlesource.com/c/public/gem5/+/16543

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

Change subject: arch: Add lookUpTiming to BaseTLB
..

arch: Add lookUpTiming to BaseTLB

lookUpTiming performs a timed translation look up. If the entry exists in  
the

TLB, the translation is performed, otherwise the translation does not occur
and the state of the TLB is not modified.

Change-Id: I07e4a4f1ecf8e5b5874fad80fc20b45f9dbbda00
---
M src/arch/generic/tlb.cc
M src/arch/generic/tlb.hh
2 files changed, 29 insertions(+), 0 deletions(-)


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


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I07e4a4f1ecf8e5b5874fad80fc20b45f9dbbda00
Gerrit-Change-Number: 16543
Gerrit-PatchSet: 2
Gerrit-Owner: Javier Bueno Hedo 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Javier Bueno Hedo 
Gerrit-CC: Ivan Pizarro 
Gerrit-MessageType: newpatchset
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: systemc: Handle exceptions "correctly" even if sc_main hasn't been run.

2019-02-21 Thread Gabe Black (Gerrit)
Gabe Black has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/c/public/gem5/+/16442 )


Change subject: systemc: Handle exceptions "correctly" even if sc_main  
hasn't been run.

..

systemc: Handle exceptions "correctly" even if sc_main hasn't been run.

If sc_main hasn't run, for instance if there isn't an sc_main and gem5
is orchestrating the simulation directly, then exceptions shouldn't be
thrown to the sc_main fiber since it isn't running and may not be able
to run since sc_main may not even exist.

Instead, we need to check whether it makes sense to throw to sc_main,
and if not pass the exception directly to the report handler since
there likely won't be anyone to catch it if we just throw it from the
scheduler or into general purpose gem5.

Since the name throwToScMain is no longer a complete description for
what that function does, this change renames it to throwUp, since it
will now throw exceptions up the stack, either to sc_main or to the
conceptual top level by going directly to the report handler.

Change-Id: Ibdc92c9cf213ec6aa15ad654862057b7bf2e1c8e
Reviewed-on: https://gem5-review.googlesource.com/c/16442
Reviewed-by: Andreas Sandberg 
Maintainer: Gabe Black 
---
M src/systemc/core/kernel.cc
M src/systemc/core/process_types.hh
M src/systemc/core/scheduler.cc
M src/systemc/core/scheduler.hh
4 files changed, 26 insertions(+), 19 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved
  Gabe Black: Looks good to me, approved



diff --git a/src/systemc/core/kernel.cc b/src/systemc/core/kernel.cc
index 2fd3027..13e69d1 100644
--- a/src/systemc/core/kernel.cc
+++ b/src/systemc/core/kernel.cc
@@ -103,7 +103,7 @@
 for (auto c: sc_gem5::allChannels)
 c->sc_chan()->end_of_elaboration();
 } catch (...) {
-::sc_gem5::scheduler.throwToScMain();
+::sc_gem5::scheduler.throwUp();
 }
 }

@@ -127,7 +127,7 @@
 for (auto c: sc_gem5::allChannels)
 c->sc_chan()->start_of_simulation();
 } catch (...) {
-::sc_gem5::scheduler.throwToScMain();
+::sc_gem5::scheduler.throwUp();
 }

 startComplete = true;
@@ -159,7 +159,7 @@
 for (auto c: sc_gem5::allChannels)
 c->sc_chan()->end_of_simulation();
 } catch (...) {
-::sc_gem5::scheduler.throwToScMain();
+::sc_gem5::scheduler.throwUp();
 }

 endComplete = true;
diff --git a/src/systemc/core/process_types.hh  
b/src/systemc/core/process_types.hh

index 1361e97..c14ec1f 100644
--- a/src/systemc/core/process_types.hh
+++ b/src/systemc/core/process_types.hh
@@ -94,7 +94,7 @@
 thread->run();
 } catch (...) {
 thread->terminate();
-scheduler.throwToScMain();
+scheduler.throwUp();
 return;
 }
 thread->terminate();
diff --git a/src/systemc/core/scheduler.cc b/src/systemc/core/scheduler.cc
index 465da55..4b566ca 100644
--- a/src/systemc/core/scheduler.cc
+++ b/src/systemc/core/scheduler.cc
@@ -47,7 +47,7 @@
 Scheduler::Scheduler() :
 eq(nullptr), readyEvent(this, false, ReadyPriority),
 pauseEvent(this, false, PausePriority),
-stopEvent(this, false, StopPriority), _throwToScMain(nullptr),
+stopEvent(this, false, StopPriority), _throwUp(nullptr),
 starvationEvent(this, false, StarvationPriority),
 _elaborationDone(false), _started(false), _stopNow(false),
 _status(StatusOther), maxTickEvent(this, false, MaxTickPriority),
@@ -180,7 +180,7 @@
 try {
 _current->run();
 } catch (...) {
-throwToScMain();
+throwUp();
 }
 }
 }
@@ -327,7 +327,7 @@
 channel = updateList.getNext();
 }
 } catch (...) {
-throwToScMain();
+throwUp();
 }
 }

@@ -340,7 +340,7 @@
 while (!deltas.empty())
 deltas.back()->run();
 } catch (...) {
-throwToScMain();
+throwUp();
 }
 }

@@ -398,9 +398,9 @@
 if (starvationEvent.scheduled())
 deschedule(&starvationEvent);

-if (_throwToScMain) {
-const ::sc_core::sc_report *to_throw = _throwToScMain;
-_throwToScMain = nullptr;
+if (_throwUp) {
+const ::sc_core::sc_report *to_throw = _throwUp;
+_throwUp = nullptr;
 throw *to_throw;
 }
 }
@@ -423,12 +423,17 @@
 }

 void
-Scheduler::throwToScMain()
+Scheduler::throwUp()
 {
-::sc_core::sc_report report = reportifyException();
-_throwToScMain = &report;
-status(StatusOther);
-scMainFiber.run();
+if (scMainFiber.called() && !scMainFiber.finished()) {
+::sc_core::sc_report report = reportifyException();
+_throwUp = &report;
+status(StatusOther);
+scMainFiber.run();
+} else {
+reportHandlerProc(reportifyException(),
+

[gem5-dev] Change in gem5/gem5[master]: systemc: Init some values in the scheduler for running without sc_main.

2019-02-21 Thread Gabe Black (Gerrit)
Gabe Black has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/c/public/gem5/+/16443 )


Change subject: systemc: Init some values in the scheduler for running  
without sc_main.

..

systemc: Init some values in the scheduler for running without sc_main.

When running without sc_main, sc_start won't be called, and therefore
runToTime and maxTick won't be initialized. To avoid the scheduler
getting confused and behaving erratically, those values should be
initialized to something that makes sense in situations where there's
no sc_main.

Change-Id: I6ddd7db9ecb36d716eb5ef75e1c38bb99a386092
Reviewed-on: https://gem5-review.googlesource.com/c/16443
Reviewed-by: Andreas Sandberg 
Maintainer: Gabe Black 
---
M src/systemc/core/scheduler.cc
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved
  Gabe Black: Looks good to me, approved



diff --git a/src/systemc/core/scheduler.cc b/src/systemc/core/scheduler.cc
index 4b566ca..da1dd2d 100644
--- a/src/systemc/core/scheduler.cc
+++ b/src/systemc/core/scheduler.cc
@@ -50,9 +50,11 @@
 stopEvent(this, false, StopPriority), _throwUp(nullptr),
 starvationEvent(this, false, StarvationPriority),
 _elaborationDone(false), _started(false), _stopNow(false),
-_status(StatusOther), maxTickEvent(this, false, MaxTickPriority),
+_status(StatusOther), maxTick(::MaxTick),
+maxTickEvent(this, false, MaxTickPriority),
 timeAdvancesEvent(this, false, TimeAdvancesPriority), _numCycles(0),
-_changeStamp(0), _current(nullptr), initDone(false), runOnce(false)
+_changeStamp(0), _current(nullptr), initDone(false), runToTime(true),
+runOnce(false)
 {}

 Scheduler::~Scheduler()

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


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I6ddd7db9ecb36d716eb5ef75e1c38bb99a386092
Gerrit-Change-Number: 16443
Gerrit-PatchSet: 6
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Matthias Jung 
Gerrit-Reviewer: Weiping Liao 
Gerrit-MessageType: merged
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: ext: test: Split up the GTEST_CPPFLAGS and CPPFLAGS.

2019-02-21 Thread Gabe Black (Gerrit)
Gabe Black has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/c/public/gem5/+/16567 )


Change subject: ext: test: Split up the GTEST_CPPFLAGS and CPPFLAGS.
..

ext: test: Split up the GTEST_CPPFLAGS and CPPFLAGS.

scons seems to get confused in some situations when this is a single
large string and passes it as one big argument to g++ instead of
breaking it up into several arguments.

We need to do the work for it and break it into individual arguments,
like what was already being done with GTEST_LIBS.

Also wrap some overly long lines.

Change-Id: Ib7688a7abced43a9c62994d17b78d358fc0dc000
Reviewed-on: https://gem5-review.googlesource.com/c/16567
Reviewed-by: Andreas Sandberg 
Maintainer: Gabe Black 
---
M ext/googletest/SConscript
1 file changed, 7 insertions(+), 5 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved
  Gabe Black: Looks good to me, approved



diff --git a/ext/googletest/SConscript b/ext/googletest/SConscript
index 6792a75..e5241d6 100644
--- a/ext/googletest/SConscript
+++ b/ext/googletest/SConscript
@@ -43,14 +43,16 @@
 main.Append(CPPPATH=[gtest_include, gmock_include])
 main.Append(LIBPATH=[build])

-env = main.Clone(CPPFLAGS='-g -Wall -Wextra -pthread'
-  ' -Wno-undef -isystem %s -isystem %s' %  
(gtest_include, gmock_include))

+env = main.Clone(CPPFLAGS=['-g', '-Wall', '-Wextra', '-pthread',
+   '-Wno-undef', '-isystem', str(gtest_include),
+   '-isystem', str(gmock_include)])
 env.Append(CPPPATH=[gtest_base, gmock_base])

 gtest_all = env.Object(gtest_src.File('gtest-all.cc'))
 gmock_all = env.Object(gmock_src.File('gmock-all.cc'))
-gtest_main = env.StaticLibrary(
-target='libgtest', source=[gtest_all, gmock_all,  
gtest_src.File('gtest_main.cc')])

+gtest_main = env.StaticLibrary(target='libgtest', source=[
+gtest_all, gmock_all, gtest_src.File('gtest_main.cc')])

 main['GTEST_LIBS'] = ['libgtest', 'pthread']
-main['GTEST_CPPFLAGS'] = '-pthread -DUSE_GMOCK -Wno-undef -isystem %s' %  
gtest_include.abspath

+main['GTEST_CPPFLAGS'] = [
+'-pthread', '-DUSE_GMOCK', '-Wno-undef', '-isystem',  
gtest_include.abspath]


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


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

[gem5-dev] Change in gem5/gem5[master]: systemc: Make the verify.py script work when run from different dirs.

2019-02-21 Thread Gabe Black (Gerrit)
Gabe Black has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/c/public/gem5/+/16562 )


Change subject: systemc: Make the verify.py script work when run from  
different dirs.

..

systemc: Make the verify.py script work when run from different dirs.

The verify.py script ran scons from the CWD, and that would fail if
there wasn't a SConstruct in that directory, ie if it wasn't from the
source of the checkout.

This change makes verify.py use scons' --directory option to run from
where the SConstruct is, or at least the SConstruct which was checked
out alongside that copy of verify.py. That location can be overridden
using the new -C or --scons-dir options.

Change-Id: I9f033d6dd30e0c2992b7f3102c573b34ea9c49e0
Reviewed-on: https://gem5-review.googlesource.com/c/16562
Reviewed-by: Andreas Sandberg 
Maintainer: Gabe Black 
---
M src/systemc/tests/verify.py
1 file changed, 11 insertions(+), 2 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved
  Gabe Black: Looks good to me, approved



diff --git a/src/systemc/tests/verify.py b/src/systemc/tests/verify.py
index 503c11d..2bb6d33 100755
--- a/src/systemc/tests/verify.py
+++ b/src/systemc/tests/verify.py
@@ -45,6 +45,10 @@
 script_path = os.path.abspath(inspect.getfile(inspect.currentframe()))
 script_dir = os.path.dirname(script_path)
 config_path = os.path.join(script_dir, 'config.py')
+# Parent directories if checked out as part of gem5.
+systemc_dir = os.path.dirname(script_dir)
+src_dir = os.path.dirname(systemc_dir)
+checkout_dir = os.path.dirname(src_dir)

 systemc_rel_path = 'systemc'
 tests_rel_path = os.path.join(systemc_rel_path, 'tests')
@@ -131,7 +135,8 @@
 if args.j == 0:
 self.args = ('-j', str(self.main_args.j)) + self.args

-scons_args = [ 'USE_SYSTEMC=1' ] + list(self.args) + targets
+scons_args = [ '--directory', self.main_args.scons_dir,
+   'USE_SYSTEMC=1' ] + list(self.args) + targets
 scons(*scons_args)

 class RunPhase(TestPhaseBase):
@@ -512,6 +517,10 @@
 help='Default level of parallelism, can be overriden '
 'for individual stages')

+parser.add_argument('-C', '--scons-dir', metavar='SCONS_DIR',
+default=checkout_dir,
+help='Directory to run scons from')
+
 filter_opts = parser.add_mutually_exclusive_group()
 filter_opts.add_argument('--filter', default='True',
  help='Python expression which filters tests  
based '

@@ -549,7 +558,7 @@
 json_path = os.path.join(main_args.build_dir, json_rel_path)

 if main_args.update_json:
-scons(os.path.join(json_path))
+scons('--directory', main_args.scons_dir, os.path.join(json_path))

 with open(json_path) as f:
 test_data = json.load(f)

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


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I9f033d6dd30e0c2992b7f3102c573b34ea9c49e0
Gerrit-Change-Number: 16562
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Matthias Jung 
Gerrit-Reviewer: Weiping Liao 
Gerrit-MessageType: merged
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: systemc: Make sc_(pause|stop) exit to python when not using sc_main.

2019-02-21 Thread Gabe Black (Gerrit)
Gabe Black has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/c/public/gem5/+/16445 )


Change subject: systemc: Make sc_(pause|stop) exit to python when not using  
sc_main.

..

systemc: Make sc_(pause|stop) exit to python when not using sc_main.

In those cases, there's no sc_main to return control to. The python
config script is serving more or less the same purpose, so we can
return control to there instead.

Change-Id: I3cf0623ae51d989b883fb8556ebbf44651bbec99
Reviewed-on: https://gem5-review.googlesource.com/c/16445
Reviewed-by: Andreas Sandberg 
Maintainer: Gabe Black 
---
M src/systemc/core/scheduler.cc
1 file changed, 19 insertions(+), 4 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved
  Gabe Black: Looks good to me, approved



diff --git a/src/systemc/core/scheduler.cc b/src/systemc/core/scheduler.cc
index da1dd2d..d06ddfb 100644
--- a/src/systemc/core/scheduler.cc
+++ b/src/systemc/core/scheduler.cc
@@ -32,6 +32,7 @@
 #include "base/fiber.hh"
 #include "base/logging.hh"
 #include "sim/eventq.hh"
+#include "sim/sim_exit.hh"
 #include "systemc/core/kernel.hh"
 #include "systemc/core/sc_main_fiber.hh"
 #include "systemc/ext/core/messages.hh"
@@ -352,8 +353,15 @@
 status(StatusPaused);
 kernel->status(::sc_core::SC_PAUSED);
 runOnce = false;
-if (scMainFiber.called() && !scMainFiber.finished())
-scMainFiber.run();
+if (scMainFiber.called()) {
+if (!scMainFiber.finished())
+scMainFiber.run();
+} else {
+if (scMainFiber.finished())
+fatal("Pausing systemc after sc_main completed.");
+else
+exitSimLoopNow("systemc pause");
+}
 }

 void
@@ -365,8 +373,15 @@
 clear();

 runOnce = false;
-if (scMainFiber.called() && !scMainFiber.finished())
-scMainFiber.run();
+if (scMainFiber.called()) {
+if (!scMainFiber.finished())
+scMainFiber.run();
+} else {
+if (scMainFiber.finished())
+fatal("Stopping systemc after sc_main completed.");
+else
+exitSimLoopNow("systemc stop");
+}
 }

 void

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


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I3cf0623ae51d989b883fb8556ebbf44651bbec99
Gerrit-Change-Number: 16445
Gerrit-PatchSet: 6
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Matthias Jung 
Gerrit-Reviewer: Weiping Liao 
Gerrit-MessageType: merged
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: scons: Add a convenience method to set RPATH for local libraries.

2019-02-21 Thread Gabe Black (Gerrit)
Gabe Black has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/c/public/gem5/+/16566 )


Change subject: scons: Add a convenience method to set RPATH for local  
libraries.

..

scons: Add a convenience method to set RPATH for local libraries.

When linking in a dynamic library which is in the gem5 build directory,
it's useful to set RPATH so that you don't have to set LD_LIBRARY_PATH
when you run gem5 so that the dynamic linker can find it.

Since it's tricky and not entirely obvious how to set up those paths
correctly, this change adds a small convenience function which does
that for you. It also handles situations where the same dynamic
library may be linked into different binaries in different directories
which each need a different relative RPATH. It does that by letting the
environment for each binary set a construction variable which says
how to get from that particular binary back to the build directory.
This helper method then sets RPATH to start at $ORIGIN (the binary),
to follow that relative path to the variant build directory, and then
the per-library but not per-binary path to the library's directory.

This change also adds the -z origin linker flag which makes the linker
handle $ORIGIN properly.

Change-Id: I45f4d72cd14396a73e0b963cea6a39d9bfb7f984
Reviewed-on: https://gem5-review.googlesource.com/c/16566
Reviewed-by: Andreas Sandberg 
Maintainer: Gabe Black 
---
M SConstruct
M src/SConscript
2 files changed, 25 insertions(+), 0 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved
  Gabe Black: Looks good to me, approved



diff --git a/SConstruct b/SConstruct
index 5c8f649..026327c 100755
--- a/SConstruct
+++ b/SConstruct
@@ -1072,6 +1072,27 @@
 main.Append(BUILDERS = { 'PartialShared' : partial_shared_builder,
  'PartialStatic' : partial_static_builder })

+def add_local_rpath(env, *targets):
+'''Set up an RPATH for a library which lives in the build directory.
+
+The construction environment variable BIN_RPATH_PREFIX should be set to
+the relative path of the build directory starting from the location of  
the

+binary.'''
+for target in targets:
+target = env.Entry(target)
+if not target.isdir():
+target = target.dir
+relpath = os.path.relpath(target.abspath, env['BUILDDIR'])
+components = [
+'\\$$ORIGIN',
+'${BIN_RPATH_PREFIX}',
+relpath
+]
+env.Append(RPATH=[env.Literal(os.path.join(*components))])
+
+main.Append(LINKFLAGS=Split('-z origin'))
+main.AddMethod(add_local_rpath, 'AddLocalRPATH')
+
 # builds in ext are shared across all configs in the build root.
 ext_dir = abspath(joinpath(str(main.root), 'ext'))
 ext_build_dirs = []
diff --git a/src/SConscript b/src/SConscript
index 81b6cd3..ef7e670 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -449,6 +449,10 @@
 if objs is None:
 objs = self.srcs_to_objs(env, self.sources)

+env = env.Clone()
+env['BIN_RPATH_PREFIX'] = os.path.relpath(
+env['BUILDDIR'], self.path(env).dir.abspath)
+
 if env['STRIP_EXES']:
 stripped = self.path(env)
 unstripped = env.File(str(stripped) + '.unstripped')

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


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

Re: [gem5-dev] SimObject Param types which are template classes

2019-02-21 Thread Jason Lowe-Power
Hey Gabe,

Could you describe in a little more detail why you want to templatize a
SimObject. Since python doesn't have support for templates, I don't really
like the idea of supporting this.

One option is to have the Python side of the SimObject be the
"specialization" and then you'd just have to implement the
SimObjectParams::create() function to return the specialized template for
each of the types you want to support from Python. Does that make sense?
Maybe this is what you meant by "subclassing"

For instance:

*my_simobject.hh:*
template 
MySimObject public SimObject
{
...
};

*my_simobject.cc:*
MySimObjectIntParams::create() {
return MySimObject(this);
}

MySimObjectFloatParams::create() {
return MySimObject(this);
}

*MySimObject.py:*
class MySimObjectGeneric(SimObject): # I'm not sure if this is exactly
right...
   ...
   

class MySimObjectInt(MySimObjectGeneric):



class MySimObjectFloat(MySimObjectGeneric):



I would say that if the above doesn't work now, we should update things so
it does work. However, I don't think we should do any of this
*automatically* for templated SimObjects.

Cheers,
Jason

On Fri, Feb 15, 2019 at 5:55 PM Gabe Black  wrote:

> Hi folks. I'm trying to create a SimObject out of a templated class (the
> python Param type uses a specialization of it), and the pybind11 generated
> code doesn't compile because the predeclaration of the class type isn't
> syntactically correct since it's a template. I can work around this problem
> by, for instance, subclassing it and then using that subclass (at least I
> think I can, I haven't tried it yet), but it would be nice if the system
> could handle it.
>
> It's not obvious how to fix it since it's not obvious from the fully
> specified type how it should be prototyped, so it's not a quick fix. Has
> anyone attempted to get this to work, and/or have a solution?
>
> Thanks!
> Gabe
> ___
> 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