Index: trunk/modules/vci_mem_cache/caba/source/include/xram_transaction.h
===================================================================
--- trunk/modules/vci_mem_cache/caba/source/include/xram_transaction.h	(revision 601)
+++ trunk/modules/vci_mem_cache/caba/source/include/xram_transaction.h	(revision 836)
@@ -15,24 +15,24 @@
 class TransactionTabEntry 
 {
-    typedef sc_dt::sc_uint<64>    wide_data_t;
-    typedef sc_dt::sc_uint<40>    addr_t;
-    typedef uint32_t              data_t;
-    typedef uint32_t              be_t;
+    typedef sc_dt::sc_uint<64> wide_data_t;
+    typedef sc_dt::sc_uint<40> addr_t;
+    typedef uint32_t data_t;
+    typedef uint32_t be_t;
 
     public:
-    bool 		        valid;     	    // entry valid 
-    bool 		        xram_read; 	    // read request to XRAM
-    addr_t   	        nline;    	    // index (zy) of the requested line
-    size_t 	            srcid;     	    // processor requesting the transaction
-    size_t 	            trdid;     	    // processor requesting the transaction
-    size_t 	            pktid;     	    // processor requesting the transaction
-    bool 		        proc_read;	    // read request from processor
-    size_t 	            read_length;    // length of the read (for the response)
-    size_t 	            word_index;    	// index of the first read word (for response)
-    std::vector<data_t> wdata;          // write buffer (one cache line)
-    std::vector<be_t>   wdata_be;    	// be for each data in the write buffer
-    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
+    bool   valid;                 // entry valid 
+    bool   xram_read;             // read request to XRAM
+    addr_t nline;                 // index (zy) of the requested line
+    size_t srcid;                 // processor requesting the transaction
+    size_t trdid;                 // processor requesting the transaction
+    size_t pktid;                 // processor requesting the transaction
+    bool   proc_read;             // read request from processor
+    size_t read_length;           // length of the read (for the response)
+    size_t word_index;            // index of the first read word (for response)
+    std::vector<data_t> wdata;    // write buffer (one cache line)
+    std::vector<be_t>   wdata_be; // be for each data in the write buffer
+    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
 
     /////////////////////////////////////////////////////////////////////
@@ -41,7 +41,7 @@
     void init()
     {
-        valid		= false;
-        rerror      = false;
-        config      = false;
+        valid  = false;
+        rerror = false;
+        config = false;
     }
 
@@ -52,7 +52,7 @@
     void alloc(size_t n_words)
     {
-        wdata_be.reserve( (int)n_words );
-        wdata.reserve( (int)n_words );
-        for(size_t i=0; i<n_words; i++)
+        wdata_be.reserve((int) n_words);
+        wdata.reserve((int) n_words);
+        for (size_t i = 0; i < n_words; i++)
         {
             wdata_be.push_back(0);
@@ -66,13 +66,13 @@
     void copy(const TransactionTabEntry &source)
     {
-        valid	    = source.valid;
-        xram_read 	= source.xram_read;
-        nline	    = source.nline;
-        srcid	    = source.srcid;
-        trdid	    = source.trdid;
-        pktid	    = source.pktid;
-        proc_read 	= source.proc_read;
+        valid       = source.valid;
+        xram_read   = source.xram_read;
+        nline       = source.nline;
+        srcid       = source.srcid;
+        trdid       = source.trdid;
+        pktid       = source.pktid;
+        proc_read   = source.proc_read;
         read_length = source.read_length;
-        word_index	= source.word_index;
+        word_index  = source.word_index;
         wdata_be.assign(source.wdata_be.begin(),source.wdata_be.end());
         wdata.assign(source.wdata.begin(),source.wdata.end());
@@ -85,23 +85,23 @@
     // The print() function prints the entry identified by "index". 
     ////////////////////////////////////////////////////////////////////
-    void print( size_t index, size_t mode )
+    void print(size_t index, size_t mode)
     {
         std::cout << "  TRT[" << std::dec << index << "] "
-                  << " valid = " << valid
-                  << " / error = " << rerror 
-                  << " / get = " << xram_read 
-                  << " / config = " << config << std::hex
-                  << " / address = " << nline*4*wdata.size()
-                  << " / srcid = " << srcid << std::endl;
-        if ( mode )
+            << " valid = " << valid
+            << " / error = " << rerror 
+            << " / get = " << xram_read 
+            << " / config = " << config << std::hex
+            << " / address = " << nline*4*wdata.size()
+            << " / srcid = " << srcid << std::endl;
+        if (mode)
         {
             std::cout << "        trdid = " << trdid
-                      << " / pktid = " << pktid << std::dec 
-                      << " / proc_read = " << proc_read 
-                      << " / read_length = " << read_length
-                      << " / word_index  = " << word_index << std::hex 
-                      << " / ll_key = " << ll_key << std::endl;
+                << " / pktid = " << pktid << std::dec 
+                << " / proc_read = " << proc_read 
+                << " / read_length = " << read_length
+                << " / word_index  = " << word_index << std::hex 
+                << " / ll_key = " << ll_key << std::endl;
             std::cout << "        wdata = ";
-            for(size_t i=0; i<wdata.size() ; i++)
+            for (size_t i = 0; i < wdata.size(); i++)
             {
                 std::cout << std::hex << wdata[i] << " / ";
@@ -112,5 +112,5 @@
 
     /////////////////////////////////////////////////////////////////////
-    // 		Constructors
+    //         Constructors
     /////////////////////////////////////////////////////////////////////
 
@@ -126,15 +126,15 @@
     TransactionTabEntry(const TransactionTabEntry &source)
     {
-        valid	    = source.valid;
-        xram_read	= source.xram_read;
-        nline	    = source.nline;
-        srcid	    = source.srcid;
-        trdid	    = source.trdid;
-        pktid	    = source.pktid;
-        proc_read	= source.proc_read;
+        valid       = source.valid;
+        xram_read   = source.xram_read;
+        nline       = source.nline;
+        srcid       = source.srcid;
+        trdid       = source.trdid;
+        pktid       = source.pktid;
+        proc_read   = source.proc_read;
         read_length = source.read_length;
-        word_index	= source.word_index;
-        wdata_be.assign(source.wdata_be.begin(),source.wdata_be.end());
-        wdata.assign(source.wdata.begin(),source.wdata.end());	
+        word_index  = source.word_index;
+        wdata_be.assign(source.wdata_be.begin(), source.wdata_be.end());
+        wdata.assign(source.wdata.begin(), source.wdata.end());    
         rerror      = source.rerror;
         ll_key      = source.ll_key;
@@ -149,26 +149,26 @@
 class TransactionTab
 {
-    typedef sc_dt::sc_uint<64>    wide_data_t;
-    typedef sc_dt::sc_uint<40>    addr_t;
-    typedef uint32_t              data_t;
-    typedef uint32_t              be_t;
+    typedef sc_dt::sc_uint<64> wide_data_t;
+    typedef sc_dt::sc_uint<40> addr_t;
+    typedef uint32_t           data_t;
+    typedef uint32_t           be_t;
 
     private:
-    const std::string tab_name;                // the name for logs
-    size_t            size_tab;                // the size of the tab
+    const std::string tab_name; // the name for logs
+    size_t size_tab; // the size of the tab
 
     data_t be_to_mask(be_t be)
     {
         data_t ret = 0;
-        if ( be&0x1 ) {
+        if (be & 0x1) {
             ret = ret | 0x000000FF;
         }
-        if ( be&0x2 ) {
+        if (be & 0x2) {
             ret = ret | 0x0000FF00;
         }
-        if ( be&0x4 ) {
+        if (be & 0x4) {
             ret = ret | 0x00FF0000;
         }
-        if ( be&0x8 ) {
+        if (be & 0x8) {
             ret = ret | 0xFF000000;
         }
@@ -177,23 +177,23 @@
 
     public:
-    TransactionTabEntry *tab;       // The transaction tab
-
-    ////////////////////////////////////////////////////////////////////
-    //		Constructors
+    TransactionTabEntry * tab; // The transaction tab
+
+    ////////////////////////////////////////////////////////////////////
+    //        Constructors
     ////////////////////////////////////////////////////////////////////
     TransactionTab()
     {
-        size_tab=0;
-        tab=NULL;
+        size_tab = 0;
+        tab = NULL;
     }
 
     TransactionTab(const std::string &name,
-                   size_t            n_entries, 
-                   size_t            n_words )
-    : tab_name( name ),
-      size_tab( n_entries ) 
+            size_t n_entries, 
+            size_t n_words)
+        : tab_name(name),
+        size_tab(n_entries) 
     {
         tab = new TransactionTabEntry[size_tab];
-        for ( size_t i=0; i<size_tab; i++) 
+        for (size_t i = 0; i < size_tab; i++) 
         {
             tab[i].alloc(n_words);
@@ -217,5 +217,5 @@
     void init()
     {
-        for ( size_t i=0; i<size_tab; i++) 
+        for (size_t i = 0; i < size_tab; i++) 
         {
             tab[i].init();
@@ -226,8 +226,8 @@
     // Detailed content if detailed argument is non zero.
     /////////////////////////////////////////////////////////////////////
-    void print( size_t detailed = 0 )
+    void print(size_t detailed = 0)
     {
         std::cout << "  < TRT content in " <<  tab_name << " >" << std::endl;
-        for ( size_t id = 0 ; id < size_tab ; id++ )
+        for (size_t id = 0; id < size_tab; id++)
         {
             tab[id].print( id , detailed );
@@ -241,6 +241,5 @@
     TransactionTabEntry read(const size_t index)
     {
-        assert( (index < size_tab) and 
-        "MEMC ERROR: Invalid Transaction Tab Entry");
+        assert((index < size_tab) and "MEMC ERROR: Invalid Transaction Tab Entry");
 
         return tab[index];
@@ -252,12 +251,12 @@
     // The function returns true if the transaction tab is full
     /////////////////////////////////////////////////////////////////////
-    bool full(size_t &index)
-    {
-        for(size_t i=0; i<size_tab; i++)
-        {
-            if(!tab[i].valid)
+    bool full(size_t & index)
+    {
+        for (size_t i = 0; i < size_tab; i++)
+        {
+            if (!tab[i].valid)
             {
-                index=i;
-                return false;	
+                index = i;
+                return false;    
             }
         }
@@ -274,10 +273,10 @@
     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;	
+                index = i;
+                return true;    
             }
         }
@@ -293,9 +292,9 @@
     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;	
+                return true;    
             }
         }
@@ -312,17 +311,17 @@
     /////////////////////////////////////////////////////////////////////
     void write_data_mask(const size_t index, 
-            const std::vector<be_t> &be, 
-            const std::vector<data_t> &data) 
+            const std::vector<be_t> & be, 
+            const std::vector<data_t> & data) 
     {
         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++) 
+                "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];
@@ -358,33 +357,33 @@
             const size_t read_length,
             const size_t word_index,
-            const std::vector<be_t> &data_be,
-            const std::vector<data_t> &data, 
+            const std::vector<be_t> & data_be,
+            const std::vector<data_t> & data, 
             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;
-        tab[index].xram_read        = xram_read;
-        tab[index].nline	        = nline;
-        tab[index].srcid	        = srcid;
-        tab[index].trdid	        = trdid;
-        tab[index].pktid	        = pktid;
-        tab[index].proc_read	    = proc_read;
-        tab[index].read_length	    = read_length;
-        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++) 
-        {
-            tab[index].wdata_be[i]    = data_be[i];
-            tab[index].wdata[i]       = data[i];
+        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;
+        tab[index].xram_read   = xram_read;
+        tab[index].nline       = nline;
+        tab[index].srcid       = srcid;
+        tab[index].trdid       = trdid;
+        tab[index].pktid       = pktid;
+        tab[index].proc_read   = proc_read;
+        tab[index].read_length = read_length;
+        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++) 
+        {
+            tab[index].wdata_be[i] = data_be[i];
+            tab[index].wdata[i]    = data[i];
         }
     }
@@ -399,25 +398,25 @@
     // - 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)
-    {
-        data_t  value;
-        data_t  mask;
-
-        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()");
-
-        if ( rerror )
+    void write_rsp(const size_t index,
+            const size_t        word,
+            const wide_data_t   data,
+            const bool          rerror)
+    {
+        data_t value;
+        data_t mask;
+
+        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()");
+
+        if (rerror)
         {
             tab[index].rerror = true;
@@ -426,12 +425,12 @@
 
         // first 32 bits word
-        value = (data_t)data;
+        value = (data_t) data;
         mask  = be_to_mask(tab[index].wdata_be[word]);
         tab[index].wdata[word] = (tab[index].wdata[word] & mask) | (value & ~mask);
 
         // second 32 bits word
-        value = (data_t)(data>>32);
-        mask  = be_to_mask(tab[index].wdata_be[word+1]);
-        tab[index].wdata[word+1] = (tab[index].wdata[word+1] & mask) | (value & ~mask);
+        value = (data_t) (data >> 32);
+        mask  = be_to_mask(tab[index].wdata_be[word + 1]);
+        tab[index].wdata[word + 1] = (tab[index].wdata[word + 1] & mask) | (value & ~mask);
     }
     /////////////////////////////////////////////////////////////////////
@@ -443,8 +442,8 @@
     {
         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;
+                "MEMC ERROR: The selected entry is out of range in TRT erase()");
+
+        tab[index].valid  = false;
+        tab[index].rerror = false;
     }
     /////////////////////////////////////////////////////////////////////
@@ -456,5 +455,5 @@
     {
         assert( (index < size_tab) and
-        "MEMC ERROR: The selected entry is out of range in TRT is_config()");
+                "MEMC ERROR: The selected entry is out of range in TRT is_config()");
 
         return tab[index].config;
