physical.cc (6329:5d8b91875859) physical.cc (6429:7ed8937e375a)
1/*
2 * Copyright (c) 2001-2005 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;

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

206 return success;
207}
208
209
210#if TRACING_ON
211
212#define CASE(A, T) \
213 case sizeof(T): \
1/*
2 * Copyright (c) 2001-2005 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;

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

206 return success;
207}
208
209
210#if TRACING_ON
211
212#define CASE(A, T) \
213 case sizeof(T): \
214 DPRINTF(MemoryAccess, A " of size %i on address 0x%x data 0x%x\n", \
215 pkt->getSize(), pkt->getAddr(), pkt->get<T>()); \
214 DPRINTF(MemoryAccess,"%s of size %i on address 0x%x data 0x%x\n", \
215 A, pkt->getSize(), pkt->getAddr(), pkt->get<T>()); \
216 break
217
218
219#define TRACE_PACKET(A) \
220 do { \
221 switch (pkt->getSize()) { \
222 CASE(A, uint64_t); \
223 CASE(A, uint32_t); \
224 CASE(A, uint16_t); \
225 CASE(A, uint8_t); \
226 default: \
216 break
217
218
219#define TRACE_PACKET(A) \
220 do { \
221 switch (pkt->getSize()) { \
222 CASE(A, uint64_t); \
223 CASE(A, uint32_t); \
224 CASE(A, uint16_t); \
225 CASE(A, uint8_t); \
226 default: \
227 DPRINTF(MemoryAccess, A " of size %i on address 0x%x\n", \
228 pkt->getSize(), pkt->getAddr()); \
227 DPRINTF(MemoryAccess, "%s of size %i on address 0x%x\n", \
228 A, pkt->getSize(), pkt->getAddr()); \
229 } \
230 } while (0)
231
232#else
233
234#define TRACE_PACKET(A)
235
236#endif

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

276 sizeof(uint32_t));
277 } else
278 panic("Invalid size for conditional read/write\n");
279 }
280
281 if (overwrite_mem)
282 std::memcpy(hostAddr, &overwrite_val, pkt->getSize());
283
229 } \
230 } while (0)
231
232#else
233
234#define TRACE_PACKET(A)
235
236#endif

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

276 sizeof(uint32_t));
277 } else
278 panic("Invalid size for conditional read/write\n");
279 }
280
281 if (overwrite_mem)
282 std::memcpy(hostAddr, &overwrite_val, pkt->getSize());
283
284 assert(!pkt->req->isInstFetch());
284 TRACE_PACKET("Read/Write");
285 } else if (pkt->isRead()) {
286 assert(!pkt->isWrite());
287 if (pkt->isLLSC()) {
288 trackLoadLocked(pkt);
289 }
290 if (pmemAddr)
291 memcpy(pkt->getPtr<uint8_t>(), hostAddr, pkt->getSize());
285 TRACE_PACKET("Read/Write");
286 } else if (pkt->isRead()) {
287 assert(!pkt->isWrite());
288 if (pkt->isLLSC()) {
289 trackLoadLocked(pkt);
290 }
291 if (pmemAddr)
292 memcpy(pkt->getPtr<uint8_t>(), hostAddr, pkt->getSize());
292 TRACE_PACKET("Read");
293 TRACE_PACKET(pkt->req->isInstFetch() ? "IFetch" : "Read");
293 } else if (pkt->isWrite()) {
294 if (writeOK(pkt)) {
295 if (pmemAddr)
296 memcpy(hostAddr, pkt->getPtr<uint8_t>(), pkt->getSize());
294 } else if (pkt->isWrite()) {
295 if (writeOK(pkt)) {
296 if (pmemAddr)
297 memcpy(hostAddr, pkt->getPtr<uint8_t>(), pkt->getSize());
298 assert(!pkt->req->isInstFetch());
297 TRACE_PACKET("Write");
298 }
299 } else if (pkt->isInvalidate()) {
300 //upgrade or invalidate
301 if (pkt->needsResponse()) {
302 pkt->makeAtomicResponse();
303 }
304 } else {

--- 266 unchanged lines hidden ---
299 TRACE_PACKET("Write");
300 }
301 } else if (pkt->isInvalidate()) {
302 //upgrade or invalidate
303 if (pkt->needsResponse()) {
304 pkt->makeAtomicResponse();
305 }
306 } else {

--- 266 unchanged lines hidden ---