physical.cc (4929:6db35d0c81c6) physical.cc (5222:bb733a878f85)
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;

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

299 }
300 return calculateLatency(pkt);
301}
302
303
304void
305PhysicalMemory::doFunctionalAccess(PacketPtr pkt)
306{
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;

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

299 }
300 return calculateLatency(pkt);
301}
302
303
304void
305PhysicalMemory::doFunctionalAccess(PacketPtr pkt)
306{
307 warn("addr %#x >= %#x AND %#x <= %#x",
308 pkt->getAddr(), start(), pkt->getAddr() + pkt->getSize(), start() + size());
309
307 assert(pkt->getAddr() >= start() &&
308 pkt->getAddr() + pkt->getSize() <= start() + size());
309
310 assert(pkt->getAddr() >= start() &&
311 pkt->getAddr() + pkt->getSize() <= start() + size());
312
313
310 uint8_t *hostAddr = pmemAddr + pkt->getAddr() - start();
311
312 if (pkt->cmd == MemCmd::ReadReq) {
313 memcpy(pkt->getPtr<uint8_t>(), hostAddr, pkt->getSize());
314 TRACE_PACKET("Read");
315 } else if (pkt->cmd == MemCmd::WriteReq) {
316 memcpy(hostAddr, pkt->getPtr<uint8_t>(), pkt->getSize());
317 TRACE_PACKET("Write");

--- 222 unchanged lines hidden ---
314 uint8_t *hostAddr = pmemAddr + pkt->getAddr() - start();
315
316 if (pkt->cmd == MemCmd::ReadReq) {
317 memcpy(pkt->getPtr<uint8_t>(), hostAddr, pkt->getSize());
318 TRACE_PACKET("Read");
319 } else if (pkt->cmd == MemCmd::WriteReq) {
320 memcpy(hostAddr, pkt->getPtr<uint8_t>(), pkt->getSize());
321 TRACE_PACKET("Write");

--- 222 unchanged lines hidden ---