Somebody please help me with the DIP replacement policy. In my code i
changed the insert block code this way. But when i apply this i get more
misses than LRU. Please suggest me the change that i have to make in this
code.
void
DIP::insertBlock(PacketPtr pkt, BlkType *blk)
{
BaseSetAssoc::insertBlock(pkt, blk);
int set = extractSet(pkt->getAddr());
PSEL=0;
if (set == 0 || set%1024==0 || set %32==0)
{
sets[set].moveToHead(blk);
if (blk==NULL)
{
PSEL++;
}
}
if (set % 31 == 0) /*BIP Implementation*/
{
srand(time(NULL));
throttle1 = (float)1/32;
if(rand()% assoc <= throttle1)
{
sets[set].moveToHead(blk);
}
else
{
sets[set].moveToTail(blk);
}
if (blk==NULL)
{
PSEL--;
}
// break;
}
else
{ //printf("In follower with PSEL");
if (PSEL!=0)
{
sets[set].moveToHead(blk);
}
else
{
srand(time(NULL));
throttle1 = (float)1/32;
if(rand()% assoc <= throttle1)
{
sets[set].moveToHead(blk);
}
else
{
sets[set].moveToTail(blk);
}
}
}
}
Somebody please help me to fix this code.Please.
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users