tport.hh (4490:f9d3db907eec) tport.hh (4492:75dabb0392ee)
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 80 unchanged lines hidden (view full) ---

89 SendEvent;
90
91 Event *sendEvent;
92
93 /** If we need to drain, keep the drain event around until we're done
94 * here.*/
95 Event *drainEvent;
96
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 80 unchanged lines hidden (view full) ---

89 SendEvent;
90
91 Event *sendEvent;
92
93 /** If we need to drain, keep the drain event around until we're done
94 * here.*/
95 Event *drainEvent;
96
97 /** Remember whether we're awaiting a retry from the bus. */
98 bool waitingOnRetry;
99
97 /** Check the list of buffered packets against the supplied
98 * functional request. */
99 void checkFunctional(PacketPtr funcPkt);
100
100 /** Check the list of buffered packets against the supplied
101 * functional request. */
102 void checkFunctional(PacketPtr funcPkt);
103
104 /** Check whether we have a packet ready to go on the transmit list. */
105 bool deferredPacketReady()
106 { return !transmitList.empty() && transmitList.front().tick <= curTick; }
107
101 /** Schedule a sendTiming() event to be called in the future.
102 * @param pkt packet to send
108 /** Schedule a sendTiming() event to be called in the future.
109 * @param pkt packet to send
103 * @param time increment from now (in ticks) to send packet
110 * @param absolute time (in ticks) to send packet
104 */
111 */
105 void sendTiming(PacketPtr pkt, Tick time);
112 void schedSendTiming(PacketPtr pkt, Tick when);
106
113
114 /** Attempt to send the packet at the head of the deferred packet
115 * list. Caller must guarantee that the deferred packet list is
116 * non-empty and that the head packet is scheduled for curTick (or
117 * earlier).
118 */
119 void sendDeferredPacket();
120
107 /** This function is notification that the device should attempt to send a
108 * packet again. */
109 virtual void recvRetry();
110
111 /** Implemented using recvAtomic(). */
112 void recvFunctional(PacketPtr pkt);
113
114 /** Implemented using recvAtomic(). */

--- 6 unchanged lines hidden (view full) ---

121 virtual void recvStatusChange(Status status) { }
122
123
124 public:
125
126 SimpleTimingPort(std::string pname, MemObject *_owner = NULL)
127 : Port(pname, _owner),
128 sendEvent(new SendEvent(this)),
121 /** This function is notification that the device should attempt to send a
122 * packet again. */
123 virtual void recvRetry();
124
125 /** Implemented using recvAtomic(). */
126 void recvFunctional(PacketPtr pkt);
127
128 /** Implemented using recvAtomic(). */

--- 6 unchanged lines hidden (view full) ---

135 virtual void recvStatusChange(Status status) { }
136
137
138 public:
139
140 SimpleTimingPort(std::string pname, MemObject *_owner = NULL)
141 : Port(pname, _owner),
142 sendEvent(new SendEvent(this)),
129 drainEvent(NULL)
143 drainEvent(NULL),
144 waitingOnRetry(false)
130 {}
131
132 ~SimpleTimingPort() { delete sendEvent; }
133
134 /** Hook for draining timing accesses from the system. The
135 * associated SimObject's drain() functions should be implemented
136 * something like this when this class is used:
137 \code

--- 16 unchanged lines hidden ---
145 {}
146
147 ~SimpleTimingPort() { delete sendEvent; }
148
149 /** Hook for draining timing accesses from the system. The
150 * associated SimObject's drain() functions should be implemented
151 * something like this when this class is used:
152 \code

--- 16 unchanged lines hidden ---