cache.cc (11750:c15cc4d973ea) | cache.cc (11751:cd6248b276a8) |
---|---|
1/* 2 * Copyright (c) 2010-2016 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 --- 1769 unchanged lines hidden (view full) --- 1778 blk->status |= BlkSecure; 1779 blk->status |= BlkValid | BlkReadable; 1780 1781 // sanity check for whole-line writes, which should always be 1782 // marked as writable as part of the fill, and then later marked 1783 // dirty as part of satisfyRequest 1784 if (pkt->cmd == MemCmd::WriteLineReq) { 1785 assert(!pkt->hasSharers()); | 1/* 2 * Copyright (c) 2010-2016 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 --- 1769 unchanged lines hidden (view full) --- 1778 blk->status |= BlkSecure; 1779 blk->status |= BlkValid | BlkReadable; 1780 1781 // sanity check for whole-line writes, which should always be 1782 // marked as writable as part of the fill, and then later marked 1783 // dirty as part of satisfyRequest 1784 if (pkt->cmd == MemCmd::WriteLineReq) { 1785 assert(!pkt->hasSharers()); |
1786 // at the moment other caches do not respond to the 1787 // invalidation requests corresponding to a whole-line write 1788 assert(!pkt->cacheResponding()); | |
1789 } 1790 1791 // here we deal with setting the appropriate state of the line, 1792 // and we start by looking at the hasSharers flag, and ignore the 1793 // cacheResponding flag (normally signalling dirty data) if the 1794 // packet has sharers, thus the line is never allocated as Owned 1795 // (dirty but not writable), and always ends up being either 1796 // Shared, Exclusive or Modified, see Packet::setCacheResponding --- 183 unchanged lines hidden (view full) --- 1980 } 1981 1982 chatty_assert(!(isReadOnly && blk->isDirty()), 1983 "Should never have a dirty block in a read-only cache %s\n", 1984 name()); 1985 1986 // We may end up modifying both the block state and the packet (if 1987 // we respond in atomic mode), so just figure out what to do now | 1786 } 1787 1788 // here we deal with setting the appropriate state of the line, 1789 // and we start by looking at the hasSharers flag, and ignore the 1790 // cacheResponding flag (normally signalling dirty data) if the 1791 // packet has sharers, thus the line is never allocated as Owned 1792 // (dirty but not writable), and always ends up being either 1793 // Shared, Exclusive or Modified, see Packet::setCacheResponding --- 183 unchanged lines hidden (view full) --- 1977 } 1978 1979 chatty_assert(!(isReadOnly && blk->isDirty()), 1980 "Should never have a dirty block in a read-only cache %s\n", 1981 name()); 1982 1983 // We may end up modifying both the block state and the packet (if 1984 // we respond in atomic mode), so just figure out what to do now |
1988 // and then do it later. If we find dirty data while snooping for 1989 // an invalidate, we don't need to send a response. The | 1985 // and then do it later. We respond to all snoops that need 1986 // responses provided we have the block in dirty state. The |
1990 // invalidation itself is taken care of below. | 1987 // invalidation itself is taken care of below. |
1991 bool respond = blk->isDirty() && pkt->needsResponse() && 1992 pkt->cmd != MemCmd::InvalidateReq; | 1988 bool respond = blk->isDirty() && pkt->needsResponse(); |
1993 bool have_writable = blk->isWritable(); 1994 1995 // Invalidate any prefetch's from below that would strip write permissions 1996 // MemCmd::HardPFReq is only observed by upstream caches. After missing 1997 // above and in it's own cache, a new MemCmd::ReadReq is created that 1998 // downstream caches observe. 1999 if (pkt->mustCheckAbove()) { 2000 DPRINTF(Cache, "Found addr %#llx in upper level cache for snoop %s " --- 154 unchanged lines hidden (view full) --- 2155 } 2156 2157 // conceptually writebacks are no different to other blocks in 2158 // this cache, so the behaviour is modelled after handleSnoop, 2159 // the difference being that instead of querying the block 2160 // state to determine if it is dirty and writable, we use the 2161 // command and fields of the writeback packet 2162 bool respond = wb_pkt->cmd == MemCmd::WritebackDirty && | 1989 bool have_writable = blk->isWritable(); 1990 1991 // Invalidate any prefetch's from below that would strip write permissions 1992 // MemCmd::HardPFReq is only observed by upstream caches. After missing 1993 // above and in it's own cache, a new MemCmd::ReadReq is created that 1994 // downstream caches observe. 1995 if (pkt->mustCheckAbove()) { 1996 DPRINTF(Cache, "Found addr %#llx in upper level cache for snoop %s " --- 154 unchanged lines hidden (view full) --- 2151 } 2152 2153 // conceptually writebacks are no different to other blocks in 2154 // this cache, so the behaviour is modelled after handleSnoop, 2155 // the difference being that instead of querying the block 2156 // state to determine if it is dirty and writable, we use the 2157 // command and fields of the writeback packet 2158 bool respond = wb_pkt->cmd == MemCmd::WritebackDirty && |
2163 pkt->needsResponse() && pkt->cmd != MemCmd::InvalidateReq; | 2159 pkt->needsResponse(); |
2164 bool have_writable = !wb_pkt->hasSharers(); 2165 bool invalidate = pkt->isInvalidate(); 2166 2167 if (!pkt->req->isUncacheable() && pkt->isRead() && !invalidate) { 2168 assert(!pkt->needsWritable()); 2169 pkt->setHasSharers(); 2170 wb_pkt->setHasSharers(); 2171 } --- 505 unchanged lines hidden --- | 2160 bool have_writable = !wb_pkt->hasSharers(); 2161 bool invalidate = pkt->isInvalidate(); 2162 2163 if (!pkt->req->isUncacheable() && pkt->isRead() && !invalidate) { 2164 assert(!pkt->needsWritable()); 2165 pkt->setHasSharers(); 2166 wb_pkt->setHasSharers(); 2167 } --- 505 unchanged lines hidden --- |