base.cc (12702:27cb33a96e0f) base.cc (12703:2d0e4d2d76b3)
1/*
2 * Copyright (c) 2013,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

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

73}
74
75void
76BaseTags::insertBlock(PacketPtr pkt, CacheBlk *blk)
77{
78 // Get address
79 Addr addr = pkt->getAddr();
80
1/*
2 * Copyright (c) 2013,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

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

73}
74
75void
76BaseTags::insertBlock(PacketPtr pkt, CacheBlk *blk)
77{
78 // Get address
79 Addr addr = pkt->getAddr();
80
81 // Update warmup data
82 if (!blk->isTouched) {
83 if (!warmedUp && tagsInUse.value() >= warmupBound) {
84 warmedUp = true;
85 warmupCycle = curTick();
86 }
87 }
88
89 // If we're replacing a block that was previously valid update
90 // stats for it. This can't be done in findBlock() because a
91 // found block might not actually be replaced there if the
92 // coherence protocol says it can't be.
93 if (blk->isValid()) {
94 totalRefs += blk->refCount;
95 ++sampledRefs;
96
97 invalidate(blk);
98 blk->invalidate();
99 }
100
101 // Previous block, if existed, has been removed, and now we have
102 // to insert the new one
81 // If we're replacing a block that was previously valid update
82 // stats for it. This can't be done in findBlock() because a
83 // found block might not actually be replaced there if the
84 // coherence protocol says it can't be.
85 if (blk->isValid()) {
86 totalRefs += blk->refCount;
87 ++sampledRefs;
88
89 invalidate(blk);
90 blk->invalidate();
91 }
92
93 // Previous block, if existed, has been removed, and now we have
94 // to insert the new one
103 tagsInUse++;
104
105 // Deal with what we are bringing in
106 MasterID master_id = pkt->req->masterId();
107 assert(master_id < cache->system->maxMasters());
108 occupancies[master_id]++;
109
110 // Insert block with tag, src master id and task id
111 blk->insert(extractTag(addr), pkt->isSecure(), master_id,
112 pkt->req->taskId());
113
95
96 // Deal with what we are bringing in
97 MasterID master_id = pkt->req->masterId();
98 assert(master_id < cache->system->maxMasters());
99 occupancies[master_id]++;
100
101 // Insert block with tag, src master id and task id
102 blk->insert(extractTag(addr), pkt->isSecure(), master_id,
103 pkt->req->taskId());
104
105 tagsInUse++;
106 if (!warmedUp && tagsInUse.value() >= warmupBound) {
107 warmedUp = true;
108 warmupCycle = curTick();
109 }
110
114 // We only need to write into one tag and one data block.
115 tagAccesses += 1;
116 dataAccesses += 1;
117}
118
119void
120BaseTags::regStats()
121{

--- 87 unchanged lines hidden ---
111 // We only need to write into one tag and one data block.
112 tagAccesses += 1;
113 dataAccesses += 1;
114}
115
116void
117BaseTags::regStats()
118{

--- 87 unchanged lines hidden ---