From 5d09ff452580c5a42b9a2b3a825e2827f2551003 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 18 Dec 2023 14:37:51 -0800 Subject: [PATCH 1/3] configs: Add `hasattr` guard to ensure DerivO3CPU compiled configs/ruby/Ruby.py fails when `DerivO3CPU` is not compiled into the gem5 binary. The `isinstance` check fails. This fix addds a guard. Change-Id: I1e5503ab18ec94683056c6eb28cebeda6632ae8e --- configs/ruby/Ruby.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configs/ruby/Ruby.py b/configs/ruby/Ruby.py index d3f798ec3a..b84a69a80f 100644 --- a/configs/ruby/Ruby.py +++ b/configs/ruby/Ruby.py @@ -331,8 +331,9 @@ def send_evicts(options): # 2. The x86 mwait instruction is built on top of coherence invalidations # 3. The local exclusive monitor in ARM systems - if isinstance(options.cpu_type, DerivO3CPU) or ObjectList.cpu_list.get_isa( - options.cpu_type - ) in [ISA.X86, ISA.ARM]: + if ( + hasattr(m5.objects, "DerivO3CPU") + and isinstance(options.cpu_type, DerivO3CPU) + ) or ObjectList.cpu_list.get_isa(options.cpu_type) in [ISA.X86, ISA.ARM]: return True return False From b22ca02a65927f8f3fe0bac0cce4e33100595028 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 18 Dec 2023 14:39:28 -0800 Subject: [PATCH 2/3] tests: Fix garnet and memcheck tests to use X86 These tests previously used "build/NULL" but due to changes in the "Ruby" and "garnet_synth_traffic.py" scripts, "NULL" fails as the script exists "X86TimingSimple" with MESI_Two_Level. This change fixes the tests by compiling and using the correct compilation of gem5. It shouldn't affect the tests in any negative way. As far as I'm aware it does not matter what ISA is used for these tests. Change-Id: I8ae84b49f65968e97bef4904268de5a455f06f5c --- tests/gem5/memory/test.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/gem5/memory/test.py b/tests/gem5/memory/test.py index d76463be7b..e049267813 100644 --- a/tests/gem5/memory/test.py +++ b/tests/gem5/memory/test.py @@ -70,7 +70,7 @@ gem5_verify_config( length=constants.long_tag, ) -null_tests = [ +x86_tests = [ ("garnet_synth_traffic", None, ["--sim-cycles", "5000000"]), ("memcheck", None, ["--maxtick", "2000000000", "--prefetchers"]), ( @@ -122,7 +122,7 @@ null_tests = [ ("ruby_direct_test", None, ["--requests", "50000"]), ] -for test_name, basename_noext, args in null_tests: +for test_name, basename_noext, args in x86_tests: if basename_noext == None: basename_noext = test_name gem5_verify_config( @@ -133,7 +133,8 @@ for test_name, basename_noext, args in null_tests: config.base_dir, "configs", "example", basename_noext + ".py" ), config_args=args, - valid_isas=(constants.null_tag,), + valid_isas=(constants.x86_tag,), + protocol="MESI_Two_Level", valid_hosts=constants.supported_hosts, length=constants.long_tag, ) From 213d0b0bfe4ba8456ef034f1dbbb4bc696401da6 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 20 Dec 2023 07:29:48 -0800 Subject: [PATCH 3/3] cpu: 'suppressFuncErrors' -> 'pkt->suppressFuncError()' fix Change-Id: If4aa71e9f6332df2a3daa51b69eaad97f6603f6b --- src/cpu/testers/memtest/memtest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu/testers/memtest/memtest.cc b/src/cpu/testers/memtest/memtest.cc index a84bf67cd9..e3859ff44c 100644 --- a/src/cpu/testers/memtest/memtest.cc +++ b/src/cpu/testers/memtest/memtest.cc @@ -151,7 +151,7 @@ MemTest::completeRequest(PacketPtr pkt, bool functional) const uint8_t *pkt_data = pkt->getConstPtr(); if (pkt->isError()) { - if (!functional || !suppressFuncErrors) + if (!functional || !pkt->suppressFuncError() || !suppressFuncErrors) panic( "%s access failed at %#x\n", pkt->isWrite() ? "Write" : "Read", req->getPaddr()); } else {