Index: trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
===================================================================
--- trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp	(revision 496)
+++ trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp	(revision 499)
@@ -926,9 +926,4 @@
         bool        config   = false;
 
-        // register arguments for response (segmentation violation or config)
-        r_tgt_cmd_to_tgt_rsp_srcid = p_vci_tgt.srcid.read();
-        r_tgt_cmd_to_tgt_rsp_trdid = p_vci_tgt.trdid.read();
-        r_tgt_cmd_to_tgt_rsp_pktid = p_vci_tgt.pktid.read();
-
         for(size_t seg_id = 0 ; (seg_id < m_nseg) and not found ; seg_id++)
         {
@@ -1014,4 +1009,7 @@
     if ( p_vci_tgt.cmdval and p_vci_tgt.eop )
     {
+        r_tgt_cmd_to_tgt_rsp_srcid = p_vci_tgt.srcid.read();
+        r_tgt_cmd_to_tgt_rsp_trdid = p_vci_tgt.trdid.read();
+        r_tgt_cmd_to_tgt_rsp_pktid = p_vci_tgt.pktid.read();
         r_tgt_cmd_to_tgt_rsp_req   = true;
         r_tgt_cmd_to_tgt_rsp_error = 1;
@@ -1059,6 +1057,5 @@
         }
         else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)  // release lock
-                   and (cell == MEMC_LOCK)
-                   and (p_vci_tgt.srcid.read() == r_tgt_cmd_srcid.read()) )
+                   and (cell == MEMC_LOCK) )
         {
             need_rsp         = true;
@@ -1067,6 +1064,5 @@
         }
         else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)   // set addr_lo
-                   and (cell == MEMC_ADDR_LO)
-                   and (p_vci_tgt.srcid.read() == r_tgt_cmd_srcid.read()) )
+                   and (cell == MEMC_ADDR_LO) )
         {
             assert( ((wdata % (m_words*vci_param_int::B)) == 0) and
@@ -1076,9 +1072,8 @@
             error            = 0;
             r_config_address = (r_config_address.read() & 0xFFFFFFFF00000000LL) |
-                               (addr_t)p_vci_tgt.wdata.read();
+                               ((addr_t)wdata);
         }
         else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)   // set addr_hi
-                   and (cell == MEMC_ADDR_HI)
-                   and (p_vci_tgt.srcid.read() == r_tgt_cmd_srcid.read()) )
+                   and (cell == MEMC_ADDR_HI) )
 
         {
@@ -1086,24 +1081,22 @@
             error            = 0;
             r_config_address = (r_config_address.read() & 0x00000000FFFFFFFFLL) |
-                               ((addr_t)p_vci_tgt.wdata.read())<<32;
+                               (((addr_t)wdata)<<32);
         }
         else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)   // set buf_lines
-                   and (cell == MEMC_BUF_LENGTH)
-                   and (p_vci_tgt.srcid.read() == r_tgt_cmd_srcid.read()) )
+                   and (cell == MEMC_BUF_LENGTH) )
         {
             need_rsp         = true;
             error            = 0;
-            size_t lines = (size_t)(p_vci_tgt.wdata.read()/(m_words<<2));
-            if ( r_config_address.read()%(m_words*4) ) lines++;
+            size_t lines     = wdata/(m_words<<2);
+            if ( wdata%(m_words<<2) ) lines++;
             r_config_cmd_lines  = lines;
             r_config_rsp_lines  = lines;
         }
         else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE)   // set cmd type
-                   and (cell == MEMC_CMD_TYPE)
-                   and (p_vci_tgt.srcid.read() == r_tgt_cmd_srcid.read()) )
+                   and (cell == MEMC_CMD_TYPE) )
         {
             need_rsp         = false;
             error            = 0;
-            r_config_cmd     = p_vci_tgt.wdata.read();
+            r_config_cmd     = wdata;
 
             // prepare delayed response from CONFIG FSM
@@ -1123,4 +1116,7 @@
             if ( r_tgt_cmd_to_tgt_rsp_req.read() ) break;
 
+            r_tgt_cmd_to_tgt_rsp_srcid = p_vci_tgt.srcid.read();
+            r_tgt_cmd_to_tgt_rsp_trdid = p_vci_tgt.trdid.read();
+            r_tgt_cmd_to_tgt_rsp_pktid = p_vci_tgt.pktid.read();
             r_tgt_cmd_to_tgt_rsp_req   = true;
             r_tgt_cmd_to_tgt_rsp_error = error;
@@ -1560,16 +1556,16 @@
           DirectoryEntry entry = m_cache_directory.read(r_config_address.read(), way);
 
+          r_config_dir_way        = way;
+          r_config_dir_copy_inst  = entry.owner.inst;
+          r_config_dir_copy_srcid = entry.owner.srcid;
+          r_config_dir_is_cnt     = entry.is_cnt;
+          r_config_dir_lock       = entry.lock;
+          r_config_dir_count      = entry.count;
+          r_config_dir_ptr        = entry.ptr;
+
           if ( entry.valid and                            // hit & inval command
                (r_config_cmd.read() == MEMC_CMD_INVAL) ) 
           {
-              r_config_dir_way        = way;
-              r_config_dir_copy_inst  = entry.owner.inst;
-              r_config_dir_copy_srcid = entry.owner.srcid;
-              r_config_dir_is_cnt     = entry.is_cnt;
-              r_config_dir_lock       = entry.lock;
-              r_config_dir_count      = entry.count;
-              r_config_dir_ptr        = entry.ptr;
-
-              r_config_fsm    = CONFIG_IVT_LOCK;
+              r_config_fsm       = CONFIG_IVT_LOCK;
           }
           else if ( entry.valid and                       // hit & sync command
@@ -1577,5 +1573,5 @@
                     (r_config_cmd.read() == MEMC_CMD_SYNC) )
           { 
-              r_config_fsm  = CONFIG_TRT_LOCK;
+              r_config_fsm       = CONFIG_TRT_LOCK;
           }
           else                                            // miss : return to LOOP 
@@ -1583,5 +1579,4 @@
               r_config_cmd_lines = r_config_cmd_lines.read() - 1;
               r_config_rsp_lines = r_config_rsp_lines.read() - 1;
-              r_config_cmd_lines = r_config_cmd_lines.read() - 1;
               r_config_address   = r_config_address.read() + (m_words<<2);
               r_config_fsm       = CONFIG_LOOP;
@@ -1635,7 +1630,5 @@
                   entry.owner.inst  = r_config_dir_copy_inst.read();
                   entry.owner.srcid = r_config_dir_copy_srcid.read();
-                  m_cache_directory.write( set, 
-                                           way, 
-                                           entry );
+                  m_cache_directory.write( set, way, entry );
 
                   r_config_trt_index = index;
@@ -1663,27 +1656,29 @@
 
           // read data into cache
-          size_t          way = r_config_dir_way.read();
-          size_t          set = m_y[r_config_address.read()];
-
-          sc_signal<data_t> config_data[16];
-          m_cache_data.read_line( way, 
-                                  set, 
-                                  config_data );
-            
-          // post a PUT request in TRT
+          size_t              way = r_config_dir_way.read();
+          size_t              set = m_y[r_config_address.read()];
           std::vector<data_t> data_vector;
           data_vector.clear();
-          for(size_t i=0; i<m_words; i++) data_vector.push_back(config_data[i].read());
+          for(size_t word=0; word<m_words; word++) 
+          {
+              uint32_t data = m_cache_data.read( way, set, word );
+              data_vector.push_back( data );
+          }
+
+          // post the PUT request in TRT
           m_trt.set( r_config_trt_index.read(),
-                     false,                               // PUT
-                     m_nline[r_config_address.read()],    // nline
-                     0,                                   // srcid:       unused
-                     0,                                   // trdid:       unused
-                     0,                                   // pktid:       unused
+                     false,                               // PUT transaction
+                     m_nline[r_config_address.read()],    // line index
+                     0,                                   // srcid:           unused
+                     0,                                   // trdid:           unused
+                     0,                                   // pktid:           unused
                      false,                               // not proc_read
-                     0,                                   // read_length: unused
-                     0,                                   // word_index:  unused
-                     std::vector<be_t>(m_words,0xF),                         
-                     data_vector);
+                     0,                                   // read_length:     unused
+                     0,                                   // word_index:      unused
+                     std::vector<be_t>(m_words,0xF),      // byte-enable:     unused 
+                     data_vector,                         // data to be written
+                     0,                                   // ll_key:          unused
+                     true );                              // requested by config FSM
+          r_config_fsm = CONFIG_PUT_REQ;
 
 #if DEBUG_MEMC_CONFIG
@@ -1696,5 +1691,5 @@
       }
       ////////////////////
-      case CONFIG_PUT_REQ:       // PUT request to IXR_CMD_FSM
+      case CONFIG_PUT_REQ:       // post PUT request to IXR_CMD_FSM
       {
           if ( not r_config_to_ixr_cmd_req.read() )
@@ -1710,5 +1705,5 @@
 #if DEBUG_MEMC_CONFIG
 if(m_debug)
-std::cout << "  <MEMC " << name() << " CONFIG_PUT_REQ> PUT request to IXR_CMD_FSM"
+std::cout << "  <MEMC " << name() << " CONFIG_PUT_REQ> post PUT request to IXR_CMD_FSM"
           << " / address = " << std::hex << r_config_address.read() << std::endl; 
 #endif
