I am trying to partition L2 among the CPUs. Initially trying to make static
logical partitioning among 4 CPUs
have taken L2 as 8 way set associative and L1 as split 4 way set associative
into consideration
Hence, in each set , 2 blocks is assigned for each CPU. Since blocks are
pointed by an array structure blks[],
0&1 - cpu1, 2&3 - cpu2 & so on
in lru.cc, findVictim function finds the LRU block of the respective CPU.
The code written is
LRU::BlkType*
LRU::findVictim(Addr addr, PacketList &writebacks,int cpu_id)
{
//int flag=0,flag_id=0;
unsigned set = extractSet(addr);
// grab a replacement candidate
BlkType *blk;
if(assoc==8) //implying its L2 cache
{
if(cpu_id==-1)
cpu_id=3;
int temp_position = 2*cpu_id+1;
blk = sets[set].blks[temp_position];
}
else
{
blk=sets[set].blks[assoc-1];
inform("L1 : set %x: selecting blk %x for replacement : CPU id : %d
\n", set, regenerateBlkAddr(blk->tag, set),cpu_id);
}
if (blk->isValid())
{
replacements[0]++;
totalRefs += blk->refCount;
++sampledRefs;
blk->refCount = 0;
// deal with evicted block
if(blk->contextSrc!=-1)
{
occupancies[blk->contextSrc % cache->numCpus()]--;
blk->contextSrc = -1;
}
else
{
occupancies[cache->numCpus()]--;
}
}
DPRINTF(CacheRepl, "set %x: selecting blk %x for replacement\n",
set, regenerateBlkAddr(blk->tag, set));
return blk;
}
and in cacheSet.cc , moveHead() function- moves the block to the head
position of respective CPU. The altered code is
void
CacheSet::moveToHead(CacheBlk *blk, int cpu_id)
{
int i;
CacheBlk *next = blk;
// nothing to do if blk is already head %d
if(assoc==8 )
{
if(cpu_id==-1)
cpu_id=3;
if(blks[cpu_id*2]==blk)
return;
i = cpu_id* 2 ;
while(i<(cpu_id) * 2 +2)
{
CacheBlk *tmp = blks[i];
blks[i] = next;
next = tmp;
++i;
}
}
else
{
if (blks[0] == blk)
return;
do{
assert(i<assoc);
// swap blks[i] and next
CacheBlk *tmp = blks[i];
blks[i] = next;
next = tmp;
++i;
} while(next != blk);
}
}
But i am getting mapping arror as
panic: Tried to access unmapped address 0x58.
@ cycle 25441428000
[invoke:build/ALPHA_SE/arch/alpha/faults.cc, line 209]
Memory Usage: 163640 KBytes
For more information see: http://www.m5sim.org/panic/5932f339
Program aborted at cycle 25441428000
Aborted
Can anyone kindly help as to what the error is and where i am making
mistake
--
Sunitha.P
9092892876
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users