physical.cc (3751:b422ffec62c1) physical.cc (3879:1712a36b22cb)
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;

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

37#include <zlib.h>
38
39#include <iostream>
40#include <string>
41
42#include "arch/isa_traits.hh"
43#include "base/misc.hh"
44#include "config/full_system.hh"
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;

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

37#include <zlib.h>
38
39#include <iostream>
40#include <string>
41
42#include "arch/isa_traits.hh"
43#include "base/misc.hh"
44#include "config/full_system.hh"
45#include "mem/packet_access.hh"
45#include "mem/physical.hh"
46#include "sim/builder.hh"
47#include "sim/eventq.hh"
48#include "sim/host.hh"
49
50using namespace std;
51using namespace TheISA;
52

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

198 assert(pkt->getAddr() >= params()->addrRange.start &&
199 pkt->getAddr() + pkt->getSize() <= params()->addrRange.start +
200 params()->addrRange.size());
201
202 if (pkt->isRead()) {
203 if (pkt->req->isLocked()) {
204 trackLoadLocked(pkt->req);
205 }
46#include "mem/physical.hh"
47#include "sim/builder.hh"
48#include "sim/eventq.hh"
49#include "sim/host.hh"
50
51using namespace std;
52using namespace TheISA;
53

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

199 assert(pkt->getAddr() >= params()->addrRange.start &&
200 pkt->getAddr() + pkt->getSize() <= params()->addrRange.start +
201 params()->addrRange.size());
202
203 if (pkt->isRead()) {
204 if (pkt->req->isLocked()) {
205 trackLoadLocked(pkt->req);
206 }
206 DPRINTF(MemoryAccess, "Performing Read of size %i on address 0x%x\n",
207 pkt->getSize(), pkt->getAddr());
208 memcpy(pkt->getPtr<uint8_t>(),
209 pmemAddr + pkt->getAddr() - params()->addrRange.start,
210 pkt->getSize());
207 memcpy(pkt->getPtr<uint8_t>(),
208 pmemAddr + pkt->getAddr() - params()->addrRange.start,
209 pkt->getSize());
210#if TRACING_ON
211 switch (pkt->getSize()) {
212 case sizeof(uint64_t):
213 DPRINTF(MemoryAccess, "Read of size %i on address 0x%x data 0x%x\n",
214 pkt->getSize(), pkt->getAddr(),pkt->get<uint64_t>());
215 break;
216 case sizeof(uint32_t):
217 DPRINTF(MemoryAccess, "Read of size %i on address 0x%x data 0x%x\n",
218 pkt->getSize(), pkt->getAddr(),pkt->get<uint32_t>());
219 break;
220 case sizeof(uint16_t):
221 DPRINTF(MemoryAccess, "Read of size %i on address 0x%x data 0x%x\n",
222 pkt->getSize(), pkt->getAddr(),pkt->get<uint16_t>());
223 break;
224 case sizeof(uint8_t):
225 DPRINTF(MemoryAccess, "Read of size %i on address 0x%x data 0x%x\n",
226 pkt->getSize(), pkt->getAddr(),pkt->get<uint8_t>());
227 break;
228 default:
229 DPRINTF(MemoryAccess, "Read of size %i on address 0x%x\n",
230 pkt->getSize(), pkt->getAddr());
231 }
232#endif
211 }
212 else if (pkt->isWrite()) {
213 if (writeOK(pkt->req)) {
233 }
234 else if (pkt->isWrite()) {
235 if (writeOK(pkt->req)) {
214 DPRINTF(MemoryAccess, "Performing Write of size %i on address 0x%x\n",
215 pkt->getSize(), pkt->getAddr());
216 memcpy(pmemAddr + pkt->getAddr() - params()->addrRange.start,
217 pkt->getPtr<uint8_t>(), pkt->getSize());
236 memcpy(pmemAddr + pkt->getAddr() - params()->addrRange.start,
237 pkt->getPtr<uint8_t>(), pkt->getSize());
238#if TRACING_ON
239 switch (pkt->getSize()) {
240 case sizeof(uint64_t):
241 DPRINTF(MemoryAccess, "Write of size %i on address 0x%x data 0x%x\n",
242 pkt->getSize(), pkt->getAddr(),pkt->get<uint64_t>());
243 break;
244 case sizeof(uint32_t):
245 DPRINTF(MemoryAccess, "Write of size %i on address 0x%x data 0x%x\n",
246 pkt->getSize(), pkt->getAddr(),pkt->get<uint32_t>());
247 break;
248 case sizeof(uint16_t):
249 DPRINTF(MemoryAccess, "Write of size %i on address 0x%x data 0x%x\n",
250 pkt->getSize(), pkt->getAddr(),pkt->get<uint16_t>());
251 break;
252 case sizeof(uint8_t):
253 DPRINTF(MemoryAccess, "Write of size %i on address 0x%x data 0x%x\n",
254 pkt->getSize(), pkt->getAddr(),pkt->get<uint8_t>());
255 break;
256 default:
257 DPRINTF(MemoryAccess, "Write of size %i on address 0x%x\n",
258 pkt->getSize(), pkt->getAddr());
259 }
260#endif
218 }
219 }
220 else if (pkt->isInvalidate()) {
221 //upgrade or invalidate
222 pkt->flags |= SATISFIED;
223 }
224 else {
225 panic("unimplemented");

--- 237 unchanged lines hidden ---
261 }
262 }
263 else if (pkt->isInvalidate()) {
264 //upgrade or invalidate
265 pkt->flags |= SATISFIED;
266 }
267 else {
268 panic("unimplemented");

--- 237 unchanged lines hidden ---