Index: /trunk/lib/generic_cache_tsar/include/generic_cache.h
===================================================================
--- /trunk/lib/generic_cache_tsar/include/generic_cache.h	(revision 392)
+++ /trunk/lib/generic_cache_tsar/include/generic_cache.h	(revision 393)
@@ -34,5 +34,5 @@
 // This object is a generic, set associative, cache.
 // Each slot can be in three states: VALID, EMPTY or ZOMBI.
-// The ZOMBI state is used by cache coherence protocoles to indicate
+// The ZOMBI state is used by cache coherence protocols to indicate
 // a pending cleanup request.
 // Hit if ( (matching tag) and (state == VALID).
@@ -59,6 +59,4 @@
 // Template parameter is :
 // - addr_t : address format to access the cache 
-// The address can be larger than 32 bits, but the TAG field 
-// cannot be larger than 32 bits.
 /////////////////////////////////////////////////////////////////////////////////
 
@@ -88,9 +86,8 @@
 {
     typedef uint32_t    data_t;
-    typedef uint32_t    tag_t;
     typedef uint32_t    be_t;
 
     data_t              *r_data ;
-    tag_t               *r_tag ;
+    addr_t               *r_tag ;
     int                 *r_state;
     bool                *r_lru ;
@@ -111,5 +108,5 @@
 
     //////////////////////////////////////////////
-    inline tag_t &cache_tag(size_t way, size_t set)
+    inline addr_t &cache_tag(size_t way, size_t set)
     {
         return r_tag[(way*m_sets)+set];
@@ -146,5 +143,5 @@
     }
 
-    /////////////////////////////////////////////
+    ////////////////////////////////
     inline data_t be2mask( be_t be )
     {
@@ -159,5 +156,5 @@
 public:
 
-    //////////////////////////////////////////////
+    //////////////////////////////////////////
     GenericCache(   const std::string   &name,
                     size_t              nways, 
@@ -187,13 +184,16 @@
 
 #ifdef GENERIC_CACHE_DEBUG
-        std::cout
-            << " m_x: " << m_x
-            << " m_y: " << m_y
-            << " m_z: " << m_z
-            << std::endl;
+std::cout << "constructing " << name << std::endl
+          << "- nways  = " << nways << std::endl
+          << "- nsets  = " << nsets << std::endl
+          << "- nwords = " << nwords << std::endl
+          << " m_x: " << m_x 
+          << " m_y: " << m_y
+          << " m_z: " << m_z
+          << std::endl;
 #endif
 
         r_data    = new data_t[nways*nsets*nwords];
-        r_tag     = new tag_t[nways*nsets];
+        r_tag     = new addr_t[nways*nsets];
         r_state   = new int[nways*nsets];
         r_lru     = new bool[nways*nsets];
@@ -226,5 +226,5 @@
                       data_t* 	dt)
     {
-        const tag_t       tag  = m_z[ad];
+        const addr_t      tag  = m_z[ad];
         const size_t      set  = m_y[ad];
         const size_t      word = m_x[ad];
@@ -255,5 +255,5 @@
                       size_t*   selword) 
     {
-        const tag_t       tag  = m_z[ad];
+        const addr_t      tag  = m_z[ad];
         const size_t      set  = m_y[ad];
         const size_t      word = m_x[ad];
@@ -292,5 +292,5 @@
                       int*      state ) 
     {
-        const tag_t       tag  = m_z[ad];
+        const addr_t      tag  = m_z[ad];
         const size_t      set  = m_y[ad];
         const size_t      word = m_x[ad];
@@ -340,5 +340,5 @@
 			                  size_t*   selword) 
     {
-        const tag_t       tag  = m_z[ad];
+        const addr_t      tag  = m_z[ad];
         const size_t      set  = m_y[ad];
         const size_t      word = m_x[ad];
@@ -375,5 +375,5 @@
                       size_t*   selword)
     {
-        const tag_t       tag  = m_z[ad];
+        const addr_t      tag  = m_z[ad];
         const size_t      set  = m_y[ad];
         const size_t      word = m_x[ad];
@@ -417,5 +417,5 @@
                       int*      state ) 
     {
-        const tag_t       tag  = m_z[ad];
+        const addr_t      tag  = m_z[ad];
         const size_t      set  = m_y[ad];
         const size_t      word = m_x[ad];
@@ -470,5 +470,5 @@
                       size_t*   selword)
     {
-        const tag_t       tag  = m_z[ad];
+        const addr_t      tag  = m_z[ad];
         const size_t      set  = m_y[ad];
         const size_t      word = m_x[ad];
@@ -490,5 +490,5 @@
   
     ///////////////////////////////////////////////////////////////////////////////
-    // Checks the cache state for a given address, wehn the ZOMBI state is used.
+    // Checks the cache state for a given address, when the ZOMBI state is used.
     // Only the directory is accessed. 
     // Returns the access status in the state argument:
@@ -506,5 +506,5 @@
                            size_t*  word)
     {
-        const tag_t       ad_tag  = m_z[ad];
+        const addr_t      ad_tag  = m_z[ad];
         const size_t      ad_set  = m_y[ad];
         const size_t      ad_word = m_x[ad];
@@ -534,5 +534,5 @@
     inline void read_dir(  size_t 	way,
                            size_t 	set,
-                           tag_t*   tag,
+                           addr_t*   tag,
                            int*     state )
     {
@@ -542,5 +542,5 @@
 
     ////////////////////////////////////////////
-    inline tag_t get_tag(size_t way, size_t set)
+    inline addr_t get_tag(size_t way, size_t set)
     {
         return cache_tag(way, set);
@@ -684,5 +684,5 @@
                 *way     = _way;
                 *set     = m_y[ad];
-                *victim  = (addr_t)((cache_tag(*way,_set) * m_sets) + _set);
+                *victim  = cache_tag(*way,_set) * m_sets + _set;
                 return;
             }
@@ -697,5 +697,5 @@
                 *way    = _way;
                 *set     = m_y[ad];
-                *victim  = (addr_t)((cache_tag(*way,_set) * m_sets) + _set);
+                *victim  = cache_tag(*way,_set) * m_sets + _set;
                 return;
             }
@@ -715,5 +715,5 @@
                                    size_t 	set )
     {
-        tag_t  tag     = m_z[ad];
+        addr_t  tag     = m_z[ad];
 
         cache_tag(way, set)   = tag;
@@ -731,5 +731,5 @@
                            int      state)
     {
-        tag_t  tag     = m_z[ad];
+        addr_t  tag     = m_z[ad];
 
         assert( ( (state == CACHE_SLOT_STATE_VALID) or 
@@ -751,7 +751,7 @@
 
     //////////////////////////////////////////////////////////////////
-    // This function write the directory part of a slot
+    // This function change the state of a slot
     // identified by the way & set, when using the ZOMBI state.
-    // Does not affect the tag
+    // It does not affect the tag
     //////////////////////////////////////////////////////////////////
     inline void write_dir( size_t 	way, 
@@ -785,5 +785,5 @@
                        data_t* 	buf)
     {
-        tag_t tag = m_z[ad];
+        addr_t tag = m_z[ad];
 
         cache_tag(way, set)   = tag;
@@ -825,8 +825,10 @@
             for ( size_t set = 0 ; set < m_sets ; set++ )
             {
-                std::cout << std::dec << cache_state(way, set) << " | " ;
-                std::cout << "way " << way << " | " ;
-                std::cout << "set " << set << std::hex << " | " ;
-                std::cout << "@ " << (cache_tag(way,set)*m_words*m_sets+m_words*set)*4 ;
+                addr_t addr = (((addr_t)cache_tag(way,set))*m_words*m_sets+m_words*set)*4;
+                std::cout << std::dec << cache_state(way, set) 
+                          << " | way " << way 
+                          << " | set " << set 
+                          << std::hex << " | @ " << addr;
+
                 for ( size_t word = 0 ; word < m_words ; word++ )
                 {
@@ -845,5 +847,5 @@
     {
         bool              hit = false;
-        const tag_t       tag = m_z[ad];
+        const addr_t      tag = m_z[ad];
         const size_t      set = m_y[ad];
 
@@ -869,6 +871,6 @@
                        size_t* 	selset )
     {
-        bool    	hit = false;
-        const tag_t     tag = m_z[ad];
+        bool            hit = false;
+        const addr_t    tag = m_z[ad];
         const size_t    set = m_y[ad];
 
@@ -914,5 +916,5 @@
                       data_t 	dt)
     {
-        const tag_t       tag  = m_z[ad];
+        const addr_t      tag  = m_z[ad];
         const size_t      set  = m_y[ad];
         const size_t      word = m_x[ad];
@@ -939,5 +941,5 @@
                       be_t 	be)
     {
-        tag_t       tag  = m_z[ad];
+        const addr_t      tag  = m_z[ad];
         const size_t      set  = m_y[ad];
         const size_t      word = m_x[ad];
@@ -966,5 +968,5 @@
                       size_t* 	nway)
     {
-        const tag_t       tag  = m_z[ad];
+        const addr_t      tag  = m_z[ad];
         const size_t      set  = m_y[ad];
         const size_t      word = m_x[ad];
@@ -993,5 +995,5 @@
                       be_t 	be)
     {
-        const tag_t       tag  = m_z[ad];
+        const addr_t      tag  = m_z[ad];
         const size_t      set  = m_y[ad];
         const size_t      word = m_x[ad];
