Thank you for ur immediate reply.

But i was not able to debug the error.
But tried to just move the block to the corresponding contextsrc id position
instead to the MRU position. that is if contextsrc id of the block to be
inserted (with respect to L2 cache which is fixed to have 8 way assoc and L1
fixed to 4 way assoc)

= 0 : insert at 0th position
= 1 : insert at 2 position
=2 : insert at 4 position
=3 : insert at 6 position

if -1 : insert as usual at 0 position

The basic code i tried is in cacheset.cc: movetohead()

void
CacheSet::moveToHead(CacheBlk *blk, int cpu_id)
{
    int i;

    if(assoc==8)
    if (blks[0] == blk || blks[2]==blk || blks[4]==blk || blks[6]==blk)
            return;
    if (blks[0] == blk)
        return;

    CacheBlk *next = blk;
     // nothing to do if blk is already head %d

    if(assoc==8 && blk->contextSrc != -1)

      i = blk->contextSrc * 2 ;

    else

        i=0;

    do{

        assert(i<assoc);

        // swap blks[i] and next

        CacheBlk *tmp = blks[i];
        blks[i] = next;
        next = tmp;

        ++i;
    } while(next != blk);

}


but it is going to infinite looping..why?..just by changing the position.

On Tue, Nov 30, 2010 at 11:15 PM, Gabe Black <[email protected]> wrote:

> That error is basically a segfault. What likely happened is that you're
> program tried to read a member of a structure using a NULL pointer. The
> pointer could have been NULL because the workload behaves incorrectly if
> it's a custom benchmark for instance, or you're cache modifications are
> making a load return all 0s when the pointer is accessed.
>
> Gabe
>
> sunitha p wrote:
> > 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
>
> _______________________________________________
> m5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
>



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

Reply via email to