From 024a907cbbbedebf12367e621c27271f715269bf Mon Sep 17 00:00:00 2001 From: Ayaz Akram Date: Sun, 26 Mar 2023 03:19:46 -0700 Subject: [PATCH] stdlib: Small fix in mesi three level component This change ensures that if cache_line_size is not an integer type, we don't incorrectly raise the exception of cache size not equal to 2^bits. Change-Id: I5a06cdac820283feb54f23d805fd87490fae1c3b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69297 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- .../cachehierarchies/ruby/caches/mesi_three_level/l1_cache.py | 2 +- .../cachehierarchies/ruby/caches/mesi_three_level/l2_cache.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python/gem5/components/cachehierarchies/ruby/caches/mesi_three_level/l1_cache.py b/src/python/gem5/components/cachehierarchies/ruby/caches/mesi_three_level/l1_cache.py index b4854816fb..e746579834 100644 --- a/src/python/gem5/components/cachehierarchies/ruby/caches/mesi_three_level/l1_cache.py +++ b/src/python/gem5/components/cachehierarchies/ruby/caches/mesi_three_level/l1_cache.py @@ -92,7 +92,7 @@ class L1Cache(L0Cache_Controller): def getBlockSizeBits(self, cache_line_size): bits = int(math.log(cache_line_size, 2)) - if 2**bits != cache_line_size: + if 2**bits != int(cache_line_size): raise Exception("Cache line size is not a power of 2!") return bits diff --git a/src/python/gem5/components/cachehierarchies/ruby/caches/mesi_three_level/l2_cache.py b/src/python/gem5/components/cachehierarchies/ruby/caches/mesi_three_level/l2_cache.py index d54e1ab8dc..dfc1304a87 100644 --- a/src/python/gem5/components/cachehierarchies/ruby/caches/mesi_three_level/l2_cache.py +++ b/src/python/gem5/components/cachehierarchies/ruby/caches/mesi_three_level/l2_cache.py @@ -90,7 +90,7 @@ class L2Cache(L1Cache_Controller): def getBlockSizeBits(self, cache_line_size): bits = int(math.log(cache_line_size, 2)) - if 2**bits != cache_line_size: + if 2**bits != int(cache_line_size): raise Exception("Cache line size is not a power of 2!") return bits