[gem5-dev] [XS] Change in gem5/gem5[develop]: tests: Reducing json stat dump size.
Mahyar Samani has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71438?usp=email ) Change subject: tests: Reducing json stat dump size. .. tests: Reducing json stat dump size. This change reduces the number of stats dumped as json in traffic_gen tests. Change-Id: I94becb2e6d5da6096271cf7893ff2b380314da06 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71402 Maintainer: Bobby Bruce Reviewed-by: Bobby Bruce Tested-by: kokoro (cherry picked from commit f78471fb81db40c836b89a015a61b8311b4b98fd) Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71438 --- M tests/gem5/traffic_gen/simple_traffic_run.py 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Bobby Bruce: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/tests/gem5/traffic_gen/simple_traffic_run.py b/tests/gem5/traffic_gen/simple_traffic_run.py index 7c0f188..3766d73 100644 --- a/tests/gem5/traffic_gen/simple_traffic_run.py +++ b/tests/gem5/traffic_gen/simple_traffic_run.py @@ -209,7 +209,9 @@ exit_event = m5.simulate() print(f"Exiting @ tick {m5.curTick()} because {exit_event.getCause()}.") -simstats = get_simstat(root, prepare_stats=True) +simstats = get_simstat( +[core.generator for core in generator.get_cores()], prepare_stats=True +) json_output = Path(m5.options.outdir) / "output.json" with open(json_output, "w") as stats_file: simstats.dump(stats_file, indent=2) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71438?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I94becb2e6d5da6096271cf7893ff2b380314da06 Gerrit-Change-Number: 71438 Gerrit-PatchSet: 3 Gerrit-Owner: Bobby Bruce Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Mahyar Samani Gerrit-Reviewer: kokoro Gerrit-CC: kokoro ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[stable]: misc: Adjust compiler tests and CI tests
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/71725?usp=email ) Change subject: misc: Adjust compiler tests and CI tests .. misc: Adjust compiler tests and CI tests This adds a job level timeout for the compiler tests, allows them to run weekly instead of daily, and adds a workflow dispatch option. It also adds a ready for review option to the CI tests to run when someone converts a draft pull request. Change-Id: Id32b5f7da90745d18de2e550bd48d32ba45fb4d9 --- M .github/workflows/ci-tests.yaml M .github/workflows/compiler-tests.yaml 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index b1c5a1a..61ba4b5 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -4,7 +4,7 @@ on: pull_request: -types: [opened, edited, synchronize] +types: [opened, edited, synchronize, ready_for_review] jobs: diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index 013a710..ad8c8a5 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -5,9 +5,11 @@ on: - # Runs every day from 7AM UTC + # Runs every Friday from 7AM UTC schedule: -- cron: '0 7 * * *' +- cron: '00 7 * * 5' + # Allows us to manually start workflow for testing + workflow_dispatch: jobs: # replication of compiler-tests.sh @@ -17,6 +19,7 @@ image: [gcc-version-12, gcc-version-11, gcc-version-10, gcc-version-9, gcc-version-8, gcc-version-7, clang-version-14, clang-version-13, clang-version-12, clang-version-11, clang-version-10, clang-version-9, clang-version-8, clang-version-7, clang-version-6.0, ubuntu-18.04_all-dependencies, ubuntu-20.04_all-dependencies, ubuntu-22.04_all-dependencies, ubuntu-22.04_min-dependencies] opts: [.opt, .fast] runs-on: [self-hosted, linux, x64, run] +timeout-minutes: 2880 # 48 hours container: gcr.io/gem5-test/${{ matrix.image }}:latest steps: - uses: actions/checkout@v3 @@ -36,6 +39,7 @@ image: [gcc-version-12, clang-version-14] opts: [.opt, .fast] runs-on: [self-hosted, linux, x64, run] +timeout-minutes: 2880 # 48 hours container: gcr.io/gem5-test/${{ matrix.image }}:latest steps: - uses: actions/checkout@v3 -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71725?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: stable Gerrit-Change-Id: Id32b5f7da90745d18de2e550bd48d32ba45fb4d9 Gerrit-Change-Number: 71725 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [L] Change in gem5/gem5[develop]: stdlib: Add a prebuilt MESI_Three_Level cache
Hoa Nguyen has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71598?usp=email ) Change subject: stdlib: Add a prebuilt MESI_Three_Level cache .. stdlib: Add a prebuilt MESI_Three_Level cache The cache is modeled after an AMD EPYC cache, but not exactly like AMD EPYC cache. - K cores per core complex (CCD), each core has one private split L1, and one private L2. - K cores in the same CCD share 1 slice of L3 cache, which is not a victim cache. - There can be multiple CCDs, which communicate with each other via Cross-CCD router. The Cross-CCD rounter is also connected to directory controllers and dma controllers. - All links latency are set to 1. Change-Id: Ib64248bed9155b8e48e5158ffdeebf1f2d770754 Signed-off-by: Hoa Nguyen Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71598 Maintainer: Jason Lowe-Power Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/python/SConscript A src/python/gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/__init__.py A src/python/gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/core_complex.py A src/python/gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/octopi.py A src/python/gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/octopi_network.py A src/python/gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/ruby_network_components.py 6 files changed, 717 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/python/SConscript b/src/python/SConscript index f98b570..ea9d3d4 100644 --- a/src/python/SConscript +++ b/src/python/SConscript @@ -154,6 +154,18 @@ PySource('gem5.components.cachehierarchies.ruby.caches.mesi_three_level', 'gem5/components/cachehierarchies/ruby/caches/mesi_three_level/' 'l3_cache.py') +PySource('gem5.components.cachehierarchies.ruby.caches.mesi_three_level', +'gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/' +'octopi.py') +PySource('gem5.components.cachehierarchies.ruby.caches.mesi_three_level', +'gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/' +'core_complex.py') +PySource('gem5.components.cachehierarchies.ruby.caches.mesi_three_level', +'gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/' +'octopi_network.py') +PySource('gem5.components.cachehierarchies.ruby.caches.mesi_three_level', +'gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/' +'ruby_network_components.py') PySource('gem5.components.cachehierarchies.ruby.caches.mi_example', 'gem5/components/cachehierarchies/ruby/caches/mi_example/__init__.py') PySource('gem5.components.cachehierarchies.ruby.caches.mi_example', diff --git a/src/python/gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/__init__.py b/src/python/gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/__init__.py new file mode 100644 index 000..b08f46b --- /dev/null +++ b/src/python/gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/__init__.py @@ -0,0 +1,25 @@ +# Copyright (c) 2022-2023 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. diff --git a/src/python/gem5/components/cachehierarchies/ruby/caches/prebuilt/octopi_cache/core_complex.py
[gem5-dev] [M] Change in gem5/gem5[develop]: configs: Add example configuration for OctopiCache
Hoa Nguyen has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71618?usp=email ) Change subject: configs: Add example configuration for OctopiCache .. configs: Add example configuration for OctopiCache Change-Id: Ia78dd63e63808ebad40052d2a7cdb67cc7179e44 Signed-off-by: Hoa Nguyen Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71618 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- A configs/example/gem5_library/caches/octopi-cache-example.py 1 file changed, 100 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/configs/example/gem5_library/caches/octopi-cache-example.py b/configs/example/gem5_library/caches/octopi-cache-example.py new file mode 100644 index 000..1b39a8b --- /dev/null +++ b/configs/example/gem5_library/caches/octopi-cache-example.py @@ -0,0 +1,100 @@ +# Copyright (c) 2023 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. + +""" +This script boots Ubuntu 20.04 with 8 timing cores in 1 CCD. + +Usage +- + +``` +scons build/ARM_MESI_Three_Level/gem5.opt -j `nproc` +./build/ARM_MESI_Three_Level/gem5.opt \ +configs/example/gem5_library/caches/octopi-cache-example.py +``` +""" + + +from m5.objects import ArmDefaultRelease, VExpress_GEM5_Foundation + +from gem5.utils.requires import requires +from gem5.components.boards.arm_board import ArmBoard +from gem5.components.memory import DualChannelDDR4_2400 +from gem5.components.processors.simple_processor import SimpleProcessor +from gem5.components.processors.cpu_types import CPUTypes +from gem5.components.cachehierarchies.ruby.caches.mesi_three_level.octopi import ( +OctopiCache, +) +from gem5.isas import ISA +from gem5.coherence_protocol import CoherenceProtocol +from gem5.simulate.simulator import Simulator +from gem5.resources.workload import Workload + +num_ccds = 1 # CCDs +num_cores_per_ccd = 8 # 8 cores/CCD + +# OctopiCache is built on top of gem5's MESI_Three_Level cache coherence +# protocol +requires(coherence_protocol_required=CoherenceProtocol.MESI_THREE_LEVEL) +cache_hierarchy = OctopiCache( +l1i_size="32KiB", +l1i_assoc=8, +l1d_size="32KiB", +l1d_assoc=8, +l2_size="512KiB", +l2_assoc=8, +l3_size="32MiB", +l3_assoc=16, +num_core_complexes=num_ccds, +is_fullsystem=True, +) + +memory = DualChannelDDR4_2400(size="16GB") + +# The number of cores must be consistent with +# num_core_complexes and num_cores_per_core_complexes +processor = SimpleProcessor( +cpu_type=CPUTypes.TIMING, +isa=ISA.ARM, +num_cores=num_ccds * num_cores_per_ccd, +) + +release = ArmDefaultRelease() +platform = VExpress_GEM5_Foundation() + +board = ArmBoard( +clk_freq="4GHz", +processor=processor, +memory=memory, +cache_hierarchy=cache_hierarchy, +release=release, +platform=platform, +) + +board.set_workload(Workload("arm64-ubuntu-20.04-boot")) + +simulator = Simulator(board=board) +simulator.run() -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71618?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ia78dd63e63808ebad40052d2a7cdb67cc7179e44
[gem5-dev] [M] Change in gem5/gem5[develop]: arch-vega: Helper methods for SDWA/DPP for VOP2
Matthew Poremba has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/70738?usp=email ) Change subject: arch-vega: Helper methods for SDWA/DPP for VOP2 .. arch-vega: Helper methods for SDWA/DPP for VOP2 Many of the outstanding issues with the GPU model are related to instructions not having SDWA/DPP implementations and executing by ignoring the special registers leading to incorrect executiong. Adding SDWA/DPP is current very cumbersome as there is a lot of boilerplate code. This changeset adds helper methods for VOP2 with one instruction changed as an example. This review is intended to get feedback before applying this change to all VOP2 instructions that support SDWA/DPP. Change-Id: I1edbc3f3bb166d34f151545aa9f47a94150e1406 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/70738 Reviewed-by: Matt Sinclair Maintainer: Matt Sinclair Tested-by: kokoro --- M src/arch/amdgpu/vega/insts/instructions.cc M src/arch/amdgpu/vega/insts/op_encodings.hh 2 files changed, 97 insertions(+), 52 deletions(-) Approvals: Matt Sinclair: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/arch/amdgpu/vega/insts/instructions.cc b/src/arch/amdgpu/vega/insts/instructions.cc index 6c014bc..0d3f2dc 100644 --- a/src/arch/amdgpu/vega/insts/instructions.cc +++ b/src/arch/amdgpu/vega/insts/instructions.cc @@ -6384,65 +6384,17 @@ void Inst_VOP2__V_MUL_U32_U24::execute(GPUDynInstPtr gpuDynInst) { -Wavefront *wf = gpuDynInst->wavefront(); -ConstVecOperandU32 src0(gpuDynInst, instData.SRC0); -VecOperandU32 src1(gpuDynInst, instData.VSRC1); -VecOperandU32 vdst(gpuDynInst, instData.VDST); - -src0.readSrc(); -src1.read(); - -if (isSDWAInst()) { -VecOperandU32 src0_sdwa(gpuDynInst, extData.iFmt_VOP_SDWA.SRC0); -// use copies of original src0, src1, and dest during selecting -VecOperandU32 origSrc0_sdwa(gpuDynInst, -extData.iFmt_VOP_SDWA.SRC0); -VecOperandU32 origSrc1(gpuDynInst, instData.VSRC1); -VecOperandU32 origVdst(gpuDynInst, instData.VDST); - -src0_sdwa.read(); -origSrc0_sdwa.read(); -origSrc1.read(); - -DPRINTF(VEGA, "Handling V_MUL_U32_U24 SRC SDWA. SRC0: register " -"v[%d], DST_SEL: %d, DST_U: %d, CLMP: %d, SRC0_SEL: " -"%d, SRC0_SEXT: %d, SRC0_NEG: %d, SRC0_ABS: %d, SRC1_SEL: " -"%d, SRC1_SEXT: %d, SRC1_NEG: %d, SRC1_ABS: %d\n", -extData.iFmt_VOP_SDWA.SRC0, extData.iFmt_VOP_SDWA.DST_SEL, -extData.iFmt_VOP_SDWA.DST_U, -extData.iFmt_VOP_SDWA.CLMP, -extData.iFmt_VOP_SDWA.SRC0_SEL, -extData.iFmt_VOP_SDWA.SRC0_SEXT, -extData.iFmt_VOP_SDWA.SRC0_NEG, -extData.iFmt_VOP_SDWA.SRC0_ABS, -extData.iFmt_VOP_SDWA.SRC1_SEL, -extData.iFmt_VOP_SDWA.SRC1_SEXT, -extData.iFmt_VOP_SDWA.SRC1_NEG, -extData.iFmt_VOP_SDWA.SRC1_ABS); - -processSDWA_src(extData.iFmt_VOP_SDWA, src0_sdwa, origSrc0_sdwa, -src1, origSrc1); - -for (int lane = 0; lane < NumVecElemPerVecReg; ++lane) { -if (wf->execMask(lane)) { -vdst[lane] = bits(src0_sdwa[lane], 23, 0) * - bits(src1[lane], 23, 0); -origVdst[lane] = vdst[lane]; // keep copy consistent -} -} - -processSDWA_dst(extData.iFmt_VOP_SDWA, vdst, origVdst); -} else { +auto opImpl = [](VecOperandU32& src0, VecOperandU32& src1, + VecOperandU32& vdst, Wavefront* wf) { for (int lane = 0; lane < NumVecElemPerVecReg; ++lane) { if (wf->execMask(lane)) { vdst[lane] = bits(src0[lane], 23, 0) * bits(src1[lane], 23, 0); } } -} +}; - -vdst.write(); +vop2Helper(gpuDynInst, opImpl); } // execute // --- Inst_VOP2__V_MUL_HI_U32_U24 class methods --- diff --git a/src/arch/amdgpu/vega/insts/op_encodings.hh b/src/arch/amdgpu/vega/insts/op_encodings.hh index 1071ead..f195472 100644 --- a/src/arch/amdgpu/vega/insts/op_encodings.hh +++ b/src/arch/amdgpu/vega/insts/op_encodings.hh @@ -272,6 +272,99 @@ InstFormat extData; uint32_t varSize; +template +T sdwaSrcHelper(GPUDynInstPtr gpuDynInst, T & src1) +{ +T src0_sdwa(gpuDynInst, extData.iFmt_VOP_SDWA.SRC0); +// use copies of original src0, src1, and dest during selecting +
[gem5-dev] [S] Change in gem5/gem5[develop]: scons,stdlib: Remove deprecated 'distutils' module
Bobby Bruce has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/71741?usp=email ) Change subject: scons,stdlib: Remove deprecated 'distutils' module .. scons,stdlib: Remove deprecated 'distutils' module The Python module 'distutils' will be removed in Python 3.12: https://docs.python.org/3/library/distutils.html This patch removed usage of 'distutils' in the gem5 code base. Change-Id: I1e3a96149f3cd6cbf4211a1565b5f74c85a0 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71679 Tested-by: kokoro Maintainer: Jason Lowe-Power Reviewed-by: Jason Lowe-Power (cherry picked from commit b182b15f93621206c87c6c760cdfc1f5df1877cf) --- M src/SConscript M src/python/gem5/resources/client_api/client_wrapper.py 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/SConscript b/src/SConscript index d26bf49..1b44303 100644 --- a/src/SConscript +++ b/src/SConscript @@ -39,7 +39,7 @@ import collections import copy -import distutils.spawn +from shutil import which import itertools import os import os.path @@ -269,7 +269,7 @@ '''Add a Protocol Buffer to build''' Source(source, tags, add_tags, append={'CXXFLAGS': '-Wno-array-bounds'}) -env['PROTOC_GRPC'] = distutils.spawn.find_executable('grpc_cpp_plugin') +env['PROTOC_GRPC'] = which('grpc_cpp_plugin') if env['PROTOC_GRPC']: with Configure(env) as conf: if (not env['HAVE_PKG_CONFIG'] or diff --git a/src/python/gem5/resources/client_api/client_wrapper.py b/src/python/gem5/resources/client_api/client_wrapper.py index 74ee831..69787a0 100644 --- a/src/python/gem5/resources/client_api/client_wrapper.py +++ b/src/python/gem5/resources/client_api/client_wrapper.py @@ -27,8 +27,7 @@ from .jsonclient import JSONClient from .atlasclient import AtlasClient from _m5 import core -from typing import Optional, Dict, List -from distutils.version import StrictVersion +from typing import Optional, Dict, List, Tuple import itertools from m5.util import warn @@ -191,12 +190,27 @@ :param resources: A list of resources to sort. :return: A list of sorted resources. """ + +def sort_tuple(resource: Dict) -> Tuple: +"""This is used for sorting resources by ID and version. First +the ID is sorted, then the version. In cases where the version +contains periods, it's assumed this is to separate a +"major.minor.hotfix" style versioning system. In which case, the +value separated in the most-significant position is sorted before +those less significant. If the value is a digit it is cast as an +int, otherwise, it is cast as a string, to lower-case. +""" +to_return = (resource["id"].lower(),) +for val in resource["resource_version"].split("."): +if val.isdigit(): +to_return += (int(val),) +else: +to_return += (str(val).lower(),) +return to_return + return sorted( resources, -key=lambda resource: ( -resource["id"].lower(), -StrictVersion(resource["resource_version"]), -), +key=lambda resource: sort_tuple(resource), reverse=True, ) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71741?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I1e3a96149f3cd6cbf4211a1565b5f74c85a0 Gerrit-Change-Number: 71741 Gerrit-PatchSet: 1 Gerrit-Owner: Bobby Bruce ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: python: Remove Python 'pipes' module
Bobby Bruce has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/71740?usp=email ) Change subject: python: Remove Python 'pipes' module .. python: Remove Python 'pipes' module This is scheduled for removal from Python in 3.13: https://docs.python.org/3/library/pipes.html. The 'shlex.quote' function can replace the 'pipes.quote' function used in "main.py". A special wrapper has been made to account for the Windows case which 'shlex.quote' doesn't handle. Change-Id: I9c84605f0ccd8468b9cab6cece6248ef8c2107f0 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71678 Maintainer: Jason Lowe-Power Tested-by: kokoro Reviewed-by: Jason Lowe-Power (cherry picked from commit a63d376ecd4debd60f89fa2e0592dac6f9addae2) --- M src/python/m5/main.py 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/python/m5/main.py b/src/python/m5/main.py index 4701dfa..ddcb024 100644 --- a/src/python/m5/main.py +++ b/src/python/m5/main.py @@ -496,10 +496,23 @@ % (socket.gethostname(), os.getpid()) ) -# in Python 3 pipes.quote() is moved to shlex.quote() -import pipes +def quote(arg: str) -> str: +"""Quotes a string for printing in a shell. In addition to Unix, +this is designed to handle the problematic Windows cases where +'shlex.quote' doesn't work""" -print("command line:", " ".join(map(pipes.quote, sys.argv))) +if os.name == "nt" and os.sep == "\\": +# If a Windows machine, we manually quote the string. +arg = arg.replace('"', '\\"') +if re.search("\s", args): +# We quote args which have whitespace. +arg = '"' + arg + '"' +return arg +import shlex + +return shlex.quote(arg) + +print("command line:", " ".join(map(quote, sys.argv))) print() # check to make sure we can find the listed script -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71740?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I9c84605f0ccd8468b9cab6cece6248ef8c2107f0 Gerrit-Change-Number: 71740 Gerrit-PatchSet: 1 Gerrit-Owner: Bobby Bruce ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[release-staging-v23-0]: python: Remove Python 'pipes' module
Bobby Bruce has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71678?usp=email ) Change subject: python: Remove Python 'pipes' module .. python: Remove Python 'pipes' module This is scheduled for removal from Python in 3.13: https://docs.python.org/3/library/pipes.html. The 'shlex.quote' function can replace the 'pipes.quote' function used in "main.py". A special wrapper has been made to account for the Windows case which 'shlex.quote' doesn't handle. Change-Id: I9c84605f0ccd8468b9cab6cece6248ef8c2107f0 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71678 Maintainer: Jason Lowe-Power Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/python/m5/main.py 1 file changed, 16 insertions(+), 3 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/python/m5/main.py b/src/python/m5/main.py index 4701dfa..ddcb024 100644 --- a/src/python/m5/main.py +++ b/src/python/m5/main.py @@ -496,10 +496,23 @@ % (socket.gethostname(), os.getpid()) ) -# in Python 3 pipes.quote() is moved to shlex.quote() -import pipes +def quote(arg: str) -> str: +"""Quotes a string for printing in a shell. In addition to Unix, +this is designed to handle the problematic Windows cases where +'shlex.quote' doesn't work""" -print("command line:", " ".join(map(pipes.quote, sys.argv))) +if os.name == "nt" and os.sep == "\\": +# If a Windows machine, we manually quote the string. +arg = arg.replace('"', '\\"') +if re.search("\s", args): +# We quote args which have whitespace. +arg = '"' + arg + '"' +return arg +import shlex + +return shlex.quote(arg) + +print("command line:", " ".join(map(quote, sys.argv))) print() # check to make sure we can find the listed script -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71678?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: release-staging-v23-0 Gerrit-Change-Id: I9c84605f0ccd8468b9cab6cece6248ef8c2107f0 Gerrit-Change-Number: 71678 Gerrit-PatchSet: 2 Gerrit-Owner: Bobby Bruce Gerrit-Reviewer: Andreas Sandberg Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-CC: kokoro ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[release-staging-v23-0]: scons,stdlib: Remove deprecated 'distutils' module
Bobby Bruce has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71679?usp=email ) Change subject: scons,stdlib: Remove deprecated 'distutils' module .. scons,stdlib: Remove deprecated 'distutils' module The Python module 'distutils' will be removed in Python 3.12: https://docs.python.org/3/library/distutils.html This patch removed usage of 'distutils' in the gem5 code base. Change-Id: I1e3a96149f3cd6cbf4211a1565b5f74c85a0 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71679 Tested-by: kokoro Maintainer: Jason Lowe-Power Reviewed-by: Jason Lowe-Power --- M src/SConscript M src/python/gem5/resources/client_api/client_wrapper.py 2 files changed, 22 insertions(+), 8 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/SConscript b/src/SConscript index d26bf49..1b44303 100644 --- a/src/SConscript +++ b/src/SConscript @@ -39,7 +39,7 @@ import collections import copy -import distutils.spawn +from shutil import which import itertools import os import os.path @@ -269,7 +269,7 @@ '''Add a Protocol Buffer to build''' Source(source, tags, add_tags, append={'CXXFLAGS': '-Wno-array-bounds'}) -env['PROTOC_GRPC'] = distutils.spawn.find_executable('grpc_cpp_plugin') +env['PROTOC_GRPC'] = which('grpc_cpp_plugin') if env['PROTOC_GRPC']: with Configure(env) as conf: if (not env['HAVE_PKG_CONFIG'] or diff --git a/src/python/gem5/resources/client_api/client_wrapper.py b/src/python/gem5/resources/client_api/client_wrapper.py index ebf1b8e..d2baabc 100644 --- a/src/python/gem5/resources/client_api/client_wrapper.py +++ b/src/python/gem5/resources/client_api/client_wrapper.py @@ -27,8 +27,7 @@ from .jsonclient import JSONClient from .atlasclient import AtlasClient from _m5 import core -from typing import Optional, Dict, List -from distutils.version import StrictVersion +from typing import Optional, Dict, List, Tuple import itertools from m5.util import warn @@ -247,12 +246,27 @@ :param resources: A list of resources to sort. :return: A list of sorted resources. """ + +def sort_tuple(resource: Dict) -> Tuple: +"""This is used for sorting resources by ID and version. First +the ID is sorted, then the version. In cases where the version +contains periods, it's assumed this is to separate a +"major.minor.hotfix" style versioning system. In which case, the +value separated in the most-significant position is sorted before +those less significant. If the value is a digit it is cast as an +int, otherwise, it is cast as a string, to lower-case. +""" +to_return = (resource["id"].lower(),) +for val in resource["resource_version"].split("."): +if val.isdigit(): +to_return += (int(val),) +else: +to_return += (str(val).lower(),) +return to_return + return sorted( resources, -key=lambda resource: ( -resource["id"].lower(), -StrictVersion(resource["resource_version"]), -), +key=lambda resource: sort_tuple(resource), reverse=True, ) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71679?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: release-staging-v23-0 Gerrit-Change-Id: I1e3a96149f3cd6cbf4211a1565b5f74c85a0 Gerrit-Change-Number: 71679 Gerrit-PatchSet: 2 Gerrit-Owner: Bobby Bruce Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Gabe Black Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-CC: kokoro ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[release-staging-v23-0]: arch-riscv: Fix unexpected behavior of float operations in Mac OS
Bobby Bruce has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71519?usp=email ) Change subject: arch-riscv: Fix unexpected behavior of float operations in Mac OS .. arch-riscv: Fix unexpected behavior of float operations in Mac OS The uint_fast16_t is the integer at least 16 bits size, it can be 32, 64 bits and more. Usually most of the simulations are in the x86-64 linux host, the size of uint_fast16_t is 64 bits. Therefore, there is no problem for double precision float operations and it can pass FloatMM test. However, in the Mac OS, the size of uint_fast16_t is 16 bits, it will lose the upper bits when converting float register bits to freg_t and it will generate unexpected results for FloatMM test. The change can guarantee that the size of data in freg_t is at least 64 bits and it will not lose any data from floating point to freg_t. Reference: https://developer.apple.com/documentation/kernel/uint_fast16_t https://codebrowser.dev/glibc/glibc/stdlib/stdint.h.html Change-Id: I3df6610f0903cdee0f56584d6cbdb51ac26c86c8 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71519 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Bobby Bruce --- M src/arch/riscv/regs/float.hh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Bobby Bruce: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/arch/riscv/regs/float.hh b/src/arch/riscv/regs/float.hh index 1654bdb..4809372 100644 --- a/src/arch/riscv/regs/float.hh +++ b/src/arch/riscv/regs/float.hh @@ -105,7 +105,7 @@ static constexpr freg_t freg(float16_t f) { return {boxF16(f.v)}; } static constexpr freg_t freg(float32_t f) { return {boxF32(f.v)}; } static constexpr freg_t freg(float64_t f) { return f; } -static constexpr freg_t freg(uint_fast16_t f) { return {f}; } +static constexpr freg_t freg(uint_fast64_t f) { return {f}; } namespace float_reg { -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71519?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: release-staging-v23-0 Gerrit-Change-Id: I3df6610f0903cdee0f56584d6cbdb51ac26c86c8 Gerrit-Change-Number: 71519 Gerrit-PatchSet: 2 Gerrit-Owner: Bobby Bruce Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: kokoro Gerrit-CC: Roger Chang Gerrit-CC: kokoro ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: arch: set multiline re as default in isa_parser
Yu-hsin Wang has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71019?usp=email ) Change subject: arch: set multiline re as default in isa_parser .. arch: set multiline re as default in isa_parser In python3.11, it requires the global specifier should be the first token of regex. However it's not possible when using ply library. Instead, we set the rules are multiline regex by default and modifies those single line rules. Ref: https://github.com/dabeaz/ply/issues/282 Change-Id: I7bdbfeb97a9dd74f45c1890a76f8cc16100e5a42 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71019 Reviewed-by: Richard Cooper Tested-by: kokoro Maintainer: Jason Lowe-Power Reviewed-by: Jason Lowe-Power --- M src/arch/isa_parser/isa_parser.py 1 file changed, 6 insertions(+), 5 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass Richard Cooper: Looks good to me, but someone else must approve diff --git a/src/arch/isa_parser/isa_parser.py b/src/arch/isa_parser/isa_parser.py index 0f29840..5be50a1 100755 --- a/src/arch/isa_parser/isa_parser.py +++ b/src/arch/isa_parser/isa_parser.py @@ -514,6 +514,7 @@ class ISAParser(Grammar): def __init__(self, output_dir): super().__init__() +self.lex_kwargs["reflags"] = int(re.MULTILINE) self.output_dir = output_dir self.filename = None # for output file watermarking/scaremongering @@ -851,7 +852,7 @@ # String literal. Note that these use only single quotes, and # can span multiple lines. def t_STRLIT(self, t): -r"(?m)'([^'])+'" +r"'([^'])+'" # strip off quotes t.value = t.value[1:-1] t.lexer.lineno += t.value.count("\n") @@ -860,19 +861,19 @@ # "Code literal"... like a string literal, but delimiters are # '{{' and '}}' so they get formatted nicely under emacs c-mode def t_CODELIT(self, t): -r"(?m)\{\{([^\}]|}(?!\}))+\}\}" +r"\{\{([^\}]|}(?!\}))+\}\}" # strip off {{ & }} t.value = t.value[2:-2] t.lexer.lineno += t.value.count("\n") return t def t_CPPDIRECTIVE(self, t): -r"^\#[^\#].*\n" +r"^\#[^\#][^\n]*\n" t.lexer.lineno += t.value.count("\n") return t def t_NEWFILE(self, t): -r'^\#\#newfile\s+"[^"]*"\n' +r'^\#\#newfile\s+"[^"\n]*"\n' self.fileNameStack.push(t.lexer.lineno) t.lexer.lineno = LineTracker(t.value[11:-2]) @@ -892,7 +893,7 @@ # Comments def t_comment(self, t): -r"//.*" +r"//[^\n]*\n" # Completely ignored characters t_ignore = " \t\x0c" -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71019?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I7bdbfeb97a9dd74f45c1890a76f8cc16100e5a42 Gerrit-Change-Number: 71019 Gerrit-PatchSet: 3 Gerrit-Owner: Yu-hsin Wang Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Gabe Black Gerrit-Reviewer: Gabe Black Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Richard Cooper Gerrit-Reviewer: Yu-hsin Wang Gerrit-Reviewer: kokoro Gerrit-CC: Earl Ou Gerrit-CC: kokoro ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: fastmodel: only support single line literal when paring project file
Yu-hsin Wang has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71018?usp=email ) Change subject: fastmodel: only support single line literal when paring project file .. fastmodel: only support single line literal when paring project file In python3.11, it requires the global specifier should be the first token of regex. However it's not possible when using ply library. In fastmodel case, we actually don't need to support multiline string literal. We fix this issue by just making the string literal single line. Ref: https://github.com/dabeaz/ply/issues/282 Change-Id: I746b628db7ad4c1d7834f1a1b2c1243cef68aa01 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71018 Tested-by: kokoro Maintainer: Bobby Bruce Reviewed-by: Bobby Bruce --- M src/arch/arm/fastmodel/SConscript 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Bobby Bruce: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/arch/arm/fastmodel/SConscript b/src/arch/arm/fastmodel/SConscript index 3bc9aa5..7c6019e 100644 --- a/src/arch/arm/fastmodel/SConscript +++ b/src/arch/arm/fastmodel/SConscript @@ -218,10 +218,9 @@ t_ID = r'[A-Za-z_]\w*' def t_STRLIT(self, t): -r'(?m)"([^"])*"' +r'"([^"])*"' # strip off quotes t.value = t.value[1:-1] -t.lexer.lineno += t.value.count('\n') return t t_EQUALS = r'=' -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71018?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I746b628db7ad4c1d7834f1a1b2c1243cef68aa01 Gerrit-Change-Number: 71018 Gerrit-PatchSet: 3 Gerrit-Owner: Yu-hsin Wang Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Gabe Black Gerrit-Reviewer: Gabe Black Gerrit-Reviewer: Yu-hsin Wang Gerrit-Reviewer: kokoro Gerrit-CC: Earl Ou Gerrit-CC: kokoro ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org