packet.hh (3217:317ca1c50bbf) packet.hh (3218:41e0f5606940)
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;

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

53#define NACKED_LINE 1 << 0
54#define SATISFIED 1 << 1
55#define SHARED_LINE 1 << 2
56#define CACHE_LINE_FILL 1 << 3
57#define COMPRESSED 1 << 4
58#define NO_ALLOCATE 1 << 5
59#define SNOOP_COMMIT 1 << 6
60
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;

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

53#define NACKED_LINE 1 << 0
54#define SATISFIED 1 << 1
55#define SHARED_LINE 1 << 2
56#define CACHE_LINE_FILL 1 << 3
57#define COMPRESSED 1 << 4
58#define NO_ALLOCATE 1 << 5
59#define SNOOP_COMMIT 1 << 6
60
61//for now. @todo fix later
62#define NUM_MEM_CMDS 1 << 11
63/**
64 * A Packet is used to encapsulate a transfer between two objects in
65 * the memory system (e.g., the L1 and L2 cache). (In contrast, a
66 * single Request travels all the way from the requester to the
67 * ultimate destination and back, possibly being conveyed by several
68 * different Packets along the way.)
69 */
70class Packet

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

87 bool staticData;
88 /** The data pointer points to a value that should be freed when
89 * the packet is destroyed. */
90 bool dynamicData;
91 /** the data pointer points to an array (thus delete [] ) needs to
92 * be called on it rather than simply delete.*/
93 bool arrayData;
94
61/**
62 * A Packet is used to encapsulate a transfer between two objects in
63 * the memory system (e.g., the L1 and L2 cache). (In contrast, a
64 * single Request travels all the way from the requester to the
65 * ultimate destination and back, possibly being conveyed by several
66 * different Packets along the way.)
67 */
68class Packet

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

85 bool staticData;
86 /** The data pointer points to a value that should be freed when
87 * the packet is destroyed. */
88 bool dynamicData;
89 /** the data pointer points to an array (thus delete [] ) needs to
90 * be called on it rather than simply delete.*/
91 bool arrayData;
92
95
96 /** The address of the request. This address could be virtual or
97 * physical, depending on the system configuration. */
98 Addr addr;
99
100 /** The size of the request or transfer. */
101 int size;
102
103 /** Device address (e.g., bus ID) of the source of the

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

119 bool srcValid;
120
121
122 public:
123
124 /** Used to calculate latencies for each packet.*/
125 Tick time;
126
93 /** The address of the request. This address could be virtual or
94 * physical, depending on the system configuration. */
95 Addr addr;
96
97 /** The size of the request or transfer. */
98 int size;
99
100 /** Device address (e.g., bus ID) of the source of the

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

116 bool srcValid;
117
118
119 public:
120
121 /** Used to calculate latencies for each packet.*/
122 Tick time;
123
124 /** The time at which the packet will be fully transmitted */
125 Tick finishTime;
126
127 /** The time at which the first chunk of the packet will be transmitted */
128 Tick firstWordTime;
129
127 /** The special destination address indicating that the packet
128 * should be routed based on its address. */
129 static const short Broadcast = -1;
130
131 /** A pointer to the original request. */
132 RequestPtr req;
133
134 /** A virtual base opaque structure used to hold coherence-related

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

170 IsWrite = 1 << 1,
171 IsPrefetch = 1 << 2,
172 IsInvalidate = 1 << 3,
173 IsRequest = 1 << 4,
174 IsResponse = 1 << 5,
175 NeedsResponse = 1 << 6,
176 IsSWPrefetch = 1 << 7,
177 IsHWPrefetch = 1 << 8,
130 /** The special destination address indicating that the packet
131 * should be routed based on its address. */
132 static const short Broadcast = -1;
133
134 /** A pointer to the original request. */
135 RequestPtr req;
136
137 /** A virtual base opaque structure used to hold coherence-related

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

173 IsWrite = 1 << 1,
174 IsPrefetch = 1 << 2,
175 IsInvalidate = 1 << 3,
176 IsRequest = 1 << 4,
177 IsResponse = 1 << 5,
178 NeedsResponse = 1 << 6,
179 IsSWPrefetch = 1 << 7,
180 IsHWPrefetch = 1 << 8,
178 IsUpgrade = 1 << 9,
179 HasData = 1 << 10
181 HasData = 1 << 9
180 };
181
182 };
183
184//For statistics we need max number of commands, hard code it at
185//20 for now. @todo fix later
186#define NUM_MEM_CMDS 1 << 10
187
182 public:
183 /** List of all commands associated with a packet. */
184 enum Command
185 {
186 InvalidCmd = 0,
187 ReadReq = IsRead | IsRequest | NeedsResponse,
188 WriteReq = IsWrite | IsRequest | NeedsResponse | HasData,
189 WriteReqNoAck = IsWrite | IsRequest | HasData,
190 ReadResp = IsRead | IsResponse | NeedsResponse | HasData,
191 WriteResp = IsWrite | IsResponse | NeedsResponse,
192 Writeback = IsWrite | IsRequest | HasData,
193 SoftPFReq = IsRead | IsRequest | IsSWPrefetch | NeedsResponse,
194 HardPFReq = IsRead | IsRequest | IsHWPrefetch | NeedsResponse,
195 SoftPFResp = IsRead | IsResponse | IsSWPrefetch
196 | NeedsResponse | HasData,
197 HardPFResp = IsRead | IsResponse | IsHWPrefetch
198 | NeedsResponse | HasData,
199 InvalidateReq = IsInvalidate | IsRequest,
200 WriteInvalidateReq = IsWrite | IsInvalidate | IsRequest | HasData,
188 public:
189 /** List of all commands associated with a packet. */
190 enum Command
191 {
192 InvalidCmd = 0,
193 ReadReq = IsRead | IsRequest | NeedsResponse,
194 WriteReq = IsWrite | IsRequest | NeedsResponse | HasData,
195 WriteReqNoAck = IsWrite | IsRequest | HasData,
196 ReadResp = IsRead | IsResponse | NeedsResponse | HasData,
197 WriteResp = IsWrite | IsResponse | NeedsResponse,
198 Writeback = IsWrite | IsRequest | HasData,
199 SoftPFReq = IsRead | IsRequest | IsSWPrefetch | NeedsResponse,
200 HardPFReq = IsRead | IsRequest | IsHWPrefetch | NeedsResponse,
201 SoftPFResp = IsRead | IsResponse | IsSWPrefetch
202 | NeedsResponse | HasData,
203 HardPFResp = IsRead | IsResponse | IsHWPrefetch
204 | NeedsResponse | HasData,
205 InvalidateReq = IsInvalidate | IsRequest,
206 WriteInvalidateReq = IsWrite | IsInvalidate | IsRequest | HasData,
201 UpgradeReq = IsInvalidate | IsRequest | IsUpgrade,
207 UpgradeReq = IsInvalidate | IsRequest,
202 ReadExReq = IsRead | IsInvalidate | IsRequest | NeedsResponse,
203 ReadExResp = IsRead | IsInvalidate | IsResponse
204 | NeedsResponse | HasData
205 };
206
207 /** Return the string name of the cmd field (for debugging and
208 * tracing). */
209 const std::string &cmdString() const;

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

320 * modifying the destination fields, so this function
321 * should not be called. */
322 void makeTimingResponse() {
323 assert(needsResponse());
324 assert(isRequest());
325 int icmd = (int)cmd;
326 icmd &= ~(IsRequest);
327 icmd |= IsResponse;
208 ReadExReq = IsRead | IsInvalidate | IsRequest | NeedsResponse,
209 ReadExResp = IsRead | IsInvalidate | IsResponse
210 | NeedsResponse | HasData
211 };
212
213 /** Return the string name of the cmd field (for debugging and
214 * tracing). */
215 const std::string &cmdString() const;

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

326 * modifying the destination fields, so this function
327 * should not be called. */
328 void makeTimingResponse() {
329 assert(needsResponse());
330 assert(isRequest());
331 int icmd = (int)cmd;
332 icmd &= ~(IsRequest);
333 icmd |= IsResponse;
328 if (isRead())
329 icmd |= HasData;
330 if (isWrite())
331 icmd &= ~HasData;
332 cmd = (Command)icmd;
333 dest = src;
334 srcValid = false;
335 }
336
337 /** Take a request packet and modify it in place to be suitable
338 * for returning as a response to that request.
339 */

--- 57 unchanged lines hidden ---
334 cmd = (Command)icmd;
335 dest = src;
336 srcValid = false;
337 }
338
339 /** Take a request packet and modify it in place to be suitable
340 * for returning as a response to that request.
341 */

--- 57 unchanged lines hidden ---