[gem5-dev] RFC: Removing authors from file headers

2020-01-17 Thread Gabe Black
Hi folks. I would like to suggest dropping authors from the header comments
in the various files in gem5. That field is not really maintained, and it's
not clear even when it should be updated. The history is a much more
accurate and complete record of who did what.

What do people think about that?

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

[gem5-dev] Change in gem5/gem5[master]: tests: Updated tests to download from http://dist.gem5.org

2020-01-17 Thread Bobby R. Bruce (Gerrit)
Bobby R. Bruce has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/24548 )



Change subject: tests: Updated tests to download from http://dist.gem5.org
..

tests: Updated tests to download from http://dist.gem5.org

Previously some tests, and test resources, downloaded content from
http://gem5.org . This is being migrated to http://dist.gem5.org.
http://dist.gem5.org should be used to store and retrieve resources
going forward.

Change-Id: I7162c76b9b8dc07657a6ba50d643fc93c9824fdf
---
M tests/gem5/cpu_tests/test.py
M tests/gem5/fs/linux/arm/test.py
M tests/gem5/hello_se/test_hello_se.py
M tests/gem5/m5_util/test_exit.py
M tests/test-progs/hello/src/Makefile.arm
M tests/test-progs/hello/src/Makefile.x86
M tests/test-progs/m5-exit/src/Makefile.x86
7 files changed, 8 insertions(+), 7 deletions(-)



diff --git a/tests/gem5/cpu_tests/test.py b/tests/gem5/cpu_tests/test.py
index 58925de..1a61a73 100644
--- a/tests/gem5/cpu_tests/test.py
+++ b/tests/gem5/cpu_tests/test.py
@@ -43,7 +43,7 @@


 base_path = joinpath(absdirpath(__file__), 'benchmarks', 'bin')
-base_url = 'http://gem5.org/dist/current/gem5/cpu_tests/benchmarks/bin/'
+base_url  
= 'http://dist.gem5.org/dist/current/gem5/cpu_tests/benchmarks/bin/'

 for isa in valid_isas:
 path = joinpath(base_path, isa)
 for workload in workloads:
diff --git a/tests/gem5/fs/linux/arm/test.py  
b/tests/gem5/fs/linux/arm/test.py

index 4ed58ae..15a1c6f 100644
--- a/tests/gem5/fs/linux/arm/test.py
+++ b/tests/gem5/fs/linux/arm/test.py
@@ -84,7 +84,7 @@
 ]

 tarball = 'aarch-system-201901106.tar.bz2'
-url = "http://gem5.org/dist/current/arm/; + tarball
+url = "http://dist.gem5.org/dist/current/arm/; + tarball
 path = os.path.dirname(os.path.abspath(__file__))
 arm_fs_binaries = DownloadedArchive(url, path, tarball)

diff --git a/tests/gem5/hello_se/test_hello_se.py  
b/tests/gem5/hello_se/test_hello_se.py

index cc62efb..ff3ef5e 100644
--- a/tests/gem5/hello_se/test_hello_se.py
+++ b/tests/gem5/hello_se/test_hello_se.py
@@ -36,7 +36,7 @@
 'arm': ('hello64-static', 'hello32-static'),
 }

-urlbase = 'http://gem5.org/dist/current/test-progs/hello/bin/'
+urlbase = 'http://org.gem5.org/dist/current/test-progs/hello/bin/'
 for isa in test_progs:
 for binary in test_progs[isa]:
 import os
diff --git a/tests/gem5/m5_util/test_exit.py  
b/tests/gem5/m5_util/test_exit.py

index 3c99512..2268074 100644
--- a/tests/gem5/m5_util/test_exit.py
+++ b/tests/gem5/m5_util/test_exit.py
@@ -40,7 +40,8 @@
 path = joinpath(absdirpath(__file__), '..',
 'test-progs', 'hello', 'bin', 'x86', 'linux')
 filename = 'm5_exit'
-url  
= 'http://gem5.org/dist/current/test-progs/m5-exit/bin/x86/linux/m5_exit'

+url = 'http://dist.gem5.org/dist/current/test-progs/' +
+  'm5-exit/bin/x86/linux/m5_exit'
 test_program = DownloadedProgram(url, path, filename)

 a = verifier.MatchRegex(m5_exit_regex)
diff --git a/tests/test-progs/hello/src/Makefile.arm  
b/tests/test-progs/hello/src/Makefile.arm

index 2aad6f5..1f02246 100644
--- a/tests/test-progs/hello/src/Makefile.arm
+++ b/tests/test-progs/hello/src/Makefile.arm
@@ -1,6 +1,6 @@
 SERVER_USER=
 SERVER_PATH=/z/www/htdocs/dist/current/test-progs/hello/bin/arm/linux
-FETCH_PATH=http://gem5.org/dist/current/test-progs/hello/bin/arm/linux
+FETCH_PATH=http://dist.gem5.org/dist/current/test-progs/hello/bin/arm/linux
 UPLOAD_LOCATION=$(SERVER_USER)daystrom.gem5.org:$(SERVER_PATH)

 all: hello64-static hello32-static
diff --git a/tests/test-progs/hello/src/Makefile.x86  
b/tests/test-progs/hello/src/Makefile.x86

index 3eff291..3df2d23 100644
--- a/tests/test-progs/hello/src/Makefile.x86
+++ b/tests/test-progs/hello/src/Makefile.x86
@@ -1,6 +1,6 @@
 SERVER_USER=
 SERVER_PATH=/z/www/htdocs/dist/current/test-progs/hello/bin/x86/linux
-FETCH_PATH=http://gem5.org/dist/current/test-progs/hello/bin/x86/linux
+FETCH_PATH=http://dist.gem5.org/dist/current/test-progs/hello/bin/x86/linux

 UPLOAD_LOCATION=$(SERVER_USER)daystrom.gem5.org:$(SERVER_PATH)

diff --git a/tests/test-progs/m5-exit/src/Makefile.x86  
b/tests/test-progs/m5-exit/src/Makefile.x86

index eba7342..2c94a54 100644
--- a/tests/test-progs/m5-exit/src/Makefile.x86
+++ b/tests/test-progs/m5-exit/src/Makefile.x86
@@ -1,6 +1,6 @@
 SERVER_USER=
 SERVER_PATH=/z/www/htdocs/dist/current/test-progs/m5-exit/bin/x86/linux
-FETCH_PATH=http://gem5.org/dist/current/test-progs/m5-exit/bin/x86/linux
+FETCH_PATH=http://dist.gem5.org/dist/current/test-progs/m5-exit/bin/x86/linux

 UPLOAD_LOCATION=$(SERVER_USER)daystrom.gem5.org:$(SERVER_PATH)


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/24548
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: I7162c76b9b8dc07657a6ba50d643fc93c9824fdf
Gerrit-Change-Number: 24548
Gerrit-PatchSet: 1

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

2020-01-17 Thread Cron Daemon
* 
build/ARM/tests/opt/quick/fs/10.linux-boot/arm/linux/realview-simple-timing-dual:
 FAILED!
* 
build/ARM/tests/opt/quick/fs/10.linux-boot/arm/linux/realview-switcheroo-atomic:
 FAILED!
* 
build/ARM/tests/opt/quick/fs/10.linux-boot/arm/linux/realview-simple-atomic-checkpoint:
 FAILED!
* 
build/ARM/tests/opt/quick/fs/10.linux-boot/arm/linux/realview-switcheroo-timing:
 FAILED!
* 
build/ARM/tests/opt/quick/fs/10.linux-boot/arm/linux/realview-simple-atomic-dual:
 FAILED!
* 
build/ARM/tests/opt/quick/fs/10.linux-boot/arm/linux/realview-simple-atomic: 
FAILED!
* 
build/ARM/tests/opt/quick/fs/10.linux-boot/arm/linux/realview-simple-timing: 
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/simple-timing-ruby:
 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/minor-timing: 
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/minor-timing: CHANGED!
* build/ALPHA/tests/opt/quick/se/00.hello/alpha/linux/simple-timing-ruby: 
CHANGED!
* build/ALPHA/tests/opt/quick/se/00.hello/alpha/linux/simple-timing: 
CHANGED!
* build/ALPHA/tests/opt/quick/se/01.hello-2T-smt/alpha/linux/o3-timing-mt: 
CHANGED!
* build/ALPHA/tests/opt/quick/se/00.hello/alpha/linux/simple-atomic: 
CHANGED!
* build/ALPHA/tests/opt/quick/se/00.hello/alpha/linux/o3-timing: CHANGED!
* 
build/ALPHA/tests/opt/quick/se/03.learning-gem5/alpha/linux/learning-gem5-p1-simple:
 CHANGED!
* 
build/ALPHA/tests/opt/quick/se/03.learning-gem5/alpha/linux/learning-gem5-p1-two-level:
 CHANGED!
* 
build/ALPHA/tests/opt/quick/fs/10.linux-boot/alpha/linux/tsunami-simple-atomic: 
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/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-two-level:
 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-simple:
 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/o3-timing: CHANGED!
* 
build/ALPHA/tests/opt/quick/fs/80.netperf-stream/alpha/linux/twosys-tsunami-simple-atomic:
 CHANGED!
* build/NULL/tests/opt/quick/se/80.dram-openpage/null/none/dram-lowp: 
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_hammer/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MOESI_hammer:
 CHANGED!
* 
build/NULL_MESI_Two_Level/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MESI_Two_Level:
 CHANGED!
* 
build/NULL_MOESI_CMP_directory/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MOESI_CMP_directory:
 CHANGED!
* 
build/NULL_MOESI_CMP_token/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MOESI_CMP_token:
 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/00.hello/sparc/linux/simple-timing: 
CHANGED!
* 
build/SPARC/tests/opt/quick/se/03.learning-gem5/sparc/linux/learning-gem5-p1-two-level:
 CHANGED!
* build/SPARC/tests/opt/quick/se/02.insttest/sparc/linux/o3-timing: CHANGED!
* 
build/SPARC/tests/opt/quick/se/40.m5threads-test-atomic/sparc/linux/simple-timing-mp:
 CHANGED!
* build/SPARC/tests/opt/quick/se/00.hello/sparc/linux/simple-atomic: 
CHANGED!
* build/SPARC/tests/opt/quick/se/00.hello/sparc/linux/simple-timing-ruby: 
CHANGED!
* 
build/SPARC/tests/opt/quick/se/40.m5threads-test-atomic/sparc/linux/simple-atomic-mp:
 CHANGED!
* build/SPARC/tests/opt/quick/se/02.insttest/sparc/linux/simple-atomic: 
CHANGED!
* 
build/SPARC/tests/opt/quick/se/03.learning-gem5/sparc/linux/learning-gem5-p1-simple:
 CHANGED!
* build/SPARC/tests/opt/quick/se/02.insttest/sparc/linux/simple-timing: 
CHANGED!
* 
build/SPARC/tests/opt/quick/se/40.m5threads-test-atomic/sparc/linux/o3-timing-mp:
 CHANGED!
* 

[gem5-dev] Change in gem5/gem5[develop]: tests, base: Added GTest for aout_object.cc

2020-01-17 Thread Bobby R. Bruce (Gerrit)
Bobby R. Bruce has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/24546 )



Change subject: tests,base: Added GTest for aout_object.cc
..

tests,base: Added GTest for aout_object.cc

Change-Id: I50d05943ce7c90a94ca018343b1e04e1a09fa505
---
M src/base/SConscript
M src/base/loader/aout_object.hh
A src/base/loader/aout_object.test.cc
3 files changed, 41 insertions(+), 0 deletions(-)



diff --git a/src/base/SConscript b/src/base/SConscript
index 3bd4dbb..b0373dc 100644
--- a/src/base/SConscript
+++ b/src/base/SConscript
@@ -81,6 +81,8 @@
 GTest('types.test', 'types.test.cc', 'types.cc')

 Source('loader/aout_object.cc')
+GTest('loader/aout_object.test', 'loader/aout_object.test.cc',
+'loader/aout_object.cc', 'loader/object_file.cc')
 Source('loader/dtb_file.cc')
 Source('loader/ecoff_object.cc')
 Source('loader/elf_object.cc')
diff --git a/src/base/loader/aout_object.hh b/src/base/loader/aout_object.hh
index 480a30c..e9c2f43 100644
--- a/src/base/loader/aout_object.hh
+++ b/src/base/loader/aout_object.hh
@@ -32,6 +32,7 @@
 #define __AOUT_OBJECT_HH__

 #include "base/loader/object_file.hh"
+#include "base/logging.hh"

 // forward decls: avoid including exec_aout.h here
 struct aout_exechdr;
diff --git a/src/base/loader/aout_object.test.cc  
b/src/base/loader/aout_object.test.cc

new file mode 100644
index 000..18ce3f2
--- /dev/null
+++ b/src/base/loader/aout_object.test.cc
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2019 The Regents of the University of California
+ * All rights reserved
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * 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;
+ * neither the name of the copyright holders 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
+ * OWNER 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.
+ *
+ * Authors: Bobby R. Bruce
+ */
+
+#include 
+
+#include "base/loader/aout_object.hh"
+
+TEST(AOutObjectTest, MockTest)
+{
+EXPECT_TRUE(true);
+}
\ No newline at end of file

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


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I50d05943ce7c90a94ca018343b1e04e1a09fa505
Gerrit-Change-Number: 24546
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby R. Bruce 
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: Add getter for the number of valid sub-blks

2020-01-17 Thread Daniel Carvalho (Gerrit)
Daniel Carvalho has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/22605 )


Change subject: mem-cache: Add getter for the number of valid sub-blks
..

mem-cache: Add getter for the number of valid sub-blks

Add a getter function so that the number of valid sub-blocks can be
retrieved. As a side effect, make the respective counter private.

Change-Id: Icef8b51164c8e165872dcaebc65f5c330f16cb29
Signed-off-by: Daniel R. Carvalho 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22605
Tested-by: kokoro 
Reviewed-by: Nikos Nikoleris 
Maintainer: Nikos Nikoleris 
---
M src/mem/cache/tags/sector_blk.cc
M src/mem/cache/tags/sector_blk.hh
2 files changed, 21 insertions(+), 7 deletions(-)

Approvals:
  Nikos Nikoleris: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/mem/cache/tags/sector_blk.cc  
b/src/mem/cache/tags/sector_blk.cc

index 7e4468d..13c90b6 100644
--- a/src/mem/cache/tags/sector_blk.cc
+++ b/src/mem/cache/tags/sector_blk.cc
@@ -116,7 +116,7 @@
 }

 SectorBlk::SectorBlk()
-: ReplaceableEntry(), _tag(MaxAddr), _validCounter(0),  
_secureBit(false)
+: ReplaceableEntry(), _validCounter(0), _tag(MaxAddr),  
_secureBit(false)

 {
 }

@@ -127,6 +127,12 @@
 return _validCounter > 0;
 }

+uint8_t
+SectorBlk::getNumValid() const
+{
+return _validCounter;
+}
+
 bool
 SectorBlk::isSecure() const
 {
diff --git a/src/mem/cache/tags/sector_blk.hh  
b/src/mem/cache/tags/sector_blk.hh

index a30fb81..cfe6772 100644
--- a/src/mem/cache/tags/sector_blk.hh
+++ b/src/mem/cache/tags/sector_blk.hh
@@ -144,18 +144,19 @@
  */
 class SectorBlk : public ReplaceableEntry
 {
-  protected:
-/**
- * Sector tag value. A sector's tag is the tag of all its sub-blocks.
- */
-Addr _tag;
-
+  private:
 /**
  * Counter of the number of valid sub-blocks. The sector is valid if  
any

  * of its sub-blocks is valid.
  */
 uint8_t _validCounter;

+  protected:
+/**
+ * Sector tag value. A sector's tag is the tag of all its sub-blocks.
+ */
+Addr _tag;
+
 /**
  * Whether sector blk is in secure-space or not.
  */
@@ -178,6 +179,13 @@
 bool isValid() const;

 /**
+ * Get the number of sub-blocks that have been validated.
+ *
+ * @return The number of valid sub-blocks.
+ */
+uint8_t getNumValid() const;
+
+/**
  * Checks that a sector block is secure. A single secure block suffices
  * to imply that the whole sector is secure, as the insertion proccess
  * asserts that different secure spaces can't coexist in the same  
sector.


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/22605
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: Icef8b51164c8e165872dcaebc65f5c330f16cb29
Gerrit-Change-Number: 22605
Gerrit-PatchSet: 6
Gerrit-Owner: Daniel Carvalho 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-Reviewer: kokoro 
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]: mem-cache: Add print function to ReplaceableEntry

2020-01-17 Thread Daniel Carvalho (Gerrit)
Daniel Carvalho has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/23567 )


Change subject: mem-cache: Add print function to ReplaceableEntry
..

mem-cache: Add print function to ReplaceableEntry

Add a basic print function to acquire and display information about
replaceable entries.

Change-Id: I9640113d305fbe086c5bfaf8928a911bfcac50bb
Signed-off-by: Daniel R. Carvalho 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23567
Tested-by: kokoro 
Reviewed-by: Nikos Nikoleris 
Reviewed-by: Jason Lowe-Power 
Maintainer: Nikos Nikoleris 
Maintainer: Jason Lowe-Power 
---
M src/mem/cache/cache_blk.hh
M src/mem/cache/replacement_policies/replaceable_entry.hh
2 files changed, 17 insertions(+), 3 deletions(-)

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



diff --git a/src/mem/cache/cache_blk.hh b/src/mem/cache/cache_blk.hh
index dce0ce4..42b8ebd 100644
--- a/src/mem/cache/cache_blk.hh
+++ b/src/mem/cache/cache_blk.hh
@@ -345,7 +345,8 @@
  *
  * @return string with basic state information
  */
-virtual std::string print() const
+std::string
+print() const override
 {
 /**
  *  state   M   O   E   S   I
@@ -382,9 +383,9 @@
   default:s = 'T'; break; // @TODO add other types
 }
 return csprintf("state: %x (%c) valid: %d writable: %d  
readable: %d "
-"dirty: %d | tag: %#x set: %#x way: %#x", status,  
s,

+"dirty: %d | tag: %#x %s", status, s,
 isValid(), isWritable(), isReadable(), isDirty(),  
tag,

-getSet(), getWay());
+ReplaceableEntry::print());
 }

 /**
diff --git a/src/mem/cache/replacement_policies/replaceable_entry.hh  
b/src/mem/cache/replacement_policies/replaceable_entry.hh

index 2b08749..9a59b1f 100644
--- a/src/mem/cache/replacement_policies/replaceable_entry.hh
+++ b/src/mem/cache/replacement_policies/replaceable_entry.hh
@@ -34,6 +34,8 @@
 #include 
 #include 

+#include "base/cprintf.hh"
+
 /**
  * The replacement data needed by replacement policies. Each replacement  
policy

  * should have its own implementation of replacement data.
@@ -99,6 +101,17 @@
  * @return The way to which this entry belongs.
  */
 uint32_t getWay() const { return _way; }
+
+/**
+ * Prints relevant information about this entry.
+ *
+ * @return A string containg the contents of this entry.
+ */
+virtual std::string
+print() const
+{
+return csprintf("set: %#x way: %#x", getSet(), getWay());
+}
 };

 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_REPLACEABLE_ENTRY_HH_

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/23567
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: I9640113d305fbe086c5bfaf8928a911bfcac50bb
Gerrit-Change-Number: 23567
Gerrit-PatchSet: 5
Gerrit-Owner: Daniel Carvalho 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-Reviewer: kokoro 
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]: tests, misc: Created presubmit.yaml Google Cloud Build files

2020-01-17 Thread Bobby R. Bruce (Gerrit)
Bobby R. Bruce has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/24543 )



Change subject: tests,misc: Created presubmit.yaml Google Cloud Build files
..

tests,misc: Created presubmit.yaml Google Cloud Build files

This will replicate kokoro on Google Cloud services. At present, this
can be run via execution of `gcloud builds submit --config
--machine=n1-highcpu-8 cloudbuild_presubmit.yaml` (the `n1-highcpu-8`
machine is needed to complete execution in a reasonable time, i.e., in
under 4 hours).

The `hello_goodbye_test-NULL-opt` and
`hello_goodbye_test-NULL-opt-MatchStdout` tests fail on Google Cloud for
an unknown reason. They have therefore been added to `.testignore`. A Jira
issue has been created to fix this:
https://gem5.atlassian.net/browse/GEM5-273

Jira: https://gem5.atlassian.net/browse/GEM5-271
Change-Id: I5a71ef7fdbe5546b4e6970e4f4641f9e14cc640b
---
A cloudbuild_presubmit.yaml
A tests/gem5/.testignore
A tests/scripts/system_test_run.sh
A tests/scripts/unit_test_run.sh
A util/dockerfiles/Dockerfile_presubmit
5 files changed, 56 insertions(+), 0 deletions(-)



diff --git a/cloudbuild_presubmit.yaml b/cloudbuild_presubmit.yaml
new file mode 100644
index 000..7672e65
--- /dev/null
+++ b/cloudbuild_presubmit.yaml
@@ -0,0 +1,14 @@
+steps:
+- name: 'gcr.io/cloud-builders/docker'
+  args: ['build', '-t', 'ubuntu-18.04-build', '-f',
+ 'util/dockerfiles/Dockerfile_presubmit', '.']
+
+- name: 'gcr.io/cloud-builders/docker'
+  args: ['container', 'run', 'ubuntu-18.04-build',
+ './tests/scripts/unit_test_run.sh']
+
+- name: 'gcr.io/cloud-builders/docker'
+  args: ['container', 'run' ,'ubuntu-18.04-build',
+ './tests/scripts/system_test_run.sh', 'quick', '4']
+
+timeout: 18000s # 5 Hours
diff --git a/tests/gem5/.testignore b/tests/gem5/.testignore
new file mode 100644
index 000..c5cff71
--- /dev/null
+++ b/tests/gem5/.testignore
@@ -0,0 +1,2 @@
+hello_goodbye_test-NULL-opt-MatchStdout
+hello_goodbye_test-NULL-opt
diff --git a/tests/scripts/system_test_run.sh  
b/tests/scripts/system_test_run.sh

new file mode 100755
index 000..391af0a
--- /dev/null
+++ b/tests/scripts/system_test_run.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+LENGTH=""
+if [ $# -ge 1 ]; then
+LENGTH="$1"
+else
+>&2 echo "Length ('quick' or 'long') not specified"
+fi
+
+THREADS=1
+if [ $# -eq 2 ]; then
+THREADS="$2"
+fi
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
+cd "${DIR}/.."
+
+python main.py run -j${THREADS} --length "${LENGTH}"
+status=$?
+
+if [ "$status" -ne "0" ]; then
+cat .testing-results/results.xml
+fi
+
+exit ${status}
diff --git a/tests/scripts/unit_test_run.sh b/tests/scripts/unit_test_run.sh
new file mode 100755
index 000..1f89fdc
--- /dev/null
+++ b/tests/scripts/unit_test_run.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
+cd "${DIR}/../.."
+
+scons build/NULL/unittests.opt
diff --git a/util/dockerfiles/Dockerfile_presubmit  
b/util/dockerfiles/Dockerfile_presubmit

new file mode 100644
index 000..93c7cfd
--- /dev/null
+++ b/util/dockerfiles/Dockerfile_presubmit
@@ -0,0 +1,7 @@
+FROM ubuntu:18.04
+RUN apt -y update && apt -y upgrade && apt -y install build-essential git  
m4 \

+scons zlib1g zlib1g-dev libprotobuf-dev protobuf-compiler libprotoc-dev \
+libgoogle-perftools-dev python-dev libboost-all-dev python python-pip && \
+pip install six
+WORKDIR /src/
+COPY . .

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/24543
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: I5a71ef7fdbe5546b4e6970e4f4641f9e14cc640b
Gerrit-Change-Number: 24543
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby R. Bruce 
Gerrit-MessageType: newchange
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Re: [gem5-dev] Python 2.7 deprecation - can we switch to Python 3?

2020-01-17 Thread Jason Lowe-Power
On Fri, Jan 17, 2020 at 9:42 AM Andreas Sandberg 
wrote:

> Dropping support in 20.1 or 20.2 sounds good to me. In practice, that
> means we can drop support on the development branch as soon as the
> stable branch has been released. Are you suggesting that we aim to make
> Python 3 the default, but keep support for 2.7, in gem5 20 when it is
> released  in April?
>

That's what I'm proposing. We'll have to investigate what's left to do
before we can make Python3 default and make sure we have the resources
before committing, though :).


> As for the Python version, requiring 3.5 shouldn't be controversial at
> all since all major distros that are still supported and support Python
> 3 ship with 3.5 or newer. I wouldn't mind going straight to 3.6, but it
> might be controversial since Ubuntu 16.04 ships with 3.5 and will be
> supported until early 2021.
>

I quickly looked up what we'd be missing if we went with 3.5 instead of
3.6. See https://docs.python.org/3/whatsnew/3.6.html.

There are two features there that I think we would use heavily if we went
to 3.6.
1) Type annotation syntax for variables. I found this pretty important when
I was adding type annotations one of our python libraries recently.
2) f-strings. To me, this is a huge win for us if we can use f-strings
instead of `.format`. I would vote for going to 3.6 just for this!

When implementing a new gem5 python library (something that's planning for
summer 2020), it would be best to be forward looking to require at least
python 3.6 (released in 2016!). I would rather not have to bump the minimum
required python version again anytime soon :).

I don't see anything in Python 3.7 or 3.8 that is a compelling reason to
make that our minimum version anytime in the next few years.


>
> Cheers,
> Andreas
>
> On 17/01/2020 16:19, Jason Lowe-Power wrote:
> > Yes, this is very important.
> >
> > I think we could go ahead and make this a goal for gem5 20 to be released
> > in April. We can support both in gem5-20.0 and in gem5-20.1 or 20.2 drop
> > support for 2.7.
> >
> > Additionally, I'd like to see us require at least Python 3.5 so we can
> > start using python type annotations:
> > https://www.python.org/dev/peps/pep-0484/.
> >
> > Cheers,
> > Jason
> >
> > On Fri, Jan 17, 2020 at 8:08 AM Gabe Black  wrote:
> >
> >> I think this seems like something we're going to need to do sooner
> rather
> >> than later. I also made some changes recently which made our scons
> scripts
> >> more compatible with python 3, but I don't think I fixed all the issues
> >> entirely. I don't remember what issues were still there, but it should
> be
> >> easy enough to re-discover them. Ideally we'd use python 3 in scons as
> >> well.
> >>
> >> Gabe
> >>
> >> On Fri, Jan 17, 2020 at 6:13 AM Andreas Sandberg <
> andreas.sandb...@arm.com
> >> wrote:
> >>
> >>> Hi Everyone,
> >>>
> >>> As some of you might have seen, all development of Python 2.7 will
> cease
> >>> in April this year [1]. What that means in practice is that the default
> >>> version of Python in gem5 will no longer be supported by the Python
> team
> >>> after that point. Distributions will likely ship Python 2.7 for a few
> >> more
> >>> years though, but the default version has already switched to Python 3
> in
> >>> some cases.
> >>>
> >>> About a year ago, I posted a series of patches to make gem5 run in
> Python
> >>> 3. There is still one outstanding patch [2] that hasn't been merged
> since
> >>> the Python 2/3 meta-class compatibility code triggered some assertions
> >> that
> >>> I had to turn into warnings. If you want to try gem5 with Python 3, all
> >> you
> >>> have to do is to apply that patch and tell scons to use Python 3
> instead
> >> of
> >>> Python 2 (set PYHTHON_CONFIG=python3-config).
> >>>
> >>> I would suggest that we plan to phase out Python 2 completely sometime
> >>> this year. To reduce disruption, I would suggest that we plan for at
> >> least
> >>> one release that supports both Python 2 and 3, but defaults to Python
> 3.
> >>> After that, I would suggest that we drop Python 2.7 support entirely
> >> since
> >>> that would allow us to get rid of some compatibility code (e.g., the
> six
> >>> dependency) and re-enable the assertions disabled by [2]. Is this
> >> desirable
> >>> for the rest of the community? Is the timeline too aggressive / not
> >>> aggressive enough?
> >>>
> >>> If we decide to switch to Python 3 by default, we need to decide the
> >>> minimum supported Python 3 version. IIRC, the current implementation
> >> works
> >>> with Python 3.4, but we could probably mandate a newer version. Ubuntu
> >>> 16.04 supports 3.5 and 18.04 comes with version 3.6. RHEL/CentOS only
> >>> started to ship Python 3.6 in version 7 and doesn't support Python 3 at
> >> all
> >>> before release 7. Requiring Python 3.5 or even 3.6 seems pretty safe to
> >> me.
> >>> Cheers,
> >>> Andreas
> >>>
> >>> [1] http://pyfound.blogspot.com/2019/12/python-2-sunset.html
> >>> [2] 

Re: [gem5-dev] Python 2.7 deprecation - can we switch to Python 3?

2020-01-17 Thread Andreas Sandberg
Dropping support in 20.1 or 20.2 sounds good to me. In practice, that
means we can drop support on the development branch as soon as the
stable branch has been released. Are you suggesting that we aim to make
Python 3 the default, but keep support for 2.7, in gem5 20 when it is
released  in April?

As for the Python version, requiring 3.5 shouldn't be controversial at
all since all major distros that are still supported and support Python
3 ship with 3.5 or newer. I wouldn't mind going straight to 3.6, but it
might be controversial since Ubuntu 16.04 ships with 3.5 and will be
supported until early 2021.

Cheers,
Andreas

On 17/01/2020 16:19, Jason Lowe-Power wrote:
> Yes, this is very important.
>
> I think we could go ahead and make this a goal for gem5 20 to be released
> in April. We can support both in gem5-20.0 and in gem5-20.1 or 20.2 drop
> support for 2.7.
>
> Additionally, I'd like to see us require at least Python 3.5 so we can
> start using python type annotations:
> https://www.python.org/dev/peps/pep-0484/.
>
> Cheers,
> Jason
>
> On Fri, Jan 17, 2020 at 8:08 AM Gabe Black  wrote:
>
>> I think this seems like something we're going to need to do sooner rather
>> than later. I also made some changes recently which made our scons scripts
>> more compatible with python 3, but I don't think I fixed all the issues
>> entirely. I don't remember what issues were still there, but it should be
>> easy enough to re-discover them. Ideally we'd use python 3 in scons as
>> well.
>>
>> Gabe
>>
>> On Fri, Jan 17, 2020 at 6:13 AM Andreas Sandberg > wrote:
>>
>>> Hi Everyone,
>>>
>>> As some of you might have seen, all development of Python 2.7 will cease
>>> in April this year [1]. What that means in practice is that the default
>>> version of Python in gem5 will no longer be supported by the Python team
>>> after that point. Distributions will likely ship Python 2.7 for a few
>> more
>>> years though, but the default version has already switched to Python 3 in
>>> some cases.
>>>
>>> About a year ago, I posted a series of patches to make gem5 run in Python
>>> 3. There is still one outstanding patch [2] that hasn't been merged since
>>> the Python 2/3 meta-class compatibility code triggered some assertions
>> that
>>> I had to turn into warnings. If you want to try gem5 with Python 3, all
>> you
>>> have to do is to apply that patch and tell scons to use Python 3 instead
>> of
>>> Python 2 (set PYHTHON_CONFIG=python3-config).
>>>
>>> I would suggest that we plan to phase out Python 2 completely sometime
>>> this year. To reduce disruption, I would suggest that we plan for at
>> least
>>> one release that supports both Python 2 and 3, but defaults to Python 3.
>>> After that, I would suggest that we drop Python 2.7 support entirely
>> since
>>> that would allow us to get rid of some compatibility code (e.g., the six
>>> dependency) and re-enable the assertions disabled by [2]. Is this
>> desirable
>>> for the rest of the community? Is the timeline too aggressive / not
>>> aggressive enough?
>>>
>>> If we decide to switch to Python 3 by default, we need to decide the
>>> minimum supported Python 3 version. IIRC, the current implementation
>> works
>>> with Python 3.4, but we could probably mandate a newer version. Ubuntu
>>> 16.04 supports 3.5 and 18.04 comes with version 3.6. RHEL/CentOS only
>>> started to ship Python 3.6 in version 7 and doesn't support Python 3 at
>> all
>>> before release 7. Requiring Python 3.5 or even 3.6 seems pretty safe to
>> me.
>>> Cheers,
>>> Andreas
>>>
>>> [1] http://pyfound.blogspot.com/2019/12/python-2-sunset.html
>>> [2] 
>>> https://gem5-review.googlesource.com/c/public/gem5/+/15982
>>>
>>> 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 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


IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the 

[gem5-dev] Change in gem5/gem5[master]: tests: hello_se using dynamic tag

2020-01-17 Thread Giacomo Travaglini (Gerrit)

Hello Ciro Santilli,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: tests: hello_se using dynamic tag
..

tests: hello_se using dynamic tag

This patch is rewriting hello_se to distinguish between statically and
dynamically linked hello worlds.

Change-Id: I03c1add1d1ca568d150f4bacd89b2838a6d27035
Signed-off-by: Giacomo Travaglini 
Reviewed-by: Ciro Santilli 
---
M tests/gem5/hello_se/test_hello_se.py
1 file changed, 32 insertions(+), 20 deletions(-)



diff --git a/tests/gem5/hello_se/test_hello_se.py  
b/tests/gem5/hello_se/test_hello_se.py

index 74d7fb1..b6b78f0 100644
--- a/tests/gem5/hello_se/test_hello_se.py
+++ b/tests/gem5/hello_se/test_hello_se.py
@@ -43,8 +43,8 @@
 '''
 from testlib import *

-test_progs = {
-'x86': ('hello64-static', 'hello64-dynamic', 'hello32-static'),
+static_progs = {
+'x86': ('hello64-static', 'hello32-static'),
 'arm': ('hello64-static', 'hello32-static'),
 'alpha': ('hello',),
 'mips': ('hello',),
@@ -52,6 +52,10 @@
 'sparc': ('hello',)
 }

+dynamic_progs = {
+'x86': ('hello64-dynamic',)
+}
+
 if config.bin_path:
 base_path = config.bin_path
 else:
@@ -59,24 +63,32 @@
 'bin')

 urlbase = 'http://dist.gem5.org/dist/current/test-progs/hello/bin/'
-for isa in test_progs:
-for binary in test_progs[isa]:
-import os
-url = urlbase + isa + '/linux/' + binary
-path = joinpath(base_path, isa, 'linux')
-hello_program = DownloadedProgram(url, path, binary)
+ref_path = joinpath(getcwd(), 'ref')
+verifiers = (
+verifier.MatchStdoutNoPerf(joinpath(ref_path, 'simout')),
+)

-ref_path = joinpath(getcwd(), 'ref')
+def verify_config(isa, binary, compilation):
+url = urlbase + isa + '/linux/' + binary
+path = joinpath(base_path, isa, 'linux')
+hello_program = DownloadedProgram(url, path, binary)

-verifiers = (
-verifier.MatchStdoutNoPerf(joinpath(ref_path, 'simout')),
-)
+gem5_verify_config(
+name='test-'+binary,
+fixtures=(hello_program,),
+verifiers=verifiers,
+config=joinpath(config.base_dir, 'configs', 'example','se.py'),
+config_args=['--cmd', joinpath(path, binary)],
+valid_isas=(isa.upper(),),
+compilation=compilation,
+)

-gem5_verify_config(
-name='test-'+binary,
-fixtures=(hello_program,),
-verifiers=verifiers,
- 
config=joinpath(config.base_dir, 'configs', 'example','se.py'),

-config_args=['--cmd', joinpath(path, binary)],
-valid_isas=(isa.upper(),),
-)
+# Run statically linked hello worlds
+for isa in static_progs:
+for binary in static_progs[isa]:
+verify_config(isa, binary, constants.static_tag)
+
+# Run dynamically linked hello worlds
+for isa in dynamic_progs:
+for binary in dynamic_progs[isa]:
+verify_config(isa, binary, constants.dynamic_tag)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/24528
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: I03c1add1d1ca568d150f4bacd89b2838a6d27035
Gerrit-Change-Number: 24528
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini 
Gerrit-Reviewer: Ciro Santilli 
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]: tests: fs/linux/arm passing M5_PATH via commandline

2020-01-17 Thread Giacomo Travaglini (Gerrit)

Hello Ciro Santilli,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: tests: fs/linux/arm passing M5_PATH via commandline
..

tests: fs/linux/arm passing M5_PATH via commandline

This will make it configurable from the testing framework

Change-Id: If82d5e44927c67a1eaecf41505d1d55a6469a4cf
Signed-off-by: Giacomo Travaglini 
Reviewed-by: Ciro Santilli 
---
M tests/gem5/fs/linux/arm/run.py
M tests/gem5/fs/linux/arm/test.py
2 files changed, 11 insertions(+), 5 deletions(-)



diff --git a/tests/gem5/fs/linux/arm/run.py b/tests/gem5/fs/linux/arm/run.py
index f4d7f46..2183b5d 100644
--- a/tests/gem5/fs/linux/arm/run.py
+++ b/tests/gem5/fs/linux/arm/run.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2012, 2019 ARM Limited
+# Copyright (c) 2012, 2019-2020 ARM Limited
 # All rights reserved
 #
 # The license below extends only to copyright in the software and shall
@@ -59,7 +59,7 @@
 print('Exiting @ tick', m5.curTick(), 'because', exit_event.getCause())

 config = sys.argv[1]
-os.environ['M5_PATH'] = os.path.dirname(__file__)
+os.environ['M5_PATH'] = sys.argv[2]

 # path setup
 gem5_root =  
joinpath(os.path.dirname(__file__), '..', '..', '..', '..', '..')
diff --git a/tests/gem5/fs/linux/arm/test.py  
b/tests/gem5/fs/linux/arm/test.py

index 4ed58ae..2bd703b 100644
--- a/tests/gem5/fs/linux/arm/test.py
+++ b/tests/gem5/fs/linux/arm/test.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 ARM Limited
+# Copyright (c) 2019-2020 ARM Limited
 # All rights reserved
 #
 # The license below extends only to copyright in the software and shall
@@ -89,7 +89,10 @@
 arm_fs_binaries = DownloadedArchive(url, path, tarball)

 for name in arm_fs_quick_tests:
-args = [ joinpath(config.base_dir, 'tests', 'configs', name + '.py') ]
+args = [
+joinpath(config.base_dir, 'tests', 'configs', name + '.py'),
+path
+]
 gem5_verify_config(
 name=name,
 verifiers=(), # Add basic stat verifiers
@@ -101,7 +104,10 @@
 )

 for name in arm_fs_long_tests:
-args = [ joinpath(config.base_dir, 'tests', 'configs', name + '.py') ]
+args = [
+joinpath(config.base_dir, 'tests', 'configs', name + '.py'),
+path
+]
 gem5_verify_config(
 name=name,
 verifiers=(), # TODO: Add basic stat verifiers

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/24524
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: If82d5e44927c67a1eaecf41505d1d55a6469a4cf
Gerrit-Change-Number: 24524
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini 
Gerrit-Reviewer: Ciro Santilli 
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]: TESTING: update TESTING.md documentation

2020-01-17 Thread Giacomo Travaglini (Gerrit)

Hello Ciro Santilli,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: TESTING: update TESTING.md documentation
..

TESTING: update TESTING.md documentation

* Documentation was assuming only tests in tests/test-progs were run.
This is not true anymore since we are running linux-boot for arm
which doesn't have a directory inside test-progs and because it
is now possible to explicitly specify the bin directory
(--bin-path)

Change-Id: I4cbb02fa1c88839be45302ea64e07792e1fc81f5
Signed-off-by: Giacomo Travaglini 
Reviewed-by: Ciro Santilli 
---
M TESTING.md
1 file changed, 10 insertions(+), 3 deletions(-)



diff --git a/TESTING.md b/TESTING.md
index cf160e6..6670621 100644
--- a/TESTING.md
+++ b/TESTING.md
@@ -197,16 +197,23 @@

 ## Binary test applications

-The code for test binaries that are run in the gem5 guest during testing  
are

-found in `tests/test-progs`.
+The code for some test binaries that are run in the gem5 guest during
+testing can be found in `tests/test-progs`.
 There's one directory per test application.
 The source code is under the `source` directory.

 You may have a `bin` directory as well.
 The `bin` directory is automatically created when running the test case  
that
-uses the test binary. The binary is downloaded from the gem5 servers the  
first

+uses the test binary.
+This is not the case when a test is run via the --bin-path option.
+In that scenario a bin directory will be created in the selected path
+rather than in `tests/test-progs`.
+The binary is downloaded from the gem5 servers the first
 time it is referenced by a test.

+Some other tests (like Linux-boot) don't have sources inside gem5 and
+are simply downloaded from gem5 servers.
+
 ## Updating the test binaries

 The test infrastructure should check with the gem5 servers to ensure you  
have


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/24526
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: I4cbb02fa1c88839be45302ea64e07792e1fc81f5
Gerrit-Change-Number: 24526
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini 
Gerrit-Reviewer: Ciro Santilli 
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]: tests: Adding --bin-path option to select tests bin directory

2020-01-17 Thread Giacomo Travaglini (Gerrit)

Hello Ciro Santilli,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: tests: Adding --bin-path option to select tests bin  
directory

..

tests: Adding --bin-path option to select tests bin directory

So far lots of tests will download binaries inside the gem5 directory.
The path is also specific to the test being run.
This doesn't play well with an environment where gem5 is cloned from
scratch for every build, or if several gem5 are cloned in a single
machine.
Binaries will be automatically downloaded every time this happens.

This patch is adding a --bin-path option, so that it's possible to
setup a fixed directory with all pre-downloaded binaries.
By default it is set to None to preserve original behaviour.

Change-Id: I42fb25e3ce0a495c73672b15a097b1bd2607795c
Signed-off-by: Giacomo Travaglini 
Reviewed-by: Ciro Santilli 
---
M ext/testlib/config.py
M tests/gem5/cpu_tests/test.py
M tests/gem5/fs/linux/arm/test.py
M tests/gem5/hello_se/test_hello_se.py
M tests/gem5/m5_util/test_exit.py
5 files changed, 78 insertions(+), 8 deletions(-)



diff --git a/ext/testlib/config.py b/ext/testlib/config.py
index 5e28cd0..513463f 100644
--- a/ext/testlib/config.py
+++ b/ext/testlib/config.py
@@ -1,3 +1,15 @@
+# Copyright (c) 2020 ARM Limited
+# All rights reserved
+#
+# The license below extends only to copyright in the software and shall
+# not be construed as granting a license to any other intellectual
+# property including but not limited to intellectual property relating
+# to a hardware implementation of the functionality of the software
+# licensed hereunder.  You may use the software subject to the license
+# terms below provided that you ensure that this notice is replicated
+# unmodified and in its entirety in all distributions of the software,
+# modified or unmodified, in source code or in binary form.
+#
 # Copyright (c) 2017 Mark D. Hill and David A. Wood
 # All rights reserved.
 #
@@ -521,6 +533,13 @@
 action='store',
 help='The path to store results in.'
 ),
+Argument(
+'--bin-path',
+action='store',
+default=None,
+help='Path where binaries are stored (downloaded if not  
present)'

+),
+
 ]

 # NOTE: There is a limitation which arises due to this format. If you  
have

@@ -576,6 +595,7 @@
 common_args.directory.add_to(parser)
 common_args.build_dir.add_to(parser)
 common_args.base_dir.add_to(parser)
+common_args.bin_path.add_to(parser)
 common_args.threads.add_to(parser)
 common_args.test_threads.add_to(parser)
 common_args.isa.add_to(parser)
@@ -629,6 +649,7 @@
 ).add_to(parser)

 common_args.directory.add_to(parser)
+common_args.bin_path.add_to(parser)
 common_args.isa.add_to(parser)
 common_args.variant.add_to(parser)
 common_args.length.add_to(parser)
@@ -648,6 +669,7 @@
 common_args.directory.add_to(parser)
 common_args.build_dir.add_to(parser)
 common_args.base_dir.add_to(parser)
+common_args.bin_path.add_to(parser)
 common_args.threads.add_to(parser)
 common_args.test_threads.add_to(parser)
 common_args.isa.add_to(parser)
diff --git a/tests/gem5/cpu_tests/test.py b/tests/gem5/cpu_tests/test.py
index 58925de..0991ba0 100644
--- a/tests/gem5/cpu_tests/test.py
+++ b/tests/gem5/cpu_tests/test.py
@@ -1,3 +1,15 @@
+# Copyright (c) 2020 ARM Limited
+# All rights reserved
+#
+# The license below extends only to copyright in the software and shall
+# not be construed as granting a license to any other intellectual
+# property including but not limited to intellectual property relating
+# to a hardware implementation of the functionality of the software
+# licensed hereunder.  You may use the software subject to the license
+# terms below provided that you ensure that this notice is replicated
+# unmodified and in its entirety in all distributions of the software,
+# modified or unmodified, in source code or in binary form.
+#
 # Copyright (c) 2018 The Regents of the University of California
 # All Rights Reserved.
 #
@@ -41,8 +53,11 @@
 'riscv':  
('AtomicSimpleCPU', 'TimingSimpleCPU', 'MinorCPU', 'DerivO3CPU'),

 }

+if config.bin_path:
+base_path = config.bin_path
+else:
+base_path = joinpath(absdirpath(__file__), 'benchmarks', 'bin')

-base_path = joinpath(absdirpath(__file__), 'benchmarks', 'bin')
 base_url = 'http://gem5.org/dist/current/gem5/cpu_tests/benchmarks/bin/'
 for isa in valid_isas:
 path = joinpath(base_path, isa)
diff --git a/tests/gem5/fs/linux/arm/test.py  
b/tests/gem5/fs/linux/arm/test.py

index 2bd703b..46bc087 100644
--- a/tests/gem5/fs/linux/arm/test.py
+++ b/tests/gem5/fs/linux/arm/test.py
@@ -85,7 +85,8 @@

 tarball = 

[gem5-dev] Change in gem5/gem5[master]: tests: Add --compilation tag

2020-01-17 Thread Giacomo Travaglini (Gerrit)

Hello Ciro Santilli,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: tests: Add --compilation tag
..

tests: Add --compilation tag

This is to distinguish between statically from dynamically linked
regressions.  By default regressions are considered to be statically
linked.  If a dynamically linked regression is added, the
gem5_verify_config needs to pass constants.dynamic_tag to the
compilation argument to tag the regression.

Change-Id: I4c4044a4f1b8899f443856340df302df7c1aaf8e
Signed-off-by: Giacomo Travaglini 
Reviewed-by: Ciro Santilli 
---
M ext/testlib/config.py
M ext/testlib/main.py
M ext/testlib/suite.py
M tests/gem5/suite.py
4 files changed, 40 insertions(+), 1 deletion(-)



diff --git a/ext/testlib/config.py b/ext/testlib/config.py
index 513463f..1f2146d 100644
--- a/ext/testlib/config.py
+++ b/ext/testlib/config.py
@@ -251,6 +251,10 @@
 constants.quick_tag = 'quick'
 constants.long_tag = 'long'

+constants.compilation_tag_type = 'compilation'
+constants.static_tag = 'static'
+constants.dynamic_tag = 'dynamic'
+
 constants.supported_tags = {
 constants.isa_tag_type : (
 constants.x86_tag,
@@ -271,11 +275,16 @@
 constants.quick_tag,
 constants.long_tag,
 ),
+constants.compilation_tag_type: (
+constants.static_tag,
+constants.dynamic_tag
+),
 }

 constants.supported_isas = constants.supported_tags['isa']
 constants.supported_variants = constants.supported_tags['variant']
 constants.supported_lengths = constants.supported_tags['length']
+constants.supported_compilations =  
constants.supported_tags['compilation']


 constants.tempdir_fixture_name = 'tempdir'
 constants.gem5_simulation_stderr = 'simerr'
@@ -347,6 +356,12 @@
 else:
 return length

+def default_compilation(compilation):
+if not compilation[0]:
+return  
[constants.supported_tags[constants.compilation_tag_type]]

+else:
+return compilation
+
 def compile_tag_regex(positional_tags):
 if not positional_tags:
 return positional_tags
@@ -370,6 +385,7 @@
 config._add_post_processor('isa', default_isa)
 config._add_post_processor('variant', default_variant)
 config._add_post_processor('length', default_length)
+config._add_post_processor('compilation', default_compilation)
 config._add_post_processor('threads', threads_as_int)
 config._add_post_processor('test_threads', test_threads_as_int)
 config._add_post_processor(StorePositionalTagsAction.position_kword,
@@ -487,6 +503,12 @@
 default=[],
 help="Only tests that are one of these lengths. Comma  
separated."),

 Argument(
+'--compilation',
+action='append',
+default=[],
+help="Only tests that have been compiled in one of these  
ways. "

+ "Comma separated."),
+Argument(
 '--uid',
 action='store',
 default=None,
@@ -601,6 +623,7 @@
 common_args.isa.add_to(parser)
 common_args.variant.add_to(parser)
 common_args.length.add_to(parser)
+common_args.compilation.add_to(parser)
 common_args.include_tags.add_to(parser)
 common_args.exclude_tags.add_to(parser)

@@ -653,6 +676,7 @@
 common_args.isa.add_to(parser)
 common_args.variant.add_to(parser)
 common_args.length.add_to(parser)
+common_args.compilation.add_to(parser)
 common_args.include_tags.add_to(parser)
 common_args.exclude_tags.add_to(parser)

@@ -675,6 +699,7 @@
 common_args.isa.add_to(parser)
 common_args.variant.add_to(parser)
 common_args.length.add_to(parser)
+common_args.compilation.add_to(parser)

 config = _Config()
 define_constants(config.constants)
diff --git a/ext/testlib/main.py b/ext/testlib/main.py
index cbba000..c825f72 100644
--- a/ext/testlib/main.py
+++ b/ext/testlib/main.py
@@ -114,6 +114,7 @@
 special_tags = (
 cfg.constants.isa_tag_type,
 cfg.constants.length_tag_type,
+cfg.constants.compilation_tag_type,
 cfg.constants.variant_tag_type
 )

diff --git a/ext/testlib/suite.py b/ext/testlib/suite.py
index 2ce817a..9886415 100644
--- a/ext/testlib/suite.py
+++ b/ext/testlib/suite.py
@@ -1,3 +1,15 @@
+# Copyright (c) 2020 ARM Limited
+# All rights reserved
+#
+# The license below extends only to copyright in the software and shall
+# not be construed as granting a license to any other intellectual
+# property including but not limited to intellectual property relating
+# to a hardware implementation of the functionality of the software
+# licensed hereunder.  You may use the 

[gem5-dev] Change in gem5/gem5[master]: mem-cache: Add more compression stats

2020-01-17 Thread Daniel Carvalho (Gerrit)
Daniel Carvalho has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/22609 )


Change subject: mem-cache: Add more compression stats
..

mem-cache: Add more compression stats

Add stats to calculate the total number of compressions, decompressions
and the average compression size, in number of bits.

Change-Id: I5eb563856c1ff54216e1edcd2886332b7481cbfe
Signed-off-by: Daniel R. Carvalho 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22609
Tested-by: kokoro 
Reviewed-by: Nikos Nikoleris 
Maintainer: Nikos Nikoleris 
---
M src/mem/cache/compressors/base.cc
M src/mem/cache/compressors/base.hh
2 files changed, 59 insertions(+), 32 deletions(-)

Approvals:
  Nikos Nikoleris: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/mem/cache/compressors/base.cc  
b/src/mem/cache/compressors/base.cc

index 0016e47..297c6a9 100644
--- a/src/mem/cache/compressors/base.cc
+++ b/src/mem/cache/compressors/base.cc
@@ -35,6 +35,7 @@
 #include "mem/cache/compressors/base.hh"

 #include 
+#include 
 #include 
 #include 

@@ -73,7 +74,8 @@
 }

 BaseCacheCompressor::BaseCacheCompressor(const Params *p)
-: SimObject(p), blkSize(p->block_size),  
sizeThreshold(p->size_threshold)

+  : SimObject(p), blkSize(p->block_size), sizeThreshold(p->size_threshold),
+stats(*this)
 {
 fatal_if(blkSize < sizeThreshold, "Compressed data must fit in a  
block");

 }
@@ -107,7 +109,9 @@
 }

 // Update stats
-compressionSize[std::ceil(std::log2(comp_size_bits))]++;
+stats.compressions++;
+stats.compressionSizeBits += comp_size_bits;
+stats.compressionSize[std::ceil(std::log2(comp_size_bits))]++;

 // Print debug information
 DPRINTF(CacheComp, "Compressed cache line from %d to %d bits. " \
@@ -116,7 +120,7 @@
 }

 Cycles
-BaseCacheCompressor::getDecompressionLatency(const CacheBlk* blk) const
+BaseCacheCompressor::getDecompressionLatency(const CacheBlk* blk)
 {
 const CompressionBlk* comp_blk = static_castCompressionBlk*>(blk);


@@ -125,6 +129,7 @@
 const Cycles decomp_lat = comp_blk->getDecompressionLatency();
 DPRINTF(CacheComp, "Decompressing block: %s (%d cycles)\n",
 comp_blk->print(), decomp_lat);
+stats.decompressions += 1;
 return decomp_lat;
 }

@@ -152,22 +157,36 @@
 static_cast(blk)->setSizeBits(size_bits);
 }

-void
-BaseCacheCompressor::regStats()
+BaseCacheCompressor::BaseCacheCompressorStats::BaseCacheCompressorStats(
+BaseCacheCompressor& _compressor)
+  : Stats::Group(&_compressor), compressor(_compressor),
+compressions(this, "compressions",
+"Total number of compressions"),
+compressionSize(this, "compression_size",
+"Number of blocks that were compressed to this power of two size"),
+compressionSizeBits(this, "compression_size_bits",
+"Total compressed data size, in bits"),
+avgCompressionSizeBits(this, "avg_compression_size_bits",
+"Average compression size, in bits"),
+decompressions(this, "total_decompressions",
+"Total number of decompressions")
 {
-SimObject::regStats();
+}

-compressionSize
-.init(std::log2(blkSize*8) + 1)
-.name(name() + ".compression_size")
-.desc("Number of blocks that were compressed to this power of" \
-  "two size.")
-;
+void
+BaseCacheCompressor::BaseCacheCompressorStats::regStats()
+{
+Stats::Group::regStats();

-for (unsigned i = 0; i <= std::log2(blkSize*8); ++i) {
-compressionSize.subname(i, std::to_string(1 << i));
-compressionSize.subdesc(i, "Number of blocks that compressed to  
fit " \
-   "in " + std::to_string(1 << i) + "  
bits");

+compressionSize.init(std::log2(compressor.blkSize*8) + 1);
+for (unsigned i = 0; i <= std::log2(compressor.blkSize*8); ++i) {
+std::string str_i = std::to_string(1 << i);
+compressionSize.subname(i, str_i);
+compressionSize.subdesc(i,
+"Number of blocks that compressed to fit in " + str_i + "  
bits");

 }
+
+avgCompressionSizeBits.flags(Stats::total | Stats::nozero |  
Stats::nonan);

+avgCompressionSizeBits = compressionSizeBits / compressions;
 }

diff --git a/src/mem/cache/compressors/base.hh  
b/src/mem/cache/compressors/base.hh

index ea40b8d..027b26c 100644
--- a/src/mem/cache/compressors/base.hh
+++ b/src/mem/cache/compressors/base.hh
@@ -51,7 +51,8 @@
  * Base cache compressor interface. Every cache compressor must implement a
  * compression and a decompression method.
  */
-class BaseCacheCompressor : public SimObject {
+class BaseCacheCompressor : public SimObject
+{
   protected:
 /**
  * This compressor must be able to access the protected functions of
@@ -76,17 +77,29 @@
  */
 const std::size_t sizeThreshold;

-/**
- * @defgroup 

[gem5-dev] Change in gem5/gem5[master]: mem-cache: Factor out multiple block eviction

2020-01-17 Thread Daniel Carvalho (Gerrit)
Daniel Carvalho has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/22607 )


Change subject: mem-cache: Factor out multiple block eviction
..

mem-cache: Factor out multiple block eviction

Create a function to try to evict multiple blocks while checking for
transient state.

Change-Id: I6a879fa5e793cd92c4bdf4a258a133de4c865012
Signed-off-by: Daniel R. Carvalho 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22607
Tested-by: kokoro 
Reviewed-by: Nikos Nikoleris 
Maintainer: Nikos Nikoleris 
---
M src/mem/cache/base.cc
M src/mem/cache/base.hh
2 files changed, 58 insertions(+), 66 deletions(-)

Approvals:
  Nikos Nikoleris: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index d56fcbe..87f2af1 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -795,6 +795,43 @@
 }

 bool
+BaseCache::handleEvictions(std::vector _blks,
+PacketList )
+{
+bool replacement = false;
+for (const auto& blk : evict_blks) {
+if (blk->isValid()) {
+replacement = true;
+
+const MSHR* mshr =
+mshrQueue.findMatch(regenerateBlkAddr(blk),  
blk->isSecure());

+if (mshr) {
+// Must be an outstanding upgrade or clean request on a  
block

+// we're about to replace
+assert((!blk->isWritable() && mshr->needsWritable()) ||
+   mshr->isCleaning());
+return false;
+}
+}
+}
+
+// The victim will be replaced by a new entry, so increase the  
replacement

+// counter if a valid block is being replaced
+if (replacement) {
+stats.replacements++;
+
+// Evict valid blocks associated to this victim block
+for (auto& blk : evict_blks) {
+if (blk->isValid()) {
+evictBlock(blk, writebacks);
+}
+}
+}
+
+return true;
+}
+
+bool
 BaseCache::updateCompressionData(CacheBlk *blk, const uint64_t* data,
  PacketList )
 {
@@ -833,37 +870,20 @@
 // allocated blocks to make room for the expansion, but other  
approaches

 // that take the replacement data of the superblock into account may
 // generate better results
-std::vector evict_blks;
 const bool was_compressed = compression_blk->isCompressed();
 if (was_compressed && !is_co_allocatable) {
-// Get all co-allocated blocks
+std::vector evict_blks;
 for (const auto& sub_blk : superblock->blks) {
 if (sub_blk->isValid() && (compression_blk != sub_blk)) {
-// Check for transient state allocations. If any of the
-// entries listed for eviction has a transient state, the
-// allocation fails
-const Addr repl_addr = regenerateBlkAddr(sub_blk);
-const MSHR *repl_mshr =
-mshrQueue.findMatch(repl_addr, sub_blk->isSecure());
-if (repl_mshr) {
-DPRINTF(CacheRepl, "Aborting data expansion of %s  
due " \
-"to replacement of block in transient  
state: %s\n",

-compression_blk->print(), sub_blk->print());
-// Too hard to replace block with transient state, so  
it
-// cannot be evicted. Mark the update as failed and  
expect

-// the caller to evict this block. Since this is called
-// only when writebacks arrive, and packets do not  
contain

-// compressed data, there is no need to decompress
-compression_blk->setSizeBits(blkSize * 8);
-compression_blk->setDecompressionLatency(Cycles(0));
-compression_blk->setUncompressed();
-return false;
-}
-
 evict_blks.push_back(sub_blk);
 }
 }

+// Try to evict blocks; if it fails, give up on update
+if (!handleEvictions(evict_blks, writebacks)) {
+return false;
+}
+
 // Update the number of data expansions
 stats.dataExpansions++;

@@ -880,13 +900,6 @@
 compression_blk->setSizeBits(compression_size);
 compression_blk->setDecompressionLatency(decompression_lat);

-// Evict valid blocks
-for (const auto& evict_blk : evict_blks) {
-if (evict_blk->isValid()) {
-evictBlock(evict_blk, writebacks);
-}
-}
-
 return true;
 }

@@ -1427,42 +1440,9 @@
 // Print victim block's information
 DPRINTF(CacheRepl, "Replacement victim: %s\n", victim->print());

-// Check for transient state allocations. If any of the entries listed
-// for eviction has a transient state, the allocation 

[gem5-dev] Change in gem5/gem5[master]: mem-cache: Add multiple eviction stats

2020-01-17 Thread Daniel Carvalho (Gerrit)
Daniel Carvalho has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/22606 )


Change subject: mem-cache: Add multiple eviction stats
..

mem-cache: Add multiple eviction stats

Add stats to inform how many blocks were evicted due to a sector
replacement/eviction.

Change-Id: I886365506016d0888f835d182b3b65a808a9dccd
Signed-off-by: Daniel R. Carvalho 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22606
Tested-by: kokoro 
Reviewed-by: Nikos Nikoleris 
Maintainer: Nikos Nikoleris 
---
M src/mem/cache/tags/compressed_tags.cc
M src/mem/cache/tags/sector_tags.cc
M src/mem/cache/tags/sector_tags.hh
3 files changed, 48 insertions(+), 3 deletions(-)

Approvals:
  Nikos Nikoleris: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/mem/cache/tags/compressed_tags.cc  
b/src/mem/cache/tags/compressed_tags.cc

index 1871a7a..d2ab7cf 100644
--- a/src/mem/cache/tags/compressed_tags.cc
+++ b/src/mem/cache/tags/compressed_tags.cc
@@ -138,7 +138,9 @@

 // The whole superblock must be evicted to make room for the new  
one

 for (const auto& blk : victim_superblock->blks){
-evict_blks.push_back(blk);
+if (blk->isValid()) {
+evict_blks.push_back(blk);
+}
 }
 }

@@ -159,6 +161,9 @@
 }
 }

+// Update number of sub-blocks evicted due to a replacement
+sectorStats.evictionsReplacement[evict_blks.size()]++;
+
 return victim;
 }

diff --git a/src/mem/cache/tags/sector_tags.cc  
b/src/mem/cache/tags/sector_tags.cc

index 610cba8..d2fcd76 100644
--- a/src/mem/cache/tags/sector_tags.cc
+++ b/src/mem/cache/tags/sector_tags.cc
@@ -53,7 +53,8 @@
   replacementPolicy(p->replacement_policy),
   numBlocksPerSector(p->num_blocks_per_sector),
   numSectors(numBlocks / numBlocksPerSector),
-  sectorShift(floorLog2(blkSize)), sectorMask(numBlocksPerSector - 1)
+  sectorShift(floorLog2(blkSize)), sectorMask(numBlocksPerSector - 1),
+  sectorStats(stats, *this)
 {
 // Check parameters
 fatal_if(blkSize < 4 || !isPowerOf2(blkSize),
@@ -260,10 +261,15 @@
 } else {
 // The whole sector must be evicted to make room for the new sector
 for (const auto& blk : victim_sector->blks){
-evict_blks.push_back(blk);
+if (blk->isValid()) {
+evict_blks.push_back(blk);
+}
 }
 }

+// Update number of sub-blocks evicted due to a replacement
+sectorStats.evictionsReplacement[evict_blks.size()]++;
+
 return victim;
 }

@@ -282,6 +288,27 @@
 return sec_addr | ((Addr)blk_cast->getSectorOffset() << sectorShift);
 }

+SectorTags::SectorTagsStats::SectorTagsStats(BaseTagStats _group,
+SectorTags& _tags)
+  : Stats::Group(_group), tags(_tags),
+evictionsReplacement(this, "evictions_replacement",
+"Number of blocks evicted due to a replacement")
+{
+}
+
+void
+SectorTags::SectorTagsStats::regStats()
+{
+Stats::Group::regStats();
+
+evictionsReplacement.init(tags.numBlocksPerSector + 1);
+for (unsigned i = 0; i <= tags.numBlocksPerSector; ++i) {
+evictionsReplacement.subname(i, std::to_string(i));
+evictionsReplacement.subdesc(i, "Number of replacements that  
caused " \

+"the eviction of " + std::to_string(i) + " blocks");
+}
+}
+
 void
 SectorTags::forEachBlk(std::function visitor)
 {
diff --git a/src/mem/cache/tags/sector_tags.hh  
b/src/mem/cache/tags/sector_tags.hh

index 905a87a..3ad59e3 100644
--- a/src/mem/cache/tags/sector_tags.hh
+++ b/src/mem/cache/tags/sector_tags.hh
@@ -40,6 +40,7 @@
 #include 
 #include 

+#include "base/statistics.hh"
 #include "mem/cache/tags/base.hh"
 #include "mem/cache/tags/sector_blk.hh"
 #include "mem/packet.hh"
@@ -88,6 +89,18 @@
 /** Mask out all bits that aren't part of the sector tag. */
 const unsigned sectorMask;

+struct SectorTagsStats : public Stats::Group
+{
+const SectorTags& tags;
+
+SectorTagsStats(BaseTagStats _group, SectorTags& _tags);
+
+void regStats() override;
+
+/** Number of sub-blocks evicted due to a replacement. */
+Stats::Vector evictionsReplacement;
+} sectorStats;
+
   public:
 /** Convenience typedef. */
  typedef SectorTagsParams Params;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/22606
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: I886365506016d0888f835d182b3b65a808a9dccd
Gerrit-Change-Number: 22606
Gerrit-PatchSet: 5
Gerrit-Owner: Daniel Carvalho 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged

[gem5-dev] Change in gem5/gem5[master]: mem-cache: Make findVictim non-const

2020-01-17 Thread Daniel Carvalho (Gerrit)
Daniel Carvalho has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/22604 )


Change subject: mem-cache: Make findVictim non-const
..

mem-cache: Make findVictim non-const

In order to acquire stats when a victim is found,
findVictim must be made const.

Change-Id: I493c7849f07625c90b2b95fd220f50751f4d0f52
Signed-off-by: Daniel R. Carvalho 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22604
Tested-by: kokoro 
Reviewed-by: Nikos Nikoleris 
Maintainer: Nikos Nikoleris 
---
M src/mem/cache/tags/base.hh
M src/mem/cache/tags/base_set_assoc.hh
M src/mem/cache/tags/compressed_tags.cc
M src/mem/cache/tags/compressed_tags.hh
M src/mem/cache/tags/fa_lru.cc
M src/mem/cache/tags/fa_lru.hh
M src/mem/cache/tags/sector_tags.cc
M src/mem/cache/tags/sector_tags.hh
8 files changed, 8 insertions(+), 8 deletions(-)

Approvals:
  Nikos Nikoleris: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh
index 0a9f16b..88d08ca 100644
--- a/src/mem/cache/tags/base.hh
+++ b/src/mem/cache/tags/base.hh
@@ -280,7 +280,7 @@
  */
 virtual CacheBlk* findVictim(Addr addr, const bool is_secure,
  const std::size_t size,
- std::vector& evict_blks) const  
= 0;

+ std::vector& evict_blks) = 0;

 /**
  * Access block and update replacement data. May not succeed, in which  
case
diff --git a/src/mem/cache/tags/base_set_assoc.hh  
b/src/mem/cache/tags/base_set_assoc.hh

index efb08ca..0949994 100644
--- a/src/mem/cache/tags/base_set_assoc.hh
+++ b/src/mem/cache/tags/base_set_assoc.hh
@@ -167,7 +167,7 @@
  */
 CacheBlk* findVictim(Addr addr, const bool is_secure,
  const std::size_t size,
- std::vector& evict_blks) const override
+ std::vector& evict_blks) override
 {
 // Get possible entries to be victimized
 const std::vector entries =
diff --git a/src/mem/cache/tags/compressed_tags.cc  
b/src/mem/cache/tags/compressed_tags.cc

index 1394be8..1871a7a 100644
--- a/src/mem/cache/tags/compressed_tags.cc
+++ b/src/mem/cache/tags/compressed_tags.cc
@@ -103,7 +103,7 @@
 CacheBlk*
 CompressedTags::findVictim(Addr addr, const bool is_secure,
const std::size_t compressed_size,
-   std::vector& evict_blks) const
+   std::vector& evict_blks)
 {
 // Get all possible locations of this superblock
 const std::vector superblock_entries =
diff --git a/src/mem/cache/tags/compressed_tags.hh  
b/src/mem/cache/tags/compressed_tags.hh

index 2c2a699..cce76fc 100644
--- a/src/mem/cache/tags/compressed_tags.hh
+++ b/src/mem/cache/tags/compressed_tags.hh
@@ -109,7 +109,7 @@
  */
 CacheBlk* findVictim(Addr addr, const bool is_secure,
  const std::size_t compressed_size,
- std::vector& evict_blks) const  
override;

+ std::vector& evict_blks) override;

 /**
  * Insert the new block into the cache and update replacement data.
diff --git a/src/mem/cache/tags/fa_lru.cc b/src/mem/cache/tags/fa_lru.cc
index 5738dcb..2b3ef1b 100644
--- a/src/mem/cache/tags/fa_lru.cc
+++ b/src/mem/cache/tags/fa_lru.cc
@@ -197,7 +197,7 @@

 CacheBlk*
 FALRU::findVictim(Addr addr, const bool is_secure, const std::size_t size,
-  std::vector& evict_blks) const
+  std::vector& evict_blks)
 {
 // The victim is always stored on the tail for the FALRU
 FALRUBlk* victim = tail;
diff --git a/src/mem/cache/tags/fa_lru.hh b/src/mem/cache/tags/fa_lru.hh
index 2ca9f4d..199a82f 100644
--- a/src/mem/cache/tags/fa_lru.hh
+++ b/src/mem/cache/tags/fa_lru.hh
@@ -225,7 +225,7 @@
  */
 CacheBlk* findVictim(Addr addr, const bool is_secure,
  const std::size_t size,
- std::vector& evict_blks) const  
override;

+ std::vector& evict_blks) override;

 /**
  * Insert the new block into the cache and update replacement data.
diff --git a/src/mem/cache/tags/sector_tags.cc  
b/src/mem/cache/tags/sector_tags.cc

index 77fb53c..610cba8 100644
--- a/src/mem/cache/tags/sector_tags.cc
+++ b/src/mem/cache/tags/sector_tags.cc
@@ -222,7 +222,7 @@

 CacheBlk*
 SectorTags::findVictim(Addr addr, const bool is_secure, const std::size_t  
size,

-   std::vector& evict_blks) const
+   std::vector& evict_blks)
 {
 // Get possible entries to be victimized
 const std::vector sector_entries =
diff --git a/src/mem/cache/tags/sector_tags.hh  
b/src/mem/cache/tags/sector_tags.hh

index 13638b4..905a87a 100644
--- a/src/mem/cache/tags/sector_tags.hh
+++ 

Re: [gem5-dev] Python 2.7 deprecation - can we switch to Python 3?

2020-01-17 Thread Jason Lowe-Power
Yes, this is very important.

I think we could go ahead and make this a goal for gem5 20 to be released
in April. We can support both in gem5-20.0 and in gem5-20.1 or 20.2 drop
support for 2.7.

Additionally, I'd like to see us require at least Python 3.5 so we can
start using python type annotations:
https://www.python.org/dev/peps/pep-0484/.

Cheers,
Jason

On Fri, Jan 17, 2020 at 8:08 AM Gabe Black  wrote:

> I think this seems like something we're going to need to do sooner rather
> than later. I also made some changes recently which made our scons scripts
> more compatible with python 3, but I don't think I fixed all the issues
> entirely. I don't remember what issues were still there, but it should be
> easy enough to re-discover them. Ideally we'd use python 3 in scons as
> well.
>
> Gabe
>
> On Fri, Jan 17, 2020 at 6:13 AM Andreas Sandberg  >
> wrote:
>
> > Hi Everyone,
> >
> > As some of you might have seen, all development of Python 2.7 will cease
> > in April this year [1]. What that means in practice is that the default
> > version of Python in gem5 will no longer be supported by the Python team
> > after that point. Distributions will likely ship Python 2.7 for a few
> more
> > years though, but the default version has already switched to Python 3 in
> > some cases.
> >
> > About a year ago, I posted a series of patches to make gem5 run in Python
> > 3. There is still one outstanding patch [2] that hasn't been merged since
> > the Python 2/3 meta-class compatibility code triggered some assertions
> that
> > I had to turn into warnings. If you want to try gem5 with Python 3, all
> you
> > have to do is to apply that patch and tell scons to use Python 3 instead
> of
> > Python 2 (set PYHTHON_CONFIG=python3-config).
> >
> > I would suggest that we plan to phase out Python 2 completely sometime
> > this year. To reduce disruption, I would suggest that we plan for at
> least
> > one release that supports both Python 2 and 3, but defaults to Python 3.
> > After that, I would suggest that we drop Python 2.7 support entirely
> since
> > that would allow us to get rid of some compatibility code (e.g., the six
> > dependency) and re-enable the assertions disabled by [2]. Is this
> desirable
> > for the rest of the community? Is the timeline too aggressive / not
> > aggressive enough?
> >
> > If we decide to switch to Python 3 by default, we need to decide the
> > minimum supported Python 3 version. IIRC, the current implementation
> works
> > with Python 3.4, but we could probably mandate a newer version. Ubuntu
> > 16.04 supports 3.5 and 18.04 comes with version 3.6. RHEL/CentOS only
> > started to ship Python 3.6 in version 7 and doesn't support Python 3 at
> all
> > before release 7. Requiring Python 3.5 or even 3.6 seems pretty safe to
> me.
> >
> > Cheers,
> > Andreas
> >
> > [1] http://pyfound.blogspot.com/2019/12/python-2-sunset.html
> > [2] 
> > https://gem5-review.googlesource.com/c/public/gem5/+/15982
> >
> > 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 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] Python 2.7 deprecation - can we switch to Python 3?

2020-01-17 Thread Gabe Black
I think this seems like something we're going to need to do sooner rather
than later. I also made some changes recently which made our scons scripts
more compatible with python 3, but I don't think I fixed all the issues
entirely. I don't remember what issues were still there, but it should be
easy enough to re-discover them. Ideally we'd use python 3 in scons as well.

Gabe

On Fri, Jan 17, 2020 at 6:13 AM Andreas Sandberg 
wrote:

> Hi Everyone,
>
> As some of you might have seen, all development of Python 2.7 will cease
> in April this year [1]. What that means in practice is that the default
> version of Python in gem5 will no longer be supported by the Python team
> after that point. Distributions will likely ship Python 2.7 for a few more
> years though, but the default version has already switched to Python 3 in
> some cases.
>
> About a year ago, I posted a series of patches to make gem5 run in Python
> 3. There is still one outstanding patch [2] that hasn't been merged since
> the Python 2/3 meta-class compatibility code triggered some assertions that
> I had to turn into warnings. If you want to try gem5 with Python 3, all you
> have to do is to apply that patch and tell scons to use Python 3 instead of
> Python 2 (set PYHTHON_CONFIG=python3-config).
>
> I would suggest that we plan to phase out Python 2 completely sometime
> this year. To reduce disruption, I would suggest that we plan for at least
> one release that supports both Python 2 and 3, but defaults to Python 3.
> After that, I would suggest that we drop Python 2.7 support entirely since
> that would allow us to get rid of some compatibility code (e.g., the six
> dependency) and re-enable the assertions disabled by [2]. Is this desirable
> for the rest of the community? Is the timeline too aggressive / not
> aggressive enough?
>
> If we decide to switch to Python 3 by default, we need to decide the
> minimum supported Python 3 version. IIRC, the current implementation works
> with Python 3.4, but we could probably mandate a newer version. Ubuntu
> 16.04 supports 3.5 and 18.04 comes with version 3.6. RHEL/CentOS only
> started to ship Python 3.6 in version 7 and doesn't support Python 3 at all
> before release 7. Requiring Python 3.5 or even 3.6 seems pretty safe to me.
>
> Cheers,
> Andreas
>
> [1] http://pyfound.blogspot.com/2019/12/python-2-sunset.html
> [2] 
> https://gem5-review.googlesource.com/c/public/gem5/+/15982
>
> 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 mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[master]: cpu: Mark ExecContext::tcBase() as const

2020-01-17 Thread Giacomo Travaglini (Gerrit)
Giacomo Travaglini has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/24523 )



Change subject: cpu: Mark ExecContext::tcBase() as const
..

cpu: Mark ExecContext::tcBase() as const

Change-Id: Ia3965c05a1b00e0a9738ddbccb4dc0b651f78e5e
Signed-off-by: Giacomo Travaglini 
---
M src/cpu/base_dyn_inst.hh
M src/cpu/checker/cpu.hh
M src/cpu/exec_context.hh
M src/cpu/minor/exec_context.hh
M src/cpu/simple/exec_context.hh
5 files changed, 10 insertions(+), 10 deletions(-)



diff --git a/src/cpu/base_dyn_inst.hh b/src/cpu/base_dyn_inst.hh
index 85ad544..81b3999 100644
--- a/src/cpu/base_dyn_inst.hh
+++ b/src/cpu/base_dyn_inst.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, 2016-2019 ARM Limited
+ * Copyright (c) 2011, 2013, 2016-2020 ARM Limited
  * Copyright (c) 2013 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
@@ -919,7 +919,7 @@
 void setThreadState(ImplState *state) { thread = state; }

 /** Returns the thread context. */
-ThreadContext *tcBase() { return thread->getTC(); }
+ThreadContext *tcBase() const { return thread->getTC(); }

   public:
 /** Returns whether or not the eff. addr. source registers are ready.  
*/

diff --git a/src/cpu/checker/cpu.hh b/src/cpu/checker/cpu.hh
index 775381c..7d3d339 100644
--- a/src/cpu/checker/cpu.hh
+++ b/src/cpu/checker/cpu.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016-2018 ARM Limited
+ * Copyright (c) 2011, 2016-2018, 2020 ARM Limited
  * Copyright (c) 2013 Advanced Micro Devices, Inc.
  * All rights reserved
  *
@@ -595,7 +595,7 @@

 void dumpAndExit();

-ThreadContext *tcBase() override { return tc; }
+ThreadContext *tcBase() const override { return tc; }
 SimpleThread *threadBase() { return thread; }

 InstResult unverifiedResult;
diff --git a/src/cpu/exec_context.hh b/src/cpu/exec_context.hh
index a96ccfc..c1af767 100644
--- a/src/cpu/exec_context.hh
+++ b/src/cpu/exec_context.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016-2018 ARM Limited
+ * Copyright (c) 2014, 2016-2018, 2020 ARM Limited
  * All rights reserved
  *
  * The license below extends only to copyright in the software and shall
@@ -311,7 +311,7 @@
 /** @} */

 /** Returns a pointer to the ThreadContext. */
-virtual ThreadContext *tcBase() = 0;
+virtual ThreadContext *tcBase() const = 0;

 /**
  * @{
diff --git a/src/cpu/minor/exec_context.hh b/src/cpu/minor/exec_context.hh
index 4cc41c6..3e925586 100644
--- a/src/cpu/minor/exec_context.hh
+++ b/src/cpu/minor/exec_context.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2014, 2016-2018 ARM Limited
+ * Copyright (c) 2011-2014, 2016-2018, 2020 ARM Limited
  * Copyright (c) 2013 Advanced Micro Devices, Inc.
  * All rights reserved
  *
@@ -393,7 +393,7 @@
 thread.syscall(fault);
 }

-ThreadContext *tcBase() override { return thread.getTC(); }
+ThreadContext *tcBase() const override { return thread.getTC(); }

 /* @todo, should make stCondFailures persistent somewhere */
 unsigned int readStCondFailures() const override { return 0; }
diff --git a/src/cpu/simple/exec_context.hh b/src/cpu/simple/exec_context.hh
index 04be1a0..5924ada 100644
--- a/src/cpu/simple/exec_context.hh
+++ b/src/cpu/simple/exec_context.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2018 ARM Limited
+ * Copyright (c) 2014-2018, 2020 ARM Limited
  * All rights reserved
  *
  * The license below extends only to copyright in the software and shall
@@ -505,7 +505,7 @@
 }

 /** Returns a pointer to the ThreadContext. */
-ThreadContext *tcBase() override { return thread->getTC(); }
+ThreadContext *tcBase() const override { return thread->getTC(); }

 bool
 readPredicate() const override

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/24523
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: Ia3965c05a1b00e0a9738ddbccb4dc0b651f78e5e
Gerrit-Change-Number: 24523
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini 
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]: configs: MESI_Three_level python parameters

2020-01-17 Thread Giacomo Travaglini (Gerrit)
Giacomo Travaglini has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/24255 )


Change subject: configs: MESI_Three_level python parameters
..

configs: MESI_Three_level python parameters

Allow specifying the L0 cache parameters via command line in
MESI_Three_Level.

Change-Id: Ie2a7f74790ed4c81c408857eccc2b439c60627f5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24255
Reviewed-by: Jason Lowe-Power 
Maintainer: Jason Lowe-Power 
Tested-by: kokoro 
---
M configs/ruby/MESI_Three_Level.py
1 file changed, 31 insertions(+), 11 deletions(-)

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



diff --git a/configs/ruby/MESI_Three_Level.py  
b/configs/ruby/MESI_Three_Level.py

index 22b02fa..58ed3fb 100644
--- a/configs/ruby/MESI_Three_Level.py
+++ b/configs/ruby/MESI_Three_Level.py
@@ -1,6 +1,7 @@
 # Copyright (c) 2006-2007 The Regents of The University of Michigan
 # Copyright (c) 2009,2015 Advanced Micro Devices, Inc.
 # Copyright (c) 2013 Mark D. Hill and David A. Wood
+# Copyright (c) 2020 ARM Limited
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -48,6 +49,13 @@
 parser.add_option("--num-clusters", type = "int", default = 1,
 help = "number of clusters in a design in which there are  
shared\

 caches private to clusters")
+parser.add_option("--l0i_size", type="string", default="4096B")
+parser.add_option("--l0d_size", type="string", default="4096B")
+parser.add_option("--l0i_assoc", type="int", default=1)
+parser.add_option("--l0d_assoc", type="int", default=1)
+parser.add_option("--l0_transitions_per_cycle", type="int", default=32)
+parser.add_option("--l1_transitions_per_cycle", type="int", default=32)
+parser.add_option("--l2_transitions_per_cycle", type="int", default=4)
 return

 def create_system(options, full_system, system, dma_ports, bootmem,
@@ -89,11 +97,15 @@
 #
 # First create the Ruby objects associated with this cpu
 #
-l0i_cache = L0Cache(size = '4096B', assoc = 1, is_icache =  
True,

+l0i_cache = L0Cache(size = options.l0i_size,
+assoc = options.l0i_assoc,
+is_icache = True,
 start_index_bit = block_size_bits,
 replacement_policy = LRURP())

-l0d_cache = L0Cache(size = '4096B', assoc = 1, is_icache =  
False,

+l0d_cache = L0Cache(size = options.l0d_size,
+assoc = options.l0d_assoc,
+is_icache = False,
 start_index_bit = block_size_bits,
 replacement_policy = LRURP())

@@ -110,9 +122,12 @@
 clk_domain = system.cpu[i].clk_domain

 l0_cntrl = L0Cache_Controller(
-   version = i * num_cpus_per_cluster + j, Icache =  
l0i_cache,
-   Dcache = l0d_cache, send_evictions =  
send_evicts(options),

-   clk_domain = clk_domain, ruby_system = ruby_system)
+   version = i * num_cpus_per_cluster + j,
+   Icache = l0i_cache, Dcache = l0d_cache,
+   transitions_per_cycle =  
options.l0_transitions_per_cycle,

+   send_evictions = send_evicts(options),
+   clk_domain = clk_domain,
+   ruby_system = ruby_system)

 cpu_seq = RubySequencer(version = i * num_cpus_per_cluster + j,
 icache = l0i_cache,
@@ -130,7 +145,9 @@
 l1_cntrl = L1Cache_Controller(
 version = i * num_cpus_per_cluster + j,
 cache = l1_cache, l2_select_num_bits = l2_bits,
-cluster_id = i, ruby_system = ruby_system)
+cluster_id = i,
+transitions_per_cycle =  
options.l1_transitions_per_cycle,

+ruby_system = ruby_system)

 exec("ruby_system.l0_cntrl%d = l0_cntrl"
  % ( i * num_cpus_per_cluster + j))
@@ -173,7 +190,8 @@
 l2_cntrl = L2Cache_Controller(
 version = i * num_l2caches_per_cluster + j,
 L2cache = l2_cache, cluster_id = i,
-transitions_per_cycle = options.ports,
+transitions_per_cycle =\
+ options.l2_transitions_per_cycle,
 ruby_system = ruby_system)

 exec("ruby_system.l2_cntrl%d = l2_cntrl"
@@ -272,14 +290,16 @@

 FileSystemConfig.register_cache(level = 0,
 idu_type = 'Instruction',
-size = '4096B',
-line_size =  

[gem5-dev] Change in gem5/gem5[master]: misc: add Arm build_opts for MESI_Three_Level and MOESI_hammer

2020-01-17 Thread Giacomo Travaglini (Gerrit)
Giacomo Travaglini has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/24254 )


Change subject: misc: add Arm build_opts for MESI_Three_Level and  
MOESI_hammer

..

misc: add Arm build_opts for MESI_Three_Level and MOESI_hammer

Change-Id: I0d1c5671efdd3cb2041805ab615cdff76d3a5e8a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24254
Tested-by: kokoro 
Reviewed-by: Jason Lowe-Power 
Maintainer: Jason Lowe-Power 
---
A build_opts/ARM_MESI_Three_Level
A build_opts/ARM_MOESI_hammer
2 files changed, 12 insertions(+), 0 deletions(-)

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



diff --git a/build_opts/ARM_MESI_Three_Level  
b/build_opts/ARM_MESI_Three_Level

new file mode 100644
index 000..1836fb0
--- /dev/null
+++ b/build_opts/ARM_MESI_Three_Level
@@ -0,0 +1,6 @@
+# Copyright (c) 2019 ARM Limited
+# All rights reserved.
+
+TARGET_ISA = 'arm'
+CPU_MODELS = 'TimingSimpleCPU, O3CPU'
+PROTOCOL = 'MESI_Three_Level'
diff --git a/build_opts/ARM_MOESI_hammer b/build_opts/ARM_MOESI_hammer
new file mode 100644
index 000..2eddc5b
--- /dev/null
+++ b/build_opts/ARM_MOESI_hammer
@@ -0,0 +1,6 @@
+# Copyright (c) 2019 ARM Limited
+# All rights reserved.
+
+TARGET_ISA = 'arm'
+CPU_MODELS = 'TimingSimpleCPU, O3CPU'
+PROTOCOL = 'MOESI_hammer'

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/24254
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: I0d1c5671efdd3cb2041805ab615cdff76d3a5e8a
Gerrit-Change-Number: 24254
Gerrit-PatchSet: 3
Gerrit-Owner: Giacomo Travaglini 
Gerrit-Reviewer: Bobby R. Bruce 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-Reviewer: Timothy Hayes 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Python 2.7 deprecation - can we switch to Python 3?

2020-01-17 Thread Andreas Sandberg
Hi Everyone,

As some of you might have seen, all development of Python 2.7 will cease in 
April this year [1]. What that means in practice is that the default version of 
Python in gem5 will no longer be supported by the Python team after that point. 
Distributions will likely ship Python 2.7 for a few more years though, but the 
default version has already switched to Python 3 in some cases.

About a year ago, I posted a series of patches to make gem5 run in Python 3. 
There is still one outstanding patch [2] that hasn't been merged since the 
Python 2/3 meta-class compatibility code triggered some assertions that I had 
to turn into warnings. If you want to try gem5 with Python 3, all you have to 
do is to apply that patch and tell scons to use Python 3 instead of Python 2 
(set PYHTHON_CONFIG=python3-config).

I would suggest that we plan to phase out Python 2 completely sometime this 
year. To reduce disruption, I would suggest that we plan for at least one 
release that supports both Python 2 and 3, but defaults to Python 3. After 
that, I would suggest that we drop Python 2.7 support entirely since that would 
allow us to get rid of some compatibility code (e.g., the six dependency) and 
re-enable the assertions disabled by [2]. Is this desirable for the rest of the 
community? Is the timeline too aggressive / not aggressive enough?

If we decide to switch to Python 3 by default, we need to decide the minimum 
supported Python 3 version. IIRC, the current implementation works with Python 
3.4, but we could probably mandate a newer version. Ubuntu 16.04 supports 3.5 
and 18.04 comes with version 3.6. RHEL/CentOS only started to ship Python 3.6 
in version 7 and doesn't support Python 3 at all before release 7. Requiring 
Python 3.5 or even 3.6 seems pretty safe to me.

Cheers,
Andreas

[1] http://pyfound.blogspot.com/2019/12/python-2-sunset.html
[2]  
https://gem5-review.googlesource.com/c/public/gem5/+/15982

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] Cron /z/m5/regression/do-regression quick

2020-01-17 Thread Cron Daemon
* build/RISCV/tests/opt/quick/se/02.insttest/riscv/linux-rv64c/o3-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/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-atomic: 
FAILED!
* build/NULL/tests/opt/quick/se/70.tgen/null/none/tgen-simple-mem: CHANGED!
* build/NULL/tests/opt/quick/se/80.dram-openpage/null/none/dram-lowp: 
CHANGED!
* build/NULL/tests/opt/quick/se/80.dram-closepage/null/none/dram-lowp: 
CHANGED!
* build/NULL/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby: 
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-timing-ruby: 
CHANGED!
* build/MIPS/tests/opt/quick/se/00.hello/mips/linux/simple-atomic: 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-simple:
 CHANGED!
* build/MIPS/tests/opt/quick/se/00.hello/mips/linux/o3-timing: CHANGED!
* build/ALPHA/tests/opt/quick/se/01.hello-2T-smt/alpha/linux/o3-timing-mt: 
CHANGED!
* 
build/NULL_MOESI_hammer/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MOESI_hammer:
 CHANGED!
* build/NULL/tests/opt/quick/se/70.tgen/null/none/tgen-dram-ctrl: CHANGED!
* build/ALPHA/tests/opt/quick/se/00.hello/alpha/linux/simple-timing-ruby: 
CHANGED!
* build/ALPHA/tests/opt/quick/se/00.hello/alpha/linux/o3-timing: 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_MESI_Two_Level/tests/opt/quick/se/60.rubytest/null/none/rubytest-ruby-MESI_Two_Level:
 CHANGED!
* 
build/ALPHA/tests/opt/quick/fs/10.linux-boot/alpha/linux/tsunami-simple-atomic: 
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/fs/10.linux-boot/alpha/linux/tsunami-simple-atomic-dual:
 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-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/o3-timing: CHANGED!
* build/POWER/tests/opt/quick/se/00.hello/power/linux/simple-atomic: 
CHANGED!
* 
build/SPARC/tests/opt/quick/se/03.learning-gem5/sparc/linux/learning-gem5-p1-simple:
 CHANGED!
* build/X86/tests/opt/quick/se/00.hello/x86/linux/simple-timing: CHANGED!
* build/SPARC/tests/opt/quick/se/00.hello/sparc/linux/simple-timing-ruby: 
CHANGED!
* build/X86/tests/opt/quick/fs/10.linux-boot/x86/linux/pc-simple-timing: 
CHANGED!
* build/X86/tests/opt/quick/se/70.twolf/x86/linux/simple-timing: CHANGED!
* build/X86/tests/opt/quick/fs/10.linux-boot/x86/linux/pc-simple-atomic: 
CHANGED!
* build/X86/tests/opt/quick/se/10.mcf/x86/linux/simple-atomic: CHANGED!
* 
build/X86/tests/opt/quick/se/03.learning-gem5/x86/linux/learning-gem5-p1-two-level:
 CHANGED!
* 
build/X86/tests/opt/quick/se/03.learning-gem5/x86/linux/learning-gem5-p1-simple:
 CHANGED!
* build/X86/tests/opt/quick/se/70.twolf/x86/linux/simple-atomic: CHANGED!
* build/X86/tests/opt/quick/se/00.hello/x86/linux/simple-timing-ruby: 
CHANGED!
* build/X86/tests/opt/quick/se/00.hello/x86/linux/simple-atomic: CHANGED!
* build/X86/tests/opt/quick/se/00.hello/x86/linux/o3-timing: CHANGED!
* build/SPARC/tests/opt/quick/se/02.insttest/sparc/linux/simple-timing: 
CHANGED!
* build/SPARC/tests/opt/quick/se/02.insttest/sparc/linux/simple-atomic: 
CHANGED!
* 
build/SPARC/tests/opt/quick/se/40.m5threads-test-atomic/sparc/linux/simple-atomic-mp:
 CHANGED!
* build/SPARC/tests/opt/quick/se/02.insttest/sparc/linux/o3-timing: CHANGED!
* 
build/SPARC/tests/opt/quick/se/03.learning-gem5/sparc/linux/learning-gem5-p1-two-level:
 CHANGED!
* build/SPARC/tests/opt/quick/se/00.hello/sparc/linux/simple-timing: 
CHANGED!
* 
build/SPARC/tests/opt/quick/se/40.m5threads-test-atomic/sparc/linux/simple-timing-mp:
 CHANGED!
* 
build/SPARC/tests/opt/quick/se/40.m5threads-test-atomic/sparc/linux/o3-timing-mp:
 CHANGED!
*