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 <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Ayaz Akram
2023-03-26 03:19:46 -07:00
parent 2112eea414
commit 024a907cbb
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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