Index: /branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
===================================================================
--- /branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp	(revision 538)
+++ /branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp	(revision 539)
@@ -304,5 +304,5 @@
   "ALLOC_TRT_XRAM_RSP",
   "ALLOC_TRT_IXR_RSP",
-  "ALLOC_TRT_CLEANUP"
+  "ALLOC_TRT_CLEANUP",
   "ALLOC_TRT_IXR_CMD",
   "ALLOC_TRT_CONFIG"
@@ -4505,8 +4505,4 @@
 
         r_xram_rsp_victim_copy      = victim.owner.srcid;
-
-#if L1_MULTI_CACHE
-        r_xram_rsp_victim_copy_cache= victim.owner.cache_id;
-#endif
         r_xram_rsp_victim_coherent  = victim.cache_coherent;
         r_xram_rsp_victim_copy_inst = victim.owner.inst;
@@ -4529,4 +4525,5 @@
           << " way = " << std::dec << way
           << " / set = " << set
+          << "/ count = " << victim.count
           << " / inval_required = " << inval << std::endl;
 #endif
@@ -4694,4 +4691,5 @@
           << " / owner_ins = " << std::dec << entry.owner.inst
           << " / count = " << entry.count
+          << " / nline = " << r_xram_rsp_trt_buf.nline
           << " / is_cnt = " << entry.is_cnt << std::endl;
 if(r_xram_rsp_victim_inval.read())
@@ -8590,9 +8588,9 @@
           r_alloc_trt_fsm = ALLOC_TRT_IXR_RSP;
         
+        else if( r_config_fsm.read() == CONFIG_TRT_LOCK ) 
+          r_alloc_trt_fsm = ALLOC_TRT_CONFIG;
+
         else if (r_cleanup_fsm.read() == CLEANUP_IXR_REQ)
           r_alloc_trt_fsm = ALLOC_TRT_CLEANUP;
-
-        else if( r_config_fsm.read() == CONFIG_TRT_LOCK ) 
-          r_alloc_trt_fsm = ALLOC_TRT_CONFIG;
 
         else if(r_read_fsm.read() == READ_TRT_LOCK)
@@ -8628,10 +8626,10 @@
           r_alloc_trt_fsm = ALLOC_TRT_IXR_RSP;
         
+        else if( r_config_fsm.read() == CONFIG_TRT_LOCK ) 
+          r_alloc_trt_fsm = ALLOC_TRT_CONFIG;
+
         else if (r_cleanup_fsm.read() == CLEANUP_IXR_REQ)
           r_alloc_trt_fsm = ALLOC_TRT_CLEANUP;
 
-        else if( r_config_fsm.read() == CONFIG_TRT_LOCK ) 
-          r_alloc_trt_fsm = ALLOC_TRT_CONFIG;
- 
         else if(r_read_fsm.read() == READ_TRT_LOCK)
           r_alloc_trt_fsm = ALLOC_TRT_READ;
@@ -8664,10 +8662,9 @@
                   r_alloc_trt_fsm = ALLOC_TRT_IXR_RSP;
 
+              else if( r_config_fsm.read() == CONFIG_TRT_LOCK ) 
+                  r_alloc_trt_fsm = ALLOC_TRT_CONFIG;
+
               else if (r_cleanup_fsm.read() == CLEANUP_IXR_REQ)
                   r_alloc_trt_fsm = ALLOC_TRT_CLEANUP;
-
-
-              else if( r_config_fsm.read() == CONFIG_TRT_LOCK ) 
-                  r_alloc_trt_fsm = ALLOC_TRT_CONFIG;
 
               else if(r_read_fsm.read() == READ_TRT_LOCK)
@@ -8695,4 +8692,7 @@
             (r_ixr_rsp_fsm.read() == IXR_RSP_TRT_READ))
           r_alloc_trt_fsm = ALLOC_TRT_IXR_RSP;
+
+         else if( r_config_fsm.read() == CONFIG_TRT_LOCK ) 
+          r_alloc_trt_fsm = ALLOC_TRT_CONFIG;
         
         else if (r_cleanup_fsm.read() == CLEANUP_IXR_REQ)
@@ -8710,7 +8710,4 @@
           r_alloc_trt_fsm = ALLOC_TRT_CAS;
 
-        else if( r_config_fsm.read() == CONFIG_TRT_LOCK ) 
-          r_alloc_trt_fsm = ALLOC_TRT_CONFIG;
- 
         else if((r_ixr_cmd_fsm.read() == IXR_CMD_READ_TRT) or
                (r_ixr_cmd_fsm.read() == IXR_CMD_WRITE_TRT) or
@@ -8769,5 +8766,42 @@
       break;
 
-      ////////////////////////
+      //////////////////////
+      case ALLOC_TRT_CONFIG:
+          if((r_config_fsm.read() != CONFIG_TRT_LOCK) and
+             (r_config_fsm.read() != CONFIG_TRT_SET))
+          {
+              if (r_cleanup_fsm.read() == CLEANUP_IXR_REQ)
+                  r_alloc_trt_fsm = ALLOC_TRT_CLEANUP;
+
+              else if(r_read_fsm.read() == READ_TRT_LOCK)
+                  r_alloc_trt_fsm = ALLOC_TRT_READ;
+
+              else if((r_write_fsm.read() == WRITE_MISS_TRT_LOCK) or
+                      (r_write_fsm.read() == WRITE_BC_TRT_LOCK))
+                  r_alloc_trt_fsm = ALLOC_TRT_WRITE;
+
+              else if((r_cas_fsm.read() == CAS_MISS_TRT_LOCK) or
+                      (r_cas_fsm.read() == CAS_BC_TRT_LOCK))
+                  r_alloc_trt_fsm = ALLOC_TRT_CAS;
+
+              else if((r_ixr_cmd_fsm.read() == IXR_CMD_READ_TRT) or
+                      (r_ixr_cmd_fsm.read() == IXR_CMD_WRITE_TRT) or
+                      (r_ixr_cmd_fsm.read() == IXR_CMD_CAS_TRT) or
+                      (r_ixr_cmd_fsm.read() == IXR_CMD_XRAM_TRT) or
+                      (r_ixr_cmd_fsm.read() == IXR_CMD_CLEANUP_TRT) or
+                      (r_ixr_cmd_fsm.read() == IXR_CMD_CONFIG_TRT) )
+                  r_alloc_trt_fsm = ALLOC_TRT_IXR_CMD;
+
+              else if((r_xram_rsp_fsm.read()  == XRAM_RSP_DIR_LOCK) and
+                      (r_alloc_dir_fsm.read() == ALLOC_DIR_XRAM_RSP))
+                  r_alloc_trt_fsm = ALLOC_TRT_XRAM_RSP;
+
+              else if((r_ixr_rsp_fsm.read() == IXR_RSP_TRT_ERASE) or
+                      (r_ixr_rsp_fsm.read() == IXR_RSP_TRT_READ))
+                  r_alloc_trt_fsm = ALLOC_TRT_IXR_RSP;
+          }
+          break;
+
+    ////////////////////////
     case ALLOC_TRT_CLEANUP:
       /*ODCCP*///std::cout << "TRT ALLOCATED TO CLEANUP" << std::endl;
@@ -8784,15 +8818,4 @@
                 (r_cas_fsm.read() == CAS_BC_TRT_LOCK))
           r_alloc_trt_fsm = ALLOC_TRT_CAS;
-
-        else if((r_xram_rsp_fsm.read()  == XRAM_RSP_DIR_LOCK) and
-                (r_alloc_dir_fsm.read() == ALLOC_DIR_XRAM_RSP))
-          r_alloc_trt_fsm = ALLOC_TRT_XRAM_RSP;
-
-        else if((r_ixr_rsp_fsm.read() == IXR_RSP_TRT_ERASE) ||
-            (r_ixr_rsp_fsm.read() == IXR_RSP_TRT_READ))
-          r_alloc_trt_fsm = ALLOC_TRT_IXR_RSP;
-
-        else if( r_config_fsm.read() == CONFIG_TRT_LOCK ) 
-          r_alloc_trt_fsm = ALLOC_TRT_CONFIG;
 
         else if((r_ixr_cmd_fsm.read() == IXR_CMD_READ_TRT) or
@@ -8803,42 +8826,17 @@
                 (r_ixr_cmd_fsm.read() == IXR_CMD_CONFIG_TRT) )
           r_alloc_trt_fsm = ALLOC_TRT_IXR_CMD;
-      }
-      break;
-      //////////////////////
-      case ALLOC_TRT_CONFIG:
-          if((r_config_fsm.read() != CONFIG_TRT_LOCK) and
-             (r_config_fsm.read() != CONFIG_TRT_SET))
-          {
-              if(r_read_fsm.read() == READ_TRT_LOCK)
-                  r_alloc_trt_fsm = ALLOC_TRT_READ;
-
-              else if((r_write_fsm.read() == WRITE_MISS_TRT_LOCK) or
-                      (r_write_fsm.read() == WRITE_BC_TRT_LOCK))
-                  r_alloc_trt_fsm = ALLOC_TRT_WRITE;
-
-              else if((r_cas_fsm.read() == CAS_MISS_TRT_LOCK) or
-                      (r_cas_fsm.read() == CAS_BC_TRT_LOCK))
-                  r_alloc_trt_fsm = ALLOC_TRT_CAS;
-
-              else if((r_ixr_cmd_fsm.read() == IXR_CMD_READ_TRT) or
-                      (r_ixr_cmd_fsm.read() == IXR_CMD_WRITE_TRT) or
-                      (r_ixr_cmd_fsm.read() == IXR_CMD_CAS_TRT) or
-                      (r_ixr_cmd_fsm.read() == IXR_CMD_XRAM_TRT) or
-                      (r_ixr_cmd_fsm.read() == IXR_CMD_CLEANUP_TRT) or
-                      (r_ixr_cmd_fsm.read() == IXR_CMD_CONFIG_TRT) )
-                  r_alloc_trt_fsm = ALLOC_TRT_IXR_CMD;
-
-              else if((r_xram_rsp_fsm.read()  == XRAM_RSP_DIR_LOCK) and
-                      (r_alloc_dir_fsm.read() == ALLOC_DIR_XRAM_RSP))
-                  r_alloc_trt_fsm = ALLOC_TRT_XRAM_RSP;
-
-              else if (r_cleanup_fsm.read() == CLEANUP_IXR_REQ)
-                  r_alloc_trt_fsm = ALLOC_TRT_CLEANUP;
-
-              else if((r_ixr_rsp_fsm.read() == IXR_RSP_TRT_ERASE) or
-                      (r_ixr_rsp_fsm.read() == IXR_RSP_TRT_READ))
-                  r_alloc_trt_fsm = ALLOC_TRT_IXR_RSP;
-          }
-          break;
+
+        else if((r_xram_rsp_fsm.read()  == XRAM_RSP_DIR_LOCK) and
+                (r_alloc_dir_fsm.read() == ALLOC_DIR_XRAM_RSP))
+          r_alloc_trt_fsm = ALLOC_TRT_XRAM_RSP;
+
+        else if((r_ixr_rsp_fsm.read() == IXR_RSP_TRT_ERASE) ||
+            (r_ixr_rsp_fsm.read() == IXR_RSP_TRT_READ))
+          r_alloc_trt_fsm = ALLOC_TRT_IXR_RSP;
+
+        else if( r_config_fsm.read() == CONFIG_TRT_LOCK ) 
+          r_alloc_trt_fsm = ALLOC_TRT_CONFIG;
+      }
+      break;
 
 
