base.cc (12629:c17d4dc2379e) base.cc (12636:9859213e2662)
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

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

71void
72BaseTags::setCache(BaseCache *_cache)
73{
74 assert(!cache);
75 cache = _cache;
76}
77
78void
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

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

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

--- 88 unchanged lines hidden ---
127BaseTags::regStats()
128{
129 ClockedObject::regStats();
130
131 using namespace Stats;
132
133 replacements
134 .init(maxThreadsPerCPU)

--- 88 unchanged lines hidden ---