From 873ceaded5d05116d4f8589f604b03520c906231 Mon Sep 17 00:00:00 2001 From: Matthew Poremba Date: Thu, 24 Sep 2020 13:10:04 -0500 Subject: [PATCH 01/17] configs: Set kvm_map in DRAMInterface in Ruby.py The kvm_map parameter from AbstractMemory has been moved from MemCtrl (formerly DRAMCtrl) to DRAMInterface. Assign it to DRAMInterface instead. Change-Id: I4508aefcf5eb859d9ffe05c81d85a1b84ee0a196 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35095 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- configs/ruby/Ruby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/ruby/Ruby.py b/configs/ruby/Ruby.py index 622771aa1a..86d5748e85 100644 --- a/configs/ruby/Ruby.py +++ b/configs/ruby/Ruby.py @@ -136,7 +136,7 @@ def setup_memory_controllers(system, ruby, dir_cntrls, options): mem_ctrl = m5.objects.MemCtrl(dram = dram_intf) if options.access_backing_store: - mem_ctrl.kvm_map=False + dram_intf.kvm_map=False mem_ctrls.append(mem_ctrl) dir_ranges.append(mem_ctrl.dram.range) From 4b63d5e7a87b3d7b30d41348c5edda3a02f5268c Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 25 Sep 2020 00:56:24 -0700 Subject: [PATCH 02/17] mem: When loading an image directly in memory, use the right CL size. Some code was added fairly recently which would load a memory image into a memory directly in order to make it easier to set up ROMs. Unfortunately, that code accidentally used the image size instead of the cache line size when setting up the port proxy which would actually write the data. This happens to work when the image size is a power of two since that's all the proxy checks for, but there's no guarantee that every image will be sized that way. This change instead looks into the system object, retrieves the cache line size from it, and uses that to set up the port proxy. Change-Id: I227ac475b855d9516e1feb881769e12ec4e7d598 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35155 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/mem/abstract_mem.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mem/abstract_mem.cc b/src/mem/abstract_mem.cc index a5730c78de..2de77e9ec5 100644 --- a/src/mem/abstract_mem.cc +++ b/src/mem/abstract_mem.cc @@ -93,7 +93,8 @@ AbstractMemory::initState() panic_if(!image_range.isSubset(range), "%s: memory image %s doesn't fit.", name(), file); - PortProxy proxy([this](PacketPtr pkt) { functionalAccess(pkt); }, size()); + PortProxy proxy([this](PacketPtr pkt) { functionalAccess(pkt); }, + system()->cacheLineSize()); panic_if(!image.write(proxy), "%s: Unable to write image."); } From 55cbc64d1eedcde9347d1a64c27215ab63b2867e Mon Sep 17 00:00:00 2001 From: Nikos Nikoleris Date: Thu, 17 Sep 2020 18:09:32 +0100 Subject: [PATCH 03/17] mem: Fix some reference use in range loops This change fixes two cases of range loops, one where we can't use lvalue reference, and one more where we have to use an lvalue reference as we can't create a copy. In both cases clang would warn. Change-Id: I760aa094af66be32a150bad37acc21d6fd512a65 Signed-off-by: Nikos Nikoleris Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34776 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/mem/ruby/common/BoolVec.cc | 4 ++-- src/mem/ruby/slicc_interface/RubySlicc_Util.hh | 4 ++-- src/mem/ruby/system/Sequencer.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mem/ruby/common/BoolVec.cc b/src/mem/ruby/common/BoolVec.cc index 603f714ced..1c2953288c 100644 --- a/src/mem/ruby/common/BoolVec.cc +++ b/src/mem/ruby/common/BoolVec.cc @@ -41,8 +41,8 @@ #include std::ostream& operator<<(std::ostream& os, const BoolVec& myvector) { - for (const auto& it: myvector) { - os << " " << it; + for (const bool e: myvector) { + os << " " << e; } return os; } diff --git a/src/mem/ruby/slicc_interface/RubySlicc_Util.hh b/src/mem/ruby/slicc_interface/RubySlicc_Util.hh index 8ff8884aae..155d134dff 100644 --- a/src/mem/ruby/slicc_interface/RubySlicc_Util.hh +++ b/src/mem/ruby/slicc_interface/RubySlicc_Util.hh @@ -256,8 +256,8 @@ inline int countBoolVec(BoolVec bVec) { int count = 0; - for (const auto &it: bVec) { - if (it) { + for (const bool e: bVec) { + if (e) { count++; } } diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc index 75c58d600e..dbc85c4182 100644 --- a/src/mem/ruby/system/Sequencer.cc +++ b/src/mem/ruby/system/Sequencer.cc @@ -167,7 +167,7 @@ Sequencer::wakeup() int total_outstanding = 0; for (const auto &table_entry : m_RequestTable) { - for (const auto seq_req : table_entry.second) { + for (const auto &seq_req : table_entry.second) { if (current_time - seq_req.issue_time < m_deadlock_threshold) continue; From 5c83d8f74c8c24df931d05c2e32cb57687056d27 Mon Sep 17 00:00:00 2001 From: Timothy Hayes Date: Wed, 23 Sep 2020 12:10:37 +0100 Subject: [PATCH 04/17] cpu: Allow storing an invalid HTM checkpoint Commits 02745afd and f9b4e32 introduced a mechanism for creating checkpoint objects for hardware transactional memory (HTM) and Arm TME. Because the checkpoint object also contains the local UID of a transaction, it is needed before any architectural checkpointing takes places. This caused segfaults when running HTM codes. This commit allows ISAs to allocate a checkpoint once at the beginning of simulation. In order to do that we need to remove the validity check assertion; the cpt will become valid only after a first successfull transaction start Change-Id: I233d01805f8ab655131ed8cd6404950a2bf6fbc7 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35015 Reviewed-by: Jason Lowe-Power Maintainer: Giacomo Travaglini Tested-by: kokoro --- src/cpu/o3/thread_context_impl.hh | 1 - src/cpu/simple_thread.cc | 1 - 2 files changed, 2 deletions(-) diff --git a/src/cpu/o3/thread_context_impl.hh b/src/cpu/o3/thread_context_impl.hh index 005aa57166..bea4dc7840 100644 --- a/src/cpu/o3/thread_context_impl.hh +++ b/src/cpu/o3/thread_context_impl.hh @@ -347,7 +347,6 @@ template void O3ThreadContext::setHtmCheckpointPtr(BaseHTMCheckpointPtr new_cpt) { - assert(!thread->htmCheckpoint->valid()); thread->htmCheckpoint = std::move(new_cpt); } diff --git a/src/cpu/simple_thread.cc b/src/cpu/simple_thread.cc index 28a1c80692..b9b69d89ec 100644 --- a/src/cpu/simple_thread.cc +++ b/src/cpu/simple_thread.cc @@ -196,6 +196,5 @@ SimpleThread::getHtmCheckpointPtr() void SimpleThread::setHtmCheckpointPtr(BaseHTMCheckpointPtr new_cpt) { - assert(!_htmCheckpoint->valid()); _htmCheckpoint = std::move(new_cpt); } From d9d4203e04d9d027c3d6c0d7eed1af89ebd4574a Mon Sep 17 00:00:00 2001 From: Timothy Hayes Date: Wed, 23 Sep 2020 14:39:46 +0100 Subject: [PATCH 05/17] arch-arm: Instantiate a single HTM checkpoint at ISA::startup Change-Id: I48cc71dce607233f025387379507bcd485943dde Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35016 Reviewed-by: Jason Lowe-Power Maintainer: Giacomo Travaglini Tested-by: kokoro --- src/arch/arm/insts/tme64ruby.cc | 13 +++++++------ src/arch/arm/isa.cc | 9 ++++++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/arch/arm/insts/tme64ruby.cc b/src/arch/arm/insts/tme64ruby.cc index 99481ba436..f8d9481970 100644 --- a/src/arch/arm/insts/tme64ruby.cc +++ b/src/arch/arm/insts/tme64ruby.cc @@ -109,15 +109,16 @@ Tstart64::completeAcc(PacketPtr pkt, ExecContext *xc, // checkpointing occurs in the outer transaction only if (htm_depth == 1) { - auto new_cpt = new HTMCheckpoint(); + BaseHTMCheckpointPtr& cpt = xc->tcBase()->getHtmCheckpointPtr(); - new_cpt->save(tc); - new_cpt->destinationRegister(dest); + HTMCheckpoint *armcpt = + dynamic_cast(cpt.get()); + assert(armcpt != nullptr); + + armcpt->save(tc); + armcpt->destinationRegister(dest); ArmISA::globalClearExclusive(tc); - - xc->tcBase()->setHtmCheckpointPtr( - std::unique_ptr(new_cpt)); } xc->setIntRegOperand(this, 0, (Dest64) & mask(intWidth)); diff --git a/src/arch/arm/isa.cc b/src/arch/arm/isa.cc index 9ace2367f4..4ad1125ebc 100644 --- a/src/arch/arm/isa.cc +++ b/src/arch/arm/isa.cc @@ -38,6 +38,7 @@ #include "arch/arm/isa.hh" #include "arch/arm/faults.hh" +#include "arch/arm/htm.hh" #include "arch/arm/interrupts.hh" #include "arch/arm/pmu.hh" #include "arch/arm/self_debug.hh" @@ -439,9 +440,15 @@ ISA::startup() { BaseISA::startup(); - if (tc) + if (tc) { setupThreadContext(); + if (haveTME) { + std::unique_ptr cpt(new HTMCheckpoint()); + tc->setHtmCheckpointPtr(std::move(cpt)); + } + } + afterStartup = true; } From b715c2d513f43c1b717dd62c30ee5b1bdbde079c Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 22 Sep 2020 12:37:34 -0700 Subject: [PATCH 06/17] python: Flush the simulation stdout/stderr buffers Occasionally gem5's stdout/stderr, when run within the TestLib framework, will be shuffled. This is resolved by flushing the stdout/stderr buffer before and after simulation. In addition to this, the verifier.py has been improved to remove boilerplate gem5 code from the stdout comparison. Change-Id: I04c8f9cee4475b8eab2f1ba9bb76bfa3cfcca6ec Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34995 Reviewed-by: Jason Lowe-Power Reviewed-by: Andreas Sandberg Maintainer: Jason Lowe-Power Maintainer: Andreas Sandberg Tested-by: kokoro --- src/python/m5/simulate.py | 10 +++++++++- tests/gem5/cpu_tests/ref/Bubblesort | 4 ---- tests/gem5/cpu_tests/ref/FloatMM | 4 ---- tests/gem5/dram-lowp/ref/simout | 4 ---- tests/gem5/hello_se/ref/simout | 4 ---- tests/gem5/insttest_se/ref/sparc/linux/insttest/simout | 4 ---- tests/gem5/learning_gem5/ref/hello | 4 ---- tests/gem5/learning_gem5/ref/hello_goodbye | 4 ---- tests/gem5/learning_gem5/ref/simple | 4 ---- tests/gem5/learning_gem5/ref/test | 4 ---- tests/gem5/learning_gem5/ref/threads | 4 ---- tests/gem5/m5threads_test_atomic/ref/sparc64/simout | 4 ---- tests/gem5/verifier.py | 3 +++ 13 files changed, 12 insertions(+), 45 deletions(-) diff --git a/src/python/m5/simulate.py b/src/python/m5/simulate.py index 698dfbc62d..080d725a12 100644 --- a/src/python/m5/simulate.py +++ b/src/python/m5/simulate.py @@ -175,7 +175,15 @@ def simulate(*args, **kwargs): if _drain_manager.isDrained(): _drain_manager.resume() - return _m5.event.simulate(*args, **kwargs) + # We flush stdout and stderr before and after the simulation to ensure the + # output arrive in order. + sys.stdout.flush() + sys.stderr.flush() + sim_out = _m5.event.simulate(*args, **kwargs) + sys.stdout.flush() + sys.stderr.flush() + + return sim_out def drain(): """Drain the simulator in preparation of a checkpoint or memory mode diff --git a/tests/gem5/cpu_tests/ref/Bubblesort b/tests/gem5/cpu_tests/ref/Bubblesort index 79d2ae3119..76f4de047b 100644 --- a/tests/gem5/cpu_tests/ref/Bubblesort +++ b/tests/gem5/cpu_tests/ref/Bubblesort @@ -1,6 +1,2 @@ -gem5 Simulator System. http://gem5.org -gem5 is copyrighted software; use the --copyright option for details. - - Global frequency set at 1000000000000 ticks per second -50000 diff --git a/tests/gem5/cpu_tests/ref/FloatMM b/tests/gem5/cpu_tests/ref/FloatMM index 6539627a25..0f1d582ffe 100644 --- a/tests/gem5/cpu_tests/ref/FloatMM +++ b/tests/gem5/cpu_tests/ref/FloatMM @@ -1,6 +1,2 @@ -gem5 Simulator System. http://gem5.org -gem5 is copyrighted software; use the --copyright option for details. - - Global frequency set at 1000000000000 ticks per second -776.000061 diff --git a/tests/gem5/dram-lowp/ref/simout b/tests/gem5/dram-lowp/ref/simout index 5128ab4f4b..6fdcf8545e 100644 --- a/tests/gem5/dram-lowp/ref/simout +++ b/tests/gem5/dram-lowp/ref/simout @@ -1,7 +1,3 @@ -gem5 Simulator System. http://gem5.org -gem5 is copyrighted software; use the --copyright option for details. - - Global frequency set at 1000000000000 ticks per second --- Done DRAM low power sweep --- Fixed params - diff --git a/tests/gem5/hello_se/ref/simout b/tests/gem5/hello_se/ref/simout index a38e2880d4..9e8cf2779e 100644 --- a/tests/gem5/hello_se/ref/simout +++ b/tests/gem5/hello_se/ref/simout @@ -1,7 +1,3 @@ -gem5 Simulator System. http://gem5.org -gem5 is copyrighted software; use the --copyright option for details. - - Global frequency set at 1000000000000 ticks per second **** REAL SIMULATION **** Hello world! diff --git a/tests/gem5/insttest_se/ref/sparc/linux/insttest/simout b/tests/gem5/insttest_se/ref/sparc/linux/insttest/simout index 466574666d..81a0b927df 100644 --- a/tests/gem5/insttest_se/ref/sparc/linux/insttest/simout +++ b/tests/gem5/insttest_se/ref/sparc/linux/insttest/simout @@ -1,7 +1,3 @@ -gem5 Simulator System. http://gem5.org -gem5 is copyrighted software; use the --copyright option for details. - - Global frequency set at 1000000000000 ticks per second **** REAL SIMULATION **** Begining test of difficult SPARC instructions... diff --git a/tests/gem5/learning_gem5/ref/hello b/tests/gem5/learning_gem5/ref/hello index 0f0a7d63f4..bcdd7b91e0 100644 --- a/tests/gem5/learning_gem5/ref/hello +++ b/tests/gem5/learning_gem5/ref/hello @@ -1,7 +1,3 @@ -gem5 Simulator System. http://gem5.org -gem5 is copyrighted software; use the --copyright option for details. - - Global frequency set at 1000000000000 ticks per second Beginning simulation! Hello world! diff --git a/tests/gem5/learning_gem5/ref/hello_goodbye b/tests/gem5/learning_gem5/ref/hello_goodbye index 8e80377b22..cdaace8cea 100644 --- a/tests/gem5/learning_gem5/ref/hello_goodbye +++ b/tests/gem5/learning_gem5/ref/hello_goodbye @@ -1,7 +1,3 @@ -gem5 Simulator System. http://gem5.org -gem5 is copyrighted software; use the --copyright option for details. - - Global frequency set at 1000000000000 ticks per second Beginning simulation! Exiting @ tick 10944163 because Goodbye hello!! Goodbye hello!! Goodbye hello!! Goodbye hello!! Goodbye hello!! Goodbye hello!! Goo diff --git a/tests/gem5/learning_gem5/ref/simple b/tests/gem5/learning_gem5/ref/simple index b4c614a0c3..71a3d6284c 100644 --- a/tests/gem5/learning_gem5/ref/simple +++ b/tests/gem5/learning_gem5/ref/simple @@ -1,7 +1,3 @@ -gem5 Simulator System. http://gem5.org -gem5 is copyrighted software; use the --copyright option for details. - - Global frequency set at 1000000000000 ticks per second Hello World! From a SimObject! Beginning simulation! diff --git a/tests/gem5/learning_gem5/ref/test b/tests/gem5/learning_gem5/ref/test index 794ccdd202..309ac2fa40 100644 --- a/tests/gem5/learning_gem5/ref/test +++ b/tests/gem5/learning_gem5/ref/test @@ -1,7 +1,3 @@ -gem5 Simulator System. http://gem5.org -gem5 is copyrighted software; use the --copyright option for details. - - Global frequency set at 1000000000 ticks per second Beginning simulation! Exiting @ tick 9981 because Ruby Tester completed diff --git a/tests/gem5/learning_gem5/ref/threads b/tests/gem5/learning_gem5/ref/threads index 18a47fddb0..841ad733f4 100644 --- a/tests/gem5/learning_gem5/ref/threads +++ b/tests/gem5/learning_gem5/ref/threads @@ -1,7 +1,3 @@ -gem5 Simulator System. http://gem5.org -gem5 is copyrighted software; use the --copyright option for details. - - Global frequency set at 1000000000000 ticks per second Beginning simulation! Running on 2 cores. with 100 values diff --git a/tests/gem5/m5threads_test_atomic/ref/sparc64/simout b/tests/gem5/m5threads_test_atomic/ref/sparc64/simout index c6b51ca076..dbe1405e53 100644 --- a/tests/gem5/m5threads_test_atomic/ref/sparc64/simout +++ b/tests/gem5/m5threads_test_atomic/ref/sparc64/simout @@ -1,7 +1,3 @@ -gem5 Simulator System. http://gem5.org -gem5 is copyrighted software; use the --copyright option for details. - - Global frequency set at 1000000000000 ticks per second Init done [Iteration 1, Thread 1] Got lock diff --git a/tests/gem5/verifier.py b/tests/gem5/verifier.py index ba4bd4ff54..60d44f3984 100644 --- a/tests/gem5/verifier.py +++ b/tests/gem5/verifier.py @@ -115,6 +115,9 @@ class DerivedGoldStandard(MatchGoldStandard): class MatchStdout(DerivedGoldStandard): _file = constants.gem5_simulation_stdout _default_ignore_regex = [ + re.compile('^\s+$'), # Remove blank lines. + re.compile('^gem5 Simulator System'), + re.compile('^gem5 is copyrighted software'), re.compile('^Redirecting (stdout|stderr) to'), re.compile('^gem5 version '), re.compile('^gem5 compiled '), From 16b2c029f5777ec4f728493e752371fb4913b576 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 21 Sep 2020 13:51:19 -0700 Subject: [PATCH 07/17] scons,python: Prioritize Python3 for PYTHON_CONFIG Change-Id: I0ac4d90b93f2e0a9384216f759937f7b0aa23d41 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34899 Reviewed-by: Jason Lowe-Power Reviewed-by: Andreas Sandberg Maintainer: Gabe Black Tested-by: kokoro --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index ca3f1a1dbe..316c10b2f3 100755 --- a/SConstruct +++ b/SConstruct @@ -238,7 +238,7 @@ global_vars.AddVariables( ('MARSHAL_CCFLAGS_EXTRA', 'Extra C and C++ marshal compiler flags', ''), ('MARSHAL_LDFLAGS_EXTRA', 'Extra marshal linker flags', ''), ('PYTHON_CONFIG', 'Python config binary to use', - [ 'python2.7-config', 'python-config', 'python3-config' ]), + [ 'python3-config', 'python-config', 'python2.7-config' ]), ('PROTOC', 'protoc tool', environ.get('PROTOC', 'protoc')), ('BATCH', 'Use batch pool for build and tests', False), ('BATCH_CMD', 'Batch pool submission command name', 'qdo'), From 5eb9cdd2c6317922182ec38024d1af13b6c07bb8 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 28 Sep 2020 11:23:38 -0700 Subject: [PATCH 08/17] scons,python: Add python2-config to PYTHON_CONFIG PYTHON_CONFIG can be python2-config as well as python2.7-config. Change-Id: I482cb922fcf26b37f67f2aca392e04968ca144bd Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35255 Reviewed-by: Jason Lowe-Power Reviewed-by: Andreas Sandberg Maintainer: Jason Lowe-Power Tested-by: kokoro --- SConstruct | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 316c10b2f3..667a0e6478 100755 --- a/SConstruct +++ b/SConstruct @@ -238,7 +238,8 @@ global_vars.AddVariables( ('MARSHAL_CCFLAGS_EXTRA', 'Extra C and C++ marshal compiler flags', ''), ('MARSHAL_LDFLAGS_EXTRA', 'Extra marshal linker flags', ''), ('PYTHON_CONFIG', 'Python config binary to use', - [ 'python3-config', 'python-config', 'python2.7-config' ]), + [ 'python3-config', 'python-config', 'python2.7-config', 'python2-config'] + ), ('PROTOC', 'protoc tool', environ.get('PROTOC', 'protoc')), ('BATCH', 'Use batch pool for build and tests', False), ('BATCH_CMD', 'Batch pool submission command name', 'qdo'), From e2460a5dab43d55b489ca17241058fc5358634b3 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 22 Sep 2020 13:05:02 -0700 Subject: [PATCH 09/17] tests: Removing gem5/hello_se/ref/simerr This is not needed in any comparison we make. It was probably added in error. Change-Id: Ie771654f73d101d0ef90ca6e2864a7cb684b3919 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34996 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- tests/gem5/hello_se/ref/simerr | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tests/gem5/hello_se/ref/simerr diff --git a/tests/gem5/hello_se/ref/simerr b/tests/gem5/hello_se/ref/simerr deleted file mode 100644 index e69de29bb2..0000000000 From 81779301d8d131b50a661d64b18412a318c34023 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 28 Sep 2020 11:56:19 -0700 Subject: [PATCH 10/17] scons,python: Add warning for when python3-config is not used We cannot say for certain whether 'python-config' is python2 or python3, but this patch will produce a warning if 'python3-config' is not used, stating that support for python2 will be dropped in future releases of gem5. Change-Id: I114da359c8768071bf7dd7f2701aae85e3459678 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35256 Reviewed-by: Jason Lowe-Power Reviewed-by: Andreas Sandberg Maintainer: Jason Lowe-Power Maintainer: Andreas Sandberg Tested-by: kokoro --- SConstruct | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SConstruct b/SConstruct index 667a0e6478..621f923cdb 100755 --- a/SConstruct +++ b/SConstruct @@ -637,6 +637,10 @@ if main['USE_PYTHON']: main['PYTHON_CONFIG']) print("Info: Using Python config: %s" % (python_config, )) + if python_config != 'python3-config': + warning('python3-config could not be found.\n' + 'Future releases of gem5 will drop support for python2.') + py_includes = readCommand([python_config, '--includes'], exception='').split() py_includes = list(filter( From c79dcaf498b546f10583b91f4f9745c24036c4d4 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Fri, 25 Sep 2020 10:25:43 -0700 Subject: [PATCH 11/17] tests,misc: Updated TestLib and boot-tests for gzipped imgs In efforts to reduce storage costs and download times, the images hosted by us have been gzipped. The TestLib framework has therefore been extended to decompress gzipped files after download. The x86-boot-tests are, at present, the only tests which use the gem5 images. These tests have been updated to download the gzipped image. Change-Id: I6b2dbe9472a604148834820db8ea70e91e94376f Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35257 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- tests/gem5/fixture.py | 21 +++++++++++++++++--- tests/gem5/x86-boot-tests/test_linux_boot.py | 4 ++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/tests/gem5/fixture.py b/tests/gem5/fixture.py index bb911dde0f..e21cb88598 100644 --- a/tests/gem5/fixture.py +++ b/tests/gem5/fixture.py @@ -42,6 +42,7 @@ import shutil import sys import socket import threading +import gzip from six.moves import urllib @@ -260,11 +261,11 @@ class DownloadedProgram(UniqueFixture): and downloads an updated version if it is needed. """ - def __new__(cls, url, path, filename): + def __new__(cls, url, path, filename, gzip_decompress=False): target = joinpath(path, filename) return super(DownloadedProgram, cls).__new__(cls, target) - def _init(self, url, path, filename, **kwargs): + def _init(self, url, path, filename, gzip_decompress=False, **kwargs): """ url: string The url of the archive @@ -272,12 +273,16 @@ class DownloadedProgram(UniqueFixture): The absolute path of the directory containing the archive filename: string The name of the archive + gzip_decompress: boolean + True if this target resource have been compressed using gzip and + is to be decompressed prior to usage. """ self.url = url self.path = path self.filename = joinpath(path, filename) self.name = "Downloaded:" + self.filename + self.gzip_decompress = gzip_decompress def _download(self): import errno @@ -288,7 +293,17 @@ class DownloadedProgram(UniqueFixture): except OSError as e: if e.errno != errno.EEXIST: raise - urllib.request.urlretrieve(self.url, self.filename) + if self.gzip_decompress: + gzipped_filename = self.filename + ".gz" + urllib.request.urlretrieve(self.url, gzipped_filename) + + with open(self.filename, 'w') as outfile: + with gzip.open(gzipped_filename, 'r') as infile: + shutil.copyfileobj(infile, outfile) + + os.remove(gzipped_filename) + else: + urllib.request.urlretrieve(self.url, self.filename) def _getremotetime(self): import datetime, time diff --git a/tests/gem5/x86-boot-tests/test_linux_boot.py b/tests/gem5/x86-boot-tests/test_linux_boot.py index 0e66659202..d73f3a1202 100644 --- a/tests/gem5/x86-boot-tests/test_linux_boot.py +++ b/tests/gem5/x86-boot-tests/test_linux_boot.py @@ -34,13 +34,13 @@ else: base_path = joinpath(absdirpath(__file__), '..', 'resources', 'ubuntu-boot') -image_url = config.resource_url + '/images/x86/ubuntu-18-04/base.img' +image_url = config.resource_url + '/images/x86/ubuntu-18-04/base.img.gz' kernel_url = config.resource_url + '/kernels/x86/static/vmlinux-4.19.83' image_name = 'ubuntu-18-04-base.img' kernel_name = 'vmlinux-4.19.83' # 4.19 is LTS (Projected EOL: Dec, 2020) -image = DownloadedProgram(image_url, base_path, image_name) +image = DownloadedProgram(image_url, base_path, image_name, True) kernel = DownloadedProgram(kernel_url, base_path, kernel_name) From 7c9ff611d6a8e11a4c479bc6d0e70ebd184d6357 Mon Sep 17 00:00:00 2001 From: Nikos Nikoleris Date: Tue, 29 Sep 2020 10:28:24 +0100 Subject: [PATCH 12/17] ext: Disable range-loop-analysis warnings for pybind11 Change-Id: I9d9e118c1c70c2f6b11260fff31ecd763e491115 Signed-off-by: Nikos Nikoleris Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35296 Reviewed-by: Bobby R. Bruce Maintainer: Bobby R. Bruce Tested-by: kokoro --- ext/pybind11/include/pybind11/pybind11.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/pybind11/include/pybind11/pybind11.h b/ext/pybind11/include/pybind11/pybind11.h index a9ee31a34f..04ef30f283 100644 --- a/ext/pybind11/include/pybind11/pybind11.h +++ b/ext/pybind11/include/pybind11/pybind11.h @@ -12,6 +12,7 @@ #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-value" +#pragma clang diagnostic warning "-Wrange-loop-analysis" #endif #if defined(__INTEL_COMPILER) From 65338a63d25f6e84eb451f9020d0a251e4a70444 Mon Sep 17 00:00:00 2001 From: Sungkeun Kim Date: Thu, 24 Sep 2020 06:42:18 -0500 Subject: [PATCH 13/17] sim: Adding missing argument of panic function panic function call in panicFsOnlyPseudoInst (src/sim/pseudo_inst.cc) needs to be invoked with argument (name). Jira Issue: https://gem5.atlassian.net/jira/software/c/projects/GEM5/issues/GEM5-786?filter=allissues Change-Id: Iecacab7b9e0383373b69e9b790fa822d173d29c3 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35040 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/sim/pseudo_inst.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sim/pseudo_inst.cc b/src/sim/pseudo_inst.cc index 7335fda4e7..6970120036 100644 --- a/src/sim/pseudo_inst.cc +++ b/src/sim/pseudo_inst.cc @@ -103,7 +103,7 @@ const std::string DIST_SIZE = "dist-size"; static inline void panicFsOnlyPseudoInst(const char *name) { - panic("Pseudo inst \"%s\" is only available in Full System mode."); + panic("Pseudo inst \"%s\" is only available in Full System mode.", name); } void From aae8bd9a66f1aa8ce279c667e7c55c911705fc01 Mon Sep 17 00:00:00 2001 From: Jason Lowe-Power Date: Tue, 29 Sep 2020 17:03:08 -0700 Subject: [PATCH 14/17] misc: Add release notes for 20.1 Change-Id: I011ff987e222326dd7f0787c41043578b52b236a Signed-off-by: Jason Lowe-Power Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35375 Maintainer: Jason Lowe-Power Reviewed-by: Giacomo Travaglini Reviewed-by: Matthew Poremba Tested-by: kokoro --- RELEASE-NOTES.md | 120 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 119 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 1a97b4c0a3..492bb962a2 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,6 +1,124 @@ # Version 20.1.0.0 -* m5.stats.dump() root argument renamed to roots to reflect the fact that it now takes a list of SimObjects +Thank you to everyone that made this release possible! +This has been a very productive release with [150 issues](https://gem5.atlassian.net/), over 650 commits (a 25% increase from the 20.0 release), and 58 unique contributors (a 100% increase!). + +## Process changes + +We are no longer using the "master" branch. +Instead, we will have two branches: + +* "stable": This will point to the latest stable release (gem5-20.1 as of today) +* "develop": This is the latest development code that will be merged in to the "stable" branch at each release. + +We suggest all *users* use the stable (default) branch. +However, to contribute your fixes and new changes to gem5, it should be contributed to the develop branch. +See CONTRIBUTING.md for more details. + +gem5 has also implemented a project code of conduct. +See the CODE-OF-CONDUCT.md file for details. +In the code of conduct "we pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community." + +## New features in 20.1 + +### New DRAM interface: Contributed by *Wendy Elsasser* + +You can find details about this on the [gem5 blog](http://www.gem5.org/2020/05/27/memory-controller.html) or Wendy's talks on YouTube: [Talk on new interface and NVM](https://www.youtube.com/watch?v=t2PRoZPwwpk) and the [talk on LPDDR5](https://www.youtube.com/watch?v=ttJ9_I_Avyc) + +* **[PYTHON API CHANGE]**: The DRAM models are now *DRAM interfaces* which is a child of the *memory controller*. Example change shown [in the blog post](http://www.gem5.org/project/2020/07/18/gem5-20-1.html). + * The DRAM is split into a memory controller and a DRAM interface + * `SimpleMemory` is no longer a drop-in replacement for a DRAM-based memory controller. +* LPDDR5 model added +* NVM model added +* New memory controller model that can use both NVM and DRAM + +### Improved on-chip interconnect model, HeteroGarnet: Contributed by *Srikant Bharadwaj* + +You can find details about this on the [gem5 blog](http://www.gem5.org/2020/05/27/heterogarnet.html) and [Srikant's talk on YouTube](https://www.youtube.com/watch?v=AH9r44r2lHA). + +* **[USER-FACING CHANGE]**: The network type options are now "simple" and "garnet" instead of "garnet2.0". (If "garnet2.0" is used, you will get a warning until gem5-20.2) +* Added models for clock domain crossings and serialization/deserialization (SERDES) + +### Transactional memory support: Contributed by *Timothy Hayes* + +You can find details on the [Jira issue](https://gem5.atlassian.net/browse/GEM5-587) + +* gem5 now supports Arm TME (transactional memory extensions) +* Transactional memory is only implemented in the `MESI_Three_Level_HTM` Ruby protocol, and it is only implemented in Ruby. +* This implements a checkpointing mechanism for the architectural state and buffering of speculative memory updates. +* IBM POWER and x86 HTM extensions have *not* been implemented. + +### Other new features + +* External simulator integrations + * Added support for DRAMSim3 + * Added back support for DRAMSim2 +* Armv8-A Self Hosted Debug extension added +* KVM support for Armv8-A hosts without GICv2 hardware +* Implemented Secure EL2 for Armv8-A + +## Removed features + +* Dropped support for mercurial version control + +## New supported platforms + +* GCC up to 10.2 is now supported. Minimum GCC is now 5.0. +* Clang up to version 9. Minimum Clang is now 3.9. + +## Platforms no longer support + +* **[USER-FACING CHANGE]**: Python 2 is officially deprecated. We will drop support for Python 2 in the next release. In this release you will get a warning if you're using Python 2. +* **[USER-FACING CHANGE]**: We have dropped support for GCC 4.X +* **[USER-FACING CHANGE]**: We have dropped support for Scons 2.x (Note: this is the default in Ubuntu 16.04. Use pip to install a newer scons.) + +See for gem5's current dependencies. + +## Other changes + +### Deprecating "master" and "slave" + +* **[API CHANGE]**: The names "master" and "slave" have been deprecated + * Special thanks to Lakin Smith, Shivani Parekh, Eden Avivi, and Emily Brickey. + * Below is a guide to most of the name changes. + * The goal was to replace problematic language with more descriptive and precise terms. +* There may be some bugs introduced with this change as there were many places in the Python configurations which relied on "duck typing". +* This change is mostly backwards compatible and warning will be issued until at least gem5-20.2. + +``` +MasterPort -> RequestorPort +SlavePort -> ResponsePort + +xbar.slave -> xbar.cpu_side +xbar.master -> xbar.mem_side + +MasterId -> RequestorId +``` + +### Testing improvements + +* We now have Jenkins server () running nightly and other large tests. Special thanks to Mike Upton for setting this up! + * Nightly tests run the "long" regression tests (many tests added). + * Compiler tests run gem5 build for many targets and all compilers once a week. +* Updated CI tester (kokoro) to use a more up-to-date environment. +* Improved the testing infrastructure. + * Almost all testing resources now available in [gem5-resources repository](https://gem5.googlesource.com/public/gem5-resources/). + * Generally cleaned up the `tests/` directory in mainline gem5. + * Many general testlib improvements. + +### More changes + +* **[PYTHON API CHANGE]**: m5.stats.dump() root argument renamed to roots to reflect the fact that it now takes a list of SimObjects +* **[USER-FACING CHANGE]**: Checkpoint compatibility may be broken by the following changes + * + * +* **[API CHANGE]** Changed `setCPU` to `setThreadContext` in Interrupts +* Added a `Compressor` namespace. +* **[API CHANGE]** The `Callback` class was removed and replaced with C++ lambdas. +* Many objects' stats have been updated to the "new" stats style. +* Many more objects have had their APIs formalized. See + +---------------------------------------------------------------------------------------------------- # Version 20.0.0.3 From a069ce5050a33e7e7dfb785c602fef2a036e4dfb Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 30 Sep 2020 15:11:17 -0700 Subject: [PATCH 15/17] misc: Updated CONTRIBUTING.md: 'master' -> 'stable' The `master` branch is now the `stable` branch. This commit updates CONTRIBUTING.md accordingly. Change-Id: Ic5231eda336520e8a7260efac6474b4f0af08c37 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35457 Maintainer: Bobby R. Bruce Reviewed-by: Jason Lowe-Power Tested-by: kokoro --- CONTRIBUTING.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 74bdd2c0e2..590c773fe6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -86,20 +86,20 @@ To clone the gem5 repository: git clone https://gem5.googlesource.com/public/gem5 ``` -By default, the master branch is checked out. The master branch is stable, -containing the latest released version of gem5. To obtain code still -under-development (and which contributions can be made): +By default, the stable branch is checked out. The stable branch contains the +latest released version of gem5. To obtain code still under-development (and +which contributions can be made): ``` cd gem5 git checkout --track origin/develop ``` -Changes should be made to this develop branch. Changes to the master branch +Changes should be made to this develop branch. Changes to the stable branch will be blocked. Once a change on the develop branch is properly incorporated -into the gem5 repo it will be merged into the master Branch upon the next +into the gem5 repo it will be merged into the stable Branch upon the next release of gem5. New releases of gem5 occur three times a year. Ergo, changes -made to the develop branch should appear on the master branch within three to +made to the develop branch should appear on the stable branch within three to four months as part of a stable release. Other gem5 repositories @@ -322,7 +322,7 @@ Branches ======== By default, contributions to gem5 should be made on the develop branch. The -master branch is maintained as a stable release branch (i.e., it can be pulled +stable branch is maintained as a stable release branch (i.e., it can be pulled to obtain the latest official release of gem5). Creation of additional branches is generally discouraged due to their tendency to bloat git repositories with abandoned code. However, the creation of new branches is permitted for @@ -491,7 +491,7 @@ release are submitted to the develop branch. 2. When a release is ready, a new staging branch shall be created by a project maintainer, from develop, with the name "release-staging-{VERSION}". The gem5-dev mailing list will be notified that the staging branch will be merged -into the master branch after two weeks, thus marking the new release. +into the stable branch after two weeks, thus marking the new release. 3. The staging branch will have the full suite of gem5 tests run on it to ensure all tests pass and the to-be-released code is in a decent state. 4. If a user submits a changeset to the staging branch, it will be considered @@ -504,8 +504,8 @@ change may be submitted directly to the staging branch. All other submissions to gem5 will continue to be made to the develop branch. Patches submitted into the staging branch do not need to be re-added to the develop branch. 5. Once signed off by members of the PMC the staging branch shall be merged -into the master and develop branch. The staging branch will then be deleted. -6. The master branch shall be tagged with the correct version number for that +into the stable and develop branch. The staging branch will then be deleted. +6. The stable branch shall be tagged with the correct version number for that release. gem5 conforms to a "v{YY}.{MAJOR}.{MINOR}.{HOTFIX}" versioning system. E.g., the first major release of 2022 will be "v22.0.0.0", followed by "v22.1.0.0". All the releases (with the exception of hotfixes) are considered @@ -527,14 +527,14 @@ whether the issue is worthy of a hotfix, and the final decision should be made by members of the PMC if there is no consensus. Assuming the hotfix is permitted, the following steps will be taken: -1. A new branch with the prefix "hotfix-" will be created from the master +1. A new branch with the prefix "hotfix-" will be created from the stable branch. Only gem5 maintainers can create branches. If a non-maintainer requires the creation of a hotfix branch then they should contact a gem5 maintainer. 2. The change shall be submitted to the hotfix branch via gerrit. Full review, as with any other change, will be required. 3. Once fully submitted, the hotfix branch shall be merged into both the -develop and the master branch by a gem5 maintainer. -4. The master branch will be tagged with the new version number; the same as +develop and the stable branch by a gem5 maintainer. +4. The stable branch will be tagged with the new version number; the same as the last but with an incremented hotfix number (e.g., "v20.2.0.0" would transition to "v20.2.0.1"). 4. The hotfix branch will then be deleted. From 2a4357bfd0c688a19cfd6b1c600bb2d2d6fa6151 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 30 Sep 2020 10:55:03 -0700 Subject: [PATCH 16/17] scons: Removed -Werror for the gem5 20.1 release While gem5 compiles on all our supported compilers, removing the -Werror flag on the stable branch ensures that, as new compilers are released with stricter warnings, gem5 remains compilable. Change-Id: I9a356472dc4d729a3fef9f1455814c900103bd66 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35455 Maintainer: Bobby R. Bruce Reviewed-by: Jason Lowe-Power Reviewed-by: Gabe Black Tested-by: kokoro --- SConstruct | 6 ------ 1 file changed, 6 deletions(-) diff --git a/SConstruct b/SConstruct index 621f923cdb..0d8159bbab 100755 --- a/SConstruct +++ b/SConstruct @@ -337,12 +337,6 @@ if main['GCC'] or main['CLANG']: main.Append(PSHLINKFLAGS=shared_partial_flags) main.Append(PLINKFLAGS=shared_partial_flags) - # Treat warnings as errors but white list some warnings that we - # want to allow (e.g., deprecation warnings). - main.Append(CCFLAGS=['-Werror', - '-Wno-error=deprecated-declarations', - '-Wno-error=deprecated', - ]) else: error('\n'.join(( "Don't know what compiler options to use for your compiler.", From 090fa08c149768e940f857df9cb936da23ae48da Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 30 Sep 2020 11:14:02 -0700 Subject: [PATCH 17/17] misc: Updated version to 20.1.0.0 Change-Id: Ic7a37581c58caa354eeecab051122116177d0721 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35456 Reviewed-by: Bobby R. Bruce Reviewed-by: Jason Lowe-Power Maintainer: Bobby R. Bruce Tested-by: kokoro --- ext/testlib/configuration.py | 2 +- src/Doxyfile | 2 +- src/base/version.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/testlib/configuration.py b/ext/testlib/configuration.py index 1267c25b8a..3203479fc3 100644 --- a/ext/testlib/configuration.py +++ b/ext/testlib/configuration.py @@ -214,7 +214,7 @@ def define_defaults(defaults): os.pardir, os.pardir)) defaults.result_path = os.path.join(os.getcwd(), 'testing-results') - defaults.resource_url = 'http://dist.gem5.org/dist/develop' + defaults.resource_url = 'http://dist.gem5.org/dist/v20-1' defaults.resource_path = os.path.abspath(os.path.join(defaults.base_dir, 'tests', 'gem5', diff --git a/src/Doxyfile b/src/Doxyfile index c92a787b65..d029a66850 100644 --- a/src/Doxyfile +++ b/src/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = gem5 # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = DEVELOP-FOR-V20.1 +PROJECT_NUMBER = v20.1.0.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/src/base/version.cc b/src/base/version.cc index ff58ad1956..8edb8c6ff9 100644 --- a/src/base/version.cc +++ b/src/base/version.cc @@ -29,4 +29,4 @@ /** * @ingroup api_base_utils */ -const char *gem5Version = "[DEVELOP-FOR-V20.1]"; +const char *gem5Version = "20.1.0.0";