Index: branches/RWT/lib/generic_cache_tsar/include/generic_cache.h
===================================================================
--- branches/RWT/lib/generic_cache_tsar/include/generic_cache.h	(revision 767)
+++ branches/RWT/lib/generic_cache_tsar/include/generic_cache.h	(revision 771)
@@ -86,19 +86,19 @@
 //////////////////////////
 {
-    typedef uint32_t    data_t;
-    typedef uint32_t    be_t;
-
-    data_t              *r_data ;
-    addr_t               *r_tag ;
-    int                 *r_state;
-    bool                *r_lru ;
-
-    size_t              m_ways;	
-    size_t              m_sets;	
-    size_t              m_words;
-
-    const soclib::common::AddressMaskingTable<addr_t>  m_x ;
-    const soclib::common::AddressMaskingTable<addr_t>  m_y ;
-    const soclib::common::AddressMaskingTable<addr_t>  m_z ;
+    typedef uint32_t data_t;
+    typedef uint32_t be_t;
+
+    data_t           *r_data ;
+    addr_t           *r_tag ;
+    int              *r_state;
+    bool             *r_lru ;
+
+    size_t           m_ways;	
+    size_t           m_sets;	
+    size_t           m_words;
+
+    const soclib::common::AddressMaskingTable<addr_t> m_x ;
+    const soclib::common::AddressMaskingTable<addr_t> m_y ;
+    const soclib::common::AddressMaskingTable<addr_t> m_z ;
 
     //////////////////////////////////////////////////////////////
@@ -134,10 +134,10 @@
         cache_lru(way, set) = true;
 
-	    for (way2 = 0; way2 < m_ways; way2++ ) 
+	    for (way2 = 0; way2 < m_ways; way2++) 
         {
 	        if (cache_lru(way2, set) == false) return;
 	    }
  	    // all lines are new -> they all become old 
-	    for (way2 = 0; way2 < m_ways; way2++ ) 
+	    for (way2 = 0; way2 < m_ways; way2++) 
         {
 	        cache_lru(way2, set) = false;
@@ -146,5 +146,5 @@
 
     ////////////////////////////////
-    inline data_t be2mask( be_t be )
+    inline data_t be2mask(be_t be)
     {
         data_t mask = 0;
@@ -159,8 +159,8 @@
 
     //////////////////////////////////////////
-    GenericCache(   const std::string   &name,
-                    size_t              nways, 
-                    size_t              nsets, 
-                    size_t              nwords)
+    GenericCache(const std::string &name,
+                    size_t            nways, 
+                    size_t            nsets, 
+                    size_t            nwords)
         : m_ways(nways),
           m_sets(nsets),
@@ -186,5 +186,5 @@
 
 #ifdef GENERIC_CACHE_DEBUG
-std::cout << "constructing " << name << std::endl
+        std::cout << "constructing " << name << std::endl
           << "- nways  = " << nways << std::endl
           << "- nsets  = " << nsets << std::endl
@@ -196,8 +196,8 @@
 #endif
 
-        r_data    = new data_t[nways*nsets*nwords];
-        r_tag     = new addr_t[nways*nsets];
-        r_state   = new int[nways*nsets];
-        r_lru     = new bool[nways*nsets];
+        r_data  = new data_t[nways*nsets*nwords];
+        r_tag   = new addr_t[nways*nsets];
+        r_state = new int[nways*nsets];
+        r_lru   = new bool[nways*nsets];
     }
 
@@ -212,5 +212,5 @@
 
     ////////////////////
-    inline void reset( )
+    inline void reset()
     {
         std::memset(r_data, 0, sizeof(*r_data)*m_ways*m_sets*m_words);
@@ -230,15 +230,15 @@
     // Both data & directory are accessed. 
     /////////////////////////////////////////////////////////////////////
-    inline bool read( addr_t 	ad, 
-                      data_t* 	dt)
-    {
-        const addr_t      tag  = m_z[ad];
-        const size_t      set  = m_y[ad];
-        const size_t      word = m_x[ad];
-
-        for ( size_t way = 0; way < m_ways; way++ ) 
-        {
-            if ( (tag == cache_tag(way, set))  
-                   && ( (cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC) or (cache_state(way, set) == CACHE_SLOT_STATE_VALID_NCC)) )
+    inline bool read(addr_t  ad, 
+                     data_t* dt)
+    {
+        const addr_t tag  = m_z[ad];
+        const size_t set  = m_y[ad];
+        const size_t word = m_x[ad];
+
+        for (size_t way = 0; way < m_ways; way++) 
+        {
+            if ((tag == cache_tag(way, set))  
+                   && ((cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC) or (cache_state(way, set) == CACHE_SLOT_STATE_VALID_NCC)) )
             {
                 *dt = cache_data(way, set, word);
@@ -256,18 +256,18 @@
     // The selected way, set and word index are returned in case of hit.
     /////////////////////////////////////////////////////////////////////
-    inline bool read( addr_t 	ad, 
-                      data_t* 	dt,
-                      size_t*   selway,
-                      size_t*   selset,
-                      size_t*   selword) 
-    {
-        const addr_t      tag  = m_z[ad];
-        const size_t      set  = m_y[ad];
-        const size_t      word = m_x[ad];
-
-        for ( size_t way = 0; way < m_ways; way++ ) 
-        {
-            if ( (tag == cache_tag(way, set)) and
-                 ( (cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC)or (cache_state(way, set) == CACHE_SLOT_STATE_VALID_NCC)))
+    inline bool read(addr_t ad, 
+                     data_t* dt,
+                     size_t* selway,
+                     size_t* selset,
+                     size_t* selword) 
+    {
+        const addr_t tag  = m_z[ad];
+        const size_t set  = m_y[ad];
+        const size_t word = m_x[ad];
+
+        for (size_t way = 0; way < m_ways; way++) 
+        {
+            if ((tag == cache_tag(way, set)) and
+                 ((cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC)or (cache_state(way, set) == CACHE_SLOT_STATE_VALID_NCC)))
             {
                 *selway  = way;
@@ -292,14 +292,14 @@
     // returned in the other arguments.
     ////////////////////////////////////////////////////////////////////
-    inline void read( addr_t    ad,
-                      data_t*   dt,
-                      size_t*   selway,
-                      size_t*   selset,
-                      size_t*   selword,
-                      int*      state ) 
-    {
-        const addr_t      tag  = m_z[ad];
-        const size_t      set  = m_y[ad];
-        const size_t      word = m_x[ad];
+    inline void read(addr_t  ad,
+                     data_t* dt,
+                     size_t* selway,
+                     size_t* selset,
+                     size_t* selword,
+                     int*    state) 
+    {
+        const addr_t tag  = m_z[ad];
+        const size_t set  = m_y[ad];
+        const size_t word = m_x[ad];
 
         // default return values 
@@ -310,10 +310,10 @@
         *dt      = 0;
 
-        for ( size_t way = 0; way < m_ways; way++ ) 
-        {
-            if ( tag == cache_tag(way, set) )  // matching tag
-            {
-
-                if ( cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC )
+        for (size_t way = 0; way < m_ways; way++) 
+        {
+            if (tag == cache_tag(way, set))  // matching tag
+            {
+
+                if (cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC)
                 {
                     *state   = CACHE_SLOT_STATE_VALID_CC;
@@ -324,5 +324,5 @@
                     cache_set_lru(way, set);
                 }
-                else if ( cache_state(way, set) == CACHE_SLOT_STATE_VALID_NCC )
+                else if (cache_state(way, set) == CACHE_SLOT_STATE_VALID_NCC)
                 {
                     *state   = CACHE_SLOT_STATE_VALID_NCC;
@@ -333,5 +333,5 @@
                     cache_set_lru(way, set);
                 }
-                else if ( cache_state(way, set) == CACHE_SLOT_STATE_ZOMBI )
+                else if (cache_state(way, set) == CACHE_SLOT_STATE_ZOMBI)
                 {
                     *state   = CACHE_SLOT_STATE_ZOMBI;
@@ -350,18 +350,18 @@
     // The selected way, set and word index are returned in case of hit.
     /////////////////////////////////////////////////////////////////////
-    inline bool read_neutral( addr_t 	ad, 
-	            		      data_t* 	dt,
-			                  size_t*   selway,
-			                  size_t*   selset,
-			                  size_t*   selword) 
-    {
-        const addr_t      tag  = m_z[ad];
-        const size_t      set  = m_y[ad];
-        const size_t      word = m_x[ad];
-
-        for ( size_t way = 0; way < m_ways; way++ ) 
-        {
-            if ( (tag == cache_tag(way, set))  
-                   && ( (cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC) or (cache_state(way, set) == CACHE_SLOT_STATE_VALID_NCC) ) )
+    inline bool read_neutral(addr_t  ad, 
+                             data_t* dt,
+                             size_t* selway,
+                             size_t* selset,
+                             size_t* selword) 
+    {
+        const addr_t tag  = m_z[ad];
+        const size_t set  = m_y[ad];
+        const size_t word = m_x[ad];
+
+        for (size_t way = 0; way < m_ways; way++) 
+        {
+            if ((tag == cache_tag(way, set))  
+                   && ((cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC) or (cache_state(way, set) == CACHE_SLOT_STATE_VALID_NCC) ))
             {
                 *selway  = way;
@@ -384,24 +384,24 @@
     // This function is used by the cc_vcache to get a 64 bits page table entry.
     /////////////////////////////////////////////////////////////////////////////
-    inline bool read( addr_t 	ad, 
-                      data_t* 	dt, 
-                      data_t*	dt_next,
-                      size_t*	selway,
-                      size_t*	selset,
-                      size_t*   selword)
-    {
-        const addr_t      tag  = m_z[ad];
-        const size_t      set  = m_y[ad];
-        const size_t      word = m_x[ad];
-
-        for ( size_t way = 0; way < m_ways; way++ ) 
-        {
-            if ( (tag == cache_tag(way, set))   
-                   &&( (cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC) ) ) 
-            {
-                *dt      = cache_data(way, set, word);
-                if ( word+1 < m_words) 
-                {
-                    *dt_next = cache_data(way, set, word+1);
+    inline bool read( addr_t  ad, 
+                      data_t* dt, 
+                      data_t* dt_next,
+                      size_t* selway,
+                      size_t* selset,
+                      size_t* selword)
+    {
+        const addr_t tag  = m_z[ad];
+        const size_t set  = m_y[ad];
+        const size_t word = m_x[ad];
+
+        for (size_t way = 0; way < m_ways; way++) 
+        {
+            if ((tag == cache_tag(way, set))   
+                   &&( (cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC))) 
+            {
+                *dt = cache_data(way, set, word);
+                if (word + 1 < m_words) 
+                {
+                    *dt_next = cache_data(way, set, word + 1);
                 }
                 *selway  = way;
@@ -425,15 +425,15 @@
     // returned in the other arguments.
     ////////////////////////////////////////////////////////////////////
-    inline void read( addr_t    ad,
-                      data_t*   dt,
-                      data_t*   dt_next,
-                      size_t*   selway,
-                      size_t*   selset,
-                      size_t*   selword,
-                      int*      state ) 
-    {
-        const addr_t      tag  = m_z[ad];
-        const size_t      set  = m_y[ad];
-        const size_t      word = m_x[ad];
+    inline void read(addr_t  ad,
+                     data_t* dt,
+                     data_t* dt_next,
+                     size_t* selway,
+                     size_t* selset,
+                     size_t* selword,
+                     int*    state) 
+    {
+        const addr_t tag  = m_z[ad];
+        const size_t set  = m_y[ad];
+        const size_t word = m_x[ad];
 
         // default return values 
@@ -444,10 +444,10 @@
         *dt      = 0;
 
-        for ( size_t way = 0; way < m_ways; way++ ) 
-        {
-            if ( tag == cache_tag(way, set) )  // matching tag
-            {
-
-                if ( cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC )
+        for (size_t way = 0; way < m_ways; way++) 
+        {
+            if (tag == cache_tag(way, set))  // matching tag
+            {
+
+                if (cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC)
                 {
                     *state   = CACHE_SLOT_STATE_VALID_CC;
@@ -456,5 +456,5 @@
                     *selword = word;
                     *dt      = cache_data(way, set, word);
-                    if ( word+1 < m_words) 
+                    if (word + 1 < m_words) 
                     {
                         *dt_next = cache_data(way, set, word+1);
@@ -463,5 +463,5 @@
                 }
 
-                else if ( cache_state(way, set) == CACHE_SLOT_STATE_VALID_NCC )
+                else if (cache_state(way, set) == CACHE_SLOT_STATE_VALID_NCC)
                 {
                     *state   = CACHE_SLOT_STATE_VALID_NCC;
@@ -470,12 +470,12 @@
                     *selword = word;
                     *dt      = cache_data(way, set, word);
-                    if ( word+1 < m_words) 
+                    if (word + 1 < m_words) 
                     {
-                        *dt_next = cache_data(way, set, word+1);
+                        *dt_next = cache_data(way, set, word + 1);
                     }
                     cache_set_lru(way, set);
                 }
 
-                else if ( cache_state(way, set) == CACHE_SLOT_STATE_ZOMBI )
+                else if (cache_state(way, set) == CACHE_SLOT_STATE_ZOMBI)
                 {
                     *state   = CACHE_SLOT_STATE_ZOMBI;
@@ -496,17 +496,17 @@
     // while we write in the data part with a different address in the same cycle.
     ///////////////////////////////////////////////////////////////////////////////
-    inline bool hit(  addr_t 	ad, 
-                      size_t*	selway,
-                      size_t*	selset,
-                      size_t*   selword)
-    {
-        const addr_t      tag  = m_z[ad];
-        const size_t      set  = m_y[ad];
-        const size_t      word = m_x[ad];
-
-        for ( size_t way = 0; way < m_ways; way++ ) 
-        {
-            if ( (tag == cache_tag(way, set)) 
-                   && ( (cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC)or(cache_state(way, set) == CACHE_SLOT_STATE_VALID_NCC) ) ) 
+    inline bool hit(addr_t  ad, 
+                    size_t* selway,
+                    size_t* selset,
+                    size_t* selword)
+    {
+        const addr_t tag  = m_z[ad];
+        const size_t set  = m_y[ad];
+        const size_t word = m_x[ad];
+
+        for (size_t way = 0; way < m_ways; way++) 
+        {
+            if ((tag == cache_tag(way, set)) 
+                   && ((cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC)or(cache_state(way, set) == CACHE_SLOT_STATE_VALID_NCC))) 
             {
                 *selway  = way;
@@ -531,17 +531,17 @@
     // while we write in the data part with a different address in the same cycle.
     ///////////////////////////////////////////////////////////////////////////////
-    inline void read_dir(  addr_t 	ad, 
-                           int*     state,
-                           size_t*	way,
-                           size_t*	set,
-                           size_t*  word)
-    {
-        const addr_t      ad_tag  = m_z[ad];
-        const size_t      ad_set  = m_y[ad];
-        const size_t      ad_word = m_x[ad];
-        for ( size_t _way = 0; _way < m_ways; _way++ ) 
-        {
-            if ( (ad_tag == cache_tag(_way, ad_set) ) and 
-                 (cache_state(_way, ad_set) != CACHE_SLOT_STATE_EMPTY) ) 
+    inline void read_dir(addr_t  ad, 
+                         int*    state,
+                         size_t* way,
+                         size_t* set,
+                         size_t* word)
+    {
+        const addr_t ad_tag  = m_z[ad];
+        const size_t ad_set  = m_y[ad];
+        const size_t ad_word = m_x[ad];
+        for (size_t _way = 0; _way < m_ways; _way++) 
+        {
+            if ((ad_tag == cache_tag(_way, ad_set)) and 
+                (cache_state(_way, ad_set) != CACHE_SLOT_STATE_EMPTY)) 
             {
                 *state = cache_state(_way, ad_set);
@@ -562,8 +562,8 @@
     // Returns the access status and the tag value in the state and tag argument.
     ///////////////////////////////////////////////////////////////////////////////
-    inline void read_dir(  size_t 	way,
-                           size_t 	set,
-                           addr_t*   tag,
-                           int*     state )
+    inline void read_dir(size_t  way,
+                         size_t  set,
+                         addr_t* tag,
+                         int*    state)
     {
         *state = cache_state(way, set);
@@ -581,8 +581,8 @@
     // It does not use the directory and cannot miss.
     //////////////////////////////////////////////////////////////////
-    inline void write(size_t 	way, 
-                      size_t 	set, 
-                      size_t 	word, 
-                      data_t 	data)
+    inline void write(size_t way, 
+                      size_t set, 
+                      size_t word, 
+                      data_t data)
     {
         cache_data(way, set, word) = data;
@@ -594,9 +594,9 @@
     // It does not use the directory and cannot miss.
     ////////////////////////////////////////////////////////////////////////////
-    inline void write(size_t 	way, 
-                      size_t 	set, 
-                      size_t 	word, 
-                      data_t 	data, 
-                      be_t 	    be)
+    inline void write(size_t way, 
+                      size_t set, 
+                      size_t word, 
+                      data_t data, 
+                      be_t   be)
     {
         data_t mask = be2mask(be);
@@ -610,9 +610,9 @@
     // It returns true if the line was valid, and returns the line index.
     //////////////////////////////////////////////////////////////////////////
-    inline bool inval(size_t 	way, 
-                      size_t 	set, 
-                      addr_t* 	nline)
-    {
-        if( (cache_state(way,set) == CACHE_SLOT_STATE_VALID_CC) or  (cache_state(way,set) == CACHE_SLOT_STATE_VALID_NCC))
+    inline bool inval(size_t  way, 
+                      size_t  set, 
+                      addr_t* nline)
+    {
+        if ((cache_state(way,set) == CACHE_SLOT_STATE_VALID_CC) or  (cache_state(way,set) == CACHE_SLOT_STATE_VALID_NCC))
         {
             cache_state(way,set) = CACHE_SLOT_STATE_EMPTY;
@@ -631,11 +631,11 @@
     // and a Boolean indicating that a cleanup is requested.
     //////////////////////////////////////////////////////////////////////////////////
-    inline bool victim_select(addr_t 	ad, 
-                              addr_t* 	victim, 
-                              size_t*   way, 
-                              size_t*   set)
-    {
-        bool   found   = false;
-        bool   cleanup = false;
+    inline bool victim_select(addr_t  ad, 
+                              addr_t* victim, 
+                              size_t* way, 
+                              size_t* set)
+    {
+        bool found   = false;
+        bool cleanup = false;
 
         *set = m_y[ad];
@@ -643,7 +643,7 @@
 
         // Search first empty slot 
-        for ( size_t _way = 0 ; _way < m_ways && !found ; _way++ )
-        {
-            if( ( cache_state(_way, *set) != CACHE_SLOT_STATE_VALID_CC ) and ( cache_state(_way, *set) != CACHE_SLOT_STATE_VALID_NCC ))  // empty
+        for (size_t _way = 0 ; _way < m_ways && !found ; _way++)
+        {
+            if ((cache_state(_way, *set) != CACHE_SLOT_STATE_VALID_CC) and (cache_state(_way, *set) != CACHE_SLOT_STATE_VALID_NCC ))  // empty
             {
                 found   = true;
@@ -654,9 +654,9 @@
 
         // If no empty slot, search first  old slot (lru == false) 
-        if ( !found )
+        if (!found)
         { 
-            for ( size_t _way = 0 ; _way < m_ways && !found ; _way++ )
-            {
-                if ( not cache_lru(_way, *set) )
+            for (size_t _way = 0 ; _way < m_ways && !found ; _way++)
+            {
+                if (not cache_lru(_way, *set))
                 {
                     found   = true;
@@ -668,5 +668,5 @@
 
         assert(found && "all ways can't be new at the same time");
-        *victim = (addr_t)((cache_tag(*way,*set) * m_sets) + *set);
+        *victim = (addr_t) ((cache_tag(*way,*set) * m_sets) + *set);
         return cleanup;
     }
@@ -681,10 +681,10 @@
     // and two Boolean indicating success and a required cleanup.
     //////////////////////////////////////////////////////////////////////////////////
-    inline void read_select(addr_t 	  ad, 
-                            addr_t*   victim, 
-                            size_t*   way, 
-                            size_t*   set,
-                            bool*     found,
-                            bool*     cleanup )
+    inline void read_select(addr_t  ad, 
+                            addr_t* victim, 
+                            size_t* way, 
+                            size_t* set,
+                            bool*   found,
+                            bool*   cleanup)
     {
         size_t _set = m_y[ad];
@@ -693,7 +693,7 @@
 
         // Search first empty slot 
-        for ( size_t _way = 0 ; _way < m_ways && !(*found) ; _way++ )
-        {
-            if ( cache_state(_way, _set) == CACHE_SLOT_STATE_EMPTY )
+        for (size_t _way = 0 ; _way < m_ways && !(*found) ; _way++)
+        {
+            if (cache_state(_way, _set) == CACHE_SLOT_STATE_EMPTY)
             {
                 *found   = true;
@@ -704,24 +704,10 @@
             }
         }
-        //////////////////////////////////////////////////////////////
-        /*for ( size_t _way = 0 ; _way < m_ways && !(*found) ; _way++ )
-        {
-            if ( not cache_lru(_way, _set) and 
-                 (cache_state(_way, _set) != CACHE_SLOT_STATE_ZOMBI) and
-                 (cache_state(_way, _set) == CACHE_SLOT_STATE_VALID_NCC) )
-            {
-                *found   = true;
-                *cleanup = true;
-                *way     = _way;
-                *set     = m_y[ad];
-                *victim  = (addr_t)((cache_tag(*way,_set) * m_sets) + _set);
-                return;
-            }
-        }*/
+        
         // Search first not zombi old slot 
-        for ( size_t _way = 0 ; _way < m_ways && !(*found) ; _way++ )
-        {
-            if ( not cache_lru(_way, _set) and 
-                 (cache_state(_way, _set) != CACHE_SLOT_STATE_ZOMBI) )
+        for (size_t _way = 0 ; _way < m_ways && !(*found) ; _way++)
+        {
+            if (not cache_lru(_way, _set) and 
+                 (cache_state(_way, _set) != CACHE_SLOT_STATE_ZOMBI))
             {
                 *found   = true;
@@ -734,7 +720,7 @@
         }
         // Search first not zombi slot
-        for ( size_t _way = 0 ; _way < m_ways && !(*found) ; _way++ )
-        {
-            if ( cache_state(_way, _set) != CACHE_SLOT_STATE_ZOMBI) 
+        for (size_t _way = 0 ; _way < m_ways && !(*found) ; _way++)
+        {
+            if (cache_state(_way, _set) != CACHE_SLOT_STATE_ZOMBI) 
             {
                 *found   = true;
@@ -756,7 +742,7 @@
     // identified by the way & set.
     //////////////////////////////////////////////////////////////////
-    inline void victim_update_tag( addr_t 	ad, 
-                                   size_t 	way, 
-                                   size_t 	set )
+    inline void victim_update_tag(addr_t ad, 
+                                  size_t way, 
+                                  size_t set)
     {
         addr_t  tag     = m_z[ad];
@@ -771,10 +757,10 @@
     // identified by the way & set, when using the ZOMBI state.
     //////////////////////////////////////////////////////////////////
-    inline void write_dir( addr_t 	ad, 
-                           size_t 	way, 
-                           size_t 	set,
-                           int      state)
-    {
-        addr_t  tag     = m_z[ad];
+    inline void write_dir(addr_t ad, 
+                          size_t way, 
+                          size_t set,
+                          int    state)
+    {
+        addr_t tag = m_z[ad];
 
         assert( ( (state == CACHE_SLOT_STATE_VALID_CC) or
@@ -793,5 +779,5 @@
         cache_state(way, set) = state;
 
-        if ( (state == CACHE_SLOT_STATE_VALID_CC) or (state == CACHE_SLOT_STATE_VALID_NCC) ) cache_set_lru(way, set);
+        if ((state == CACHE_SLOT_STATE_VALID_CC) or (state == CACHE_SLOT_STATE_VALID_NCC)) cache_set_lru(way, set);
     }
 
@@ -801,7 +787,7 @@
     // It does not affect the tag
     //////////////////////////////////////////////////////////////////
-    inline void write_dir( size_t 	way, 
-                           size_t 	set,
-                           int      state)
+    inline void write_dir(size_t way, 
+                          size_t set,
+                          int    state)
     {
         assert( ( (state == CACHE_SLOT_STATE_VALID_CC) or
@@ -827,8 +813,8 @@
     // Both DATA and DIRECTORY are written
     ///////////////////////////////////////////////////////////////////
-    inline void update(addr_t 	ad, 
-                       size_t 	way, 
-                       size_t 	set, 
-                       data_t* 	buf)
+    inline void update(addr_t  ad, 
+                       size_t  way, 
+                       size_t  set, 
+                       data_t* buf)
     {
         addr_t tag = m_z[ad];
@@ -837,5 +823,5 @@
         cache_state(way, set) = CACHE_SLOT_STATE_VALID_CC;
         cache_set_lru(way, set);
-        for ( size_t word = 0 ; word < m_words ; word++ ) 
+        for (size_t word = 0 ; word < m_words ; word++) 
         {
             cache_data(way, set, word) = buf[word] ;
@@ -846,7 +832,7 @@
     void fileTrace(FILE* file)
     {
-        for( size_t nway = 0 ; nway < m_ways ; nway++) 
-        {
-            for( size_t nset = 0 ; nset < m_sets ; nset++) 
+        for (size_t nway = 0 ; nway < m_ways ; nway++) 
+        {
+            for (size_t nset = 0 ; nset < m_sets ; nset++) 
             {
                 fprintf(file, "%d / ", (int)cache_state(nway, nset));
@@ -854,9 +840,9 @@
                 fprintf(file, "set %d / ", (int)nset);
                 fprintf(file, "@ = %08zX / ", 
-                        ((cache_tag(nway, nset)*m_sets+nset)*m_words*4));
-                for( size_t nword = m_words ; nword > 0 ; nword--) 
-                {
-                    unsigned int data = cache_data(nway, nset, nword-1);
-                    fprintf(file, "%08X ", data );
+                        ((cache_tag(nway, nset) * m_sets + nset) * m_words * 4));
+                for (size_t nword = m_words ; nword > 0 ; nword--) 
+                {
+                    unsigned int data = cache_data(nway, nset, nword - 1);
+                    fprintf(file, "%08X ", data);
                 }
                 fprintf(file, "\n");
@@ -868,7 +854,7 @@
     inline void printTrace()
     {
-        for ( size_t way = 0; way < m_ways ; way++ ) 
-        {
-            for ( size_t set = 0 ; set < m_sets ; set++ )
+        for (size_t way = 0; way < m_ways ; way++) 
+        {
+            for (size_t set = 0 ; set < m_sets ; set++)
             {
                 addr_t addr = (((addr_t)cache_tag(way,set))*m_words*m_sets+m_words*set)*4;
@@ -878,5 +864,5 @@
                           << std::hex << " | @ " << addr;
 
-                for ( size_t word = 0 ; word < m_words ; word++ )
+                for (size_t word = 0 ; word < m_words ; word++)
                 {
                     std::cout << " | " << cache_data(way,set,word) ;
@@ -886,180 +872,5 @@
         }
     }
-
-    ///////////////////////////////////////////////////////////////////////////
-    // This function is deprecated as it is difficult to implement in 1 cycle.
-    ///////////////////////////////////////////////////////////////////////////
-    __attribute__((deprecated))
-    inline bool inval(addr_t 	ad)
-    {
-        bool              hit = false;
-        const addr_t      tag = m_z[ad];
-        const size_t      set = m_y[ad];
-
-        for ( size_t way = 0 ; way < m_ways && !hit ; way++ ) 
-        {
-            if ( (tag == cache_tag(way, set)) and
-                 (cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC) ) 
-            {
-                hit                   = true;
-                cache_state(way, set) = CACHE_SLOT_STATE_EMPTY;
-                cache_lru(way, set)   = false;
-            }
-        }
-        return hit;
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////
-    // This function is deprecated as it is difficult to implement in 1 cycle.
-    ////////////////////////////////////////////////////////////////////////////////
-    __attribute__((deprecated))
-    inline bool inval( addr_t 	ad, 
-                       size_t* 	selway, 
-                       size_t* 	selset )
-    {
-        bool            hit = false;
-        const addr_t    tag = m_z[ad];
-        const size_t    set = m_y[ad];
-
-        for ( size_t way = 0 ; way < m_ways && !hit ; way++ ) 
-        {
-            if ( (tag == cache_tag(way, set)) and 
-                 (cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC) ) 
-            {
-                hit                   = true;
-                cache_state(way, set) = CACHE_SLOT_STATE_EMPTY;
-                cache_lru(way, set)   = false;
-                *selway             = way;
-                *selset             = set;
-            }
-        }
-        return hit;
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////
-    // This function is deprecated as the directory must be a dual port RAM...
-    ////////////////////////////////////////////////////////////////////////////////
-    __attribute__((deprecated))
-    inline bool update( addr_t 	ad, 
-                        data_t* buf, 
-                        addr_t* victim )
-    {
-        size_t set, way;
-        bool   cleanup = victim_select(ad, victim, &way, &set);
-        victim_update_tag (ad, way, set);
-
-        for ( size_t word = 0 ; word < m_words ; word++ ) {
-            cache_data(way, set, word) = buf[word] ;
-        }
-
-        return cleanup;
-    }
-
-    ////////////////////////////////////////////////////////////////////////////
-    // this function is deprecated, as it is difficult to implement in 1 cycle. 
-    ////////////////////////////////////////////////////////////////////////////
-    __attribute__((deprecated))
-    inline bool write(addr_t 	ad, 
-                      data_t 	dt)
-    {
-        const addr_t      tag  = m_z[ad];
-        const size_t      set  = m_y[ad];
-        const size_t      word = m_x[ad];
-
-        for ( size_t way = 0; way < m_ways; way++ ) 
-        {
-            if ( (tag == cache_tag(way, set)) and
-                 (cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC) ) 
-            {
-                cache_data(way, set, word) = dt;
-                cache_set_lru(way, set);
-                return true;
-            }
-        }
-        return false;
-    }
-
-    ////////////////////////////////////////////////////////////////////////////
-    // this function is deprecated, as it is difficult to implement in 1 cycle. 
-    ////////////////////////////////////////////////////////////////////////////
-    __attribute__((deprecated))
-    inline bool write(addr_t 	ad, 
-                      data_t 	dt, 
-                      be_t 	be)
-    {
-        const addr_t      tag  = m_z[ad];
-        const size_t      set  = m_y[ad];
-        const size_t      word = m_x[ad];
-
-        for ( size_t way = 0; way < m_ways; way++ ) 
-        {
-            if ( (tag == cache_tag(way, set)) and 
-                 (cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC) ) 
-            {
-                data_t mask = be2mask(be);
-                data_t prev = cache_data(way, set, word);
-                cache_data(way, set, word) = (mask & dt) | (~mask & prev);
-                cache_set_lru(way, set);
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    /////////////////////////////////////////////////////////////////////////////
-    // this function is deprecated, as it is difficult to implement in 1 cycle. 
-    /////////////////////////////////////////////////////////////////////////////
-    __attribute__((deprecated))
-    inline bool write(addr_t 	ad, 
-                      data_t 	dt, 
-                      size_t* 	nway)
-    {
-        const addr_t      tag  = m_z[ad];
-        const size_t      set  = m_y[ad];
-        const size_t      word = m_x[ad];
-
-        for ( size_t way = 0; way < m_ways; way++ ) 
-        {
-            if ( (tag == cache_tag(way, set)) and
-                 (cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC) ) 
-            {
-                cache_data(way, set, word) = dt;
-                cache_set_lru(way, set);
-                *nway = way;
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /////////////////////////////////////////////////////////////////////////////
-    // this function is deprecated, as it is difficult to implement in 1 cycle. 
-    /////////////////////////////////////////////////////////////////////////////
-    __attribute__((deprecated))
-    inline bool write(addr_t 	ad, 
-                      data_t 	dt, 
-                      size_t* 	nway, 
-                      be_t 	be)
-    {
-        const addr_t      tag  = m_z[ad];
-        const size_t      set  = m_y[ad];
-        const size_t      word = m_x[ad];
-
-        for ( size_t way = 0; way < m_ways; way++ ) 
-        {
-            if ( (tag == cache_tag(way, set)) and 
-                 (cache_state(way, set) == CACHE_SLOT_STATE_VALID_CC) ) 
-            {
-                data_t mask = be2mask(be);
-                data_t prev = cache_data(way, set, word);
-                cache_data(way, set, word) = (mask & dt) | (~mask & prev);
-                cache_set_lru(way, set);
-                *nway = way;
-                return true;
-            }
-        }
-        return false;
-    }
-    
+   
 };
 
Index: branches/RWT/lib/generic_cache_tsar/metadata/generic_cache.sd
===================================================================
--- branches/RWT/lib/generic_cache_tsar/metadata/generic_cache.sd	(revision 767)
+++ branches/RWT/lib/generic_cache_tsar/metadata/generic_cache.sd	(revision 771)
@@ -4,12 +4,14 @@
 __version__ = "$Revision: 917 $"
 
-Module('caba:generic_cache_tsar',
-	classname = 'soclib::GenericCache',
-	header_files = ['../include/generic_cache.h',],
-	   tmpl_parameters = [
-	parameter.Type('addr_t'),
-	],
-	uses = [Uses('common:mapping_table'),
-			Uses('common:address_masking_table',
-				 data_t = parameter.Reference('addr_t')),],
+Module('caba:generic_cache_tsar_rwt',
+    classname = 'soclib::GenericCache',
+    header_files = ['../include/generic_cache.h',],
+    tmpl_parameters = [
+        parameter.Type('addr_t'),
+    ],
+    uses = [
+         Uses('common:mapping_table'),
+         Uses('common:address_masking_table',
+              data_t = parameter.Reference('addr_t')),
+    ],
 )
