Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/45861 )
Change subject: cpu: Add a sendFunctional function to the ThreadContext.
......................................................................
cpu: Add a sendFunctional function to the ThreadContext.
This can be used to send a functional packet from the perspective of a
thread context. Currently this will not consider targets within the CPU
like the local APIC on x86. The default implementation sends a packet
using the port on the way out of the CPU.
Change-Id: Idb311e156a416ad51b585794c1e9fa75711d61f1
---
M src/cpu/thread_context.cc
M src/cpu/thread_context.hh
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/cpu/thread_context.cc b/src/cpu/thread_context.cc
index 1a78693..00afe7c 100644
--- a/src/cpu/thread_context.cc
+++ b/src/cpu/thread_context.cc
@@ -48,6 +48,7 @@
#include "cpu/base.hh"
#include "debug/Context.hh"
#include "debug/Quiesce.hh"
+#include "mem/port.hh"
#include "params/BaseCPU.hh"
#include "sim/full_system.hh"
@@ -128,6 +129,15 @@
}
void
+ThreadContext::sendFunctional(PacketPtr pkt)
+{
+ const auto *port =
+ dynamic_cast<const RequestPort *>(&getCpuPtr()->getDataPort());
+ assert(port);
+ port->sendFunctional(pkt);
+}
+
+void
ThreadContext::quiesce()
{
getSystemPtr()->threads.quiesce(contextId());
diff --git a/src/cpu/thread_context.hh b/src/cpu/thread_context.hh
index 145be58..921135c 100644
--- a/src/cpu/thread_context.hh
+++ b/src/cpu/thread_context.hh
@@ -68,6 +68,8 @@
class PortProxy;
class Process;
class System;
+class Packet;
+using PacketPtr = Packet *;
/**
* ThreadContext is the external interface to all thread state for
@@ -146,6 +148,8 @@
virtual PortProxy &getVirtProxy() = 0;
+ virtual void sendFunctional(PacketPtr pkt);
+
/**
* Initialise the physical and virtual port proxies and tie them to
* the data port of the CPU.
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/45861
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: Idb311e156a416ad51b585794c1e9fa75711d61f1
Gerrit-Change-Number: 45861
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[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