2006-04-28 21:37:48 +02:00
|
|
|
/*
|
2013-06-27 11:49:49 +02:00
|
|
|
* Copyright (c) 2011-2013 ARM Limited
|
2012-01-17 19:55:09 +01:00
|
|
|
* All rights reserved
|
|
|
|
*
|
|
|
|
* The license below extends only to copyright in the software and shall
|
|
|
|
* not be construed as granting a license to any other intellectual
|
|
|
|
* property including but not limited to intellectual property relating
|
|
|
|
* to a hardware implementation of the functionality of the software
|
|
|
|
* licensed hereunder. You may use the software subject to the license
|
|
|
|
* terms below provided that you ensure that this notice is replicated
|
|
|
|
* unmodified and in its entirety in all distributions of the software,
|
|
|
|
* modified or unmodified, in source code or in binary form.
|
|
|
|
*
|
2006-04-28 21:37:48 +02:00
|
|
|
* Copyright (c) 2006 The Regents of The University of Michigan
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are
|
|
|
|
* met: redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer;
|
|
|
|
* redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution;
|
|
|
|
* neither the name of the copyright holders nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived from
|
|
|
|
* this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2006-06-01 01:26:56 +02:00
|
|
|
*
|
|
|
|
* Authors: Ali Saidi
|
|
|
|
* Steve Reinhardt
|
2012-01-17 19:55:09 +01:00
|
|
|
* Andreas Hansson
|
2006-04-28 21:37:48 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2006-08-15 01:25:07 +02:00
|
|
|
* @file
|
2012-01-17 19:55:09 +01:00
|
|
|
* Declaration of a memory-mapped bus bridge that connects a master
|
|
|
|
* and a slave through a request and response queue.
|
2006-04-28 21:37:48 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MEM_BRIDGE_HH__
|
|
|
|
#define __MEM_BRIDGE_HH__
|
|
|
|
|
2013-06-27 11:49:49 +02:00
|
|
|
#include <deque>
|
2006-04-28 21:37:48 +02:00
|
|
|
|
2009-05-17 23:34:51 +02:00
|
|
|
#include "base/types.hh"
|
2006-04-28 21:37:48 +02:00
|
|
|
#include "mem/mem_object.hh"
|
2007-07-24 06:51:38 +02:00
|
|
|
#include "params/Bridge.hh"
|
2006-04-28 21:37:48 +02:00
|
|
|
|
2012-01-17 19:55:09 +01:00
|
|
|
/**
|
|
|
|
* A bridge is used to interface two different busses (or in general a
|
|
|
|
* memory-mapped master and slave), with buffering for requests and
|
|
|
|
* responses. The bridge has a fixed delay for packets passing through
|
|
|
|
* it and responds to a fixed set of address ranges.
|
|
|
|
*
|
|
|
|
* The bridge comprises a slave port and a master port, that buffer
|
|
|
|
* outgoing responses and requests respectively. Buffer space is
|
|
|
|
* reserved when a request arrives, also reserving response space
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
* before forwarding the request. If there is no space present, then
|
|
|
|
* the bridge will delay accepting the packet until space becomes
|
|
|
|
* available.
|
2012-01-17 19:55:09 +01:00
|
|
|
*/
|
2006-04-28 21:37:48 +02:00
|
|
|
class Bridge : public MemObject
|
|
|
|
{
|
2006-05-26 20:29:29 +02:00
|
|
|
protected:
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
/**
|
2012-05-30 11:28:06 +02:00
|
|
|
* A bridge request state stores packets along with their sender
|
|
|
|
* state and original source. It has enough information to also
|
|
|
|
* restore the response once it comes back to the bridge.
|
2012-01-17 19:55:09 +01:00
|
|
|
*/
|
2012-06-05 07:23:08 +02:00
|
|
|
class RequestState : public Packet::SenderState
|
2012-05-30 11:28:06 +02:00
|
|
|
{
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
public:
|
2012-05-30 11:28:06 +02:00
|
|
|
|
2013-06-27 11:49:49 +02:00
|
|
|
const PortID origSrc;
|
2012-01-17 19:55:09 +01:00
|
|
|
|
2013-02-19 11:56:05 +01:00
|
|
|
RequestState(PortID orig_src) : origSrc(orig_src)
|
2012-05-30 11:28:06 +02:00
|
|
|
{ }
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2012-05-30 11:28:06 +02:00
|
|
|
/**
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
* A deferred packet stores a packet along with its scheduled
|
|
|
|
* transmission time
|
2012-05-30 11:28:06 +02:00
|
|
|
*/
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
class DeferredPacket
|
2012-05-30 11:28:06 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2013-06-27 11:49:49 +02:00
|
|
|
const Tick tick;
|
|
|
|
const PacketPtr pkt;
|
2012-05-30 11:28:06 +02:00
|
|
|
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
DeferredPacket(PacketPtr _pkt, Tick _tick) : tick(_tick), pkt(_pkt)
|
2012-05-30 11:28:06 +02:00
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
2012-01-17 19:55:09 +01:00
|
|
|
// Forward declaration to allow the slave port to have a pointer
|
|
|
|
class BridgeMasterPort;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The port on the side that receives requests and sends
|
|
|
|
* responses. The slave port has a set of address ranges that it
|
|
|
|
* is responsible for. The slave port also has a buffer for the
|
|
|
|
* responses not yet sent.
|
|
|
|
*/
|
MEM: Introduce the master/slave port sub-classes in C++
This patch introduces the notion of a master and slave port in the C++
code, thus bringing the previous classification from the Python
classes into the corresponding simulation objects and memory objects.
The patch enables us to classify behaviours into the two bins and add
assumptions and enfore compliance, also simplifying the two
interfaces. As a starting point, isSnooping is confined to a master
port, and getAddrRanges to slave ports. More of these specilisations
are to come in later patches.
The getPort function is not getMasterPort and getSlavePort, and
returns a port reference rather than a pointer as NULL would never be
a valid return value. The default implementation of these two
functions is placed in MemObject, and calls fatal.
The one drawback with this specific patch is that it requires some
code duplication, e.g. QueuedPort becomes QueuedMasterPort and
QueuedSlavePort, and BusPort becomes BusMasterPort and BusSlavePort
(avoiding multiple inheritance). With the later introduction of the
port interfaces, moving the functionality outside the port itself, a
lot of the duplicated code will disappear again.
2012-03-30 15:40:11 +02:00
|
|
|
class BridgeSlavePort : public SlavePort
|
2006-04-28 21:37:48 +02:00
|
|
|
{
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
/** The bridge to which this port belongs. */
|
|
|
|
Bridge& bridge;
|
2006-04-28 21:37:48 +02:00
|
|
|
|
2006-05-26 20:29:29 +02:00
|
|
|
/**
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
* Master port on the other side of the bridge (connected to
|
|
|
|
* the other bus).
|
2006-05-26 20:29:29 +02:00
|
|
|
*/
|
2012-02-24 17:43:53 +01:00
|
|
|
BridgeMasterPort& masterPort;
|
2006-04-28 21:37:48 +02:00
|
|
|
|
2012-01-17 19:55:09 +01:00
|
|
|
/** Minimum request delay though this bridge. */
|
2013-06-27 11:49:49 +02:00
|
|
|
const Cycles delay;
|
2006-04-28 21:37:48 +02:00
|
|
|
|
2012-01-17 19:55:09 +01:00
|
|
|
/** Address ranges to pass through the bridge */
|
2013-06-27 11:49:49 +02:00
|
|
|
const AddrRangeList ranges;
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Response packet queue. Response packets are held in this
|
|
|
|
* queue for a specified delay to model the processing delay
|
2013-06-27 11:49:49 +02:00
|
|
|
* of the bridge. We use a deque as we need to iterate over
|
|
|
|
* the items for functional accesses.
|
2012-01-17 19:55:09 +01:00
|
|
|
*/
|
2013-06-27 11:49:49 +02:00
|
|
|
std::deque<DeferredPacket> transmitList;
|
2007-05-07 20:42:03 +02:00
|
|
|
|
2012-01-17 19:55:09 +01:00
|
|
|
/** Counter to track the outstanding responses. */
|
|
|
|
unsigned int outstandingResponses;
|
|
|
|
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
/** If we should send a retry when space becomes available. */
|
|
|
|
bool retryReq;
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
/** Max queue size for reserved responses. */
|
|
|
|
unsigned int respQueueLimit;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Is this side blocked from accepting new response packets.
|
|
|
|
*
|
|
|
|
* @return true if the reserved space has reached the set limit
|
|
|
|
*/
|
2013-06-27 11:49:49 +02:00
|
|
|
bool respQueueFull() const;
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle send event, scheduled when the packet at the head of
|
|
|
|
* the response queue is ready to transmit (for timing
|
|
|
|
* accesses only).
|
|
|
|
*/
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
void trySendTiming();
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
/** Send event for the response queue. */
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
EventWrapper<BridgeSlavePort,
|
|
|
|
&BridgeSlavePort::trySendTiming> sendEvent;
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2006-05-26 20:29:29 +02:00
|
|
|
/**
|
2012-01-17 19:55:09 +01:00
|
|
|
* Constructor for the BridgeSlavePort.
|
|
|
|
*
|
|
|
|
* @param _name the port name including the owner
|
|
|
|
* @param _bridge the structural owner
|
|
|
|
* @param _masterPort the master port on the other side of the bridge
|
2012-08-28 20:30:33 +02:00
|
|
|
* @param _delay the delay in cycles from receiving to sending
|
2012-01-17 19:55:09 +01:00
|
|
|
* @param _resp_limit the size of the response queue
|
|
|
|
* @param _ranges a number of address ranges to forward
|
2006-05-26 20:29:29 +02:00
|
|
|
*/
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
BridgeSlavePort(const std::string& _name, Bridge& _bridge,
|
2012-08-28 20:30:33 +02:00
|
|
|
BridgeMasterPort& _masterPort, Cycles _delay,
|
2012-09-19 12:15:44 +02:00
|
|
|
int _resp_limit, std::vector<AddrRange> _ranges);
|
2006-04-28 21:37:48 +02:00
|
|
|
|
2012-01-17 19:55:09 +01:00
|
|
|
/**
|
|
|
|
* Queue a response packet to be sent out later and also schedule
|
|
|
|
* a send if necessary.
|
|
|
|
*
|
|
|
|
* @param pkt a response to send out after a delay
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
* @param when tick when response packet should be sent
|
|
|
|
*/
|
|
|
|
void schedTimingResp(PacketPtr pkt, Tick when);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retry any stalled request that we have failed to accept at
|
|
|
|
* an earlier point in time. This call will do nothing if no
|
|
|
|
* request is waiting.
|
2012-01-17 19:55:09 +01:00
|
|
|
*/
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
void retryStalledReq();
|
2006-05-26 20:29:29 +02:00
|
|
|
|
2012-01-17 19:55:09 +01:00
|
|
|
protected:
|
2007-05-10 00:20:24 +02:00
|
|
|
|
2012-01-17 19:55:09 +01:00
|
|
|
/** When receiving a timing request from the peer port,
|
|
|
|
pass it to the bridge. */
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
bool recvTimingReq(PacketPtr pkt);
|
2007-05-10 00:20:24 +02:00
|
|
|
|
2012-01-17 19:55:09 +01:00
|
|
|
/** When receiving a retry request from the peer port,
|
|
|
|
pass it to the bridge. */
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
void recvRetry();
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
/** When receiving a Atomic requestfrom the peer port,
|
|
|
|
pass it to the bridge. */
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
Tick recvAtomic(PacketPtr pkt);
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
/** When receiving a Functional request from the peer port,
|
|
|
|
pass it to the bridge. */
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
void recvFunctional(PacketPtr pkt);
|
2006-05-26 20:29:29 +02:00
|
|
|
|
2012-01-17 19:55:09 +01:00
|
|
|
/** When receiving a address range request the peer port,
|
|
|
|
pass it to the bridge. */
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
AddrRangeList getAddrRanges() const;
|
2012-01-17 19:55:09 +01:00
|
|
|
};
|
2006-05-26 20:29:29 +02:00
|
|
|
|
|
|
|
|
2012-01-17 19:55:09 +01:00
|
|
|
/**
|
|
|
|
* Port on the side that forwards requests and receives
|
|
|
|
* responses. The master port has a buffer for the requests not
|
|
|
|
* yet sent.
|
|
|
|
*/
|
MEM: Introduce the master/slave port sub-classes in C++
This patch introduces the notion of a master and slave port in the C++
code, thus bringing the previous classification from the Python
classes into the corresponding simulation objects and memory objects.
The patch enables us to classify behaviours into the two bins and add
assumptions and enfore compliance, also simplifying the two
interfaces. As a starting point, isSnooping is confined to a master
port, and getAddrRanges to slave ports. More of these specilisations
are to come in later patches.
The getPort function is not getMasterPort and getSlavePort, and
returns a port reference rather than a pointer as NULL would never be
a valid return value. The default implementation of these two
functions is placed in MemObject, and calls fatal.
The one drawback with this specific patch is that it requires some
code duplication, e.g. QueuedPort becomes QueuedMasterPort and
QueuedSlavePort, and BusPort becomes BusMasterPort and BusSlavePort
(avoiding multiple inheritance). With the later introduction of the
port interfaces, moving the functionality outside the port itself, a
lot of the duplicated code will disappear again.
2012-03-30 15:40:11 +02:00
|
|
|
class BridgeMasterPort : public MasterPort
|
2012-01-17 19:55:09 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
/** The bridge to which this port belongs. */
|
|
|
|
Bridge& bridge;
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
/**
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
* The slave port on the other side of the bridge (connected
|
|
|
|
* to the other bus).
|
2012-01-17 19:55:09 +01:00
|
|
|
*/
|
2012-02-24 17:43:53 +01:00
|
|
|
BridgeSlavePort& slavePort;
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
/** Minimum delay though this bridge. */
|
2013-06-27 11:49:49 +02:00
|
|
|
const Cycles delay;
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Request packet queue. Request packets are held in this
|
|
|
|
* queue for a specified delay to model the processing delay
|
2013-06-27 11:49:49 +02:00
|
|
|
* of the bridge. We use a deque as we need to iterate over
|
|
|
|
* the items for functional accesses.
|
2012-01-17 19:55:09 +01:00
|
|
|
*/
|
2013-06-27 11:49:49 +02:00
|
|
|
std::deque<DeferredPacket> transmitList;
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
/** Max queue size for request packets */
|
2013-06-27 11:49:49 +02:00
|
|
|
const unsigned int reqQueueLimit;
|
2007-05-08 00:58:38 +02:00
|
|
|
|
2006-05-26 20:29:29 +02:00
|
|
|
/**
|
|
|
|
* Handle send event, scheduled when the packet at the head of
|
|
|
|
* the outbound queue is ready to transmit (for timing
|
|
|
|
* accesses only).
|
|
|
|
*/
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
void trySendTiming();
|
2006-05-26 20:29:29 +02:00
|
|
|
|
2012-01-17 19:55:09 +01:00
|
|
|
/** Send event for the request queue. */
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
EventWrapper<BridgeMasterPort,
|
|
|
|
&BridgeMasterPort::trySendTiming> sendEvent;
|
2006-04-28 21:37:48 +02:00
|
|
|
|
|
|
|
public:
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor for the BridgeMasterPort.
|
|
|
|
*
|
|
|
|
* @param _name the port name including the owner
|
|
|
|
* @param _bridge the structural owner
|
|
|
|
* @param _slavePort the slave port on the other side of the bridge
|
2012-08-28 20:30:33 +02:00
|
|
|
* @param _delay the delay in cycles from receiving to sending
|
2012-01-17 19:55:09 +01:00
|
|
|
* @param _req_limit the size of the request queue
|
|
|
|
*/
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
BridgeMasterPort(const std::string& _name, Bridge& _bridge,
|
2012-08-28 20:30:33 +02:00
|
|
|
BridgeSlavePort& _slavePort, Cycles _delay,
|
2012-01-17 19:55:09 +01:00
|
|
|
int _req_limit);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Is this side blocked from accepting new request packets.
|
|
|
|
*
|
|
|
|
* @return true if the occupied space has reached the set limit
|
|
|
|
*/
|
2013-06-27 11:49:49 +02:00
|
|
|
bool reqQueueFull() const;
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Queue a request packet to be sent out later and also schedule
|
|
|
|
* a send if necessary.
|
|
|
|
*
|
|
|
|
* @param pkt a request to send out after a delay
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
* @param when tick when response packet should be sent
|
2012-01-17 19:55:09 +01:00
|
|
|
*/
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
void schedTimingReq(PacketPtr pkt, Tick when);
|
2012-01-17 19:55:09 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check a functional request against the packets in our
|
|
|
|
* request queue.
|
|
|
|
*
|
|
|
|
* @param pkt packet to check against
|
|
|
|
*
|
|
|
|
* @return true if we find a match
|
|
|
|
*/
|
|
|
|
bool checkFunctional(PacketPtr pkt);
|
2006-04-28 21:37:48 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2006-05-26 20:29:29 +02:00
|
|
|
/** When receiving a timing request from the peer port,
|
2006-04-28 21:37:48 +02:00
|
|
|
pass it to the bridge. */
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
bool recvTimingResp(PacketPtr pkt);
|
2006-04-28 21:37:48 +02:00
|
|
|
|
2006-05-26 20:29:29 +02:00
|
|
|
/** When receiving a retry request from the peer port,
|
2006-04-28 21:37:48 +02:00
|
|
|
pass it to the bridge. */
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
void recvRetry();
|
2006-04-28 21:37:48 +02:00
|
|
|
};
|
|
|
|
|
2012-01-17 19:55:09 +01:00
|
|
|
/** Slave port of the bridge. */
|
|
|
|
BridgeSlavePort slavePort;
|
|
|
|
|
|
|
|
/** Master port of the bridge. */
|
|
|
|
BridgeMasterPort masterPort;
|
2006-04-28 21:37:48 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2012-10-15 14:12:35 +02:00
|
|
|
virtual BaseMasterPort& getMasterPort(const std::string& if_name,
|
|
|
|
PortID idx = InvalidPortID);
|
|
|
|
virtual BaseSlavePort& getSlavePort(const std::string& if_name,
|
|
|
|
PortID idx = InvalidPortID);
|
2006-04-28 21:37:48 +02:00
|
|
|
|
|
|
|
virtual void init();
|
|
|
|
|
Bridge: Remove NACKs in the bridge and unify with packet queue
This patch removes the NACKing in the bridge, as the split
request/response busses now ensure that protocol deadlocks do not
occur, i.e. the message-dependency chain is broken by always allowing
responses to make progress without being stalled by requests. The
NACKs had limited support in the system with most components ignoring
their use (with a suitable call to panic), and as the NACKs are no
longer needed to avoid protocol deadlocks, the cleanest way is to
simply remove them.
The bridge is the starting point as this is the only place where the
NACKs are created. A follow-up patch will remove the code that deals
with NACKs in the endpoints, e.g. the X86 table walker and DMA
port. Ultimately the type of packet can be complete removed (until
someone sees a need for modelling more complex protocols, which can
now be done in parts of the system since the port and interface is
split).
As a consequence of the NACK removal, the bridge now has to send a
retry to a master if the request or response queue was full on the
first attempt. This change also makes the bridge ports very similar to
QueuedPorts, and a later patch will change the bridge to use these. A
first step in this direction is taken by aligning the name of the
member functions, as done by this patch.
A bit of tidying up has also been done as part of the simplifications.
Surprisingly, this patch has no impact on any of the
regressions. Hence, there was never any NACKs issued. In a follow-up
patch I would suggest changing the size of the bridge buffers set in
FSConfig.py to also test the situation where the bridge fills up.
2012-08-22 17:39:58 +02:00
|
|
|
typedef BridgeParams Params;
|
|
|
|
|
2007-05-10 00:20:24 +02:00
|
|
|
Bridge(Params *p);
|
2006-04-28 21:37:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__MEM_BUS_HH__
|