Deleted Added
sdiff udiff text old ( 3686:fa8d8b90cd8a ) new ( 3806:65ae5388c059 )
full compact
1/*
2 * Copyright (c) 2002-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;

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

24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Steve Reinhardt
29 */
30
31#include "arch/locked_mem.hh"
32#include "arch/utility.hh"
33#include "cpu/exetrace.hh"
34#include "cpu/simple/atomic.hh"
35#include "mem/packet.hh"
36#include "mem/packet_access.hh"
37#include "sim/builder.hh"
38#include "sim/system.hh"
39

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

72void
73AtomicSimpleCPU::init()
74{
75 BaseCPU::init();
76#if FULL_SYSTEM
77 for (int i = 0; i < threadContexts.size(); ++i) {
78 ThreadContext *tc = threadContexts[i];
79
80 // initialize CPU, including PC
81 TheISA::initCPU(tc, tc->readCpuId());
82 }
83#endif
84}
85
86bool
87AtomicSimpleCPU::CpuPort::recvTiming(PacketPtr pkt)

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

232{
233 assert(thread_num == 0);
234 assert(thread);
235
236 assert(_status == Idle);
237 assert(!tickEvent.scheduled());
238
239 notIdleFraction++;
240
241#if FULL_SYSTEM
242 // Connect the ThreadContext's memory ports (Functional/Virtual
243 // Ports)
244 tc->connectMemPorts();
245#endif
246
247 //Make sure ticks are still on multiples of cycles
248 tickEvent.schedule(nextCycle(curTick + cycles(delay)));
249 _status = Running;
250}
251
252
253void
254AtomicSimpleCPU::suspendContext(int thread_num)

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

284
285 // translate to physical address
286 Fault fault = thread->translateDataReadReq(req);
287
288 // Now do the access.
289 if (fault == NoFault) {
290 pkt->reinitFromRequest();
291
292 dcache_latency = dcachePort.sendAtomic(pkt);
293 dcache_access = true;
294
295 assert(pkt->result == Packet::Success);
296 data = pkt->get<T>();
297
298 if (req->isLocked()) {
299 TheISA::handleLockedRead(thread, req);
300 }

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

371 if (fault == NoFault) {
372 bool do_access = true; // flag to suppress cache access
373
374 if (req->isLocked()) {
375 do_access = TheISA::handleLockedWrite(thread, req);
376 }
377
378 if (do_access) {
379 data = htog(data);
380 pkt->reinitFromRequest();
381 pkt->dataStatic(&data);
382
383 dcache_latency = dcachePort.sendAtomic(pkt);
384 dcache_access = true;
385
386 assert(pkt->result == Packet::Success);
387 }
388
389 if (req->isLocked()) {
390 uint64_t scResult = req->getScResult();
391 if (scResult != 0) {

--- 221 unchanged lines hidden ---