Nikos Nikoleris has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/30055 )
Change subject: mem: Fix latency handling in MemDelay
......................................................................
mem: Fix latency handling in MemDelay
MemDelay wouldn't consume pre-existing delays in the packet and
therefore the latency it adds would overlap with them. This patch
fixes the MemDelay to properly account for them.
Change-Id: I7330fbf1c8161a21523a0b4aab31c72e34bce650
Signed-off-by: Nikos Nikoleris <nikos.nikole...@arm.com>
---
M src/mem/mem_delay.cc
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/mem/mem_delay.cc b/src/mem/mem_delay.cc
index 83177fd..52c1ca8 100644
--- a/src/mem/mem_delay.cc
+++ b/src/mem/mem_delay.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited
+ * Copyright (c) 2018, 2020 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -87,7 +87,13 @@
bool
MemDelay::MasterPort::recvTimingResp(PacketPtr pkt)
{
- const Tick when = curTick() + parent.delayResp(pkt);
+ // technically the packet only reaches us after the header delay,
+ // and typically we also need to deserialise any payload (unless
+ // the two sides of the bridge are synchronous)
+ const Tick receive_delay = pkt->headerDelay + pkt->payloadDelay;
+ pkt->headerDelay = pkt->payloadDelay = 0;
+
+ const Tick when = curTick() + parent.delayResp(pkt) + receive_delay;
parent.slavePort.schedTimingResp(pkt, when);
@@ -136,7 +142,14 @@
bool
MemDelay::SlavePort::recvTimingReq(PacketPtr pkt)
{
- const Tick when = curTick() + parent.delayReq(pkt);
+ // technically the packet only reaches us after the header
+ // delay, and typically we also need to deserialise any
+ // payload (unless the two sides of the bridge are
+ // synchronous)
+ Tick receive_delay = pkt->headerDelay + pkt->payloadDelay;
+ pkt->headerDelay = pkt->payloadDelay = 0;
+
+ const Tick when = curTick() + parent.delayReq(pkt) + receive_delay;
parent.masterPort.schedTimingReq(pkt, when);
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/30055
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: I7330fbf1c8161a21523a0b4aab31c72e34bce650
Gerrit-Change-Number: 30055
Gerrit-PatchSet: 1
Gerrit-Owner: Nikos Nikoleris <nikos.nikole...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s