Index: branches/RWT/modules/vci_mem_cache/caba/source/include/mem_cache_directory.h
===================================================================
--- branches/RWT/modules/vci_mem_cache/caba/source/include/mem_cache_directory.h	(revision 814)
+++ branches/RWT/modules/vci_mem_cache/caba/source/include/mem_cache_directory.h	(revision 823)
@@ -18,403 +18,416 @@
   class LruEntry {
 
-    public:
-
-      bool recent;
-
+      public:
+
+          bool recent;
+
+          void init()
+          {
+              recent=false;
+          }
+
+  }; // end class LruEntry
+
+  ////////////////////////////////////////////////////////////////////////
+  //                    An Owner
+  ////////////////////////////////////////////////////////////////////////
+  class Owner{
+
+      public:
+
+          // Fields
+          bool   inst;  // Is the owner an ICache ?
+          size_t srcid; // The SRCID of the owner
+
+          ////////////////////////
+          // Constructors
+          ////////////////////////
+          Owner(bool   i_inst,
+                size_t i_srcid)
+          {
+              inst  = i_inst;
+              srcid = i_srcid;
+          }
+
+          Owner(const Owner &a)
+          {
+              inst  = a.inst;
+              srcid = a.srcid;
+          }
+
+          Owner()
+          {
+              inst  = false;
+              srcid = 0;
+          }
+          // end constructors
+
+  }; // end class Owner
+
+
+  ////////////////////////////////////////////////////////////////////////
+  //                    A directory entry
+  ////////////////////////////////////////////////////////////////////////
+  class DirectoryEntry {
+
+      typedef uint32_t tag_t;
+
+      public:
+
+      bool   valid;          // entry valid
+      bool   cache_coherent; // WB or WT policy
+      bool   is_cnt;         // directory entry is in counter mode
+      bool   dirty;          // entry dirty
+      bool   lock;           // entry locked
+      tag_t  tag;            // tag of the entry
+      size_t count;          // number of copies
+      Owner  owner;          // an owner of the line
+      size_t ptr;            // pointer to the next owner
+
+      DirectoryEntry()
+      {
+          valid          = false;
+          cache_coherent = false;
+          is_cnt         = false;
+          dirty          = false;
+          lock           = false;
+          tag            = 0;
+          count          = 0;
+          owner.inst     = 0;
+          owner.srcid    = 0;
+          ptr            = 0;
+      }
+
+      DirectoryEntry(const DirectoryEntry &source)
+      {
+          valid          = source.valid;
+          cache_coherent = source.cache_coherent;
+          is_cnt         = source.is_cnt;
+          dirty          = source.dirty;
+          lock           = source.lock;
+          tag            = source.tag;
+          count          = source.count;
+          owner          = source.owner;
+          ptr            = source.ptr;
+      }
+
+      /////////////////////////////////////////////////////////////////////
+      // The init() function initializes the entry
+      /////////////////////////////////////////////////////////////////////
       void init()
       {
-        recent=false;
+          valid          = false;
+          cache_coherent = false;
+          is_cnt         = false;
+          dirty          = false;
+          lock           = false;
+          count          = 0;
       }
 
-  }; // end class LruEntry
-
-  ////////////////////////////////////////////////////////////////////////
-  //                    An Owner
-  ////////////////////////////////////////////////////////////////////////
-  class Owner{
-
-    public:
-    // Fields
-      bool      inst;       // Is the owner an ICache ?
-      size_t    srcid;      // The SRCID of the owner
-
-    ////////////////////////
-    // Constructors
-    ////////////////////////
-      Owner(bool   i_inst,
-            size_t i_srcid)
-      {
-        inst    = i_inst;
-        srcid   = i_srcid;
+      /////////////////////////////////////////////////////////////////////
+      // The copy() function copies an existing source entry to a target
+      /////////////////////////////////////////////////////////////////////
+      void copy(const DirectoryEntry &source)
+      {
+          valid          = source.valid;
+          cache_coherent = source.cache_coherent;
+          is_cnt         = source.is_cnt;
+          dirty          = source.dirty;
+          lock           = source.lock;
+          tag            = source.tag;
+          count          = source.count;
+          owner          = source.owner;
+          ptr            = source.ptr;
       }
 
-      Owner(const Owner &a)
-      {
-        inst    = a.inst;
-        srcid   = a.srcid;
+      ////////////////////////////////////////////////////////////////////
+      // The print() function prints the entry
+      ////////////////////////////////////////////////////////////////////
+      void print()
+      {
+          std::cout << "Valid = " << valid
+              << " ; COHERENCE = " << cache_coherent
+              << " ; IS COUNT = " << is_cnt
+              << " ; Dirty = " << dirty
+              << " ; Lock = " << lock
+              << " ; Tag = " << std::hex << tag << std::dec
+              << " ; Count = " << count
+              << " ; Owner = " << owner.srcid
+              << " " << owner.inst
+              << " ; Pointer = " << ptr << std::endl;
       }
 
-      Owner()
-      {
-        inst    = false;
-        srcid   = 0;
+  }; // end class DirectoryEntry
+
+  ////////////////////////////////////////////////////////////////////////
+  //                       The directory
+  ////////////////////////////////////////////////////////////////////////
+  class CacheDirectory {
+
+      typedef sc_dt::sc_uint<40> addr_t;
+      typedef uint32_t data_t;
+      typedef uint32_t tag_t;
+
+      private:
+
+      // Directory constants
+      size_t   m_ways;
+      size_t   m_sets;
+      size_t   m_words;
+      size_t   m_width;
+      uint32_t lfsr;
+
+      // the directory & lru tables
+      DirectoryEntry **m_dir_tab;
+      LruEntry       **m_lru_tab;
+
+      public:
+
+      ////////////////////////
+      // Constructor
+      ////////////////////////
+      CacheDirectory(size_t ways, size_t sets, size_t words, size_t address_width)
+      {
+          m_ways  = ways;
+          m_sets  = sets;
+          m_words = words;
+          m_width = address_width;
+          lfsr    = -1;
+
+          m_dir_tab = new DirectoryEntry*[sets];
+          for (size_t i = 0; i < sets; i++) {
+              m_dir_tab[i] = new DirectoryEntry[ways];
+              for (size_t j = 0; j < ways; j++) {
+                  m_dir_tab[i][j].init();
+              }
+          }
+
+          m_lru_tab = new LruEntry*[sets];
+          for (size_t i = 0; i < sets; i++) {
+              m_lru_tab[i] = new LruEntry[ways];
+              for (size_t j = 0; j < ways; j++) {
+                  m_lru_tab[i][j].init();
+              }
+          }
+      } // end constructor
+
+      /////////////////
+      // Destructor
+      /////////////////
+      ~CacheDirectory()
+      {
+          for (size_t i = 0; i < m_sets; i++) {
+              delete [] m_dir_tab[i];
+              delete [] m_lru_tab[i];
+          }
+          delete [] m_dir_tab;
+          delete [] m_lru_tab;
+      } // end destructor
+
+      /////////////////////////////////////////////////////////////////////
+      // The read() function reads a directory entry. In case of hit, the
+      // LRU is updated.
+      // Arguments :
+      // - address : the address of the entry
+      // - way : (return argument) the way of the entry in case of hit
+      // The function returns a copy of a (valid or invalid) entry
+      /////////////////////////////////////////////////////////////////////
+      DirectoryEntry read(const addr_t &address, size_t &way)
+      {
+
+#define L2 soclib::common::uint32_log2
+          const size_t set = (size_t) (address >> (L2(m_words) + 2)) & (m_sets - 1);
+          const tag_t  tag = (tag_t) (address >> (L2(m_sets) + L2(m_words) + 2));
+#undef L2
+
+          bool hit = false;
+
+          for (size_t i = 0; i < m_ways; i++) {
+              bool equal = (m_dir_tab[set][i].tag == tag);
+              bool valid = m_dir_tab[set][i].valid;
+              hit = equal && valid;
+              if (hit) {
+                  way = i;
+                  break;
+              }
+          }
+          if (hit) {
+              m_lru_tab[set][way].recent = true;
+              return DirectoryEntry(m_dir_tab[set][way]);
+          } else {
+              return DirectoryEntry();
+          }
+      } // end read()
+
+      /////////////////////////////////////////////////////////////////////
+      // The inval function invalidate an entry defined by the set and
+      // way arguments.
+      /////////////////////////////////////////////////////////////////////
+      void inval( const size_t &way, const size_t &set )
+      {
+          m_dir_tab[set][way].init();
       }
-      // end constructors
-
-  }; // end class Owner
-
-
-  ////////////////////////////////////////////////////////////////////////
-  //                    A directory entry
-  ////////////////////////////////////////////////////////////////////////
-  class DirectoryEntry {
-
-    typedef uint32_t tag_t;
-
-    public:
-
-    bool    valid;                  // entry valid
-    bool    cache_coherent;         // WB or WT policy
-    bool    is_cnt;                 // directory entry is in counter mode
-    bool    dirty;                  // entry dirty
-    bool    lock;                   // entry locked
-    tag_t   tag;                    // tag of the entry
-    size_t  count;                  // number of copies
-    Owner   owner;                  // an owner of the line
-    size_t  ptr;                    // pointer to the next owner
-
-    DirectoryEntry()
-    {
-      valid         = false;
-      cache_coherent= false;
-      is_cnt        = false;
-      dirty         = false;
-      lock          = false;
-      tag           = 0;
-      count         = 0;
-      owner.inst    = 0;
-      owner.srcid   = 0;
-      ptr           = 0;
-    }
-
-    DirectoryEntry(const DirectoryEntry &source)
-    {
-      valid         = source.valid;
-      cache_coherent= source.cache_coherent;
-      is_cnt        = source.is_cnt;
-      dirty         = source.dirty;
-      lock          = source.lock;
-      tag           = source.tag;
-      count         = source.count;
-      owner         = source.owner;
-      ptr           = source.ptr;
-    }
-
-    /////////////////////////////////////////////////////////////////////
-    // The init() function initializes the entry
-    /////////////////////////////////////////////////////////////////////
-    void init()
-    {
-      valid     = false;
-      cache_coherent = false;
-      is_cnt    = false;
-      dirty     = false;
-      lock      = false;
-      count     = 0;
-    }
-
-    /////////////////////////////////////////////////////////////////////
-    // The copy() function copies an existing source entry to a target
-    /////////////////////////////////////////////////////////////////////
-    void copy(const DirectoryEntry &source)
-    {
-      valid     = source.valid;
-      cache_coherent = source.cache_coherent;
-      is_cnt    = source.is_cnt;
-      dirty     = source.dirty;
-      lock      = source.lock;
-      tag       = source.tag;
-      count     = source.count;
-      owner     = source.owner;
-      ptr       = source.ptr;
-    }
-
-    ////////////////////////////////////////////////////////////////////
-    // The print() function prints the entry
-    ////////////////////////////////////////////////////////////////////
-    void print()
-    {
-      std::cout << "Valid = " << valid
-                << " ; COHERENCE = " << cache_coherent
-                << " ; IS COUNT = " << is_cnt
-                << " ; Dirty = " << dirty
-                << " ; Lock = " << lock
-                << " ; Tag = " << std::hex << tag << std::dec
-                << " ; Count = " << count
-                << " ; Owner = " << owner.srcid
-                << " " << owner.inst
-                << " ; Pointer = " << ptr << std::endl;
-    }
-
-  }; // end class DirectoryEntry
-
-  ////////////////////////////////////////////////////////////////////////
-  //                       The directory
-  ////////////////////////////////////////////////////////////////////////
-  class CacheDirectory {
-
-    typedef sc_dt::sc_uint<40> addr_t;
-    typedef uint32_t data_t;
-    typedef uint32_t tag_t;
-
-    private:
-
-    // Directory constants
-    size_t   m_ways;
-    size_t   m_sets;
-    size_t   m_words;
-    size_t   m_width;
-    uint32_t lfsr;
-
-    // the directory & lru tables
-    DirectoryEntry **m_dir_tab;
-    LruEntry       **m_lru_tab;
-
-    public:
-
-    ////////////////////////
-    // Constructor
-    ////////////////////////
-    CacheDirectory( size_t ways, size_t sets, size_t words, size_t address_width)
-    {
-      m_ways  = ways;
-      m_sets  = sets;
-      m_words = words;
-      m_width = address_width;
-      lfsr = -1;
-
-      m_dir_tab = new DirectoryEntry*[sets];
-      for ( size_t i=0; i<sets; i++ ) {
-        m_dir_tab[i] = new DirectoryEntry[ways];
-        for ( size_t j=0 ; j<ways ; j++) m_dir_tab[i][j].init();
-      }
-      m_lru_tab = new LruEntry*[sets];
-      for ( size_t i=0; i<sets; i++ ) {
-        m_lru_tab[i] = new LruEntry[ways];
-        for ( size_t j=0 ; j<ways ; j++) m_lru_tab[i][j].init();
-      }
-    } // end constructor
-
-    /////////////////
-    // Destructor
-    /////////////////
-    ~CacheDirectory()
-    {
-      for(size_t i=0 ; i<m_sets ; i++){
-        delete [] m_dir_tab[i];
-        delete [] m_lru_tab[i];
-      }
-      delete [] m_dir_tab;
-      delete [] m_lru_tab;
-    } // end destructor
-
-    /////////////////////////////////////////////////////////////////////
-    // The read() function reads a directory entry. In case of hit, the
-    // LRU is updated.
-    // Arguments :
-    // - address : the address of the entry
-    // - way : (return argument) the way of the entry in case of hit
-    // The function returns a copy of a (valid or invalid) entry
-    /////////////////////////////////////////////////////////////////////
-    DirectoryEntry read(const addr_t &address, size_t &way)
-    {
+
+      /////////////////////////////////////////////////////////////////////
+      // The read_neutral() function reads a directory entry, without
+      // changing the LRU
+      // Arguments :
+      // - address : the address of the entry
+      // The function returns a copy of a (valid or invalid) entry
+      /////////////////////////////////////////////////////////////////////
+      DirectoryEntry read_neutral(const addr_t &address,
+                                  size_t*      ret_way,
+                                  size_t*      ret_set)
+      {
 
 #define L2 soclib::common::uint32_log2
-      const size_t set = (size_t)(address >> (L2(m_words) + 2)) & (m_sets - 1);
-      const tag_t  tag = (tag_t)(address >> (L2(m_sets) + L2(m_words) + 2));
+          size_t set = (size_t)(address >> (L2(m_words) + 2)) & (m_sets - 1);
+          tag_t  tag = (tag_t)(address >> (L2(m_sets) + L2(m_words) + 2));
 #undef L2
 
-      bool hit       = false;
-      for ( size_t i=0 ; i<m_ways ; i++ ) {
-        bool equal = ( m_dir_tab[set][i].tag == tag );
-        bool valid = m_dir_tab[set][i].valid;
-        hit = equal && valid;
-        if ( hit ) {
-          way = i;
-          break;
-        }
-      }
-      if ( hit ) {
-        m_lru_tab[set][way].recent = true;
-        return DirectoryEntry(m_dir_tab[set][way]);
-      } else {
-        return DirectoryEntry();
-      }
-    } // end read()
-
-    /////////////////////////////////////////////////////////////////////
-    // The inval function invalidate an entry defined by the set and
-    // way arguments.
-    /////////////////////////////////////////////////////////////////////
-    void inval( const size_t &way, const size_t &set )
-    {
-        m_dir_tab[set][way].init();
-    }
-
-    /////////////////////////////////////////////////////////////////////
-    // The read_neutral() function reads a directory entry, without
-    // changing the LRU
-    // Arguments :
-    // - address : the address of the entry
-    // The function returns a copy of a (valid or invalid) entry
-    /////////////////////////////////////////////////////////////////////
-    DirectoryEntry read_neutral( const addr_t &address,
-                                 size_t*      ret_way,
-                                 size_t*      ret_set )
-    {
-
-#define L2 soclib::common::uint32_log2
-        size_t set = (size_t)(address >> (L2(m_words) + 2)) & (m_sets - 1);
-        tag_t  tag = (tag_t)(address >> (L2(m_sets) + L2(m_words) + 2));
-#undef L2
-
-        for ( size_t way = 0 ; way < m_ways ; way++ )
-        {
-            bool equal = ( m_dir_tab[set][way].tag == tag );
-            bool valid = m_dir_tab[set][way].valid;
-            if ( equal and valid )
-            {
-                *ret_set = set;
-                *ret_way = way;
-                return DirectoryEntry(m_dir_tab[set][way]);
-            }
-        }
-        return DirectoryEntry();
-    } // end read_neutral()
-
-    /////////////////////////////////////////////////////////////////////
-    // The write function writes a new entry,
-    // and updates the LRU bits if necessary.
-    // Arguments :
-    // - set : the set of the entry
-    // - way : the way of the entry
-    // - entry : the entry value
-    /////////////////////////////////////////////////////////////////////
-    void write( const size_t         &set,
-                const size_t         &way,
-                const DirectoryEntry &entry)
-    {
-      assert( (set<m_sets)
-          && "Cache Directory write : The set index is invalid");
-      assert( (way<m_ways)
-          && "Cache Directory write : The way index is invalid");
-
-      // update Directory
-      m_dir_tab[set][way].copy(entry);
-
-      // update LRU bits
-      bool all_recent = true;
-      for ( size_t i=0 ; i<m_ways ; i++ )
-      {
-          if ( i != way ) all_recent = m_lru_tab[set][i].recent && all_recent;
-      }
-      if ( all_recent )
-      {
-          for( size_t i=0 ; i<m_ways ; i++ ) m_lru_tab[set][i].recent = false;
-      }
-      else
-      {
-          m_lru_tab[set][way].recent = true;
-      }
-    } // end write()
-
-    /////////////////////////////////////////////////////////////////////
-    // The print() function prints a selected directory entry
-    // Arguments :
-    // - set : the set of the entry to print
-    // - way : the way of the entry to print
-    /////////////////////////////////////////////////////////////////////
-    void print(const size_t &set, const size_t &way)
-    {
-      std::cout << std::dec << " set : " << set << " ; way : " << way << " ; " ;
-      m_dir_tab[set][way].print();
-    } // end print()
-
-    /////////////////////////////////////////////////////////////////////
-    // The select() function selects a directory entry to evince.
-    // Arguments :
-    // - set   : (input argument) the set to modify
-    // - way   : (return argument) the way to evince
-    /////////////////////////////////////////////////////////////////////
-    DirectoryEntry select(const size_t &set, size_t &way)
-    {
-        assert( (set < m_sets)
-          && "Cache Directory : (select) The set index is invalid");
-
-        // looking for an empty slot
-        for(size_t i=0; i<m_ways; i++)
-        {
-            if( not m_dir_tab[set][i].valid )
-            {
-                way=i;
-                return DirectoryEntry(m_dir_tab[set][way]);
-            }
-        }
+          for (size_t way = 0; way < m_ways; way++)
+          {
+              bool equal = (m_dir_tab[set][way].tag == tag);
+              bool valid = m_dir_tab[set][way].valid;
+              if (equal and valid)
+              {
+                  *ret_set = set;
+                  *ret_way = way;
+                  return DirectoryEntry(m_dir_tab[set][way]);
+              }
+          }
+          return DirectoryEntry();
+      } // end read_neutral()
+
+      /////////////////////////////////////////////////////////////////////
+      // The write function writes a new entry,
+      // and updates the LRU bits if necessary.
+      // Arguments :
+      // - set : the set of the entry
+      // - way : the way of the entry
+      // - entry : the entry value
+      /////////////////////////////////////////////////////////////////////
+      void write(const size_t         &set,
+                 const size_t         &way,
+                 const DirectoryEntry &entry)
+      {
+          assert((set<m_sets)
+                  && "Cache Directory write : The set index is invalid");
+          assert((way<m_ways)
+                  && "Cache Directory write : The way index is invalid");
+
+          // update Directory
+          m_dir_tab[set][way].copy(entry);
+
+          // update LRU bits
+          bool all_recent = true;
+          for (size_t i = 0; i < m_ways; i++)
+          {
+              if (i != way)
+              {
+                  all_recent = m_lru_tab[set][i].recent && all_recent;
+              }
+          }
+          if (all_recent)
+          {
+              for (size_t i = 0; i < m_ways; i++)
+              {
+                  m_lru_tab[set][i].recent = false;
+              }
+          }
+          else
+          {
+              m_lru_tab[set][way].recent = true;
+          }
+      } // end write()
+
+      /////////////////////////////////////////////////////////////////////
+      // The print() function prints a selected directory entry
+      // Arguments :
+      // - set : the set of the entry to print
+      // - way : the way of the entry to print
+      /////////////////////////////////////////////////////////////////////
+      void print(const size_t &set, const size_t &way)
+      {
+          std::cout << std::dec << " set : " << set << " ; way : " << way << " ; ";
+          m_dir_tab[set][way].print();
+      } // end print()
+
+      /////////////////////////////////////////////////////////////////////
+      // The select() function selects a directory entry to evince.
+      // Arguments :
+      // - set   : (input argument) the set to modify
+      // - way   : (return argument) the way to evince
+      /////////////////////////////////////////////////////////////////////
+      DirectoryEntry select(const size_t &set, size_t &way)
+      {
+          assert((set < m_sets)
+                  && "Cache Directory : (select) The set index is invalid");
+
+          // looking for an empty slot
+          for (size_t i = 0; i < m_ways; i++)
+          {
+              if (not m_dir_tab[set][i].valid)
+              {
+                  way = i;
+                  return DirectoryEntry(m_dir_tab[set][way]);
+              }
+          }
 
 #ifdef RANDOM_EVICTION
-        lfsr = (lfsr >> 1) ^ ((-(lfsr & 1)) & 0xd0000001);
-        way = lfsr % m_ways;
-        return DirectoryEntry(m_dir_tab[set][way]);
+          lfsr = (lfsr >> 1) ^ ((-(lfsr & 1)) & 0xd0000001);
+          way = lfsr % m_ways;
+          return DirectoryEntry(m_dir_tab[set][way]);
 #endif
 
-        // looking for a not locked and not recently used entry
-        for(size_t i=0; i<m_ways; i++)
-        {
-            if((not m_lru_tab[set][i].recent) && (not m_dir_tab[set][i].lock) )
-            {
-                way=i;
-                return DirectoryEntry(m_dir_tab[set][way]);
-            }
-        }
-
-        // looking for a locked not recently used entry
-        for(size_t i=0; i<m_ways; i++)
-        {
-            if( (not m_lru_tab[set][i].recent) && (m_dir_tab[set][i].lock))
-            {
-                way=i;
-                return DirectoryEntry(m_dir_tab[set][way]);
-            }
-        }
-
-        // looking for a recently used entry not locked
-        for(size_t i=0; i<m_ways; i++)
-        {
-            if( (m_lru_tab[set][i].recent) && (not m_dir_tab[set][i].lock))
-            {
-                way=i;
-                return DirectoryEntry(m_dir_tab[set][way]);
-            }
-        }
-
-        // select way 0 (even if entry is locked and recently used)
-        way = 0;
-        return DirectoryEntry(m_dir_tab[set][0]);
-    } // end select()
-
-    /////////////////////////////////////////////////////////////////////
-    //               Global initialisation function
-    /////////////////////////////////////////////////////////////////////
-    void init()
-    {
-      for ( size_t set=0 ; set<m_sets ; set++ )
-      {
-        for ( size_t way=0 ; way<m_ways ; way++ )
-        {
-          m_dir_tab[set][way].init();
-          m_lru_tab[set][way].init();
-        }
-      }
-    } // end init()
+          // looking for a not locked and not recently used entry
+          for (size_t i = 0; i < m_ways; i++)
+          {
+              if ((not m_lru_tab[set][i].recent) and (not m_dir_tab[set][i].lock))
+              {
+                  way = i;
+                  return DirectoryEntry(m_dir_tab[set][way]);
+              }
+          }
+
+          // looking for a locked not recently used entry
+          for (size_t i = 0; i < m_ways; i++)
+          {
+              if ((not m_lru_tab[set][i].recent) and (m_dir_tab[set][i].lock))
+              {
+                  way = i;
+                  return DirectoryEntry(m_dir_tab[set][way]);
+              }
+          }
+
+          // looking for a recently used entry not locked
+          for (size_t i = 0; i < m_ways; i++)
+          {
+              if ((m_lru_tab[set][i].recent) and (not m_dir_tab[set][i].lock))
+              {
+                  way = i;
+                  return DirectoryEntry(m_dir_tab[set][way]);
+              }
+          }
+
+          // select way 0 (even if entry is locked and recently used)
+          way = 0;
+          return DirectoryEntry(m_dir_tab[set][0]);
+      } // end select()
+
+      /////////////////////////////////////////////////////////////////////
+      //               Global initialisation function
+      /////////////////////////////////////////////////////////////////////
+      void init()
+      {
+          for (size_t set = 0; set < m_sets; set++)
+          {
+              for (size_t way = 0; way < m_ways; way++)
+              {
+                  m_dir_tab[set][way].init();
+                  m_lru_tab[set][way].init();
+              }
+          }
+      } // end init()
 
   }; // end class CacheDirectory
@@ -425,48 +438,49 @@
   class HeapEntry{
 
-    public:
-    // Fields of the entry
-      Owner     owner;
-      size_t    next;
-
-    ////////////////////////
-    // Constructor
-    ////////////////////////
-      HeapEntry()
-      :owner(false,0)
-      {
-        next = 0;
-      } // end constructor
-
-    ////////////////////////
-    // Constructor
-    ////////////////////////
-      HeapEntry(const HeapEntry &entry)
-      {
-        owner.inst  = entry.owner.inst;
-        owner.srcid = entry.owner.srcid;
-        next        = entry.next;
-      } // end constructor
-
-    /////////////////////////////////////////////////////////////////////
-    // The copy() function copies an existing source entry to a target
-    /////////////////////////////////////////////////////////////////////
-      void copy(const HeapEntry &entry)
-      {
-        owner.inst  = entry.owner.inst;
-        owner.srcid = entry.owner.srcid;
-        next        = entry.next;
-      } // end copy()
-
-    ////////////////////////////////////////////////////////////////////
-    // The print() function prints the entry
-    ////////////////////////////////////////////////////////////////////
-      void print(){
-        std::cout
-        << " -- owner.inst     : " << std::dec << owner.inst << std::endl
-        << " -- owner.srcid    : " << std::dec << owner.srcid << std::endl
-        << " -- next           : " << std::dec << next << std::endl;
-
-      } // end print()
+      public:
+          // Fields of the entry
+          Owner  owner;
+          size_t next;
+
+          ////////////////////////
+          // Constructor
+          ////////////////////////
+          HeapEntry()
+              :owner(false, 0)
+          {
+              next = 0;
+          } // end constructor
+
+          ////////////////////////
+          // Constructor
+          ////////////////////////
+          HeapEntry(const HeapEntry &entry)
+          {
+              owner.inst  = entry.owner.inst;
+              owner.srcid = entry.owner.srcid;
+              next        = entry.next;
+          } // end constructor
+
+          /////////////////////////////////////////////////////////////////////
+          // The copy() function copies an existing source entry to a target
+          /////////////////////////////////////////////////////////////////////
+          void copy(const HeapEntry &entry)
+          {
+              owner.inst  = entry.owner.inst;
+              owner.srcid = entry.owner.srcid;
+              next        = entry.next;
+          } // end copy()
+
+          ////////////////////////////////////////////////////////////////////
+          // The print() function prints the entry
+          ////////////////////////////////////////////////////////////////////
+          void print()
+          {
+              std::cout
+                  << " -- owner.inst     : " << std::dec << owner.inst << std::endl
+                  << " -- owner.srcid    : " << std::dec << owner.srcid << std::endl
+                  << " -- next           : " << std::dec << next << std::endl;
+
+          } // end print()
 
   }; // end class HeapEntry
@@ -477,147 +491,163 @@
   class HeapDirectory{
 
-    private:
-    // Registers and the heap
-      size_t    ptr_free;
-      bool      full;
-      HeapEntry *m_heap_tab;
-
-    // Constants for debugging purpose
-      size_t    tab_size;
-
-    public:
-    ////////////////////////
-    // Constructor
-    ////////////////////////
-      HeapDirectory(uint32_t size){
-        assert(size>0 && "Memory Cache, HeapDirectory constructor : invalid size");
-        ptr_free    = 0;
-        full        = false;
-        m_heap_tab  = new HeapEntry[size];
-        tab_size    = size;
-      } // end constructor
-
-    /////////////////
-    // Destructor
-    /////////////////
-      ~HeapDirectory(){
-        delete [] m_heap_tab;
-      } // end destructor
-
-    /////////////////////////////////////////////////////////////////////
-    //              Global initialisation function
-    /////////////////////////////////////////////////////////////////////
-      void init(){
-        ptr_free=0;
-        full=false;
-        for(size_t i=0; i< tab_size-1;i++){
-          m_heap_tab[i].next = i+1;
-        }
-        m_heap_tab[tab_size-1].next = tab_size-1;
-        return;
-      }
-
-    /////////////////////////////////////////////////////////////////////
-    // The print() function prints a selected directory entry
-    // Arguments :
-    // - ptr : the pointer to the entry to print
-    /////////////////////////////////////////////////////////////////////
-      void print(const size_t &ptr){
-        std::cout << "Heap, printing the entry : " << std::dec << ptr << std::endl;
-        m_heap_tab[ptr].print();
-      } // end print()
-
-    /////////////////////////////////////////////////////////////////////
-    // The print_list() function prints a list from selected directory entry
-    // Arguments :
-    // - ptr : the pointer to the first entry to print
-    /////////////////////////////////////////////////////////////////////
-      void print_list(const size_t &ptr){
-        bool end = false;
-        size_t ptr_temp = ptr;
-        std::cout << "Heap, printing the list from : " << std::dec << ptr << std::endl;
-        while(!end){
-            m_heap_tab[ptr_temp].print();
-            if(ptr_temp == m_heap_tab[ptr_temp].next) end = true;
-            ptr_temp = m_heap_tab[ptr_temp].next;
-        }
-      } // end print_list()
-
-    /////////////////////////////////////////////////////////////////////
-    // The is_full() function return true if the heap is full.
-    /////////////////////////////////////////////////////////////////////
-      bool is_full(){
-        return full;
-      } // end is_full()
-
-    /////////////////////////////////////////////////////////////////////
-    // The next_free_ptr() function returns the pointer
-    // to the next free entry.
-    /////////////////////////////////////////////////////////////////////
-      size_t next_free_ptr(){
-        return ptr_free;
-      } // end next_free_ptr()
-
-    /////////////////////////////////////////////////////////////////////
-    // The next_free_entry() function returns
-    // a copy of the next free entry.
-    /////////////////////////////////////////////////////////////////////
-      HeapEntry next_free_entry(){
-        return HeapEntry(m_heap_tab[ptr_free]);
-      } // end next_free_entry()
-
-    /////////////////////////////////////////////////////////////////////
-    // The write_free_entry() function modify the next free entry.
-    // Arguments :
-    // - entry : the entry to write
-    /////////////////////////////////////////////////////////////////////
-      void write_free_entry(const HeapEntry &entry){
-        m_heap_tab[ptr_free].copy(entry);
-      } // end write_free_entry()
-
-    /////////////////////////////////////////////////////////////////////
-    // The write_free_ptr() function writes the pointer
-    // to the next free entry
-    /////////////////////////////////////////////////////////////////////
-      void write_free_ptr(const size_t &ptr){
-        assert( (ptr<tab_size) && "HeapDirectory error : try to write a wrong free pointer");
-        ptr_free = ptr;
-      } // end write_free_ptr()
-
-    /////////////////////////////////////////////////////////////////////
-    // The set_full() function sets the full bit (to true).
-    /////////////////////////////////////////////////////////////////////
-      void set_full(){
-        full = true;
-      } // end set_full()
-
-    /////////////////////////////////////////////////////////////////////
-    // The unset_full() function unsets the full bit (to false).
-    /////////////////////////////////////////////////////////////////////
-      void unset_full(){
-        full = false;
-      } // end unset_full()
-
-    /////////////////////////////////////////////////////////////////////
-    // The read() function returns a copy of
-    // the entry pointed by the argument
-    // Arguments :
-    //  - ptr : the pointer to the entry to read
-    /////////////////////////////////////////////////////////////////////
-      HeapEntry read(const size_t &ptr){
-        assert( (ptr<tab_size) && "HeapDirectory error : try to write a wrong free pointer");
-        return HeapEntry(m_heap_tab[ptr]);
-      } // end read()
-
-    /////////////////////////////////////////////////////////////////////
-    // The write() function writes an entry in the heap
-    // Arguments :
-    //  - ptr : the pointer to the entry to replace
-    //  - entry : the entry to write
-    /////////////////////////////////////////////////////////////////////
-      void write(const size_t &ptr, const HeapEntry &entry){
-        assert( (ptr<tab_size) && "HeapDirectory error : try to write a wrong free pointer");
-        m_heap_tab[ptr].copy(entry);
-      } // end write()
+      private:
+          // Registers and the heap
+          size_t    ptr_free;
+          bool      full;
+          HeapEntry *m_heap_tab;
+
+          // Constants for debugging purpose
+          size_t    tab_size;
+
+      public:
+          ////////////////////////
+          // Constructor
+          ////////////////////////
+          HeapDirectory(uint32_t size)
+          {
+              assert(size > 0 && "Memory Cache, HeapDirectory constructor : invalid size");
+              ptr_free    = 0;
+              full        = false;
+              m_heap_tab  = new HeapEntry[size];
+              tab_size    = size;
+          } // end constructor
+
+          /////////////////
+          // Destructor
+          /////////////////
+          ~HeapDirectory()
+          {
+              delete [] m_heap_tab;
+          } // end destructor
+
+          /////////////////////////////////////////////////////////////////////
+          //              Global initialisation function
+          /////////////////////////////////////////////////////////////////////
+          void init()
+          {
+              ptr_free = 0;
+              full = false;
+              for (size_t i = 0; i < tab_size - 1; i++) {
+                  m_heap_tab[i].next = i + 1;
+              }
+              m_heap_tab[tab_size - 1].next = tab_size - 1;
+              return;
+          }
+
+          /////////////////////////////////////////////////////////////////////
+          // The print() function prints a selected directory entry
+          // Arguments :
+          // - ptr : the pointer to the entry to print
+          /////////////////////////////////////////////////////////////////////
+          void print(const size_t &ptr)
+          {
+              std::cout << "Heap, printing the entry : " << std::dec << ptr << std::endl;
+              m_heap_tab[ptr].print();
+          } // end print()
+
+          /////////////////////////////////////////////////////////////////////
+          // The print_list() function prints a list from selected directory entry
+          // Arguments :
+          // - ptr : the pointer to the first entry to print
+          /////////////////////////////////////////////////////////////////////
+          void print_list(const size_t &ptr)
+          {
+              bool end = false;
+              size_t ptr_temp = ptr;
+              std::cout << "Heap, printing the list from : " << std::dec << ptr << std::endl;
+              while (!end) {
+                  m_heap_tab[ptr_temp].print();
+                  if (ptr_temp == m_heap_tab[ptr_temp].next) {
+                      end = true;
+                  }
+                  ptr_temp = m_heap_tab[ptr_temp].next;
+              }
+          } // end print_list()
+
+          /////////////////////////////////////////////////////////////////////
+          // The is_full() function return true if the heap is full.
+          /////////////////////////////////////////////////////////////////////
+          bool is_full()
+          {
+              return full;
+          } // end is_full()
+
+          /////////////////////////////////////////////////////////////////////
+          // The next_free_ptr() function returns the pointer
+          // to the next free entry.
+          /////////////////////////////////////////////////////////////////////
+          size_t next_free_ptr()
+          {
+              return ptr_free;
+          } // end next_free_ptr()
+
+          /////////////////////////////////////////////////////////////////////
+          // The next_free_entry() function returns
+          // a copy of the next free entry.
+          /////////////////////////////////////////////////////////////////////
+          HeapEntry next_free_entry()
+          {
+              return HeapEntry(m_heap_tab[ptr_free]);
+          } // end next_free_entry()
+
+          /////////////////////////////////////////////////////////////////////
+          // The write_free_entry() function modify the next free entry.
+          // Arguments :
+          // - entry : the entry to write
+          /////////////////////////////////////////////////////////////////////
+          void write_free_entry(const HeapEntry &entry)
+          {
+              m_heap_tab[ptr_free].copy(entry);
+          } // end write_free_entry()
+
+          /////////////////////////////////////////////////////////////////////
+          // The write_free_ptr() function writes the pointer
+          // to the next free entry
+          /////////////////////////////////////////////////////////////////////
+          void write_free_ptr(const size_t &ptr)
+          {
+              assert((ptr < tab_size) && "HeapDirectory error : try to write a wrong free pointer");
+              ptr_free = ptr;
+          } // end write_free_ptr()
+
+          /////////////////////////////////////////////////////////////////////
+          // The set_full() function sets the full bit (to true).
+          /////////////////////////////////////////////////////////////////////
+          void set_full()
+          {
+              full = true;
+          } // end set_full()
+
+          /////////////////////////////////////////////////////////////////////
+          // The unset_full() function unsets the full bit (to false).
+          /////////////////////////////////////////////////////////////////////
+          void unset_full()
+          {
+              full = false;
+          } // end unset_full()
+
+          /////////////////////////////////////////////////////////////////////
+          // The read() function returns a copy of
+          // the entry pointed by the argument
+          // Arguments :
+          //  - ptr : the pointer to the entry to read
+          /////////////////////////////////////////////////////////////////////
+          HeapEntry read(const size_t &ptr)
+          {
+              assert((ptr < tab_size) && "HeapDirectory error : try to write a wrong free pointer");
+              return HeapEntry(m_heap_tab[ptr]);
+          } // end read()
+
+          /////////////////////////////////////////////////////////////////////
+          // The write() function writes an entry in the heap
+          // Arguments :
+          //  - ptr : the pointer to the entry to replace
+          //  - entry : the entry to write
+          /////////////////////////////////////////////////////////////////////
+          void write(const size_t &ptr, const HeapEntry &entry)
+          {
+              assert((ptr < tab_size) && "HeapDirectory error : try to write a wrong free pointer");
+              m_heap_tab[ptr].copy(entry);
+          } // end write()
 
   }; // end class HeapDirectory
@@ -628,98 +658,98 @@
   class CacheData
   {
-    private:
-      const uint32_t m_sets;
-      const uint32_t m_ways;
-      const uint32_t m_words;
-
-      uint32_t *** m_cache_data;
-
-    public:
-
-      ///////////////////////////////////////////////////////
-      CacheData(uint32_t ways, uint32_t sets, uint32_t words)
-        : m_sets(sets), m_ways(ways), m_words(words)
-      {
-          m_cache_data = new uint32_t ** [ways];
-          for ( size_t i=0 ; i < ways ; i++ )
-          {
-              m_cache_data[i] = new uint32_t * [sets];
-          }
-          for ( size_t i=0; i<ways; i++ )
-          {
-              for ( size_t j=0; j<sets; j++ )
-              {
-                  m_cache_data[i][j] = new uint32_t [words];
-              }
-          }
-      }
-      ////////////
-      ~CacheData()
-      {
-          for(size_t i=0; i<m_ways ; i++)
-          {
-              for(size_t j=0; j<m_sets ; j++)
-              {
-                  delete [] m_cache_data[i][j];
-              }
-          }
-          for(size_t i=0; i<m_ways ; i++)
-          {
-              delete [] m_cache_data[i];
-          }
-          delete [] m_cache_data;
-      }
-      //////////////////////////////////////////
-      uint32_t read ( const uint32_t &way,
-                      const uint32_t &set,
-                      const uint32_t &word) const
-      {
-          assert((set  < m_sets ) && "Cache data error: Trying to read a wrong set" );
-          assert((way  < m_ways ) && "Cache data error: Trying to read a wrong way" );
-          assert((word < m_words) && "Cache data error: Trying to read a wrong word");
-
-          return m_cache_data[way][set][word];
-      }
-      //////////////////////////////////////////
-      void read_line( const uint32_t &way,
-                      const uint32_t &set,
-                      sc_core::sc_signal<uint32_t> * cache_line)
-      {
-          assert((set < m_sets ) && "Cache data error: Trying to read a wrong set" );
-          assert((way < m_ways ) && "Cache data error: Trying to read a wrong way" );
-
-          for (uint32_t word=0; word<m_words; word++)
-              cache_line[word].write(m_cache_data[way][set][word]);
-      }
-      /////////////////////////////////////////
-      void write ( const uint32_t &way,
-                   const uint32_t &set,
-                   const uint32_t &word,
-                   const uint32_t &data,
-                   const uint32_t &be = 0xF)
-      {
-
-          assert((set  < m_sets ) && "Cache data error: Trying to write a wrong set" );
-          assert((way  < m_ways ) && "Cache data error: Trying to write a wrong way" );
-          assert((word < m_words) && "Cache data error: Trying to write a wrong word");
-          assert((be  <= 0xF    ) && "Cache data error: Trying to write a wrong be");
-
-          if (be == 0x0) return;
-
-          if (be == 0xF)
-          {
-              m_cache_data[way][set][word] = data;
-              return;
-          }
-
-          uint32_t mask = 0;
-          if  (be & 0x1) mask = mask | 0x000000FF;
-          if  (be & 0x2) mask = mask | 0x0000FF00;
-          if  (be & 0x4) mask = mask | 0x00FF0000;
-          if  (be & 0x8) mask = mask | 0xFF000000;
-
-          m_cache_data[way][set][word] =
-              (data & mask) | (m_cache_data[way][set][word] & ~mask);
-      }
+      private:
+          const uint32_t m_sets;
+          const uint32_t m_ways;
+          const uint32_t m_words;
+
+          uint32_t *** m_cache_data;
+
+      public:
+
+          ///////////////////////////////////////////////////////
+          CacheData(uint32_t ways, uint32_t sets, uint32_t words)
+              : m_sets(sets), m_ways(ways), m_words(words)
+          {
+              m_cache_data = new uint32_t ** [ways];
+              for (size_t i = 0; i < ways; i++)
+              {
+                  m_cache_data[i] = new uint32_t * [sets];
+              }
+              for (size_t i = 0; i < ways; i++)
+              {
+                  for (size_t j = 0; j < sets; j++)
+                  {
+                      m_cache_data[i][j] = new uint32_t [words];
+                  }
+              }
+          }
+          ////////////
+          ~CacheData()
+          {
+              for (size_t i = 0; i < m_ways; i++)
+              {
+                  for (size_t j = 0; j < m_sets; j++)
+                  {
+                      delete [] m_cache_data[i][j];
+                  }
+              }
+              for (size_t i = 0; i < m_ways; i++)
+              {
+                  delete [] m_cache_data[i];
+              }
+              delete [] m_cache_data;
+          }
+          //////////////////////////////////////////
+          uint32_t read(const uint32_t &way,
+                        const uint32_t &set,
+                        const uint32_t &word) const
+          {
+              assert((set  < m_sets ) && "Cache data error: Trying to read a wrong set");
+              assert((way  < m_ways ) && "Cache data error: Trying to read a wrong way");
+              assert((word < m_words) && "Cache data error: Trying to read a wrong word");
+
+              return m_cache_data[way][set][word];
+          }
+          //////////////////////////////////////////
+          void read_line(const uint32_t &way,
+                         const uint32_t &set,
+                         sc_core::sc_signal<uint32_t> * cache_line)
+          {
+              assert((set < m_sets) && "Cache data error: Trying to read a wrong set");
+              assert((way < m_ways) && "Cache data error: Trying to read a wrong way");
+
+              for (uint32_t word = 0; word < m_words; word++) {
+                  cache_line[word].write(m_cache_data[way][set][word]);
+              }
+          }
+          /////////////////////////////////////////
+          void write(const uint32_t &way,
+                     const uint32_t &set,
+                     const uint32_t &word,
+                     const uint32_t &data,
+                     const uint32_t &be = 0xF)
+          {
+              assert((set  < m_sets ) && "Cache data error: Trying to write a wrong set");
+              assert((way  < m_ways ) && "Cache data error: Trying to write a wrong way");
+              assert((word < m_words) && "Cache data error: Trying to write a wrong word");
+              assert((be  <= 0xF    ) && "Cache data error: Trying to write a wrong be");
+
+              if (be == 0x0) return;
+
+              if (be == 0xF)
+              {
+                  m_cache_data[way][set][word] = data;
+                  return;
+              }
+
+              uint32_t mask = 0;
+              if (be & 0x1) mask = mask | 0x000000FF;
+              if (be & 0x2) mask = mask | 0x0000FF00;
+              if (be & 0x4) mask = mask | 0x00FF0000;
+              if (be & 0x8) mask = mask | 0xFF000000;
+
+              m_cache_data[way][set][word] =
+                  (data & mask) | (m_cache_data[way][set][word] & ~mask);
+          }
   }; // end class CacheData
 
Index: branches/RWT/modules/vci_mem_cache/caba/source/include/update_tab.h
===================================================================
--- branches/RWT/modules/vci_mem_cache/caba/source/include/update_tab.h	(revision 814)
+++ branches/RWT/modules/vci_mem_cache/caba/source/include/update_tab.h	(revision 823)
@@ -12,123 +12,123 @@
 class UpdateTabEntry {
 
-  typedef uint32_t size_t;
-  typedef sc_dt::sc_uint<40> addr_t;
-
-  public:
-
-  bool   valid;   // It is a valid pending transaction
-  bool   update;  // It is an update transaction
-  bool   brdcast; // It is a broadcast invalidate
-  bool   rsp;     // Response to the initiator required
-  bool   ack;     // Acknowledge to the CONFIG FSM required
-  size_t srcid;   // The srcid of the initiator which wrote the data
-  size_t trdid;   // The trdid of the initiator which wrote the data
-  size_t pktid;   // The pktid of the initiator which wrote the data
-  addr_t nline;   // The identifier of the cache line
-  size_t count;   // The number of acknowledge responses to receive
-
-  UpdateTabEntry()
-  {
-    valid   = false;
-    update  = false;
-    brdcast = false;
-    rsp     = false;
-    ack     = false;
-    srcid   = 0;
-    trdid   = 0;
-    pktid   = 0;
-    nline   = 0;
-    count   = 0;
-  }
-
-  UpdateTabEntry(bool   i_valid,
-                 bool   i_update,
-                 bool   i_brdcast,
-                 bool   i_rsp,
-                 bool   i_ack,
-                 size_t i_srcid,
-                 size_t i_trdid,
-                 size_t i_pktid,
-                 addr_t i_nline,
-                 size_t i_count)
-  {
-    valid   = i_valid;
-    update  = i_update;
-    brdcast = i_brdcast;
-    rsp     = i_rsp;
-    ack     = i_ack;
-    srcid   = i_srcid;
-    trdid   = i_trdid;
-    pktid   = i_pktid;
-    nline   = i_nline;
-    count   = i_count;
-  }
-
-  UpdateTabEntry(const UpdateTabEntry &source)
-  {
-    valid   = source.valid;
-    update  = source.update;
-    brdcast = source.brdcast;
-    rsp     = source.rsp;
-    ack     = source.ack;
-    srcid   = source.srcid;
-    trdid   = source.trdid;
-    pktid   = source.pktid;
-    nline   = source.nline;
-    count   = source.count;
-  }
-
-  ////////////////////////////////////////////////////
-  // The init() function initializes the entry
-  ///////////////////////////////////////////////////
-  void init()
-  {
-    valid   = false;
-    update  = false;
-    brdcast = false;
-    rsp     = false;
-    ack     = false;
-    srcid   = 0;
-    trdid   = 0;
-    pktid   = 0;
-    nline   = 0;
-    count   = 0;
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // The copy() function copies an existing entry
-  // Its arguments are :
-  // - source : the update tab entry to copy
-  ////////////////////////////////////////////////////////////////////
-  void copy(const UpdateTabEntry &source)
-  {
-    valid  = source.valid;
-    update = source.update;
-    brdcast= source.brdcast;
-    rsp    = source.rsp;
-    ack    = source.ack  ;
-    srcid  = source.srcid;
-    trdid  = source.trdid;
-    pktid  = source.pktid;
-    nline  = source.nline;
-    count  = source.count;
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // The print() function prints the entry
-  ////////////////////////////////////////////////////////////////////
-  void print()
-  {
-    std::cout << " val = " << std::dec << valid
-              << " / updt = " << update
-              << " / bc = " << brdcast
-              << " / rsp = " << rsp
-              << " / ack = " << ack
-              << " / count = " << count
-              << " / srcid = " << std::hex << srcid
-              << " / trdid = " << trdid
-              << " / pktid = " << pktid
-              << " / nline = " << nline  << std::endl;
-  }
+    typedef uint32_t size_t;
+    typedef sc_dt::sc_uint<40> addr_t;
+
+    public:
+
+    bool   valid;   // It is a valid pending transaction
+    bool   update;  // It is an update transaction
+    bool   brdcast; // It is a broadcast invalidate
+    bool   rsp;     // Response to the initiator required
+    bool   ack;     // Acknowledge to the CONFIG FSM required
+    size_t srcid;   // The srcid of the initiator which wrote the data
+    size_t trdid;   // The trdid of the initiator which wrote the data
+    size_t pktid;   // The pktid of the initiator which wrote the data
+    addr_t nline;   // The identifier of the cache line
+    size_t count;   // The number of acknowledge responses to receive
+
+    UpdateTabEntry()
+    {
+        valid   = false;
+        update  = false;
+        brdcast = false;
+        rsp     = false;
+        ack     = false;
+        srcid   = 0;
+        trdid   = 0;
+        pktid   = 0;
+        nline   = 0;
+        count   = 0;
+    }
+
+    UpdateTabEntry(bool   i_valid,
+                   bool   i_update,
+                   bool   i_brdcast,
+                   bool   i_rsp,
+                   bool   i_ack,
+                   size_t i_srcid,
+                   size_t i_trdid,
+                   size_t i_pktid,
+                   addr_t i_nline,
+                   size_t i_count)
+    {
+        valid   = i_valid;
+        update  = i_update;
+        brdcast = i_brdcast;
+        rsp     = i_rsp;
+        ack     = i_ack;
+        srcid   = i_srcid;
+        trdid   = i_trdid;
+        pktid   = i_pktid;
+        nline   = i_nline;
+        count   = i_count;
+    }
+
+    UpdateTabEntry(const UpdateTabEntry &source)
+    {
+        valid   = source.valid;
+        update  = source.update;
+        brdcast = source.brdcast;
+        rsp     = source.rsp;
+        ack     = source.ack;
+        srcid   = source.srcid;
+        trdid   = source.trdid;
+        pktid   = source.pktid;
+        nline   = source.nline;
+        count   = source.count;
+    }
+
+    ////////////////////////////////////////////////////
+    // The init() function initializes the entry
+    ///////////////////////////////////////////////////
+    void init()
+    {
+        valid   = false;
+        update  = false;
+        brdcast = false;
+        rsp     = false;
+        ack     = false;
+        srcid   = 0;
+        trdid   = 0;
+        pktid   = 0;
+        nline   = 0;
+        count   = 0;
+    }
+
+    ////////////////////////////////////////////////////////////////////
+    // The copy() function copies an existing entry
+    // Its arguments are :
+    // - source : the update tab entry to copy
+    ////////////////////////////////////////////////////////////////////
+    void copy(const UpdateTabEntry &source)
+    {
+        valid   = source.valid;
+        update  = source.update;
+        brdcast = source.brdcast;
+        rsp     = source.rsp;
+        ack     = source.ack;
+        srcid   = source.srcid;
+        trdid   = source.trdid;
+        pktid   = source.pktid;
+        nline   = source.nline;
+        count   = source.count;
+    }
+
+    ////////////////////////////////////////////////////////////////////
+    // The print() function prints the entry
+    ////////////////////////////////////////////////////////////////////
+    void print()
+    {
+        std::cout << " val = " << std::dec << valid
+                  << " / updt = " << update
+                  << " / bc = " << brdcast
+                  << " / rsp = " << rsp
+                  << " / ack = " << ack
+                  << " / count = " << count
+                  << " / srcid = " << std::hex << srcid
+                  << " / trdid = " << trdid
+                  << " / pktid = " << pktid
+                  << " / nline = " << nline << std::endl;
+    }
 };
 
@@ -138,295 +138,304 @@
 class UpdateTab{
 
-  typedef uint64_t addr_t;
-
-  private:
-  size_t                      size_tab;
-  std::vector<UpdateTabEntry> tab;
-
-  public:
-
-  UpdateTab()
-    : tab(0)
-  {
-    size_tab=0;
-  }
-
-  UpdateTab(size_t size_tab_i)
-    : tab(size_tab_i)
-  {
-    size_tab=size_tab_i;
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // The size() function returns the size of the tab
-  ////////////////////////////////////////////////////////////////////
-  const size_t size()
-  {
-    return size_tab;
-  }
-
-  ////////////////////////////////////////////////////////////////////
-  // The print() function diplays the tab content
-  ////////////////////////////////////////////////////////////////////
-  void print()
-  {
-    std::cout << "UPDATE TABLE Content" << std::endl;
-    for(size_t i=0; i<size_tab; i++)
-    {
-      std::cout << "[" << std::dec << i << "] ";
-      tab[i].print();
-    }
-    return;
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The init() function initializes the tab
-  /////////////////////////////////////////////////////////////////////
-  void init()
-  {
-    for ( size_t i=0; i<size_tab; i++) tab[i].init();
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The reads() function reads an entry
-  // Arguments :
-  // - entry : the entry to read
-  // This function returns a copy of the entry.
-  /////////////////////////////////////////////////////////////////////
-  UpdateTabEntry read (size_t entry)
-  {
-    assert(entry<size_tab && "Bad Update Tab Entry");
-    return UpdateTabEntry(tab[entry]);
-  }
-
-  ///////////////////////////////////////////////////////////////////////////
-  // The set() function writes an entry in the Update Table
-  // Arguments :
-  // - update : transaction type (bool)
-  // - srcid : srcid of the initiator
-  // - trdid : trdid of the initiator
-  // - pktid : pktid of the initiator
-  // - count : number of expected responses
-  // - index : (return argument) index of the selected entry
-  // This function returns true if the write successed (an entry was empty).
-  ///////////////////////////////////////////////////////////////////////////
-  bool set(const bool   update,
-           const bool   brdcast,
-           const bool   rsp,
-           const bool   ack,
-           const size_t srcid,
-           const size_t trdid,
-           const size_t pktid,
-           const addr_t nline,
-           const size_t count,
-           size_t       &index)
-  {
-    for ( size_t i=0 ; i<size_tab ; i++ )
-    {
-      if( !tab[i].valid )
-      {
-        tab[i].valid   = true;
-        tab[i].update  = update;
-        tab[i].brdcast = brdcast;
-        tab[i].rsp     = rsp;
-        tab[i].ack     = ack;
-        tab[i].srcid   = (size_t) srcid;
-        tab[i].trdid   = (size_t) trdid;
-        tab[i].pktid   = (size_t) pktid;
-        tab[i].nline   = (addr_t) nline;
-        tab[i].count   = (size_t) count;
-        index          = i;
+    typedef uint64_t addr_t;
+
+    private:
+    size_t size_tab;
+    std::vector<UpdateTabEntry> tab;
+
+    public:
+
+    UpdateTab()
+        : tab(0)
+    {
+        size_tab = 0;
+    }
+
+    UpdateTab(size_t size_tab_i)
+        : tab(size_tab_i)
+    {
+        size_tab = size_tab_i;
+    }
+
+    ////////////////////////////////////////////////////////////////////
+    // The size() function returns the size of the tab
+    ////////////////////////////////////////////////////////////////////
+    const size_t size()
+    {
+        return size_tab;
+    }
+
+    ////////////////////////////////////////////////////////////////////
+    // The print() function diplays the tab content
+    ////////////////////////////////////////////////////////////////////
+    void print()
+    {
+        std::cout << "UPDATE TABLE Content" << std::endl;
+        for (size_t i = 0; i < size_tab; i++)
+        {
+            std::cout << "[" << std::dec << i << "] ";
+            tab[i].print();
+        }
+        return;
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The init() function initializes the tab
+    /////////////////////////////////////////////////////////////////////
+    void init()
+    {
+        for (size_t i = 0; i < size_tab; i++)
+        {
+            tab[i].init();
+        }
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The reads() function reads an entry
+    // Arguments :
+    // - entry : the entry to read
+    // This function returns a copy of the entry.
+    /////////////////////////////////////////////////////////////////////
+    UpdateTabEntry read(size_t entry)
+    {
+        assert(entry < size_tab && "Bad Update Tab Entry");
+        return UpdateTabEntry(tab[entry]);
+    }
+
+    ///////////////////////////////////////////////////////////////////////////
+    // The set() function writes an entry in the Update Table
+    // Arguments :
+    // - update : transaction type (bool)
+    // - srcid : srcid of the initiator
+    // - trdid : trdid of the initiator
+    // - pktid : pktid of the initiator
+    // - count : number of expected responses
+    // - index : (return argument) index of the selected entry
+    // This function returns true if the write successed (an entry was empty).
+    ///////////////////////////////////////////////////////////////////////////
+    bool set(const bool   update,
+             const bool   brdcast,
+             const bool   rsp,
+             const bool   ack,
+             const size_t srcid,
+             const size_t trdid,
+             const size_t pktid,
+             const addr_t nline,
+             const size_t count,
+             size_t       &index)
+    {
+        for (size_t i = 0; i < size_tab; i++)
+        {
+            if (!tab[i].valid)
+            {
+                tab[i].valid   = true;
+                tab[i].update  = update;
+                tab[i].brdcast = brdcast;
+                tab[i].rsp     = rsp;
+                tab[i].ack     = ack;
+                tab[i].srcid   = (size_t) srcid;
+                tab[i].trdid   = (size_t) trdid;
+                tab[i].pktid   = (size_t) pktid;
+                tab[i].nline   = (addr_t) nline;
+                tab[i].count   = (size_t) count;
+                index          = i;
+                return true;
+            }
+        }
+        return false;
+    } // end set()
+
+    /////////////////////////////////////////////////////////////////////
+    // The decrement() function decrements the counter for a given entry.
+    // Arguments :
+    // - index   : the index of the entry
+    // - counter : (return argument) value of the counter after decrement
+    // This function returns true if the entry is valid.
+    /////////////////////////////////////////////////////////////////////
+    bool decrement(const size_t index,
+                   size_t       &counter)
+    {
+        assert((index < size_tab) && "Bad Update Tab Entry");
+        if (tab[index].valid)
+        {
+            tab[index].count--;
+            counter = tab[index].count;
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The is_full() function returns true if the table is full
+    /////////////////////////////////////////////////////////////////////
+    bool is_full()
+    {
+        for (size_t i = 0; i < size_tab; i++)
+        {
+            if (!tab[i].valid)
+            {
+                return false;
+            }
+        }
         return true;
-      }
-    }
-    return false;
-  } // end set()
-
-  /////////////////////////////////////////////////////////////////////
-  // The decrement() function decrements the counter for a given entry.
-  // Arguments :
-  // - index   : the index of the entry
-  // - counter : (return argument) value of the counter after decrement
-  // This function returns true if the entry is valid.
-  /////////////////////////////////////////////////////////////////////
-  bool decrement( const size_t index,
-                  size_t &counter )
-  {
-    assert((index<size_tab) && "Bad Update Tab Entry");
-    if ( tab[index].valid )
-    {
-      tab[index].count--;
-      counter = tab[index].count;
-      return true;
-    }
-    else
-    {
-      return false;
-    }
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The is_full() function returns true if the table is full
-  /////////////////////////////////////////////////////////////////////
-  bool is_full()
-  {
-    for(size_t i = 0 ; i < size_tab ; i++)
-    {
-      if(!tab[i].valid) return false;
-    }
-    return true;
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The is_not_empty() function returns true if the table is not empty
-  /////////////////////////////////////////////////////////////////////
-  bool is_not_empty()
-  {
-    for(size_t i = 0 ; i < size_tab ; i++)
-    {
-      if(tab[i].valid) return true;
-    }
-    return false;
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The need_rsp() function returns the need of a response
-  // Arguments :
-  // - index : the index of the entry
-  /////////////////////////////////////////////////////////////////////
-  bool need_rsp(const size_t index)
-  {
-    assert(index<size_tab && "Bad Update Tab Entry");
-    return tab[index].rsp;
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The need_ack() function returns the need of an acknowledge
-  // Arguments :
-  // - index : the index of the entry
-  /////////////////////////////////////////////////////////////////////
-  bool need_ack(const size_t index)
-  {
-    assert(index<size_tab && "Bad Update Tab Entry");
-    return tab[index].ack;
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The is_brdcast() function returns the transaction type
-  // Arguments :
-  // - index : the index of the entry
-  /////////////////////////////////////////////////////////////////////
-  bool is_brdcast(const size_t index)
-  {
-    assert(index<size_tab && "Bad Update Tab Entry");
-    return tab[index].brdcast;
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The is_update() function returns the transaction type
-  // Arguments :
-  // - index : the index of the entry
-  /////////////////////////////////////////////////////////////////////
-  bool is_update(const size_t index)
-  {
-    assert(index<size_tab && "Bad Update Tab Entry");
-    return tab[index].update;
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The srcid() function returns the srcid value
-  // Arguments :
-  // - index : the index of the entry
-  /////////////////////////////////////////////////////////////////////
-  size_t srcid(const size_t index)
-  {
-    assert(index<size_tab && "Bad Update Tab Entry");
-    return tab[index].srcid;
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The trdid() function returns the trdid value
-  // Arguments :
-  // - index : the index of the entry
-  /////////////////////////////////////////////////////////////////////
-  size_t trdid(const size_t index)
-  {
-    assert(index<size_tab && "Bad Update Tab Entry");
-    return tab[index].trdid;
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The pktid() function returns the pktid value
-  // Arguments :
-  // - index : the index of the entry
-  /////////////////////////////////////////////////////////////////////
-  size_t pktid(const size_t index)
-  {
-    assert(index<size_tab && "Bad Update Tab Entry");
-    return tab[index].pktid;
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The nline() function returns the nline value
-  // Arguments :
-  // - index : the index of the entry
-  /////////////////////////////////////////////////////////////////////
-  addr_t nline(const size_t index)
-  {
-    assert(index<size_tab && "Bad Update Tab Entry");
-    return tab[index].nline;
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The search_inval() function returns the index of the entry in UPT
-  // Arguments :
-  // - nline : the line number of the entry in the directory
-  /////////////////////////////////////////////////////////////////////
-  bool search_inval(const addr_t nline,size_t &index)
-  {
-    size_t i ;
-
-    for (i = 0 ; i < size_tab ; i++)
-    {
-      if ( (tab[i].nline == nline) and tab[i].valid and not tab[i].update )
-      {
-        index = i ;
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The read_nline() function returns the index of the entry in UPT
-  // Arguments :
-  // - nline : the line number of the entry in the directory
-  /////////////////////////////////////////////////////////////////////
-  bool read_nline(const addr_t nline,size_t &index)
-  {
-    size_t i ;
-
-    for (i = 0 ; i < size_tab ; i++)
-    {
-      if ( (tab[i].nline == nline) and tab[i].valid )
-      {
-        index = i ;
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /////////////////////////////////////////////////////////////////////
-  // The clear() function erases an entry of the tab
-  // Arguments :
-  // - index : the index of the entry
-  /////////////////////////////////////////////////////////////////////
-  void clear(const size_t index)
-  {
-    assert(index<size_tab && "Bad Update Tab Entry");
-    tab[index].valid=false;
-    return;
-  }
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The is_not_empty() function returns true if the table is not empty
+    /////////////////////////////////////////////////////////////////////
+    bool is_not_empty()
+    {
+        for (size_t i = 0; i < size_tab; i++)
+        {
+            if (tab[i].valid)
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The need_rsp() function returns the need of a response
+    // Arguments :
+    // - index : the index of the entry
+    /////////////////////////////////////////////////////////////////////
+    bool need_rsp(const size_t index)
+    {
+        assert(index < size_tab && "Bad Update Tab Entry");
+        return tab[index].rsp;
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The need_ack() function returns the need of an acknowledge
+    // Arguments :
+    // - index : the index of the entry
+    /////////////////////////////////////////////////////////////////////
+    bool need_ack(const size_t index)
+    {
+        assert(index < size_tab && "Bad Update Tab Entry");
+        return tab[index].ack;
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The is_brdcast() function returns the transaction type
+    // Arguments :
+    // - index : the index of the entry
+    /////////////////////////////////////////////////////////////////////
+    bool is_brdcast(const size_t index)
+    {
+        assert(index < size_tab && "Bad Update Tab Entry");
+        return tab[index].brdcast;
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The is_update() function returns the transaction type
+    // Arguments :
+    // - index : the index of the entry
+    /////////////////////////////////////////////////////////////////////
+    bool is_update(const size_t index)
+    {
+        assert(index < size_tab && "Bad Update Tab Entry");
+        return tab[index].update;
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The srcid() function returns the srcid value
+    // Arguments :
+    // - index : the index of the entry
+    /////////////////////////////////////////////////////////////////////
+    size_t srcid(const size_t index)
+    {
+        assert(index < size_tab && "Bad Update Tab Entry");
+        return tab[index].srcid;
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The trdid() function returns the trdid value
+    // Arguments :
+    // - index : the index of the entry
+    /////////////////////////////////////////////////////////////////////
+    size_t trdid(const size_t index)
+    {
+        assert(index < size_tab && "Bad Update Tab Entry");
+        return tab[index].trdid;
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The pktid() function returns the pktid value
+    // Arguments :
+    // - index : the index of the entry
+    /////////////////////////////////////////////////////////////////////
+    size_t pktid(const size_t index)
+    {
+        assert(index < size_tab && "Bad Update Tab Entry");
+        return tab[index].pktid;
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The nline() function returns the nline value
+    // Arguments :
+    // - index : the index of the entry
+    /////////////////////////////////////////////////////////////////////
+    addr_t nline(const size_t index)
+    {
+        assert(index < size_tab && "Bad Update Tab Entry");
+        return tab[index].nline;
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The search_inval() function returns the index of the entry in UPT
+    // Arguments :
+    // - nline : the line number of the entry in the directory
+    /////////////////////////////////////////////////////////////////////
+    bool search_inval(const addr_t nline, size_t &index)
+    {
+        size_t i;
+
+        for (i = 0; i < size_tab; i++)
+        {
+            if ((tab[i].nline == nline) and tab[i].valid and not tab[i].update)
+            {
+                index = i;
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The read_nline() function returns the index of the entry in UPT
+    // Arguments :
+    // - nline : the line number of the entry in the directory
+    /////////////////////////////////////////////////////////////////////
+    bool read_nline(const addr_t nline, size_t &index)
+    {
+        size_t i;
+
+        for (i = 0; i < size_tab; i++)
+        {
+            if ((tab[i].nline == nline) and tab[i].valid)
+            {
+                index = i;
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // The clear() function erases an entry of the tab
+    // Arguments :
+    // - index : the index of the entry
+    /////////////////////////////////////////////////////////////////////
+    void clear(const size_t index)
+    {
+        assert(index < size_tab && "Bad Update Tab Entry");
+        tab[index].valid = false;
+        return;
+    }
 
 };
Index: branches/RWT/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
===================================================================
--- branches/RWT/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h	(revision 814)
+++ branches/RWT/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h	(revision 823)
@@ -69,10 +69,10 @@
     : public soclib::caba::BaseModule
     {
-      typedef typename vci_param_int::fast_addr_t  addr_t;
-      typedef typename sc_dt::sc_uint<64>          wide_data_t;
-      typedef uint32_t                             data_t;
-      typedef uint32_t                             tag_t;
-      typedef uint32_t                             be_t;
-      typedef uint32_t                             copy_t;
+      typedef typename vci_param_int::fast_addr_t addr_t;
+      typedef typename sc_dt::sc_uint<64>         wide_data_t;
+      typedef uint32_t                            data_t;
+      typedef uint32_t                            tag_t;
+      typedef uint32_t                            be_t;
+      typedef uint32_t                            copy_t;
 
       /* States of the TGT_CMD fsm */
@@ -113,5 +113,4 @@
         CC_RECEIVE_IDLE,
         CC_RECEIVE_CLEANUP,
-        CC_RECEIVE_CLEANUP_EOP,
         CC_RECEIVE_MULTI_ACK
       };
@@ -232,5 +231,4 @@
       {
         IXR_RSP_IDLE,
-        IXR_RSP_ACK,
         IXR_RSP_TRT_ERASE,
         IXR_RSP_TRT_READ
@@ -399,12 +397,12 @@
           //  b1 accÃšs table llsc type SW / other
           //  b2 WRITE/CAS/LL/SC
-          TYPE_READ_DATA_UNC   = 0x0,
-          TYPE_READ_DATA_MISS  = 0x1,
-          TYPE_READ_INS_UNC    = 0x2,
-          TYPE_READ_INS_MISS   = 0x3,
-          TYPE_WRITE           = 0x4,
-          TYPE_CAS             = 0x5,
-          TYPE_LL              = 0x6,
-          TYPE_SC              = 0x7
+          TYPE_READ_DATA_UNC  = 0x0,
+          TYPE_READ_DATA_MISS = 0x1,
+          TYPE_READ_INS_UNC   = 0x2,
+          TYPE_READ_INS_MISS  = 0x3,
+          TYPE_WRITE          = 0x4,
+          TYPE_CAS            = 0x5,
+          TYPE_LL             = 0x6,
+          TYPE_SC             = 0x7
       };
 
@@ -425,55 +423,55 @@
 
       // instrumentation counters
-      uint32_t m_cpt_cycles;        // Counter of cycles
+      uint32_t m_cpt_cycles;                  // Counter of cycles
 
       // Counters accessible in software (not yet but eventually) and tagged
-      uint32_t m_cpt_reset_count;    // Last cycle at which counters have been reset
-      uint32_t m_cpt_read_local;     // Number of local READ transactions
-      uint32_t m_cpt_read_remote;    // number of remote READ transactions
-      uint32_t m_cpt_read_cost;      // Number of (flits * distance) for READs
-
-      uint32_t m_cpt_write_local;    // Number of local WRITE transactions
-      uint32_t m_cpt_write_remote;   // number of remote WRITE transactions
-      uint32_t m_cpt_write_flits_local;  // number of flits for local WRITEs
-      uint32_t m_cpt_write_flits_remote; // number of flits for remote WRITEs
-      uint32_t m_cpt_write_cost;     // Number of (flits * distance) for WRITEs
-      uint32_t m_cpt_write_ncc_miss;   // Number of write on ncc line
-
-      uint32_t m_cpt_ll_local;       // Number of local LL transactions
-      uint32_t m_cpt_ll_remote;      // number of remote LL transactions
-      uint32_t m_cpt_ll_cost;        // Number of (flits * distance) for LLs
-
-      uint32_t m_cpt_sc_local;       // Number of local SC transactions
-      uint32_t m_cpt_sc_remote;      // number of remote SC transactions
-      uint32_t m_cpt_sc_cost;        // Number of (flits * distance) for SCs
-
-      uint32_t m_cpt_cas_local;      // Number of local SC transactions
-      uint32_t m_cpt_cas_remote;     // number of remote SC transactions
-      uint32_t m_cpt_cas_cost;       // Number of (flits * distance) for SCs
-
-      uint32_t m_cpt_update;         // Number of requests causing an UPDATE
-      uint32_t m_cpt_update_local;   // Number of local UPDATE transactions
-      uint32_t m_cpt_update_remote;  // Number of remote UPDATE transactions
-      uint32_t m_cpt_update_cost;    // Number of (flits * distance) for UPDT
-
-      uint32_t m_cpt_minval;         // Number of requests causing M_INV
-      uint32_t m_cpt_minval_local;   // Number of local M_INV transactions
-      uint32_t m_cpt_minval_remote;  // Number of remote M_INV transactions
-      uint32_t m_cpt_minval_cost;    // Number of (flits * distance) for M_INV
-
-      uint32_t m_cpt_binval;         // Number of BROADCAST INVAL
-
-      uint32_t m_cpt_cleanup_local;  // Number of local CLEANUP transactions (all cleanup types)
-      uint32_t m_cpt_cleanup_remote; // Number of remote CLEANUP transactions (all cleanup types)
-      uint32_t m_cpt_cleanup_cost;   // Number of (flits * distance) for CLEANUPs (all types)
+      uint32_t m_cpt_reset_count;             // Last cycle at which counters have been reset
+      uint32_t m_cpt_read_local;              // Number of local READ transactions
+      uint32_t m_cpt_read_remote;             // number of remote READ transactions
+      uint32_t m_cpt_read_cost;               // Number of (flits * distance) for READs
+
+      uint32_t m_cpt_write_local;             // Number of local WRITE transactions
+      uint32_t m_cpt_write_remote;            // number of remote WRITE transactions
+      uint32_t m_cpt_write_flits_local;       // number of flits for local WRITEs
+      uint32_t m_cpt_write_flits_remote;      // number of flits for remote WRITEs
+      uint32_t m_cpt_write_cost;              // Number of (flits * distance) for WRITEs
+      uint32_t m_cpt_write_ncc_miss;          // Number of write on ncc line
+
+      uint32_t m_cpt_ll_local;                // Number of local LL transactions
+      uint32_t m_cpt_ll_remote;               // number of remote LL transactions
+      uint32_t m_cpt_ll_cost;                 // Number of (flits * distance) for LLs
+
+      uint32_t m_cpt_sc_local;                // Number of local SC transactions
+      uint32_t m_cpt_sc_remote;               // number of remote SC transactions
+      uint32_t m_cpt_sc_cost;                 // Number of (flits * distance) for SCs
+
+      uint32_t m_cpt_cas_local;               // Number of local SC transactions
+      uint32_t m_cpt_cas_remote;              // number of remote SC transactions
+      uint32_t m_cpt_cas_cost;                // Number of (flits * distance) for SCs
+
+      uint32_t m_cpt_update;                  // Number of requests causing an UPDATE
+      uint32_t m_cpt_update_local;            // Number of local UPDATE transactions
+      uint32_t m_cpt_update_remote;           // Number of remote UPDATE transactions
+      uint32_t m_cpt_update_cost;             // Number of (flits * distance) for UPDT
+
+      uint32_t m_cpt_minval;                  // Number of requests causing M_INV
+      uint32_t m_cpt_minval_local;            // Number of local M_INV transactions
+      uint32_t m_cpt_minval_remote;           // Number of remote M_INV transactions
+      uint32_t m_cpt_minval_cost;             // Number of (flits * distance) for M_INV
+
+      uint32_t m_cpt_binval;                  // Number of BROADCAST INVAL
+
+      uint32_t m_cpt_cleanup_local;           // Number of local CLEANUP transactions (all cleanup types)
+      uint32_t m_cpt_cleanup_remote;          // Number of remote CLEANUP transactions (all cleanup types)
+      uint32_t m_cpt_cleanup_cost;            // Number of (flits * distance) for CLEANUPs (all types)
 
       // Counters not accessible by software, but tagged
-      uint32_t m_cpt_read_miss;       // Number of MISS READ
-      uint32_t m_cpt_write_miss;      // Number of MISS WRITE
-      uint32_t m_cpt_write_dirty;     // Cumulated length for WRITE transactions
-      uint32_t m_cpt_write_broadcast; // Number of BROADCAST INVAL because write
-
-      uint32_t m_cpt_trt_rb;          // Read blocked by a hit in trt
-      uint32_t m_cpt_trt_full;        // Transaction blocked due to a full trt
+      uint32_t m_cpt_read_miss;               // Number of MISS READ
+      uint32_t m_cpt_write_miss;              // Number of MISS WRITE
+      uint32_t m_cpt_write_dirty;             // Cumulated length for WRITE transactions
+      uint32_t m_cpt_write_broadcast;         // Number of BROADCAST INVAL because write
+
+      uint32_t m_cpt_trt_rb;                  // Read blocked by a hit in trt
+      uint32_t m_cpt_trt_full;                // Transaction blocked due to a full trt
 
       uint32_t m_cpt_heap_unused;             // NB cycles HEAP LOCK unused
@@ -481,13 +479,13 @@
       uint32_t m_cpt_heap_min_slot_available; // NB HEAP : Min of slot available
 
-      uint32_t m_cpt_ncc_to_cc_read;         // NB change from NCC to CC caused by a READ
-      uint32_t m_cpt_ncc_to_cc_write;        // NB change from NCC to CC caused by a WRITE
-
-      uint32_t m_cpt_cleanup_data_local;  // Number of local cleanups with data
-      uint32_t m_cpt_cleanup_data_remote; // Number of remote cleanups with data
-      uint32_t m_cpt_cleanup_data_cost;   // Cost for cleanups with data
-
-      uint32_t m_cpt_update_flits;  // Number of flits for UPDATEs
-      uint32_t m_cpt_inval_cost;    // Number of (flits * distance) for INVALs
+      uint32_t m_cpt_ncc_to_cc_read;          // NB change from NCC to CC caused by a READ
+      uint32_t m_cpt_ncc_to_cc_write;         // NB change from NCC to CC caused by a WRITE
+
+      uint32_t m_cpt_cleanup_data_local;      // Number of local cleanups with data
+      uint32_t m_cpt_cleanup_data_remote;     // Number of remote cleanups with data
+      uint32_t m_cpt_cleanup_data_cost;       // Cost for cleanups with data
+
+      uint32_t m_cpt_update_flits;            // Number of flits for UPDATEs
+      uint32_t m_cpt_inval_cost;              // Number of (flits * distance) for INVALs
 
       uint32_t m_cpt_get;
@@ -499,13 +497,4 @@
       uint32_t m_cpt_upt_unused; // NB cycles UPT LOCK unused
 
-      // Unused
-      uint32_t m_cpt_read_data_unc;
-      uint32_t m_cpt_read_data_miss_CC;
-      uint32_t m_cpt_read_ins_unc;
-      uint32_t m_cpt_read_ins_miss;
-      uint32_t m_cpt_read_ll_CC;
-      uint32_t m_cpt_read_data_miss_NCC;
-      uint32_t m_cpt_read_ll_NCC;
-
       size_t   m_prev_count;
 
@@ -515,12 +504,12 @@
 
       public:
-      sc_in<bool>                                 p_clk;
-      sc_in<bool>                                 p_resetn;
-      sc_out<bool>                                p_irq;
-      soclib::caba::VciTarget<vci_param_int>      p_vci_tgt;
-      soclib::caba::VciInitiator<vci_param_ext>   p_vci_ixr;
-      soclib::caba::DspinInput<dspin_in_width>    p_dspin_p2m;
-      soclib::caba::DspinOutput<dspin_out_width>  p_dspin_m2p;
-      soclib::caba::DspinOutput<dspin_out_width>  p_dspin_clack;
+      sc_in<bool>                                p_clk;
+      sc_in<bool>                                p_resetn;
+      sc_out<bool>                               p_irq;
+      soclib::caba::VciTarget<vci_param_int>     p_vci_tgt;
+      soclib::caba::VciInitiator<vci_param_ext>  p_vci_ixr;
+      soclib::caba::DspinInput<dspin_in_width>   p_dspin_p2m;
+      soclib::caba::DspinOutput<dspin_out_width> p_dspin_m2p;
+      soclib::caba::DspinOutput<dspin_out_width> p_dspin_clack;
 
 #if MONITOR_MEMCACHE_FSM == 1
@@ -557,10 +546,10 @@
           const size_t                       nwords,          // Number of words per line
           const size_t                       max_copies,      // max number of copies
-          const size_t                       heap_size=HEAP_ENTRIES,
-          const size_t                       trt_lines=TRT_ENTRIES,
-          const size_t                       upt_lines=UPT_ENTRIES,
-          const size_t                       ivt_lines=IVT_ENTRIES,
-          const size_t                       debug_start_cycle=0,
-          const bool                         debug_ok=false );
+          const size_t                       heap_size = HEAP_ENTRIES,
+          const size_t                       trt_lines = TRT_ENTRIES,
+          const size_t                       upt_lines = UPT_ENTRIES,
+          const size_t                       ivt_lines = IVT_ENTRIES,
+          const size_t                       debug_start_cycle = 0,
+          const bool                         debug_ok = false );
 
       ~VciMemCache();
@@ -568,5 +557,5 @@
       void reset_counters();
       void print_stats(bool activity_counters = true, bool stats = false);
-      void print_trace( size_t detailled = 0 );
+      void print_trace(size_t detailled = 0);
       void cache_monitor(addr_t addr);
       void start_monitor(addr_t addr, addr_t length);
@@ -581,5 +570,5 @@
       uint32_t min_value(uint32_t old_value, uint32_t new_value);
       bool is_local_req(uint32_t req_srcid);
-      int  read_instrumentation(uint32_t regr, uint32_t & rdata);
+      int read_instrumentation(uint32_t regr, uint32_t & rdata);
 
       // Component attributes
@@ -616,11 +605,11 @@
 
       // adress masks
-      const soclib::common::AddressMaskingTable<addr_t>   m_x;
-      const soclib::common::AddressMaskingTable<addr_t>   m_y;
-      const soclib::common::AddressMaskingTable<addr_t>   m_z;
-      const soclib::common::AddressMaskingTable<addr_t>   m_nline;
+      const soclib::common::AddressMaskingTable<addr_t> m_x;
+      const soclib::common::AddressMaskingTable<addr_t> m_y;
+      const soclib::common::AddressMaskingTable<addr_t> m_z;
+      const soclib::common::AddressMaskingTable<addr_t> m_nline;
 
       // broadcast address
-      uint32_t                           m_broadcast_boundaries;
+      uint32_t m_broadcast_boundaries;
 
       // configuration interface constants
@@ -632,32 +621,32 @@
 
       // Fifo between TGT_CMD fsm and READ fsm
-      GenericFifo<addr_t>    m_cmd_read_addr_fifo;
-      GenericFifo<size_t>    m_cmd_read_length_fifo;
-      GenericFifo<size_t>    m_cmd_read_srcid_fifo;
-      GenericFifo<size_t>    m_cmd_read_trdid_fifo;
-      GenericFifo<size_t>    m_cmd_read_pktid_fifo;
+      GenericFifo<addr_t> m_cmd_read_addr_fifo;
+      GenericFifo<size_t> m_cmd_read_length_fifo;
+      GenericFifo<size_t> m_cmd_read_srcid_fifo;
+      GenericFifo<size_t> m_cmd_read_trdid_fifo;
+      GenericFifo<size_t> m_cmd_read_pktid_fifo;
 
       // Fifo between TGT_CMD fsm and WRITE fsm
-      GenericFifo<addr_t>    m_cmd_write_addr_fifo;
-      GenericFifo<bool>      m_cmd_write_eop_fifo;
-      GenericFifo<size_t>    m_cmd_write_srcid_fifo;
-      GenericFifo<size_t>    m_cmd_write_trdid_fifo;
-      GenericFifo<size_t>    m_cmd_write_pktid_fifo;
-      GenericFifo<data_t>    m_cmd_write_data_fifo;
-      GenericFifo<be_t>      m_cmd_write_be_fifo;
+      GenericFifo<addr_t> m_cmd_write_addr_fifo;
+      GenericFifo<bool>   m_cmd_write_eop_fifo;
+      GenericFifo<size_t> m_cmd_write_srcid_fifo;
+      GenericFifo<size_t> m_cmd_write_trdid_fifo;
+      GenericFifo<size_t> m_cmd_write_pktid_fifo;
+      GenericFifo<data_t> m_cmd_write_data_fifo;
+      GenericFifo<be_t>   m_cmd_write_be_fifo;
 
       // Fifo between TGT_CMD fsm and CAS fsm
-      GenericFifo<addr_t>    m_cmd_cas_addr_fifo;
-      GenericFifo<bool>      m_cmd_cas_eop_fifo;
-      GenericFifo<size_t>    m_cmd_cas_srcid_fifo;
-      GenericFifo<size_t>    m_cmd_cas_trdid_fifo;
-      GenericFifo<size_t>    m_cmd_cas_pktid_fifo;
-      GenericFifo<data_t>    m_cmd_cas_wdata_fifo;
+      GenericFifo<addr_t> m_cmd_cas_addr_fifo;
+      GenericFifo<bool>   m_cmd_cas_eop_fifo;
+      GenericFifo<size_t> m_cmd_cas_srcid_fifo;
+      GenericFifo<size_t> m_cmd_cas_trdid_fifo;
+      GenericFifo<size_t> m_cmd_cas_pktid_fifo;
+      GenericFifo<data_t> m_cmd_cas_wdata_fifo;
 
       // Fifo between CC_RECEIVE fsm and CLEANUP fsm
-      GenericFifo<uint64_t>  m_cc_receive_to_cleanup_fifo;
+      GenericFifo<uint64_t> m_cc_receive_to_cleanup_fifo;
 
       // Fifo between CC_RECEIVE fsm and MULTI_ACK fsm
-      GenericFifo<uint64_t>  m_cc_receive_to_multi_ack_fifo;
+      GenericFifo<uint64_t> m_cc_receive_to_multi_ack_fifo;
 
       // Buffer between TGT_CMD fsm and TGT_RSP fsm
@@ -678,5 +667,5 @@
       //////////////////////////////////////////////////
 
-      sc_signal<int>         r_tgt_cmd_fsm;
+      sc_signal<int> r_tgt_cmd_fsm;
 
       ///////////////////////////////////////////////////////
@@ -684,42 +673,42 @@
       ///////////////////////////////////////////////////////
 
-      sc_signal<int>      r_config_fsm;               // FSM state
-      sc_signal<bool>     r_config_lock;              // lock protecting exclusive access
-      sc_signal<int>      r_config_cmd;               // config request type
-      sc_signal<addr_t>   r_config_address;           // target buffer physical address
-      sc_signal<size_t>   r_config_srcid;             // config request srcid
-      sc_signal<size_t>   r_config_trdid;             // config request trdid
-      sc_signal<size_t>   r_config_pktid;             // config request pktid
-      sc_signal<size_t>   r_config_cmd_lines;         // number of lines to be handled
-      sc_signal<size_t>   r_config_rsp_lines;         // number of lines not completed
-      sc_signal<size_t>   r_config_dir_way;           // DIR: selected way
-      sc_signal<bool>     r_config_dir_lock;          // DIR: locked entry
-      sc_signal<size_t>   r_config_dir_count;         // DIR: number of copies
-      sc_signal<bool>     r_config_dir_is_cnt;        // DIR: counter mode (broadcast)
-      sc_signal<size_t>   r_config_dir_copy_srcid;    // DIR: first copy SRCID
-      sc_signal<bool>     r_config_dir_copy_inst;     // DIR: first copy L1 type
-      sc_signal<size_t>   r_config_dir_ptr;           // DIR: index of next copy in HEAP
-      sc_signal<size_t>   r_config_heap_next;         // current pointer to scan HEAP
-      sc_signal<size_t>   r_config_trt_index;         // selected entry in TRT
-      sc_signal<size_t>   r_config_ivt_index;         // selected entry in IVT
+      sc_signal<int>    r_config_fsm;            // FSM state
+      sc_signal<bool>   r_config_lock;           // lock protecting exclusive access
+      sc_signal<int>    r_config_cmd;            // config request type
+      sc_signal<addr_t> r_config_address;        // target buffer physical address
+      sc_signal<size_t> r_config_srcid;          // config request srcid
+      sc_signal<size_t> r_config_trdid;          // config request trdid
+      sc_signal<size_t> r_config_pktid;          // config request pktid
+      sc_signal<size_t> r_config_cmd_lines;      // number of lines to be handled
+      sc_signal<size_t> r_config_rsp_lines;      // number of lines not completed
+      sc_signal<size_t> r_config_dir_way;        // DIR: selected way
+      sc_signal<bool>   r_config_dir_lock;       // DIR: locked entry
+      sc_signal<size_t> r_config_dir_count;      // DIR: number of copies
+      sc_signal<bool>   r_config_dir_is_cnt;     // DIR: counter mode (broadcast)
+      sc_signal<size_t> r_config_dir_copy_srcid; // DIR: first copy SRCID
+      sc_signal<bool>   r_config_dir_copy_inst;  // DIR: first copy L1 type
+      sc_signal<size_t> r_config_dir_ptr;        // DIR: index of next copy in HEAP
+      sc_signal<size_t> r_config_heap_next;      // current pointer to scan HEAP
+      sc_signal<size_t> r_config_trt_index;      // selected entry in TRT
+      sc_signal<size_t> r_config_ivt_index;      // selected entry in IVT
 
       // Buffer between CONFIG fsm and IXR_CMD fsm
-      sc_signal<bool>     r_config_to_ixr_cmd_req;    // valid request
-      sc_signal<size_t>   r_config_to_ixr_cmd_index;  // TRT index
+      sc_signal<bool>   r_config_to_ixr_cmd_req;   // valid request
+      sc_signal<size_t> r_config_to_ixr_cmd_index; // TRT index
 
       // Buffer between CONFIG fsm and TGT_RSP fsm (send a done response to L1 cache)
-      sc_signal<bool>     r_config_to_tgt_rsp_req;    // valid request
-      sc_signal<bool>     r_config_to_tgt_rsp_error;  // error response
-      sc_signal<size_t>   r_config_to_tgt_rsp_srcid;  // Transaction srcid
-      sc_signal<size_t>   r_config_to_tgt_rsp_trdid;  // Transaction trdid
-      sc_signal<size_t>   r_config_to_tgt_rsp_pktid;  // Transaction pktid
+      sc_signal<bool>   r_config_to_tgt_rsp_req;   // valid request
+      sc_signal<bool>   r_config_to_tgt_rsp_error; // error response
+      sc_signal<size_t> r_config_to_tgt_rsp_srcid; // Transaction srcid
+      sc_signal<size_t> r_config_to_tgt_rsp_trdid; // Transaction trdid
+      sc_signal<size_t> r_config_to_tgt_rsp_pktid; // Transaction pktid
 
       // Buffer between CONFIG fsm and CC_SEND fsm (multi-inval / broadcast-inval)
-      sc_signal<bool>     r_config_to_cc_send_multi_req;    // multi-inval request
-      sc_signal<bool>     r_config_to_cc_send_brdcast_req;  // broadcast-inval request
-      sc_signal<addr_t>   r_config_to_cc_send_nline;        // line index
-      sc_signal<size_t>   r_config_to_cc_send_trdid;        // UPT index
-      GenericFifo<bool>   m_config_to_cc_send_inst_fifo;    // fifo for the L1 type
-      GenericFifo<size_t> m_config_to_cc_send_srcid_fifo;   // fifo for owners srcid
+      sc_signal<bool>     r_config_to_cc_send_multi_req;   // multi-inval request
+      sc_signal<bool>     r_config_to_cc_send_brdcast_req; // broadcast-inval request
+      sc_signal<addr_t>   r_config_to_cc_send_nline;       // line index
+      sc_signal<size_t>   r_config_to_cc_send_trdid;       // UPT index
+      GenericFifo<bool>   m_config_to_cc_send_inst_fifo;   // fifo for the L1 type
+      GenericFifo<size_t> m_config_to_cc_send_srcid_fifo;  // fifo for owners srcid
 
       ///////////////////////////////////////////////////////
@@ -727,34 +716,34 @@
       ///////////////////////////////////////////////////////
 
-      sc_signal<int>      r_read_fsm;                 // FSM state
-      sc_signal<size_t>   r_read_copy;                // Srcid of the first copy
-      sc_signal<size_t>   r_read_copy_cache;          // Srcid of the first copy
-      sc_signal<bool>     r_read_copy_inst;           // Type of the first copy
-      sc_signal<tag_t>    r_read_tag;                 // cache line tag (in directory)
-      sc_signal<bool>     r_read_is_cnt;              // is_cnt bit (in directory)
-      sc_signal<bool>     r_read_lock;                // lock bit (in directory)
-      sc_signal<bool>     r_read_dirty;               // dirty bit (in directory)
-      sc_signal<size_t>   r_read_count;               // number of copies
-      sc_signal<size_t>   r_read_ptr;                 // pointer to the heap
-      sc_signal<data_t> * r_read_data;                // data (one cache line)
-      sc_signal<size_t>   r_read_way;                 // associative way (in cache)
-      sc_signal<size_t>   r_read_trt_index;           // Transaction Table index
-      sc_signal<size_t>   r_read_next_ptr;            // Next entry to point to
-      sc_signal<bool>     r_read_last_free;           // Last free entry
-      sc_signal<addr_t>   r_read_ll_key;              // LL key from llsc_global_table
+      sc_signal<int>      r_read_fsm;        // FSM state
+      sc_signal<size_t>   r_read_copy;       // Srcid of the first copy
+      sc_signal<size_t>   r_read_copy_cache; // Srcid of the first copy
+      sc_signal<bool>     r_read_copy_inst;  // Type of the first copy
+      sc_signal<tag_t>    r_read_tag;        // cache line tag (in directory)
+      sc_signal<bool>     r_read_is_cnt;     // is_cnt bit (in directory)
+      sc_signal<bool>     r_read_lock;       // lock bit (in directory)
+      sc_signal<bool>     r_read_dirty;      // dirty bit (in directory)
+      sc_signal<size_t>   r_read_count;      // number of copies
+      sc_signal<size_t>   r_read_ptr;        // pointer to the heap
+      sc_signal<data_t> * r_read_data;       // data (one cache line)
+      sc_signal<size_t>   r_read_way;        // associative way (in cache)
+      sc_signal<size_t>   r_read_trt_index;  // Transaction Table index
+      sc_signal<size_t>   r_read_next_ptr;   // Next entry to point to
+      sc_signal<bool>     r_read_last_free;  // Last free entry
+      sc_signal<addr_t>   r_read_ll_key;     // LL key from llsc_global_table
 
       // Buffer between READ fsm and IXR_CMD fsm
-      sc_signal<bool>     r_read_to_ixr_cmd_req;      // valid request
-      sc_signal<size_t>   r_read_to_ixr_cmd_index;    // TRT index
+      sc_signal<bool>     r_read_to_ixr_cmd_req;   // valid request
+      sc_signal<size_t>   r_read_to_ixr_cmd_index; // TRT index
 
       // Buffer between READ fsm and TGT_RSP fsm (send a hit read response to L1 cache)
-      sc_signal<bool>     r_read_to_tgt_rsp_req;      // valid request
-      sc_signal<size_t>   r_read_to_tgt_rsp_srcid;    // Transaction srcid
-      sc_signal<size_t>   r_read_to_tgt_rsp_trdid;    // Transaction trdid
-      sc_signal<size_t>   r_read_to_tgt_rsp_pktid;    // Transaction pktid
-      sc_signal<data_t> * r_read_to_tgt_rsp_data;     // data (one cache line)
-      sc_signal<size_t>   r_read_to_tgt_rsp_word;     // first word of the response
-      sc_signal<size_t>   r_read_to_tgt_rsp_length;   // length of the response
-      sc_signal<addr_t>   r_read_to_tgt_rsp_ll_key;   // LL key from llsc_global_table
+      sc_signal<bool>     r_read_to_tgt_rsp_req;    // valid request
+      sc_signal<size_t>   r_read_to_tgt_rsp_srcid;  // Transaction srcid
+      sc_signal<size_t>   r_read_to_tgt_rsp_trdid;  // Transaction trdid
+      sc_signal<size_t>   r_read_to_tgt_rsp_pktid;  // Transaction pktid
+      sc_signal<data_t> * r_read_to_tgt_rsp_data;   // data (one cache line)
+      sc_signal<size_t>   r_read_to_tgt_rsp_word;   // first word of the response
+      sc_signal<size_t>   r_read_to_tgt_rsp_length; // length of the response
+      sc_signal<addr_t>   r_read_to_tgt_rsp_ll_key; // LL key from llsc_global_table
 
       //RWT: Buffer between READ fsm and CC_SEND fsm (send inval)
@@ -777,5 +766,5 @@
 
       //RWT:
-      sc_signal<bool>     r_read_coherent;          // State of the cache slot after transaction
+      sc_signal<bool>     r_read_coherent; // State of the cache slot after transaction
       sc_signal<bool>     r_read_ll_done;
 
@@ -839,9 +828,9 @@
 
       // RWT: Buffer between WRITE fsm and CLEANUP fsm (change slot state)
-      sc_signal<bool>     r_write_to_cleanup_req;         // valid request
-      sc_signal<addr_t>   r_write_to_cleanup_nline;       // cache line index
+      sc_signal<bool>     r_write_to_cleanup_req;    // valid request
+      sc_signal<addr_t>   r_write_to_cleanup_nline;  // cache line index
 
       // RWT
-      sc_signal<bool>     r_write_coherent;               // cache slot state after transaction
+      sc_signal<bool>     r_write_coherent;          // cache slot state after transaction
 
       //Buffer between WRITE fsm and CC_SEND fsm (INVAL for RWT)
@@ -1114,6 +1103,4 @@
 
       sc_signal<bool>      r_cleanup_ncc;
-      sc_signal<bool>      r_cleanup_to_ixr_cmd_ncc_l1_dirty;
-      sc_signal<bool>      r_xram_rsp_to_ixr_cmd_inval_ncc_pending;
 
       sc_signal<bool>      r_cleanup_to_ixr_cmd_req;
Index: branches/RWT/modules/vci_mem_cache/caba/source/include/xram_transaction.h
===================================================================
--- branches/RWT/modules/vci_mem_cache/caba/source/include/xram_transaction.h	(revision 814)
+++ branches/RWT/modules/vci_mem_cache/caba/source/include/xram_transaction.h	(revision 823)
@@ -15,8 +15,8 @@
 class TransactionTabEntry
 {
-    typedef sc_dt::sc_uint<64>    wide_data_t;
-    typedef sc_dt::sc_uint<40>    addr_t;
-    typedef uint32_t              data_t;
-    typedef uint32_t              be_t;
+    typedef sc_dt::sc_uint<64> wide_data_t;
+    typedef sc_dt::sc_uint<40> addr_t;
+    typedef uint32_t           data_t;
+    typedef uint32_t           be_t;
 
     public:
@@ -154,26 +154,26 @@
 class TransactionTab
 {
-    typedef sc_dt::sc_uint<64>    wide_data_t;
-    typedef sc_dt::sc_uint<40>    addr_t;
-    typedef uint32_t              data_t;
-    typedef uint32_t              be_t;
+    typedef sc_dt::sc_uint<64> wide_data_t;
+    typedef sc_dt::sc_uint<40> addr_t;
+    typedef uint32_t           data_t;
+    typedef uint32_t           be_t;
 
     private:
-    const std::string tab_name;                // the name for logs
-    size_t            size_tab;                // the size of the tab
+    const std::string tab_name; // the name for logs
+    size_t            size_tab; // the size of the tab
 
     data_t be_to_mask(be_t be)
     {
         data_t ret = 0;
-        if ( be&0x1 ) {
+        if (be & 0x1) {
             ret = ret | 0x000000FF;
         }
-        if ( be&0x2 ) {
+        if (be & 0x2) {
             ret = ret | 0x0000FF00;
         }
-        if ( be&0x4 ) {
+        if (be & 0x4) {
             ret = ret | 0x00FF0000;
         }
-        if ( be&0x8 ) {
+        if (be & 0x8) {
             ret = ret | 0xFF000000;
         }
@@ -189,6 +189,6 @@
     TransactionTab()
     {
-        size_tab=0;
-        tab=NULL;
+        size_tab = 0;
+        tab = NULL;
     }
 
@@ -196,9 +196,9 @@
                    size_t            n_entries,
                    size_t            n_words )
-    : tab_name( name ),
-      size_tab( n_entries )
+    : tab_name(name),
+      size_tab(n_entries)
     {
         tab = new TransactionTabEntry[size_tab];
-        for ( size_t i=0; i<size_tab; i++)
+        for (size_t i = 0; i < size_tab; i++)
         {
             tab[i].alloc(n_words);
@@ -222,5 +222,5 @@
     void init()
     {
-        for ( size_t i=0; i<size_tab; i++)
+        for (size_t i = 0; i < size_tab; i++)
         {
             tab[i].init();
@@ -234,5 +234,5 @@
     void print(const size_t index)
     {
-        assert( (index < size_tab) and
+        assert((index < size_tab) and
         "MEMC ERROR: The selected entry is out of range in TRT write_data_mask()");
 
@@ -247,5 +247,5 @@
     TransactionTabEntry read(const size_t index)
     {
-        assert( (index < size_tab) and
+        assert((index < size_tab) and
         "MEMC ERROR: Invalid Transaction Tab Entry");
 
@@ -260,9 +260,9 @@
     bool full(size_t &index)
     {
-        for(size_t i=0; i<size_tab; i++)
-        {
-            if(!tab[i].valid)
+        for (size_t i = 0; i < size_tab; i++)
+        {
+            if (!tab[i].valid)
             {
-                index=i;
+                index = i;
                 return false;
             }
@@ -278,11 +278,11 @@
     // The function returns true if a read request has already been sent
     //////////////////////////////////////////////////////////////////////
-    bool hit_read(const addr_t nline,size_t &index)
-    {
-        for(size_t i=0; i<size_tab; i++)
-        {
-            if((tab[i].valid && (nline==tab[i].nline)) && (tab[i].xram_read))
+    bool hit_read(const addr_t nline, size_t &index)
+    {
+        for (size_t i = 0; i < size_tab; i++)
+        {
+            if ((tab[i].valid && (nline == tab[i].nline)) && (tab[i].xram_read))
             {
-                index=i;
+                index = i;
                 return true;
             }
@@ -299,7 +299,7 @@
     bool hit_write(const addr_t nline)
     {
-        for(size_t i=0; i<size_tab; i++)
-        {
-            if(tab[i].valid && (nline==tab[i].nline) && !(tab[i].xram_read))
+        for (size_t i = 0; i < size_tab; i++)
+        {
+            if(tab[i].valid && (nline == tab[i].nline) && !(tab[i].xram_read))
             {
                 return true;
@@ -319,6 +319,6 @@
     bool hit_write(const addr_t nline, size_t* index)
     {
-        for(size_t i=0; i<size_tab; i++){
-            if(tab[i].valid && (nline==tab[i].nline) && !(tab[i].xram_read)) {
+        for (size_t i = 0; i < size_tab; i++){
+            if (tab[i].valid && (nline == tab[i].nline) && !(tab[i].xram_read)) {
                 *index = i;
                 return true;
@@ -337,17 +337,17 @@
     /////////////////////////////////////////////////////////////////////
     void write_data_mask(const size_t index,
-            const std::vector<be_t> &be,
-            const std::vector<data_t> &data)
-    {
-        assert( (index < size_tab) and
+                         const std::vector<be_t> &be,
+                         const std::vector<data_t> &data)
+    {
+        assert((index < size_tab) and
         "MEMC ERROR: The selected entry is out of range in TRT write_data_mask()");
 
-        assert( (be.size()==tab[index].wdata_be.size()) and
+        assert((be.size() == tab[index].wdata_be.size()) and
         "MEMC ERROR: Bad be size in TRT write_data_mask()");
 
-        assert( (data.size()==tab[index].wdata.size()) and
+        assert((data.size() == tab[index].wdata.size()) and
         "MEMC ERROR: Bad data size in TRT write_data_mask()");
 
-        for(size_t i=0; i<tab[index].wdata_be.size() ; i++)
+        for (size_t i = 0; i < tab[index].wdata_be.size(); i++)
         {
             tab[index].wdata_be[i] = tab[index].wdata_be[i] | be[i];
@@ -375,24 +375,24 @@
     /////////////////////////////////////////////////////////////////////
     void set(const size_t index,
-            const bool xram_read,
-            const addr_t nline,
-            const size_t srcid,
-            const size_t trdid,
-            const size_t pktid,
-            const bool proc_read,
-            const size_t read_length,
-            const size_t word_index,
-            const std::vector<be_t> &data_be,
-            const std::vector<data_t> &data,
-            const data_t ll_key = 0,
-            const bool config = false)
-    {
-        assert( (index < size_tab) and
+             const bool xram_read,
+             const addr_t nline,
+             const size_t srcid,
+             const size_t trdid,
+             const size_t pktid,
+             const bool proc_read,
+             const size_t read_length,
+             const size_t word_index,
+             const std::vector<be_t> &data_be,
+             const std::vector<data_t> &data,
+             const data_t ll_key = 0,
+             const bool config = false)
+    {
+        assert((index < size_tab) and
         "MEMC ERROR: The selected entry is out of range in TRT set()");
 
-        assert( (data_be.size()==tab[index].wdata_be.size()) and
+        assert((data_be.size() == tab[index].wdata_be.size()) and
         "MEMC ERROR: Bad data_be argument in TRT set()");
 
-        assert( (data.size()==tab[index].wdata.size()) and
+        assert((data.size() == tab[index].wdata.size()) and
         "MEMC ERROR: Bad data argument in TRT set()");
 
@@ -408,8 +408,8 @@
         tab[index].ll_key      = ll_key;
         tab[index].config      = config;
-        for(size_t i=0; i<tab[index].wdata.size(); i++)
-        {
-            tab[index].wdata_be[i]    = data_be[i];
-            tab[index].wdata[i]       = data[i];
+        for (size_t i = 0; i < tab[index].wdata.size(); i++)
+        {
+            tab[index].wdata_be[i] = data_be[i];
+            tab[index].wdata[i]    = data[i];
         }
     }
@@ -429,20 +429,20 @@
                    const bool        rerror)
     {
-        data_t  value;
-        data_t  mask;
-
-        assert( (index < size_tab) and
+        data_t value;
+        data_t mask;
+
+        assert((index < size_tab) and
         "MEMC ERROR: The selected entry is out of range in TRT write_rsp()");
 
-        assert( (word < tab[index].wdata_be.size()) and
+        assert((word < tab[index].wdata_be.size()) and
         "MEMC ERROR: Bad word index in TRT write_rsp()");
 
-        assert( (tab[index].valid) and
+        assert((tab[index].valid) and
         "MEMC ERROR: TRT entry not valid in TRT write_rsp()");
 
-        assert( (tab[index].xram_read ) and
+        assert((tab[index].xram_read ) and
         "MEMC ERROR: TRT entry is not a GET in TRT write_rsp()");
 
-        if ( rerror )
+        if (rerror)
         {
             tab[index].rerror = true;
@@ -456,7 +456,7 @@
 
         // second 32 bits word
-        value = (data_t)(data>>32);
-        mask  = be_to_mask(tab[index].wdata_be[word+1]);
-        tab[index].wdata[word+1] = (tab[index].wdata[word+1] & mask) | (value & ~mask);
+        value = (data_t)(data >> 32);
+        mask  = be_to_mask(tab[index].wdata_be[word + 1]);
+        tab[index].wdata[word + 1] = (tab[index].wdata[word + 1] & mask) | (value & ~mask);
     }
     /////////////////////////////////////////////////////////////////////
@@ -467,5 +467,5 @@
     void erase(const size_t index)
     {
-        assert( (index < size_tab) and
+        assert((index < size_tab) and
         "MEMC ERROR: The selected entry is out of range in TRT erase()");
 
@@ -480,5 +480,5 @@
     bool is_config(const size_t index)
     {
-        assert( (index < size_tab) and
+        assert((index < size_tab) and
         "MEMC ERROR: The selected entry is out of range in TRT is_config()");
 
