From f20ac07dded0702b078449a885ed428c70501dff Mon Sep 17 00:00:00 2001 From: Hristo Belchev Date: Mon, 12 Feb 2024 11:54:33 +0000 Subject: [PATCH 1/4] mem: Fix assertions in LRG Q policy Fix assertions in LRG Queue Policy to correctly assert requestor and list validity Change-Id: I84e3f5b8936b74e7ac675faf7a3e6b9999026781 --- src/mem/qos/q_policy.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mem/qos/q_policy.cc b/src/mem/qos/q_policy.cc index a6d13feb7e..9550eb47c6 100644 --- a/src/mem/qos/q_policy.cc +++ b/src/mem/qos/q_policy.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2018,2024 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -91,10 +91,10 @@ LrgQueuePolicy::selectPacket(PacketQueue* q) "from queue with id %d\n", requestor_id); // Check if this is a known requestor. - panic_if(memCtrl->hasRequestor(requestor_id), + panic_if(!memCtrl->hasRequestor(requestor_id), "%s: Unrecognized Requestor\n", __func__); - panic_if(toServe.size() > 0, + panic_if(toServe.size() <= 0, "%s: toServe list is empty\n", __func__); if (toServe.front() == requestor_id) { From 2138a4ec92c59dd72d9e7a93a6ab17d5eb63236b Mon Sep 17 00:00:00 2001 From: Hristo Belchev Date: Mon, 12 Feb 2024 15:04:58 +0000 Subject: [PATCH 2/4] mem: Fix LIFO q_policy and add assetions * Fix selectPacket() in LIFO Queue Policy to correctly return the end of the `deque` backing store for its packet queue * Move selectPacket() implementations for FIFO and LIFO queues into `q_policy.cc` file Change-Id: I8c35e5fc83dc380b19f52be14c18b1f414f9e141 --- src/mem/qos/q_policy.cc | 21 +++++++++++++++++++-- src/mem/qos/q_policy.hh | 20 +++++++------------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/mem/qos/q_policy.cc b/src/mem/qos/q_policy.cc index 9550eb47c6..0a210f3c71 100644 --- a/src/mem/qos/q_policy.cc +++ b/src/mem/qos/q_policy.cc @@ -69,9 +69,27 @@ QueuePolicy::create(const QoSMemCtrlParams &p) } } +QueuePolicy::PacketQueue::iterator +FifoQueuePolicy::selectPacket(PacketQueue* queue) +{ + panic_if(queue->empty(), + "Provided packet queue is not usable by queue policy"); + return queue->begin(); +} + +QueuePolicy::PacketQueue::iterator +LifoQueuePolicy::selectPacket(PacketQueue* queue) +{ + panic_if(queue->empty(), + "Provided packet queue is not usable by queue policy"); + return std::prev(queue->end()); +} + QueuePolicy::PacketQueue::iterator LrgQueuePolicy::selectPacket(PacketQueue* q) { + panic_if(q->empty(), + "Provided packet queue is not usable by queue policy"); QueuePolicy::PacketQueue::iterator ret = q->end(); // Tracks one packet per requestor in the queue @@ -137,8 +155,7 @@ LrgQueuePolicy::selectPacket(PacketQueue* q) DPRINTF(QOS, "QoSQPolicy::lrg no packet was serviced\n"); - // Ret will be : packet to serve if any found or queue begin - // (end if queue is empty) + // Ret will be : packet to serve return ret; } diff --git a/src/mem/qos/q_policy.hh b/src/mem/qos/q_policy.hh index fc9200d0af..39fd2d9bb4 100644 --- a/src/mem/qos/q_policy.hh +++ b/src/mem/qos/q_policy.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2018, 2024 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -93,7 +93,7 @@ class QueuePolicy * The implementation of this virtual method selects the packet * to be serviced from the packet queue passed as an argument. * - * @param queue Packet queue + * @param queue Non-empty packet queue to select a packet from * @return Iterator pointing to the packet in the queue to be * serviced */ @@ -127,14 +127,11 @@ class LifoQueuePolicy : public QueuePolicy /** * Implements LIFO packet select policy * - * @param queue The queue in which to select a packet + * @param queue The non-empty queue from which to select a packet * @return Iterator to the selected packet */ PacketQueue::iterator - selectPacket(PacketQueue* queue) override - { - return queue->end(); - } + selectPacket(PacketQueue* queue) override; }; /** First In First Out Queue Policy */ @@ -148,14 +145,11 @@ class FifoQueuePolicy : public QueuePolicy /** * Implements FCFS packet select policy * - * @param queue The queue in which to select a packet + * @param queue The non-empty queue from which to select a packet * @return Iterator to the selected packet */ PacketQueue::iterator - selectPacket(PacketQueue* queue) override - { - return queue->begin(); - } + selectPacket(PacketQueue* queue) override; }; /** @@ -176,7 +170,7 @@ class LrgQueuePolicy : public QueuePolicy /** * Implements LRG packet select policy * - * @param queue The queue in which to select a packet + * @param queue The non-empty queue from which to select a packet * @return Iterator to the selected packet */ PacketQueue::iterator From 920497c19fd4616561fc4e702292111ea3caaf42 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Mon, 26 Feb 2024 15:03:14 -0800 Subject: [PATCH 3/4] tests: Add compiler test for gcc 13 (#858) Change-Id: I41bdf3ab7ffff21c4148ef17fc5229b5597ec953 --- .github/workflows/compiler-tests.yaml | 6 +-- util/dockerfiles/docker-compose.yaml | 5 ++ .../ubuntu-22.04_gcc_13-version/Dockerfile | 53 +++++++++++++++++++ 3 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 util/dockerfiles/ubuntu-22.04_gcc_13-version/Dockerfile diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index 3ae6faead1..fde8f3cd44 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -16,8 +16,8 @@ jobs: strategy: fail-fast: false matrix: - image: [gcc-version-12, gcc-version-11, gcc-version-10, gcc-version-8, clang-version-16, clang-version-15, clang-version-14, clang-version-13, - clang-version-12, clang-version-11, clang-version-10, clang-version-9, clang-version-8, clang-version-7, ubuntu-20.04_all-dependencies, + image: [gcc-version-13, gcc-version-12, gcc-version-11, gcc-version-10, gcc-version-8, clang-version-16, clang-version-15, clang-version-14, + clang-version-13, clang-version-12, clang-version-11, clang-version-10, clang-version-9, clang-version-8, clang-version-7, ubuntu-20.04_all-dependencies, ubuntu-22.04_all-dependencies, ubuntu-22.04_min-dependencies] opts: [.opt, .fast] runs-on: [self-hosted, linux, x64] @@ -40,7 +40,7 @@ jobs: matrix: gem5-compilation: [ARM, ARM_MESI_Three_Level, ARM_MESI_Three_Level_HTM, ARM_MOESI_hammer, Garnet_standalone, MIPS, 'NULL', NULL_MESI_Two_Level, NULL_MOESI_CMP_directory, NULL_MOESI_CMP_token, NULL_MOESI_hammer, POWER, RISCV, SPARC, X86, X86_MI_example, X86_MOESI_AMD_Base, VEGA_X86] - image: [gcc-version-12, clang-version-16] + image: [gcc-version-13, clang-version-16] opts: [.opt] runs-on: [self-hosted, linux, x64] timeout-minutes: 2880 # 48 hours diff --git a/util/dockerfiles/docker-compose.yaml b/util/dockerfiles/docker-compose.yaml index 5c63e101ba..69a9c2a1f5 100644 --- a/util/dockerfiles/docker-compose.yaml +++ b/util/dockerfiles/docker-compose.yaml @@ -65,6 +65,11 @@ services: args: - version=12 image: gcr.io/gem5-test/gcc-version-12:latest + gcc-13: + build: + context: ubuntu-22.04_gcc_13-version + dockerfile: Dockerfile + image: gcr.io/gem5-test/gcc-version-13:latest clang-7: build: context: ubuntu-20.04_clang-version diff --git a/util/dockerfiles/ubuntu-22.04_gcc_13-version/Dockerfile b/util/dockerfiles/ubuntu-22.04_gcc_13-version/Dockerfile new file mode 100644 index 0000000000..157cf4f9ba --- /dev/null +++ b/util/dockerfiles/ubuntu-22.04_gcc_13-version/Dockerfile @@ -0,0 +1,53 @@ +# Copyright (c) 2024 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. +FROM --platform=${BUILDPLATFORM} ubuntu:22.04 + +# Valid version values: +# 13 + +ENV DEBIAN_FRONTEND=noninteractive +RUN apt -y update && \ + # software-properties-common is necessary to install + # to add PPA to the system + apt -y install software-properties-common && \ + # Installing PPA is necessary to install gcc-13 + # because it is not available in the default repositories + # for Ubuntu 22.04 + add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ + apt -y update && \ + apt -y install git m4 scons zlib1g zlib1g-dev libprotobuf-dev \ + protobuf-compiler libprotoc-dev libgoogle-perftools-dev python3-dev \ + doxygen libboost-all-dev libhdf5-serial-dev python3-pydot libpng-dev \ + gcc-13 g++-13 make + +RUN update-alternatives --install \ + /usr/bin/g++ g++ /usr/bin/g++- 100 +RUN update-alternatives --install \ + /usr/bin/gcc gcc /usr/bin/gcc-13 100 +RUN update-alternatives --install \ + /usr/bin/c++ c++ /usr/bin/g++-13 100 +RUN update-alternatives --install \ + /usr/bin/cc cc /usr/bin/gcc-13 100 From 4e12f2486b58a155595a85dc70ab11904446224d Mon Sep 17 00:00:00 2001 From: Richard Cooper Date: Tue, 27 Feb 2024 19:10:31 +0000 Subject: [PATCH 4/4] util: update list_changes.py to support multiple Change-Ids (#861) The original version of `list_changes.py` assumed no more than one `Change-Id` tag per commit. However, since transitioning to GitHub, the repository now contains some merge commits containing multiple `Change-Id`s. This patch updates `list_changes.py` to support commits with any number of `Change-Id` tags. --- util/maint/list_changes.py | 48 +++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/util/maint/list_changes.py b/util/maint/list_changes.py index 805d7676b6..8c057381b9 100755 --- a/util/maint/list_changes.py +++ b/util/maint/list_changes.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (c) 2017-2018 Arm Limited +# Copyright (c) 2017-2018, 2024 Arm Limited # All rights reserved # # The license below extends only to copyright in the software and shall @@ -88,20 +88,20 @@ class Commit: return self._tags @property - def change_id(self): - """Get the Change-Id tag from the commit + def change_ids(self): + """Get the Change-Id tag(s) from the commit - Returns: A change ID or None if no change ID has been - specified. + Returns: A list of change IDs. May be empty if no change IDs + have been specified. """ + try: cids = self.tags["Change-Id"] except KeyError: - return None + return list() - assert len(cids) == 1 - return cids[0] + return cids[:] def __str__(self): return f"{self.rev[0:8]}: {self.log[0]}" @@ -137,32 +137,26 @@ def list_changes(upstream, feature, paths=[]): feature_revs = tuple(list_revs(upstream, feature, paths=paths)) upstream_revs = tuple(list_revs(feature, upstream, paths=paths)) - feature_cids = { - c.change_id: c for c in feature_revs if c.change_id is not None - } - upstream_cids = { - c.change_id: c for c in upstream_revs if c.change_id is not None - } + feature_cids = {cid: c for c in feature_revs for cid in c.change_ids} + upstream_cids = {cid: c for c in upstream_revs for cid in c.change_ids} incoming = [ r for r in reversed(upstream_revs) - if r.change_id and r.change_id not in feature_cids + if any(rcid not in feature_cids for rcid in r.change_ids) ] outgoing = [ r for r in reversed(feature_revs) - if r.change_id and r.change_id not in upstream_cids + if any(rcid not in upstream_cids for rcid in r.change_ids) ] common = [ - r for r in reversed(feature_revs) if r.change_id in upstream_cids - ] - upstream_unknown = [ - r for r in reversed(upstream_revs) if r.change_id is None - ] - feature_unknown = [ - r for r in reversed(feature_revs) if r.change_id is None + r + for r in reversed(feature_revs) + if any(rcid in upstream_cids for rcid in r.change_ids) ] + upstream_unknown = [r for r in reversed(upstream_revs) if not r.change_ids] + feature_unknown = [r for r in reversed(feature_revs) if not r.change_ids] return incoming, outgoing, common, upstream_unknown, feature_unknown @@ -252,12 +246,12 @@ def _main(): print("Incorrectly rebased changes:") all_upstream_revs = list_revs(args.upstream, paths=args.paths) all_upstream_cids = { - c.change_id: c - for c in all_upstream_revs - if c.change_id is not None + cid: c for c in all_upstream_revs for cid in c.change_ids } incorrect_outgoing = [ - r for r in outgoing if r.change_id in all_upstream_cids + r + for r in outgoing + if any(rcid in all_upstream_cids for rcid in r.change_ids) ] for rev in incorrect_outgoing: print(rev)