Deleted Added
sdiff udiff text old ( 12749:223c83ed9979 ) new ( 13012:5fbc6b9c64bc )
full compact
1/*
2 * Copyright 2014 Google, Inc.
3 * Copyright (c) 2012-2013,2015,2017 ARM Limited
4 * All rights reserved.
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating
9 * to a hardware implementation of the functionality of the software
10 * licensed hereunder. You may use the software subject to the license
11 * terms below provided that you ensure that this notice is replicated

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

78 : BaseSimpleCPU(p),
79 tickEvent([this]{ tick(); }, "AtomicSimpleCPU tick",
80 false, Event::CPU_Tick_Pri),
81 width(p->width), locked(false),
82 simulate_data_stalls(p->simulate_data_stalls),
83 simulate_inst_stalls(p->simulate_inst_stalls),
84 icachePort(name() + ".icache_port", this),
85 dcachePort(name() + ".dcache_port", this),
86 fastmem(p->fastmem), dcache_access(false), dcache_latency(0),
87 ppCommit(nullptr)
88{
89 _status = Idle;
90 ifetch_req = std::make_shared<Request>();
91 data_read_req = std::make_shared<Request>();
92 data_write_req = std::make_shared<Request>();
93}
94

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

266 if (tickEvent.scheduled()) {
267 deschedule(tickEvent);
268 }
269 }
270
271 BaseCPU::suspendContext(thread_num);
272}
273
274
275Tick
276AtomicSimpleCPU::AtomicCPUDPort::recvAtomicSnoop(PacketPtr pkt)
277{
278 DPRINTF(SimpleCPU, "received snoop pkt for addr:%#x %s\n", pkt->getAddr(),
279 pkt->cmdString());
280
281 // X86 ISA: Snooping an invalidation for monitor/mwait

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

359 Fault fault = thread->dtb->translateAtomic(req, thread->getTC(),
360 BaseTLB::Read);
361
362 // Now do the access.
363 if (fault == NoFault && !req->getFlags().isSet(Request::NO_ACCESS)) {
364 Packet pkt(req, Packet::makeReadCmd(req));
365 pkt.dataStatic(data);
366
367 if (req->isMmappedIpr())
368 dcache_latency += TheISA::handleIprRead(thread->getTC(), &pkt);
369 else {
370 if (fastmem && system->isMemAddr(pkt.getAddr()))
371 system->getPhysMem().access(&pkt);
372 else
373 dcache_latency += dcachePort.sendAtomic(&pkt);
374 }
375 dcache_access = true;
376
377 assert(!pkt.isError());
378
379 if (req->isLLSC()) {
380 TheISA::handleLockedRead(thread, req);
381 }

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

478 if (do_access && !req->getFlags().isSet(Request::NO_ACCESS)) {
479 Packet pkt(req, Packet::makeWriteCmd(req));
480 pkt.dataStatic(data);
481
482 if (req->isMmappedIpr()) {
483 dcache_latency +=
484 TheISA::handleIprWrite(thread->getTC(), &pkt);
485 } else {
486 if (fastmem && system->isMemAddr(pkt.getAddr()))
487 system->getPhysMem().access(&pkt);
488 else
489 dcache_latency += dcachePort.sendAtomic(&pkt);
490
491 // Notify other threads on this CPU of write
492 threadSnoop(&pkt, curThread);
493 }
494 dcache_access = true;
495 assert(!pkt.isError());
496
497 if (req->isSwap()) {

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

598 // this code should be uncommented.
599 //Fetch more instruction memory if necessary
600 //if (decoder.needMoreBytes())
601 //{
602 icache_access = true;
603 Packet ifetch_pkt = Packet(ifetch_req, MemCmd::ReadReq);
604 ifetch_pkt.dataStatic(&inst);
605
606 if (fastmem && system->isMemAddr(ifetch_pkt.getAddr()))
607 system->getPhysMem().access(&ifetch_pkt);
608 else
609 icache_latency = icachePort.sendAtomic(&ifetch_pkt);
610
611 assert(!ifetch_pkt.isError());
612
613 // ifetch_req is initialized to read the instruction directly
614 // into the CPU object's inst field.
615 //}
616 }
617

--- 86 unchanged lines hidden ---