Yuan Yao has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/26343 )
Change subject: mem-ruby: Fix fast-forward when using the backing store.
......................................................................
mem-ruby: Fix fast-forward when using the backing store.
While the up-to-date data may reside in any agent of Ruby's memory
hierarchy, there's an optional backing store in Ruby that provides
a 'correct' view of the physical memory. When it is enabled by the
user, every Ruby memory access will update this global memory view
as well upon finishing.
The issue is that Ruby's atomic access, used in fast-forward, does
not currently access the backing store, leading to data
incorrectness. More specifically, at the very beginning stage of the
simulation, a loader loads the program into the backing store using
functional accesses. Then the program starts execution with
fast-forward enabled, using atomic accesses for faster simulation. But
because atomic access only accesses the real memory hierarchy, the CPU
fetches incorrect instructions.
The fix is simple. Just make Ruby's atomic access update the backing
store as well as the real physical memory.
Change-Id: I2541d923e18ea488d383097ca7abd4124e47e59b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26343
Reviewed-by: Jason Lowe-Power <[email protected]>
Reviewed-by: Onur Kayıran <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/mem/ruby/system/RubyPort.cc
1 file changed, 4 insertions(+), 1 deletion(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
Onur Kayıran: Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/mem/ruby/system/RubyPort.cc
b/src/mem/ruby/system/RubyPort.cc
index 800046e..a6cee05 100644
--- a/src/mem/ruby/system/RubyPort.cc
+++ b/src/mem/ruby/system/RubyPort.cc
@@ -339,7 +339,10 @@
RubySystem *rs = ruby_port->m_ruby_system;
AbstractController *directory =
rs->m_abstract_controls[id.getType()][id.getNum()];
- return directory->recvAtomic(pkt);
+ Tick latency = directory->recvAtomic(pkt);
+ if (access_backing_store)
+ rs->getPhysMem()->access(pkt);
+ return latency;
}
void
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/26343
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: I2541d923e18ea488d383097ca7abd4124e47e59b
Gerrit-Change-Number: 26343
Gerrit-PatchSet: 3
Gerrit-Owner: Yuan Yao <[email protected]>
Gerrit-Reviewer: Bradford Beckmann <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: John Alsop <[email protected]>
Gerrit-Reviewer: Onur Kayıran <[email protected]>
Gerrit-Reviewer: Tuan Ta <[email protected]>
Gerrit-Reviewer: Yuan Yao <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev