diff options
author | Marco Balboni <Marco.Balboni@ARM.com> | 2015-02-11 10:23:47 -0500 |
---|---|---|
committer | Marco Balboni <Marco.Balboni@ARM.com> | 2015-02-11 10:23:47 -0500 |
commit | 268d9e59c5e69a00456a40c837b0150a8f3f6bf8 (patch) | |
tree | abb89f1dcd542109c163b76fb632ee8e5444ab18 /src/mem/xbar.cc | |
parent | e2828587b3f28c4f37f0fe598209290bc3d41de0 (diff) | |
download | gem5-268d9e59c5e69a00456a40c837b0150a8f3f6bf8.tar.xz |
mem: Clarification of packet crossbar timings
This patch clarifies the packet timings annotated
when going through a crossbar.
The old 'firstWordDelay' is replaced by 'headerDelay' that represents
the delay associated to the delivery of the header of the packet.
The old 'lastWordDelay' is replaced by 'payloadDelay' that represents
the delay needed to processing the payload of the packet.
For now the uses and values remain identical. However, going forward
the payloadDelay will be additive, and not include the
headerDelay. Follow-on patches will make the headerDelay capture the
pipeline latency incurred in the crossbar, whereas the payloadDelay
will capture the additional serialisation delay.
Diffstat (limited to 'src/mem/xbar.cc')
-rw-r--r-- | src/mem/xbar.cc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/mem/xbar.cc b/src/mem/xbar.cc index d56e726d5..e98b10060 100644 --- a/src/mem/xbar.cc +++ b/src/mem/xbar.cc @@ -109,23 +109,27 @@ BaseXBar::calcPacketTiming(PacketPtr pkt) // until the next clock edge (could be zero) Tick offset = clockEdge() - curTick(); - // determine how many cycles are needed to send the data + // Determine how many cycles are needed to send the data + // If the packet has no data we take into account just the cycle to send + // the header. unsigned dataCycles = pkt->hasData() ? divCeil(pkt->getSize(), width) : 0; // before setting the bus delay fields of the packet, ensure that // the delay from any previous crossbar has been accounted for - if (pkt->firstWordDelay != 0 || pkt->lastWordDelay != 0) + if (pkt->headerDelay != 0 || pkt->payloadDelay != 0) panic("Packet %s already has delay (%d, %d) that should be " - "accounted for.\n", pkt->cmdString(), pkt->firstWordDelay, - pkt->lastWordDelay); - - // The first word will be delivered on the cycle after the header. - pkt->firstWordDelay = (headerCycles + 1) * clockPeriod() + offset; - - // Note that currently lastWordDelay can be smaller than - // firstWordDelay if the packet has no data - pkt->lastWordDelay = (headerCycles + dataCycles) * clockPeriod() + - offset; + "accounted for.\n", pkt->cmdString(), pkt->headerDelay, + pkt->payloadDelay); + + // The headerDelay takes into account the relative time to deliver the + // header of the packet. It will be charged of the additional delay of + // the xbar if the packet goes through it. + pkt->headerDelay = (headerCycles + 1) * clockPeriod() + offset; + + // The payloadDelay takes into account the relative time to deliver the + // payload of the packet. If the packet has no data its value is just one + // tick (due to header) plus the offset value. + pkt->payloadDelay = (headerCycles + dataCycles) * clockPeriod() + offset; } template <typename SrcType, typename DstType> |