physical.cc (3012:1d5e18f6a100) physical.cc (3029:02fdde6319b7)
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
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
113void
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;
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
139}
140
141Port *
142PhysicalMemory::getPort(const std::string &if_name, int idx)
143{
144 if (if_name == "port" && idx == -1) {
145 if (port != NULL)
146 panic("PhysicalMemory::getPort: additional port requested to memory!");

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

191 return memory->deviceBlockSize();
192}
193
194bool
195PhysicalMemory::MemoryPort::recvTiming(Packet *pkt)
196{
197 assert(pkt->result != Packet::Nacked);
198
200 Tick latency = memory->doFunctionalAccess(pkt);
199 Tick latency = memory->calculateLatency(pkt);
201
200
201 memory->doFunctionalAccess(pkt);
202
202 pkt->makeTimingResponse();
203 sendTiming(pkt, latency);
204
205 return true;
206}
207
208Tick
209PhysicalMemory::MemoryPort::recvAtomic(Packet *pkt)
210{
203 pkt->makeTimingResponse();
204 sendTiming(pkt, latency);
205
206 return true;
207}
208
209Tick
210PhysicalMemory::MemoryPort::recvAtomic(Packet *pkt)
211{
211 return memory->doFunctionalAccess(pkt);
212 memory->doFunctionalAccess(pkt);
213 return memory->calculateLatency(pkt);
212}
213
214void
215PhysicalMemory::MemoryPort::recvFunctional(Packet *pkt)
216{
217 memory->doFunctionalAccess(pkt);
218}
219

--- 144 unchanged lines hidden ---
214}
215
216void
217PhysicalMemory::MemoryPort::recvFunctional(Packet *pkt)
218{
219 memory->doFunctionalAccess(pkt);
220}
221

--- 144 unchanged lines hidden ---