cache.cc (12630:2208bf99bffd) | cache.cc (12633:675cd1260b40) |
---|---|
1/* 2 * Copyright (c) 2010-2018 ARM Limited 3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 402 unchanged lines hidden (view full) --- 411 // if the packet does not have sharers, it is passing 412 // writable, and we got the writeback in Modified or Exclusive 413 // state, if not we are in the Owned or Shared state 414 if (!pkt->hasSharers()) { 415 blk->status |= BlkWritable; 416 } 417 // nothing else to do; writeback doesn't expect response 418 assert(!pkt->needsResponse()); | 1/* 2 * Copyright (c) 2010-2018 ARM Limited 3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 402 unchanged lines hidden (view full) --- 411 // if the packet does not have sharers, it is passing 412 // writable, and we got the writeback in Modified or Exclusive 413 // state, if not we are in the Owned or Shared state 414 if (!pkt->hasSharers()) { 415 blk->status |= BlkWritable; 416 } 417 // nothing else to do; writeback doesn't expect response 418 assert(!pkt->needsResponse()); |
419 std::memcpy(blk->data, pkt->getConstPtr<uint8_t>(), blkSize); | 419 pkt->writeDataToBlock(blk->data, blkSize); |
420 DPRINTF(Cache, "%s new state is %s\n", __func__, blk->print()); 421 incHitCount(pkt); 422 // populate the time when the block will be ready to access. 423 blk->whenReady = clockEdge(fillLatency) + pkt->headerDelay + 424 pkt->payloadDelay; 425 return true; 426 } else if (pkt->cmd == MemCmd::CleanEvict) { 427 if (blk != nullptr) { --- 44 unchanged lines hidden (view full) --- 472 // cache, we need to update the data and the block flags 473 assert(blk); 474 assert(!blk->isDirty()); 475 if (!pkt->writeThrough()) { 476 blk->status |= BlkDirty; 477 } 478 // nothing else to do; writeback doesn't expect response 479 assert(!pkt->needsResponse()); | 420 DPRINTF(Cache, "%s new state is %s\n", __func__, blk->print()); 421 incHitCount(pkt); 422 // populate the time when the block will be ready to access. 423 blk->whenReady = clockEdge(fillLatency) + pkt->headerDelay + 424 pkt->payloadDelay; 425 return true; 426 } else if (pkt->cmd == MemCmd::CleanEvict) { 427 if (blk != nullptr) { --- 44 unchanged lines hidden (view full) --- 472 // cache, we need to update the data and the block flags 473 assert(blk); 474 assert(!blk->isDirty()); 475 if (!pkt->writeThrough()) { 476 blk->status |= BlkDirty; 477 } 478 // nothing else to do; writeback doesn't expect response 479 assert(!pkt->needsResponse()); |
480 std::memcpy(blk->data, pkt->getConstPtr<uint8_t>(), blkSize); | 480 pkt->writeDataToBlock(blk->data, blkSize); |
481 DPRINTF(Cache, "%s new state is %s\n", __func__, blk->print()); 482 483 incHitCount(pkt); 484 // populate the time when the block will be ready to access. 485 blk->whenReady = clockEdge(fillLatency) + pkt->headerDelay + 486 pkt->payloadDelay; 487 // if this a write-through packet it will be sent to cache 488 // below --- 1190 unchanged lines hidden (view full) --- 1679 // we are in the Owned state, tell the receiver 1680 pkt->setHasSharers(); 1681 } 1682 1683 // make sure the block is not marked dirty 1684 blk->status &= ~BlkDirty; 1685 1686 pkt->allocate(); | 481 DPRINTF(Cache, "%s new state is %s\n", __func__, blk->print()); 482 483 incHitCount(pkt); 484 // populate the time when the block will be ready to access. 485 blk->whenReady = clockEdge(fillLatency) + pkt->headerDelay + 486 pkt->payloadDelay; 487 // if this a write-through packet it will be sent to cache 488 // below --- 1190 unchanged lines hidden (view full) --- 1679 // we are in the Owned state, tell the receiver 1680 pkt->setHasSharers(); 1681 } 1682 1683 // make sure the block is not marked dirty 1684 blk->status &= ~BlkDirty; 1685 1686 pkt->allocate(); |
1687 std::memcpy(pkt->getPtr<uint8_t>(), blk->data, blkSize); | 1687 pkt->setDataFromBlock(blk->data, blkSize); |
1688 1689 return pkt; 1690} 1691 1692PacketPtr 1693Cache::writecleanBlk(CacheBlk *blk, Request::Flags dest, PacketId id) 1694{ 1695 Request *req = new Request(tags->regenerateBlkAddr(blk), blkSize, 0, --- 21 unchanged lines hidden (view full) --- 1717 // we are in the Owned state, tell the receiver 1718 pkt->setHasSharers(); 1719 } 1720 1721 // make sure the block is not marked dirty 1722 blk->status &= ~BlkDirty; 1723 1724 pkt->allocate(); | 1688 1689 return pkt; 1690} 1691 1692PacketPtr 1693Cache::writecleanBlk(CacheBlk *blk, Request::Flags dest, PacketId id) 1694{ 1695 Request *req = new Request(tags->regenerateBlkAddr(blk), blkSize, 0, --- 21 unchanged lines hidden (view full) --- 1717 // we are in the Owned state, tell the receiver 1718 pkt->setHasSharers(); 1719 } 1720 1721 // make sure the block is not marked dirty 1722 blk->status &= ~BlkDirty; 1723 1724 pkt->allocate(); |
1725 std::memcpy(pkt->getPtr<uint8_t>(), blk->data, blkSize); | 1725 pkt->setDataFromBlock(blk->data, blkSize); |
1726 1727 return pkt; 1728} 1729 1730 1731PacketPtr 1732Cache::cleanEvictBlk(CacheBlk *blk) 1733{ --- 231 unchanged lines hidden (view full) --- 1965 1966 // if we got new data, copy it in (checking for a read response 1967 // and a response that has data is the same in the end) 1968 if (pkt->isRead()) { 1969 // sanity checks 1970 assert(pkt->hasData()); 1971 assert(pkt->getSize() == blkSize); 1972 | 1726 1727 return pkt; 1728} 1729 1730 1731PacketPtr 1732Cache::cleanEvictBlk(CacheBlk *blk) 1733{ --- 231 unchanged lines hidden (view full) --- 1965 1966 // if we got new data, copy it in (checking for a read response 1967 // and a response that has data is the same in the end) 1968 if (pkt->isRead()) { 1969 // sanity checks 1970 assert(pkt->hasData()); 1971 assert(pkt->getSize() == blkSize); 1972 |
1973 std::memcpy(blk->data, pkt->getConstPtr<uint8_t>(), blkSize); | 1973 pkt->writeDataToBlock(blk->data, blkSize); |
1974 } 1975 // We pay for fillLatency here. 1976 blk->whenReady = clockEdge() + fillLatency * clockPeriod() + 1977 pkt->payloadDelay; 1978 1979 return blk; 1980} 1981 --- 904 unchanged lines hidden --- | 1974 } 1975 // We pay for fillLatency here. 1976 blk->whenReady = clockEdge() + fillLatency * clockPeriod() + 1977 pkt->payloadDelay; 1978 1979 return blk; 1980} 1981 --- 904 unchanged lines hidden --- |