From 9396be08da282d42f6b7703900825fcb9781091c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20M=C3=BCck?= Date: Mon, 22 Feb 2021 16:24:58 -0600 Subject: [PATCH] mem-ruby: RubyRequest getter for request ptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib3d12c9030d18d96388dd66f0a409b42543ee9a8 Signed-off-by: Tiago Mück Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41814 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/mem/ruby/protocol/RubySlicc_Exports.sm | 1 + src/mem/ruby/protocol/RubySlicc_Types.sm | 4 +++- src/mem/ruby/slicc_interface/RubyRequest.hh | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mem/ruby/protocol/RubySlicc_Exports.sm b/src/mem/ruby/protocol/RubySlicc_Exports.sm index 0eb10a7aa0..c2f2c9df48 100644 --- a/src/mem/ruby/protocol/RubySlicc_Exports.sm +++ b/src/mem/ruby/protocol/RubySlicc_Exports.sm @@ -50,6 +50,7 @@ external_type(Packet, primitive="yes"); external_type(Addr, primitive="yes"); external_type(Cycles, primitive="yes", default="Cycles(0)"); external_type(Tick, primitive="yes", default="0"); +external_type(RequestPtr, primitive="yes", default="nullptr"); structure(WriteMask, external="yes", desc="...") { void clear(); diff --git a/src/mem/ruby/protocol/RubySlicc_Types.sm b/src/mem/ruby/protocol/RubySlicc_Types.sm index 339e99acae..c3a2f2d939 100644 --- a/src/mem/ruby/protocol/RubySlicc_Types.sm +++ b/src/mem/ruby/protocol/RubySlicc_Types.sm @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 ARM Limited + * Copyright (c) 2020-2021 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -170,6 +170,8 @@ structure(RubyRequest, desc="...", interface="Message", external="yes") { PacketPtr pkt, desc="Packet associated with this request"; bool htmFromTransaction, desc="Memory request originates within a HTM transaction"; int htmTransactionUid, desc="Used to identify the unique HTM transaction that produced this request"; + + RequestPtr getRequestPtr(); } structure(AbstractCacheEntry, primitive="yes", external = "yes") { diff --git a/src/mem/ruby/slicc_interface/RubyRequest.hh b/src/mem/ruby/slicc_interface/RubyRequest.hh index 55b645e936..3a2f486528 100644 --- a/src/mem/ruby/slicc_interface/RubyRequest.hh +++ b/src/mem/ruby/slicc_interface/RubyRequest.hh @@ -154,6 +154,7 @@ class RubyRequest : public Message const RubyAccessMode& getAccessMode() const { return m_AccessMode; } const int& getSize() const { return m_Size; } const PrefetchBit& getPrefetch() const { return m_Prefetch; } + RequestPtr getRequestPtr() const { return m_pkt->req; } void print(std::ostream& out) const; bool functionalRead(Packet *pkt);