xbar.cc (10414:3dabe649f1df) | xbar.cc (10694:1a6785e37d81) |
---|---|
1/* 2 * Copyright (c) 2011-2014 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 95 unchanged lines hidden (view full) --- 104void 105BaseXBar::calcPacketTiming(PacketPtr pkt) 106{ 107 // the crossbar will be called at a time that is not necessarily 108 // coinciding with its own clock, so start by determining how long 109 // until the next clock edge (could be zero) 110 Tick offset = clockEdge() - curTick(); 111 | 1/* 2 * Copyright (c) 2011-2014 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 95 unchanged lines hidden (view full) --- 104void 105BaseXBar::calcPacketTiming(PacketPtr pkt) 106{ 107 // the crossbar will be called at a time that is not necessarily 108 // coinciding with its own clock, so start by determining how long 109 // until the next clock edge (could be zero) 110 Tick offset = clockEdge() - curTick(); 111 |
112 // determine how many cycles are needed to send the data | 112 // Determine how many cycles are needed to send the data 113 // If the packet has no data we take into account just the cycle to send 114 // the header. |
113 unsigned dataCycles = pkt->hasData() ? divCeil(pkt->getSize(), width) : 0; 114 115 // before setting the bus delay fields of the packet, ensure that 116 // the delay from any previous crossbar has been accounted for | 115 unsigned dataCycles = pkt->hasData() ? divCeil(pkt->getSize(), width) : 0; 116 117 // before setting the bus delay fields of the packet, ensure that 118 // the delay from any previous crossbar has been accounted for |
117 if (pkt->firstWordDelay != 0 || pkt->lastWordDelay != 0) | 119 if (pkt->headerDelay != 0 || pkt->payloadDelay != 0) |
118 panic("Packet %s already has delay (%d, %d) that should be " | 120 panic("Packet %s already has delay (%d, %d) that should be " |
119 "accounted for.\n", pkt->cmdString(), pkt->firstWordDelay, 120 pkt->lastWordDelay); | 121 "accounted for.\n", pkt->cmdString(), pkt->headerDelay, 122 pkt->payloadDelay); |
121 | 123 |
122 // The first word will be delivered on the cycle after the header. 123 pkt->firstWordDelay = (headerCycles + 1) * clockPeriod() + offset; | 124 // The headerDelay takes into account the relative time to deliver the 125 // header of the packet. It will be charged of the additional delay of 126 // the xbar if the packet goes through it. 127 pkt->headerDelay = (headerCycles + 1) * clockPeriod() + offset; |
124 | 128 |
125 // Note that currently lastWordDelay can be smaller than 126 // firstWordDelay if the packet has no data 127 pkt->lastWordDelay = (headerCycles + dataCycles) * clockPeriod() + 128 offset; | 129 // The payloadDelay takes into account the relative time to deliver the 130 // payload of the packet. If the packet has no data its value is just one 131 // tick (due to header) plus the offset value. 132 pkt->payloadDelay = (headerCycles + dataCycles) * clockPeriod() + offset; |
129} 130 131template <typename SrcType, typename DstType> 132BaseXBar::Layer<SrcType,DstType>::Layer(DstType& _port, BaseXBar& _xbar, 133 const std::string& _name) : 134 port(_port), xbar(_xbar), _name(_name), state(IDLE), drainManager(NULL), 135 waitingForPeer(NULL), releaseEvent(this) 136{ --- 479 unchanged lines hidden --- | 133} 134 135template <typename SrcType, typename DstType> 136BaseXBar::Layer<SrcType,DstType>::Layer(DstType& _port, BaseXBar& _xbar, 137 const std::string& _name) : 138 port(_port), xbar(_xbar), _name(_name), state(IDLE), drainManager(NULL), 139 waitingForPeer(NULL), releaseEvent(this) 140{ --- 479 unchanged lines hidden --- |