fa_lru.cc (12600:e670dd17c8cf) | fa_lru.cc (12629:c17d4dc2379e) |
---|---|
1/* 2 * Copyright (c) 2013,2016-2017 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 --- 66 unchanged lines hidden (view full) --- 75 76 blks = new FALRUBlk[numBlocks]; 77 head = &(blks[0]); 78 tail = &(blks[numBlocks-1]); 79 80 head->prev = nullptr; 81 head->next = &(blks[1]); 82 head->inCache = cacheMask; | 1/* 2 * Copyright (c) 2013,2016-2017 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 --- 66 unchanged lines hidden (view full) --- 75 76 blks = new FALRUBlk[numBlocks]; 77 head = &(blks[0]); 78 tail = &(blks[numBlocks-1]); 79 80 head->prev = nullptr; 81 head->next = &(blks[1]); 82 head->inCache = cacheMask; |
83 head->data = &dataBlks[0]; |
|
83 84 tail->prev = &(blks[numBlocks-2]); 85 tail->next = nullptr; 86 tail->inCache = 0; | 84 85 tail->prev = &(blks[numBlocks-2]); 86 tail->next = nullptr; 87 tail->inCache = 0; |
88 tail->data = &dataBlks[(numBlocks-1)*blkSize]; |
|
87 88 unsigned index = (1 << 17) / blkSize; 89 unsigned j = 0; 90 int flags = cacheMask; 91 for (unsigned i = 1; i < numBlocks - 1; i++) { 92 blks[i].inCache = flags; 93 if (i == index - 1){ 94 cacheBoundaries[j] = &(blks[i]); 95 flags &= ~ (1<<j); 96 ++j; 97 index = index << 1; 98 } 99 blks[i].prev = &(blks[i-1]); 100 blks[i].next = &(blks[i+1]); 101 blks[i].set = 0; 102 blks[i].way = i; | 89 90 unsigned index = (1 << 17) / blkSize; 91 unsigned j = 0; 92 int flags = cacheMask; 93 for (unsigned i = 1; i < numBlocks - 1; i++) { 94 blks[i].inCache = flags; 95 if (i == index - 1){ 96 cacheBoundaries[j] = &(blks[i]); 97 flags &= ~ (1<<j); 98 ++j; 99 index = index << 1; 100 } 101 blks[i].prev = &(blks[i-1]); 102 blks[i].next = &(blks[i+1]); 103 blks[i].set = 0; 104 blks[i].way = i; |
105 106 // Associate a data chunk to the block 107 blks[i].data = &dataBlks[blkSize*i]; |
|
103 } 104 assert(j == numCaches); 105 assert(index == numBlocks); 106 //assert(check()); 107} 108 109FALRU::~FALRU() 110{ --- 222 unchanged lines hidden --- | 108 } 109 assert(j == numCaches); 110 assert(index == numBlocks); 111 //assert(check()); 112} 113 114FALRU::~FALRU() 115{ --- 222 unchanged lines hidden --- |