hi all,

We have implemented Spill-Receive L2 cache (- its a Paper) . And its working
successfully. The ouput is obtained in stats.txt.

But we want the statistics in terms of throughput, speedup and performance.
Which is not in stats.txt

Can u help us in dis regard

Th code written in cacheset.cc in cahe part is


void
CacheSet::moveToHead(CacheBlk *blk,int n)
{

    int t_pos,j,k,i = 0,num_blks;

    int flag=-1;


    num_blks=assoc/n;   //number of blks in a set  per cpu

    if(assoc==8)
    {
        if(blk->contextSrc==-1)
             i=0;
        else
             i=blk->contextSrc;

    if (blks[i*num_blks] == blk)
            return;
    }
    if (blks[0] == blk)
        return;

    // write 'next' block into blks[i], moving up from MRU toward LRU
    // until we overwrite the block we moved to head.

    CacheBlk *tmp,*next = blk;

    // finding the position of the block , if already present in the set
    for(j=0;j<assoc;j++)
    {
        if(blks[j]==blk)
        {
            flag=j;
            break;
        }
    }
    //finding to which cpu the block to be moved belongs to
    for(k=0;k<n;k++)
        if(j>=num_blks*k && j<num_blks*k+num_blks)
            break;                // the block to be inserted belongs to kth
cpu

    if(assoc==8 && blk->contextSrc == -1)   // inserting to MRU of the kth
cpu
        {

        i=k*num_blks;
        t_pos=num_blks*i+num_blks;


        do {
            assert(i < t_pos);
            // swap blks[i] and next
            tmp = blks[i];
            blks[i] = next;
            next = tmp;
            ++i;
            } while (next != blk);
           return;
    }
    if(assoc==4)  // assuming that the block to be inserted into L1 cache
        {
        i=0;
        do {
                assert(i < assoc);
                // swap blks[i] and next
                tmp = blks[i];
                blks[i] = next;
                next = tmp;
                ++i;
                } while (next != blk);
        return;
    }
    if(assoc==8)
    {
        i=blk->contextSrc*num_blks;
        t_pos=i+num_blks;

        if(flag!=-1)
        {
            //if the position of the block to be inserted is lesser than the
existing blocks position
                        if(i<j)
                        {
                            //if the block and the position to be inserted
is of the same cpu
                            if (j>i&& j<t_pos)
                            {
                                do {
                                    assert(i < j+1);
                                            // swap blks[i] and next
                                        tmp = blks[i];
                                        blks[i] = next;
                                        next = tmp;
                                        ++i;
                                           } while (next != blk);
                                  }
                                  else
                                  {
                                      while(i<t_pos)
                                      {
                                               // swap blks[i] and next
                                        tmp = blks[i];
                                        blks[i] = next;
                                           next = tmp;
                                        ++i;
                                }
                                blks[j]=tmp;
                                  }
                        }
                        else if(i>j)
                        {
                            while(i<t_pos)
                                  {
                                           // swap blks[i] and next
                                        tmp = blks[i];
                                        blks[i] = next;
                                       next = tmp;
                                    ++i;
                            }
                            //finding to which cpu the block to be moved
belongs to
                            for(k=0;k<n;k++)
                                if(j>=num_blks*k && j<=num_blks*k+num_blks)
                                    break;
                                //belongs to kth cpu
                            if(j<num_blks*k+1)
                                while(j<num_blks*k+1)            //storing
the replaced block in LRU of kth cpu
                                {
                                    blks[j]=blks[j+1];
                                    j++;
                                }
                                blks[j]=tmp;
                        }

        }
    }


-- 
Sunitha.P
9092892876
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users

Reply via email to