From: David Schall Date: Thu, 18 Jun 2020 15:14:44 +0000 (+0100) Subject: base: Add XOR and modulo operator to ChannelAddr X-Git-Tag: develop-gem5-snapshot~124 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f7e0115882321a5d63450aa6d1354c1de04afca9;p=gem5.git base: Add XOR and modulo operator to ChannelAddr Channel address class did not offer bitwise XOR and modulo operation. These two functions where now added to the ChannelAddr class. Change-Id: I02a5e49e9700cc5283415c921a25989a130e5d07 Reviewed-by: Andreas Sandberg Reviewed-by: Ciro Santilli Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39235 Reviewed-by: Daniel Carvalho Reviewed-by: Jason Lowe-Power Reviewed-by: Bobby R. Bruce Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/src/base/channel_addr.hh b/src/base/channel_addr.hh index 2cfe38027..55d227bee 100644 --- a/src/base/channel_addr.hh +++ b/src/base/channel_addr.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 ARM Limited + * Copyright (c) 2019, 2021 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -93,6 +93,14 @@ class ChannelAddr return ChannelAddr(a << b); } + constexpr ChannelAddr operator^(const int b) const { + return ChannelAddr(a ^ b); + } + + constexpr ChannelAddr operator%(const int b) const { + return ChannelAddr(a % b); + } + constexpr ChannelAddr operator*(const Type &b) const { return ChannelAddr(a * b); }