Index: /branches/v5/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
===================================================================
--- /branches/v5/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h	(revision 361)
+++ /branches/v5/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h	(revision 362)
@@ -782,4 +782,5 @@
       sc_signal<int>      r_tgt_rsp_fsm;
       sc_signal<size_t>   r_tgt_rsp_cpt;
+      sc_signal<bool>     r_tgt_rsp_key_sent;
 
       ////////////////////////////////////////////////////
Index: /branches/v5/modules/vci_mem_cache/caba/source/include/xram_transaction.h
===================================================================
--- /branches/v5/modules/vci_mem_cache/caba/source/include/xram_transaction.h	(revision 361)
+++ /branches/v5/modules/vci_mem_cache/caba/source/include/xram_transaction.h	(revision 362)
@@ -78,4 +78,5 @@
         wdata.assign(source.wdata.begin(),source.wdata.end());
         rerror      = source.rerror;
+        ll_key      = source.ll_key;
     }
 
Index: /branches/v5/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
===================================================================
--- /branches/v5/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp	(revision 361)
+++ /branches/v5/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp	(revision 362)
@@ -729,4 +729,6 @@
     r_alloc_heap_reset_cpt = 0;
 
+    r_tgt_rsp_key_sent  = false;
+
     // Activity counters
     m_cpt_cycles        = 0;
@@ -6195,31 +6197,46 @@
     case TGT_RSP_READ:    // send the response to a read
     {
-      if(p_vci_tgt.rspack)
+      if ( p_vci_tgt.rspack )
       {
 
 #if DEBUG_MEMC_TGT_RSP
-        if(m_debug_tgt_rsp_fsm)
-        {
-          std::cout << "  <MEMC " << name() << ".TGT_RSP_READ> Read response"
-                    << " / rsrcid = " << std::dec << r_read_to_tgt_rsp_srcid.read()
-                    << " / rtrdid = " << r_read_to_tgt_rsp_trdid.read()
-                    << " / rpktid = " << r_read_to_tgt_rsp_pktid.read()
-                    << " / rdata = " << std::hex << r_read_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read()
-                    << " / cpt = " << std::dec << r_tgt_rsp_cpt.read() << std::endl;
-        }
-#endif
-        if(r_tgt_rsp_cpt.read() == (r_read_to_tgt_rsp_word.read() +r_read_to_tgt_rsp_length-1))
-        {
-          r_tgt_rsp_fsm = TGT_RSP_READ_IDLE;
+if( m_debug_tgt_rsp_fsm )
+{
+  std::cout
+    << "  <MEMC " << name() << ".TGT_RSP_READ> Read response"
+    << " / rsrcid = " << std::dec << r_read_to_tgt_rsp_srcid.read()
+    << " / rtrdid = " << r_read_to_tgt_rsp_trdid.read()
+    << " / rpktid = " << r_read_to_tgt_rsp_pktid.read()
+    << " / rdata = " << std::hex << r_read_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read()
+    << " / cpt = " << std::dec << r_tgt_rsp_cpt.read() << std::endl;
+}
+#endif
+  
+        uint32_t last_word_idx = r_read_to_tgt_rsp_word.read() + r_read_to_tgt_rsp_length.read() - 1;
+        bool     is_last_word  = (r_tgt_rsp_cpt.read() == last_word_idx);
+        bool     is_ll         = ((r_read_to_tgt_rsp_pktid.read() & 0x7) == TYPE_LL);
+
+        if ( (is_last_word and not is_ll) or (r_tgt_rsp_key_sent.read() and is_ll))
+        {
+          // Last word in case of READ or second flit in case if LL
+          r_tgt_rsp_key_sent    = false;
           r_read_to_tgt_rsp_req = false;
+          r_tgt_rsp_fsm         = TGT_RSP_READ_IDLE;
         }
         else
         {
-          r_tgt_rsp_cpt = r_tgt_rsp_cpt.read() + 1;
-        }
-      }
-      break;
-    }
-    ///////////////////
+          if (is_ll)
+          {
+            r_tgt_rsp_key_sent = true;                // Send second flit of ll
+          }
+          else
+          {
+            r_tgt_rsp_cpt = r_tgt_rsp_cpt.read() + 1; // Send next word of read
+          }
+        }
+      }
+      break;
+    }
+    //////////////////
     case TGT_RSP_WRITE:   // send the write acknowledge
     {
@@ -6285,28 +6302,42 @@
     case TGT_RSP_XRAM:    // send the response after XRAM access
     {
-      if(p_vci_tgt.rspack)
+      if ( p_vci_tgt.rspack )
       {
 
 #if DEBUG_MEMC_TGT_RSP
-        if(m_debug_tgt_rsp_fsm)
-        {
-          std::cout << "  <MEMC " << name() << ".TGT_RSP_XRAM> Response following XRAM access"
-                    << " / rsrcid = " << std::dec << r_xram_rsp_to_tgt_rsp_srcid.read()
-                    << " / rtrdid = " << r_xram_rsp_to_tgt_rsp_trdid.read()
-                    << " / rpktid = " << r_xram_rsp_to_tgt_rsp_pktid.read()
-                    << " / rdata = " << std::hex << r_xram_rsp_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read()
-                    << " / cpt = " << std::dec << r_tgt_rsp_cpt.read() << std::endl;
-        }
-#endif
-        if((r_tgt_rsp_cpt.read() ==
-            (r_xram_rsp_to_tgt_rsp_word.read() +r_xram_rsp_to_tgt_rsp_length.read()-1))
-            || r_xram_rsp_to_tgt_rsp_rerror.read())
-        {
-          r_tgt_rsp_fsm = TGT_RSP_XRAM_IDLE;
+if( m_debug_tgt_rsp_fsm )
+{
+  std::cout 
+    << "  <MEMC " << name() << ".TGT_RSP_XRAM> Response following XRAM access"
+    << " / rsrcid = " << std::dec << r_xram_rsp_to_tgt_rsp_srcid.read()
+    << " / rtrdid = " << r_xram_rsp_to_tgt_rsp_trdid.read()
+    << " / rpktid = " << r_xram_rsp_to_tgt_rsp_pktid.read()
+    << " / rdata = " << std::hex << r_xram_rsp_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read()
+    << " / cpt = " << std::dec << r_tgt_rsp_cpt.read() << std::endl;
+}
+#endif
+        uint32_t last_word_idx = r_xram_rsp_to_tgt_rsp_word.read() + r_xram_rsp_to_tgt_rsp_length.read() - 1;
+        bool     is_last_word  = (r_tgt_rsp_cpt.read() == last_word_idx);
+        bool     is_ll         = ((r_xram_rsp_to_tgt_rsp_pktid.read() & 0x7) == TYPE_LL);
+        bool     is_error      = r_xram_rsp_to_tgt_rsp_rerror.read();
+
+        if (((is_last_word or is_error) and not is_ll) or
+             (r_tgt_rsp_key_sent.read() and     is_ll))
+        {
+          // Last word sent in case of READ or second flit sent in case if LL
+          r_tgt_rsp_key_sent        = false;
           r_xram_rsp_to_tgt_rsp_req = false;
+          r_tgt_rsp_fsm             = TGT_RSP_XRAM_IDLE;
         }
         else
         {
-          r_tgt_rsp_cpt = r_tgt_rsp_cpt.read() + 1;
+          if (is_ll)
+          {
+            r_tgt_rsp_key_sent = true;                     // Send second flit of ll
+          }                                                                            
+          else
+          {
+            r_tgt_rsp_cpt      = r_tgt_rsp_cpt.read() + 1; // Send next word of read
+          }
         }
       }
@@ -7287,18 +7318,29 @@
 
     case TGT_RSP_READ:
-      p_vci_tgt.rspval   = true;
-      if(((r_read_to_tgt_rsp_pktid.read() & 0x7) == TYPE_LL)
-          && (r_tgt_rsp_cpt.read() == (r_read_to_tgt_rsp_word.read() +r_read_to_tgt_rsp_length-1)))
-        p_vci_tgt.rdata  = r_read_to_tgt_rsp_data[r_tgt_rsp_cpt.read()-1].read();
-      else if((r_read_to_tgt_rsp_pktid.read() & 0x7) == TYPE_LL)
-        p_vci_tgt.rdata  = r_read_to_tgt_rsp_ll_key.read();
+    {
+      uint32_t last_word_idx = r_read_to_tgt_rsp_word.read() + r_read_to_tgt_rsp_length - 1;
+      bool     is_last_word  = (r_tgt_rsp_cpt.read() == last_word_idx);
+      bool     is_ll         = ((r_read_to_tgt_rsp_pktid.read() & 0x7) == TYPE_LL);
+
+      p_vci_tgt.rspval  = true;
+
+      if ( is_ll and not r_tgt_rsp_key_sent.read() )
+      {
+        // LL response first flit
+        p_vci_tgt.rdata = r_read_to_tgt_rsp_ll_key.read();
+      }
       else
-        p_vci_tgt.rdata  = r_read_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read();
-      p_vci_tgt.rsrcid   = r_read_to_tgt_rsp_srcid.read();
-      p_vci_tgt.rtrdid   = r_read_to_tgt_rsp_trdid.read();
-      p_vci_tgt.rpktid   = r_read_to_tgt_rsp_pktid.read();
-      p_vci_tgt.rerror   = 0;
-      p_vci_tgt.reop     = (r_tgt_rsp_cpt.read() == (r_read_to_tgt_rsp_word.read() +r_read_to_tgt_rsp_length-1));
-      break;
+      {
+        // LL response second flit or READ response
+        p_vci_tgt.rdata = r_read_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read();
+      }
+
+      p_vci_tgt.rsrcid  = r_read_to_tgt_rsp_srcid.read();
+      p_vci_tgt.rtrdid  = r_read_to_tgt_rsp_trdid.read();
+      p_vci_tgt.rpktid  = r_read_to_tgt_rsp_pktid.read();
+      p_vci_tgt.rerror  = 0;
+      p_vci_tgt.reop    = (is_last_word and not is_ll) or (r_tgt_rsp_key_sent.read() and is_ll);
+      break;
+    }
 
     case TGT_RSP_WRITE:
@@ -7336,18 +7378,29 @@
 
     case TGT_RSP_XRAM:
-      p_vci_tgt.rspval   = true;
-      if(((r_xram_rsp_to_tgt_rsp_pktid.read() & 0x7) == TYPE_LL)
-          && (r_tgt_rsp_cpt.read() == (r_xram_rsp_to_tgt_rsp_word.read() +r_xram_rsp_to_tgt_rsp_length-1)))
-        p_vci_tgt.rdata  = r_xram_rsp_to_tgt_rsp_ll_key.read();
-      else
-        p_vci_tgt.rdata  = r_xram_rsp_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read();
-      p_vci_tgt.rsrcid   = r_xram_rsp_to_tgt_rsp_srcid.read();
-      p_vci_tgt.rtrdid   = r_xram_rsp_to_tgt_rsp_trdid.read();
-      p_vci_tgt.rpktid   = r_xram_rsp_to_tgt_rsp_pktid.read();
-      p_vci_tgt.rerror   = r_xram_rsp_to_tgt_rsp_rerror.read();
-      p_vci_tgt.reop     = ((r_tgt_rsp_cpt.read()
-                             == (r_xram_rsp_to_tgt_rsp_word.read() +r_xram_rsp_to_tgt_rsp_length.read()-1))
-                            || r_xram_rsp_to_tgt_rsp_rerror.read());
-      break;
+    {
+      uint32_t last_word_idx = r_xram_rsp_to_tgt_rsp_word.read() + r_xram_rsp_to_tgt_rsp_length.read() - 1;
+      bool     is_last_word  = (r_tgt_rsp_cpt.read() == last_word_idx);
+      bool     is_ll         = ((r_xram_rsp_to_tgt_rsp_pktid.read() & 0x7) == TYPE_LL);
+      bool     is_error      = r_xram_rsp_to_tgt_rsp_rerror.read();
+
+      p_vci_tgt.rspval  = true;
+
+      if( is_ll and not r_tgt_rsp_key_sent.read() ) {
+        // LL response first flit
+        p_vci_tgt.rdata = r_xram_rsp_to_tgt_rsp_ll_key.read();
+      }
+      else {
+        // LL response second flit or READ response
+        p_vci_tgt.rdata = r_xram_rsp_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read();
+      }
+
+      p_vci_tgt.rsrcid  = r_xram_rsp_to_tgt_rsp_srcid.read();
+      p_vci_tgt.rtrdid  = r_xram_rsp_to_tgt_rsp_trdid.read();
+      p_vci_tgt.rpktid  = r_xram_rsp_to_tgt_rsp_pktid.read();
+      p_vci_tgt.rerror  = is_error;
+      p_vci_tgt.reop    = (((is_last_word or is_error) and not is_ll) or
+                            (r_tgt_rsp_key_sent.read() and     is_ll));
+      break;
+    }
 
     case TGT_RSP_INIT:
