ZHENGRONG WANG has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/31314 )
Change subject: mem-ruby: Fix type casting in makeNextStrideAddress
......................................................................
mem-ruby: Fix type casting in makeNextStrideAddress
The RubyPrefetcher uses makeNextStrideAddress() with
a negative stride to find prefetched address.
The type of this expression is:
uint64_t + uint32_t * int;
This gives wrong result due to implicit conversion.
Fix this with static cast and it works correctly:
uint64_t + int * int;
Change-Id: I36e17e00d5c66c3699fe1d5b287971225a162d04
---
M src/mem/ruby/common/Address.cc
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mem/ruby/common/Address.cc b/src/mem/ruby/common/Address.cc
index 39de974..fd3c43e 100644
--- a/src/mem/ruby/common/Address.cc
+++ b/src/mem/ruby/common/Address.cc
@@ -66,7 +66,8 @@
Addr
makeNextStrideAddress(Addr addr, int stride)
{
- return makeLineAddress(addr) + RubySystem::getBlockSizeBytes() *
stride;
+ return makeLineAddress(addr) +
+ static_cast<int>(RubySystem::getBlockSizeBytes()) * stride;
}
std::string
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/31314
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I36e17e00d5c66c3699fe1d5b287971225a162d04
Gerrit-Change-Number: 31314
Gerrit-PatchSet: 1
Gerrit-Owner: ZHENGRONG WANG <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s