Index: branches/ODCCP/modules/vci_mem_cache/caba/source/include/xram_transaction.h
===================================================================
--- branches/ODCCP/modules/vci_mem_cache/caba/source/include/xram_transaction.h	(revision 460)
+++ branches/ODCCP/modules/vci_mem_cache/caba/source/include/xram_transaction.h	(revision 494)
@@ -34,4 +34,5 @@
     bool                rerror;         // error returned by xram
     data_t              ll_key;         // LL key returned by the llsc_global_table
+    bool                config;         // transaction required by CONFIG FSM
 
     /////////////////////////////////////////////////////////////////////
@@ -42,4 +43,5 @@
         valid		= false;
         rerror      = false;
+        config      = false;
     }
 
@@ -80,4 +82,5 @@
         rerror      = source.rerror;
         ll_key      = source.ll_key;
+        config      = source.config;
     }
 
@@ -87,4 +90,5 @@
     void print()
     {
+        std::cout << "------- TRT entry -------" << std::endl;
         std::cout << "valid       = " << valid        << std::endl;
         std::cout << "xram_read   = " << xram_read    << std::endl;
@@ -96,12 +100,18 @@
         std::cout << "read_length = " << read_length  << std::endl;
         std::cout << "word_index  = " << word_index   << std::endl; 
-        for(size_t i=0; i<wdata_be.size() ; i++){
-            std::cout << "wdata_be [" << i <<"] = " << wdata_be[i] << std::endl;
-        }
-        for(size_t i=0; i<wdata.size() ; i++){
-            std::cout << "wdata [" << i <<"] = " << wdata[i] << std::endl;
-        }
+        for(size_t i=0; i<wdata_be.size() ; i++)
+        {
+            std::cout << "wdata_be[" << std::dec << i << "] = " 
+                      << std::hex << wdata_be[i] << std::endl;
+        }
+        for(size_t i=0; i<wdata.size() ; i++)
+        {
+            std::cout << "wdata[" << std::dec << i << "] = " 
+                      << std::hex << wdata[i] << std::endl;
+        }
+        std::cout << "rerror      = " << rerror       << std::endl;
+        std::cout << "ll_key      = " << ll_key       << std::endl;
+        std::cout << "config      = " << config       << std::endl;
         std::cout << std::endl;
-        std::cout << "rerror      = " << rerror       << std::endl;
     }
 
@@ -114,9 +124,11 @@
         wdata_be.clear();
         wdata.clear();
-        valid=false;
-        rerror=false;
-    }
-
-    TransactionTabEntry(const TransactionTabEntry &source){
+        valid  = false;
+        rerror = false;
+        config = false;
+    }
+
+    TransactionTabEntry(const TransactionTabEntry &source)
+    {
         valid	    = source.valid;
         xram_read	= source.xram_read;
@@ -132,4 +144,5 @@
         rerror      = source.rerror;
         ll_key      = source.ll_key;
+        config      = source.config;
     }
 
@@ -197,5 +210,4 @@
         delete [] tab;
     }
-
     /////////////////////////////////////////////////////////////////////
     // The size() function returns the size of the tab
@@ -205,5 +217,4 @@
         return size_tab;
     }
-
     /////////////////////////////////////////////////////////////////////
     // The init() function initializes the transaction tab entries
@@ -211,9 +222,9 @@
     void init()
     {
-        for ( size_t i=0; i<size_tab; i++) {
+        for ( size_t i=0; i<size_tab; i++) 
+        {
             tab[i].init();
         }
     }
-
     /////////////////////////////////////////////////////////////////////
     // The print() function prints a transaction tab entry
@@ -223,10 +234,10 @@
     void print(const size_t index)
     {
-        assert( (index < size_tab) 
-                && "Invalid Transaction Tab Entry");
+        assert( (index < size_tab) and
+        "MEMC ERROR: The selected entry is out of range in TRT write_data_mask()");
+
         tab[index].print();
         return;
     }
-
     /////////////////////////////////////////////////////////////////////
     // The read() function returns a transaction tab entry.
@@ -236,9 +247,9 @@
     TransactionTabEntry read(const size_t index)
     {
-        assert( (index < size_tab) 
-                && "Invalid Transaction Tab Entry");
+        assert( (index < size_tab) and 
+        "MEMC ERROR: Invalid Transaction Tab Entry");
+
         return tab[index];
     }
-
     /////////////////////////////////////////////////////////////////////
     // The full() function returns the state of the transaction tab
@@ -249,6 +260,8 @@
     bool full(size_t &index)
     {
-        for(size_t i=0; i<size_tab; i++){
-            if(!tab[i].valid){
+        for(size_t i=0; i<size_tab; i++)
+        {
+            if(!tab[i].valid)
+            {
                 index=i;
                 return false;	
@@ -257,5 +270,4 @@
         return true;
     }
-
     /////////////////////////////////////////////////////////////////////
     // The hit_read() function checks if an XRAM read transaction exists 
@@ -268,6 +280,8 @@
     bool hit_read(const addr_t nline,size_t &index)
     {
-        for(size_t i=0; i<size_tab; i++){
-            if((tab[i].valid && (nline==tab[i].nline)) && (tab[i].xram_read)) {
+        for(size_t i=0; i<size_tab; i++)
+        {
+            if((tab[i].valid && (nline==tab[i].nline)) && (tab[i].xram_read)) 
+            {
                 index=i;
                 return true;	
@@ -276,5 +290,4 @@
         return false;
     }
-
     ///////////////////////////////////////////////////////////////////////
     // The hit_write() function looks if an XRAM write transaction exists 
@@ -286,6 +299,8 @@
     bool hit_write(const addr_t nline)
     {
-        for(size_t i=0; i<size_tab; i++){
-            if(tab[i].valid && (nline==tab[i].nline) && !(tab[i].xram_read)) {
+        for(size_t i=0; i<size_tab; i++)
+        {
+            if(tab[i].valid && (nline==tab[i].nline) && !(tab[i].xram_read)) 
+            {
                 return true;	
             }
@@ -325,12 +340,15 @@
             const std::vector<data_t> &data) 
     {
-        assert( (index < size_tab) 
-                && "Invalid Transaction Tab Entry");
-        assert(be.size()==tab[index].wdata_be.size() 
-                && "Bad data mask in write_data_mask in TransactionTab");
-        assert(data.size()==tab[index].wdata.size() 
-                && "Bad data in write_data_mask in TransactionTab");
-
-        for(size_t i=0; i<tab[index].wdata_be.size() ; i++) {
+        assert( (index < size_tab) and
+        "MEMC ERROR: The selected entry is out of range in TRT write_data_mask()");
+
+        assert( (be.size()==tab[index].wdata_be.size()) and
+        "MEMC ERROR: Bad be size in TRT write_data_mask()");
+
+        assert( (data.size()==tab[index].wdata.size()) and
+        "MEMC ERROR: Bad data size in TRT write_data_mask()");
+
+        for(size_t i=0; i<tab[index].wdata_be.size() ; i++) 
+        {
             tab[index].wdata_be[i] = tab[index].wdata_be[i] | be[i];
             data_t mask = be_to_mask(be[i]);
@@ -338,5 +356,4 @@
         }
     }
-
     /////////////////////////////////////////////////////////////////////
     // The set() function registers a transaction (read or write)
@@ -355,4 +372,5 @@
     // - data_be : the mask of the data to write (in case of write)
     // - ll_key  : the ll key (if any) returned by the llsc_global_table
+    // - config  : transaction required by config FSM
     /////////////////////////////////////////////////////////////////////
     void set(const size_t index,
@@ -367,12 +385,15 @@
             const std::vector<be_t> &data_be,
             const std::vector<data_t> &data, 
-            const data_t ll_key = 0) 
-    {
-        assert( (index < size_tab) 
-                && "The selected entry is out of range in set() Transaction Tab");
-        assert(data_be.size()==tab[index].wdata_be.size() 
-                && "Bad data_be argument in set() TransactionTab");
-        assert(data.size()==tab[index].wdata.size() 
-                && "Bad data argument in set() TransactionTab");
+            const data_t ll_key = 0,
+            const bool config = false) 
+    {
+        assert( (index < size_tab) and
+        "MEMC ERROR: The selected entry is out of range in TRT set()");
+
+        assert( (data_be.size()==tab[index].wdata_be.size()) and 
+        "MEMC ERROR: Bad data_be argument in TRT set()");
+
+        assert( (data.size()==tab[index].wdata.size()) and 
+        "MEMC ERROR: Bad data argument in TRT set()");
 
         tab[index].valid	        = true;
@@ -386,4 +407,5 @@
         tab[index].word_index	    = word_index;
         tab[index].ll_key   	    = ll_key;
+        tab[index].config           = config;
         for(size_t i=0; i<tab[index].wdata.size(); i++) 
         {
@@ -398,41 +420,26 @@
     // The BE field in TRT is taken into account.
     // Arguments :
-    // - index : the index of the transaction in the transaction tab
-    // - word_index : the index of the data in the line
-    // - data : a 64 bits value
-    // - error : invalid data
+    // - index : index of the entry in TRT
+    // - word  : index of the 32 bits word in the line
+    // - data  : 64 bits value (first data right)
     /////////////////////////////////////////////////////////////////////
     void write_rsp(const size_t      index,
                    const size_t      word,
-                   const wide_data_t data,
-                   const bool        rerror)
+                   const wide_data_t data)
     {
         data_t  value;
         data_t  mask;
 
-        if ( index >= size_tab )
-        { 
-            std::cout << "VCI_MEM_CACHE ERRROR " << tab_name
-                      <<  " TRT entry  out of range in write_rsp()" << std::endl;
-            exit(0);
-        }
-        if ( word > tab[index].wdata_be.size() ) 
-        { 
-            std::cout << "VCI_MEM_CACHE ERRROR " << tab_name
-                      <<  " Bad word_index in write_rsp() in TRT" << std::endl;
-            exit(0);
-        }
-        if ( not tab[index].valid )
-        { 
-            std::cout << "VCI_MEM_CACHE ERRROR " << tab_name
-                      <<  " TRT Entry invalid in write_rsp()" << std::endl;
-            exit(0);
-        }
-        if ( not tab[index].xram_read )
-        { 
-            std::cout << "VCI_MEM_CACHE ERRROR " << tab_name
-                      <<  " TRT entry is not an XRAM GET in write_rsp()" << std::endl;
-            exit(0);
-        }
+        assert( (index < size_tab) and
+        "MEMC ERROR: The selected entry is out of range in TRT write_rsp()");
+
+        assert( (word < tab[index].wdata_be.size()) and 
+        "MEMC ERROR: Bad word index in TRT write_rsp()");
+
+        assert( (tab[index].valid) and
+        "MEMC ERROR: TRT entry not valid in TRT write_rsp()");
+
+        assert( (tab[index].xram_read ) and
+        "MEMC ERROR: TRT entry is not a GET in TRT write_rsp()");
 
         // first 32 bits word
@@ -445,9 +452,5 @@
         mask  = be_to_mask(tab[index].wdata_be[word+1]);
         tab[index].wdata[word+1] = (tab[index].wdata[word+1] & mask) | (value & ~mask);
-
-        // error update
-        tab[index].rerror |= rerror;
-    }
-
+    }
     /////////////////////////////////////////////////////////////////////
     // The erase() function erases an entry in the transaction tab.
@@ -457,8 +460,21 @@
     void erase(const size_t index)
     {
-        assert( (index < size_tab) 
-                && "The selected entry is out of range in erase() Transaction Tab");
+        assert( (index < size_tab) and 
+        "MEMC ERROR: The selected entry is out of range in TRT erase()");
+
         tab[index].valid	= false;
         tab[index].rerror   = false;
+    }
+    /////////////////////////////////////////////////////////////////////
+    // The is_config() function returns the config flag value.
+    // Arguments :
+    // - index : the index of the entry in the transaction tab
+    /////////////////////////////////////////////////////////////////////
+    bool is_config(const size_t index)
+    {
+        assert( (index < size_tab) and
+        "MEMC ERROR: The selected entry is out of range in TRT is_config()");
+
+        return tab[index].config;
     }
 }; // end class TransactionTab
