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;
--- 96 unchanged lines hidden (view full) ---
105}
106
107Tick
108PhysicalMemory::calculateLatency(Packet *pkt)
109{
110 return lat;
111}
112
113Tick
114PhysicalMemory::doFunctionalAccess(Packet *pkt)
115{
116 assert(pkt->getAddr() + pkt->getSize() < params()->addrRange.size());
117
118 switch (pkt->cmd) {
119 case Packet::ReadReq:
120 memcpy(pkt->getPtr<uint8_t>(),
121 pmemAddr + pkt->getAddr() - params()->addrRange.start,
--- 9 unchanged lines hidden (view full) ---
131 pkt->req->setScResult(1);
132 }
133 break;
134 default:
135 panic("unimplemented");
136 }
137
138 pkt->result = Packet::Success;
139 return calculateLatency(pkt);
140}
141
142Port *
143PhysicalMemory::getPort(const std::string &if_name, int idx)
144{
145 if (if_name == "port" && idx == -1) {
146 if (port != NULL)
147 panic("PhysicalMemory::getPort: additional port requested to memory!");
--- 44 unchanged lines hidden (view full) ---
192 return memory->deviceBlockSize();
193}
194
195bool
196PhysicalMemory::MemoryPort::recvTiming(Packet *pkt)
197{
198 assert(pkt->result != Packet::Nacked);
199
200 Tick latency = memory->doFunctionalAccess(pkt);
201
202 pkt->makeTimingResponse();
203 sendTiming(pkt, latency);
204
205 return true;
206}
207
208Tick
209PhysicalMemory::MemoryPort::recvAtomic(Packet *pkt)
210{
211 return memory->doFunctionalAccess(pkt);
212}
213
214void
215PhysicalMemory::MemoryPort::recvFunctional(Packet *pkt)
216{
217 memory->doFunctionalAccess(pkt);
218}
219
--- 144 unchanged lines hidden ---
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;
--- 96 unchanged lines hidden (view full) ---
105}
106
107Tick
108PhysicalMemory::calculateLatency(Packet *pkt)
109{
110 return lat;
111}
112
113Tick
114PhysicalMemory::doFunctionalAccess(Packet *pkt)
115{
116 assert(pkt->getAddr() + pkt->getSize() < params()->addrRange.size());
117
118 switch (pkt->cmd) {
119 case Packet::ReadReq:
120 memcpy(pkt->getPtr<uint8_t>(),
121 pmemAddr + pkt->getAddr() - params()->addrRange.start,
--- 9 unchanged lines hidden (view full) ---
131 pkt->req->setScResult(1);
132 }
133 break;
134 default:
135 panic("unimplemented");
136 }
137
138 pkt->result = Packet::Success;
139 return calculateLatency(pkt);
140}
141
142Port *
143PhysicalMemory::getPort(const std::string &if_name, int idx)
144{
145 if (if_name == "port" && idx == -1) {
146 if (port != NULL)
147 panic("PhysicalMemory::getPort: additional port requested to memory!");
--- 44 unchanged lines hidden (view full) ---
192 return memory->deviceBlockSize();
193}
194
195bool
196PhysicalMemory::MemoryPort::recvTiming(Packet *pkt)
197{
198 assert(pkt->result != Packet::Nacked);
199
200 Tick latency = memory->doFunctionalAccess(pkt);
201
202 pkt->makeTimingResponse();
203 sendTiming(pkt, latency);
204
205 return true;
206}
207
208Tick
209PhysicalMemory::MemoryPort::recvAtomic(Packet *pkt)
210{
211 return memory->doFunctionalAccess(pkt);
212}
213
214void
215PhysicalMemory::MemoryPort::recvFunctional(Packet *pkt)
216{
217 memory->doFunctionalAccess(pkt);
218}
219
--- 144 unchanged lines hidden ---