Jason Lowe-Power has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/51447 )
Change subject: mem-ruby: Add RISC-V atomic support to Ruby
......................................................................
mem-ruby: Add RISC-V atomic support to Ruby
RISC-V atomics carry a atomic functor that needs to be executed in the
cache hierarchy. To implement this in Ruby, we execute the functor in
the hitCallback function. Note that these functions are slightly
different than the atomic functions used in the GPU model and the GPU
coalescer even though they have similar semantics.
This change was tested with RISC-V Linux boot which has a few atomics
and linux boot finishes successfully. Previously, the boot got stuck
after the incorrect atomic operation.
Change-Id: I47a69c05ad9f4267d0220023289116e62b5231be
Signed-off-by: Jason Lowe-Power <[email protected]>
---
M src/mem/ruby/system/Sequencer.cc
1 file changed, 29 insertions(+), 0 deletions(-)
diff --git a/src/mem/ruby/system/Sequencer.cc
b/src/mem/ruby/system/Sequencer.cc
index 77ab170..ac52c5f 100644
--- a/src/mem/ruby/system/Sequencer.cc
+++ b/src/mem/ruby/system/Sequencer.cc
@@ -613,6 +613,15 @@
data.setData(&overwrite_val[0],
getOffset(request_address), pkt->getSize());
DPRINTF(RubySequencer, "swap data %s\n", data);
+ } else if (pkt->isAtomicOp()) {
+ // Set the data in the packet to the old value in the cache
+ pkt->setData(
+ data.getData(getOffset(request_address), pkt->getSize()));
+ DPRINTF(RubySequencer, "AMO original data %s\n", data);
+ // execute AMO operation
+ (*(pkt->getAtomicOp()))(
+ data.getDataMod(getOffset(request_address)));
+ DPRINTF(RubySequencer, "AMO new data %s\n", data);
} else if (type != RubyRequestType_Store_Conditional ||
llscSuccess) {
// Types of stores set the actual data here, apart from
// failed Store Conditional requests
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/51447
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: I47a69c05ad9f4267d0220023289116e62b5231be
Gerrit-Change-Number: 51447
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Lowe-Power <[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