Deleted Added
sdiff udiff text old ( 3196:8eb90bc29df8 ) new ( 3224:60e426da682b )
full compact
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
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,
122 pkt->getSize());
123 break;
124 case Packet::WriteReq:
125 memcpy(pmemAddr + pkt->getAddr() - params()->addrRange.start,
126 pkt->getPtr<uint8_t>(),
127 pkt->getSize());
128 // temporary hack: will need to add real LL/SC implementation
129 // for cacheless systems later.
130 if (pkt->req->getFlags() & LOCKED) {
131 pkt->req->setScResult(1);
132 }
133 break;
134 default:
135 panic("unimplemented");
136 }
137
138 pkt->result = Packet::Success;
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!");
147 port = new MemoryPort(name() + "-port", this);
148 return port;
149 } else if (if_name == "functional") {
150 /* special port for functional writes at startup. */
151 return new MemoryPort(name() + "-funcport", this);
152 } else {
153 panic("PhysicalMemory::getPort: unknown port %s requested", if_name);
154 }
155}
156
157void
158PhysicalMemory::recvStatusChange(Port::Status status)

--- 196 unchanged lines hidden ---