Ignore:
Timestamp:
Jul 17, 2013, 9:24:48 AM (11 years ago)
Author:
cfuguet
Message:

Merging branch/v5/vci_mem_cache with trunk modifications to
start the development of new coherence protocol modifications
in this component

Location:
branches/v5/modules/vci_mem_cache
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/v5/modules/vci_mem_cache

  • branches/v5/modules/vci_mem_cache/caba/source/include/mem_cache_directory.h

    r307 r440  
    4040  ////////////////////////////////////////////////////////////////////////
    4141  class Owner{
    42     typedef uint32_t size_t;
    4342   
    4443    public:
     
    9291
    9392    typedef uint32_t tag_t;
    94     typedef uint32_t size_t;
    9593
    9694    public:
     
    165163    void print()
    166164    {
    167       std::cout << "Valid = " << valid << " ; IS COUNT = " << is_cnt << " ; Dirty = " << dirty << " ; Lock = "
    168                 << lock
     165      std::cout << "Valid = " << valid
     166                << " ; IS COUNT = " << is_cnt
     167                << " ; Dirty = " << dirty
     168                << " ; Lock = " << lock
    169169                << " ; Tag = " << std::hex << tag << std::dec
    170170                << " ; Count = " << count
     
    187187    typedef uint32_t data_t;
    188188    typedef uint32_t tag_t;
    189     typedef uint32_t size_t;
    190189
    191190    private:
     
    275274
    276275    /////////////////////////////////////////////////////////////////////
     276    // The inval function invalidate an entry defined by the set and
     277    // way arguments.
     278    /////////////////////////////////////////////////////////////////////
     279    void inval( const size_t &set, const size_t &way )
     280    {
     281        m_dir_tab[set][way].init();
     282    }
     283
     284    /////////////////////////////////////////////////////////////////////
    277285    // The read_neutral() function reads a directory entry, without
    278286    // changing the LRU
     
    321329      // update LRU bits
    322330      bool all_recent = true;
    323       for ( size_t i=0 ; i<m_ways ; i++ ) {
    324         if ( i != way ) all_recent = m_lru_tab[set][i].recent && all_recent;
    325       }
    326       if ( all_recent ) {
    327         for( size_t i=0 ; i<m_ways ; i++ ) m_lru_tab[set][i].recent = false;
    328       } else {
    329         m_lru_tab[set][way].recent = true;
     331      for ( size_t i=0 ; i<m_ways ; i++ )
     332      {
     333          if ( i != way ) all_recent = m_lru_tab[set][i].recent && all_recent;
     334      }
     335      if ( all_recent )
     336      {
     337          for( size_t i=0 ; i<m_ways ; i++ ) m_lru_tab[set][i].recent = false;
     338      }
     339      else
     340      {
     341          m_lru_tab[set][way].recent = true;
    330342      }
    331343    } // end write()
     
    408420  ///////////////////////////////////////////////////////////////////////
    409421  class HeapEntry{
    410     typedef uint32_t size_t;
    411422
    412423    public:
     
    472483  ////////////////////////////////////////////////////////////////////////
    473484  class HeapDirectory{
    474     typedef uint32_t size_t;
    475485   
    476486    private:
Note: See TracChangeset for help on using the changeset viewer.