[Gems-users] How to access cache entry in LRUPolicy


Date: Thu, 11 Feb 2010 17:29:06 +0530
From: Liz Joy <lizjoy86@xxxxxxxxx>
Subject: [Gems-users] How to access cache entry in LRUPolicy
Hii
I want to access each cache entry m_cache[set][i] in getVictimOwner(Index set,NodeID processorid) of LRUPolicy.h file.
I need to check the condition.
for(unsigned int i=0;i < m_assoc; i++)
{
        if(m_cache[set][i].m_Address.m_processorid == processorid)............................//line no 98
        {
                smallest_time = m_last_ref_ptr[set][i];
                smallest_index = i;
                break;

        }
}

for (unsigned int i=0; i < m_assoc; i++)
 {

        if(m_cache[set][i].m_Address.m_processorid == processorid)....................//line no 109
        {
                 time = m_last_ref_ptr[set][i];
                                 //assert(m_cache[cacheSet][i].m_Permission != AccessPermission_NotPresent);

                if (time < smallest_time)
                {
                         smallest_index = i;
                         smallest_time = time;
                }
         }
  }
But the checking condition is giving an error saying
system/LRUPolicy.h: In member function `virtual Index LRUPolicy::getVictimOwner(Index, NodeID) const':
system/LRUPolicy.h:98: error: invalid use of undefined type `const struct ENTRY'
slicc_interface/AbstractChip.h:77: error: forward declaration of `const struct ENTRY'
system/LRUPolicy.h:108: error: invalid initialization of reference of type 'ENTRY&' from _expression_ of type 'const ENTRY'
system/LRUPolicy.h:109: error: invalid use of undefined type `struct ENTRY'
slicc_interface/AbstractChip.h:77: error: forward declaration of `struct ENTRY'
system/LRUPolicy.h: In member function `virtual Index LRUPolicy::getVictimChangeOwnership(Index, NodeID) const':
system/LRUPolicy.h:140: error: invalid use of undefined type `const struct ENTRY'
slicc_interface/AbstractChip.h:77: error: forward declaration of `const struct ENTRY'
system/LRUPolicy.h:152: error: invalid use of undefined type `const struct ENTRY'
slicc_interface/AbstractChip.h:77: error: forward declaration of `const struct ENTRY'
system/CacheMemory.h: In constructor `CacheMemory<ENTRY>::CacheMemory(AbstractChip*, int, int, MachineType, const std::string&) [with ENTRY = L1Cache_Entry]':
generated/MSI_MOSI_CMP_directory/Chip.C:126:   instantiated from here
system/CacheMemory.h:247: warning: converting to `int' from `double'
system/CacheMemory.h: In constructor `CacheMemory<ENTRY>::CacheMemory(AbstractChip*, int, int, MachineType, const std::string&) [with ENTRY = L2Cache_Entry]':
generated/MSI_MOSI_CMP_directory/Chip.C:284:   instantiated from here
system/CacheMemory.h:247: warning: converting to `int' from `double'
../common/Vector.h: In destructor `Vector<TYPE>::~Vector() [with TYPE = ENTRY]':
../common/Vector.h:149:   instantiated from `Vector<TYPE>::~Vector() [with TYPE = Vector<ENTRY>]'
system/LRUPolicy.h:43:   instantiated from here
../common/Vector.h:149: error: invalid use of undefined type `struct ENTRY'
slicc_interface/AbstractChip.h:77: error: forward declaration of `struct ENTRY'
../common/Vector.h: In member function `const TYPE& Vector<TYPE>::ref(int) const [with TYPE = ENTRY]':
../common/Vector.h:108:   instantiated from `const TYPE& Vector<TYPE>::operator[](int) const [with TYPE = ENTRY]'
system/LRUPolicy.h:98:   instantiated from here
../common/Vector.h:160: error: invalid use of undefined type `struct ENTRY'
slicc_interface/AbstractChip.h:77: error: forward declaration of `struct ENTRY'
make[1]: *** [x86-linux/generated/MSI_MOSI_CMP_directory/obj/Chip.o] Error 1
make[1]: Leaving directory `/scratch/liz/simulator/gems-2.1.1/ruby'
make: *** [all] Error 2

Can anyone please help to remove this error.How can I access m_cache[set][j].m_Address.m_processorid???
Expecting a reply soon
Thanks in advance
Liz
[← Prev in Thread] Current Thread [Next in Thread→]