Deleted Added
sdiff udiff text old ( 2657:b119b774656b ) new ( 2662:f24ae2d09e27 )
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;

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

245 traceData->setAddr(addr);
246 }
247
248 // translate to physical address
249 Fault fault = cpuXC->translateDataReadReq(data_read_req);
250
251 // Now do the access.
252 if (fault == NoFault) {
253 data_read_pkt->reset();
254 data_read_pkt->reinitFromRequest();
255
256 dcache_complete = dcachePort.sendAtomic(data_read_pkt);
257 dcache_access = true;
258
259 assert(data_read_pkt->result == Packet::Success);
260 data = data_read_pkt->get<T>();
261
262 }
263
264 // This will need a new way to tell if it has a dcache attached.

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

324 traceData->setAddr(addr);
325 }
326
327 // translate to physical address
328 Fault fault = cpuXC->translateDataWriteReq(data_write_req);
329
330 // Now do the access.
331 if (fault == NoFault) {
332 data_write_pkt->reset();
333 data = htog(data);
334 data_write_pkt->dataStatic(&data);
335 data_write_pkt->reinitFromRequest();
336
337 dcache_complete = dcachePort.sendAtomic(data_write_pkt);
338 dcache_access = true;
339
340 assert(data_write_pkt->result == Packet::Success);
341
342 if (res && data_write_req->getFlags() & LOCKED) {
343 *res = data_write_req->getScResult();
344 }
345 }

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

406 Tick latency = cycles(1); // instruction takes one cycle by default
407
408 for (int i = 0; i < width; ++i) {
409 numCycles++;
410
411 checkForInterrupts();
412
413 ifetch_req->resetMin();
414 ifetch_pkt->reset();
415 Fault fault = setupFetchPacket(ifetch_pkt);
416
417 if (fault == NoFault) {
418 Tick icache_complete = icachePort.sendAtomic(ifetch_pkt);
419 // ifetch_req is initialized to read the instruction directly
420 // into the CPU object's inst field.
421
422 dcache_access = false; // assume no dcache access
423 preExecute();
424 fault = curStaticInst->execute(this, traceData);
425 postExecute();
426
427 if (simulate_stalls) {
428 // This calculation assumes that the icache and dcache
429 // access latencies are always a multiple of the CPU's
430 // cycle time. If not, the next tick event may get
431 // scheduled at a non-integer multiple of the CPU
432 // cycle time.
433 Tick icache_stall = icache_complete - curTick - cycles(1);
434 Tick dcache_stall =
435 dcache_access ? dcache_complete - curTick - cycles(1) : 0;
436 latency += icache_stall + dcache_stall;
437 }
438
439 }
440
441 advancePC(fault);
442 }
443

--- 102 unchanged lines hidden ---