Re: [Gems-users] How to access L2 cache entry in LRUPolicy.h


Date: Fri, 5 Mar 2010 07:30:26 -0600
From: Dan Gibson <degibson@xxxxxxxx>
Subject: Re: [Gems-users] How to access L2 cache entry in LRUPolicy.h
Liz,
1. Go and do that tutorial on templates that I suggested in my previous email. Your problem relates more to a lack of understanding of how C++ templates work than to any issue with Ruby.
2. You might want to study C++ in general, while you're at it. Simply adding m_cache to LRUPolicy doesn't make it the same cache as the one used by the L2.
3. By the looks of things, you are getting your segfault because the m_cache you have added to LRUPolicy is never sized. I.e., the vector is empty. Look at how other code uses vectors.

Regards,
Dan

On Fri, Mar 5, 2010 at 3:39 AM, Liz Joy <lizjoy86@xxxxxxxxx> wrote:
Hii..

I want to access the m_Address associated with each way in a particular set of L2 cache in getVictim() of  LRUPolicy.h..How can it be possible?? I templated the LRUPolicy class..bt still it is giving segmentation fault.

template <class ENTRY>
class LRUPolicy : public AbstractReplacementPolicy {
private:
 Vector<Vector<ENTRY> > m_cache;
......
......
...


};


template <class ENTRY>
inline
Index LRUPolicy<ENTRY>::getVictim(Index set) const {
..........
.........
......................
for(int i=0;i<m_assoc;i++)
{
             m_cache[set][i].m_Address         //----------------???? How can I access this???

}


}


Someone kindly  help me please...................
Thanks in advance

Liz

_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding "site:https://lists.cs.wisc.edu/archive/gems-users/" to your search.





--
http://www.cs.wisc.edu/~gibson [esc]:wq!
[← Prev in Thread] Current Thread [Next in Thread→]