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:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user