Index: /trunk/modules/vci_synthetic_initator/caba/sources/include/vci_synthetic_initator.h
===================================================================
--- /trunk/modules/vci_synthetic_initator/caba/sources/include/vci_synthetic_initator.h	(revision 80)
+++ /trunk/modules/vci_synthetic_initator/caba/sources/include/vci_synthetic_initator.h	(revision 81)
@@ -61,5 +61,6 @@
       };
 
-      uint32_t	   m_cpt_cycles;            // Counter of cycles 
+      uint64_t	   m_cpt_cycles;            // Counter of cycles 
+      
 
     protected:
@@ -77,6 +78,6 @@
 		float  rho,       // Packets ratio on the network
 		size_t depth,     // Fifo depth
-		size_t x,		// 
-		size_t y,		//
+		size_t x,	  // X location of the synthetic initiator
+		size_t y,	  // Y location of the synthetic initiator
 		size_t xmesh,	
 		size_t ymesh,
@@ -85,6 +86,6 @@
 		size_t xmax,
 		size_t ymin,
-		size_t ymax
-		const soclib::common::IntTab &vci_index, 
+		size_t ymax,
+		const soclib::common::IntTab &vci_index
 		);                                 
 
@@ -95,5 +96,5 @@
       void genMoore();
 
-      void print_stats();
+      void destAdress(size_t X_local, size_t Y_local, size_t &X_dest, size_t &Y_dest);
 
     private:
@@ -102,14 +103,17 @@
       const size_t   			  m_length;		// Number of flits of a packet
       const size_t			  m_rho;		// Rate of packets in the network wanted
-      const size_t			  m_depth,     		// Fifo depth
-      const size_t			  m_x,			// 
-      const size_t			  m_y,			//
-      const size_t			  m_xmesh,	
-      const size_t			  m_ymesh,
-      const size_t			  m_bc_period, 		// Broadcast period, if no broadcast => 0
-      const size_t			  m_xmin, 
-      const size_t			  m_xmax,
-      const size_t			  m_ymin,
-      const size_t			  m_ymax
+      const size_t			  m_depth;     		// Fifo depth
+      const size_t			  m_x;			// X location
+      const size_t			  m_y;			// Y location
+      const size_t			  m_xmesh;	
+      const size_t			  m_ymesh;
+      const size_t			  m_bc_period; 		// Broadcast period, if no broadcast => 0
+      const size_t			  m_xmin; 
+      const size_t			  m_xmax;
+      const size_t			  m_ymin;
+      const size_t			  m_ymax;
+
+      size_t       m_count;
+      size_t       m_npackets;		    // Total number of packets already sent
 
       // Fifo transmitting date to the VCI FSM
@@ -120,4 +124,6 @@
       sc_signal<size_t>	     r_index;
 
+      sc_signal<bool>	     r_broadcast_req;
+
     }; // end class VciSyntheticInitiator
  
Index: /trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initator.cpp
===================================================================
--- /trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initator.cpp	(revision 80)
+++ /trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initator.cpp	(revision 81)
@@ -67,22 +67,20 @@
     m_srcid_ini( mtc.indexForId(vci_ini_index) ),
     //  FIFOs 
+    m_length(length),
+    m_rho(rho),
+    m_depth(depth),
+    m_x(x),
+    m_y(y),
+    m_xmesh(xmesh),
+    m_ymesh(ymesh),
+    m_bc_period(bc_period),
+    m_xmin(xmin),
+    m_xmax(xmax),
+    m_ymin(ymin),
+    m_ymax(ymax),
     m_date_fifo("m_date_fifo", depth),
-
     r_tgt_cmd_fsm("r_tgt_cmd_fsm"),
     {
 
-      // Memory cache allocation & initialisation
-      m_cache_data = new data_t**[nways];
-      for ( size_t i=0 ; i<nways ; ++i ) {
-        m_cache_data[i] = new data_t*[nsets];
-      }
-      for ( size_t i=0; i<nways; ++i ) {
-        for ( size_t j=0; j<nsets; ++j ) {
-          m_cache_data[i][j] = new data_t[nwords];
-          for ( size_t k=0; k<nwords; k++){
-            m_cache_data[i][j][k]=0;
-          }	
-        }
-      }
 
       SC_METHOD(transition);
@@ -101,5 +99,12 @@
     /////////////////////////////////
   {
-    delete [] r_write_to_init_cmd_data;
+  }
+
+  ///////////////////////////////////
+  tmpl(void)::destAdress(size_t X_local, size_t Y_local, size_t &X_dest, size_t &Y_dest)
+  ///////////////////////////////////
+  {
+    X_dest = (size_t) ((rand())%m_xmesh);
+    Y_dest = (size_t) ((rand())%m_ymesh);
   }
 
@@ -111,5 +116,5 @@
     //  RESET          
     if ( ! p_resetn.read() ) {
-
+      //srand(time(NULL));
       //     Initializing FSMs
       r_tgt_cmd_fsm 	= TGT_CMD_IDLE;
@@ -119,20 +124,13 @@
       m_date_fifo.init();
 
-      r_read_to_tgt_rsp_req		= false;
-      r_read_to_xram_cmd_req		= false;
-
-      r_write_to_tgt_rsp_req		= false;
-      r_write_to_xram_cmd_req		= false;
-      r_write_to_init_cmd_req		= false;
-
-
       // Activity counters
       m_cpt_cycles		= 0;
+      m_npackets		= 0;
 
       return;
     }
 
-    bool    cmd_read_fifo_put = false;
-    bool    cmd_read_fifo_get = false;
+    bool    date_fifo_put = false;
+    bool    date_fifo_get = false;
 
     switch ( r_vci_fsm.read() ) {
@@ -151,4 +149,8 @@
       case VCI_SINGLE_RECEIVE:
         {
+	  if (p_vci.cmdack.read()) {
+	    // LATENCY
+	    r_vci_fsm = VCI_IDLE ;
+	  }
           break;
         }
@@ -161,4 +163,5 @@
       case VCI_BC_RECEIVE:
         {
+	  r_broadcast_req = false;
           break;
         }
@@ -166,26 +169,30 @@
 
 
-    if ( cmd_cleanup_fifo_put ) {
-      if ( cmd_cleanup_fifo_get ) {
-        m_cmd_cleanup_srcid_fifo.put_and_get(p_vci_tgt.srcid.read());
-        m_cmd_cleanup_trdid_fifo.put_and_get(p_vci_tgt.trdid.read());
-        m_cmd_cleanup_pktid_fifo.put_and_get(p_vci_tgt.pktid.read());
-        m_cmd_cleanup_nline_fifo.put_and_get(p_vci_tgt.wdata.read());
+/////////////////// Filling fifo
+    if(){
+      if (m_date_fifo.wok()){
+        date_fifo_put = true ;
+      } 
+      if (!r_broadcast_req.read() && (m_cpt_cycles % bc_period)){
+        r_broadcast_req = true;
+      }
+    }
+
+    if (date_fifo_put){
+      if (date_fifo_get){
+        m_date_fifo.put_and_get(m_cpt_cycles);
       } else {
-        m_cmd_cleanup_srcid_fifo.simple_put(p_vci_tgt.srcid.read());
-        m_cmd_cleanup_trdid_fifo.simple_put(p_vci_tgt.trdid.read());
-        m_cmd_cleanup_pktid_fifo.simple_put(p_vci_tgt.pktid.read());
-        m_cmd_cleanup_nline_fifo.simple_put(p_vci_tgt.wdata.read());
+        m_date_fifo.simple_put(m_cpt_cycles);
       }
     } else {
-      if ( cmd_cleanup_fifo_get ) {
-        m_cmd_cleanup_srcid_fifo.simple_get();
-        m_cmd_cleanup_trdid_fifo.simple_get();
-        m_cmd_cleanup_pktid_fifo.simple_get();
-        m_cmd_cleanup_nline_fifo.simple_get();
+      if (date_fifo_get){
+        m_date_fifo.simple_get();
       }
     }
 
+
     m_cpt_cycles++;
+
+    return;
 
   } // end transition()
@@ -198,4 +205,13 @@
     // Command signals on the p_vci_ixr port
     ////////////////////////////////////////////////////////////
+     p_vci.cmd        = vci_param::CMD_READ;   
+     p_vci.be         = 0xF;                             
+     p_vci.pktid      = 0;      
+     p_vci.srcid      = m_srcid_ixr;   
+     p_vci.cons       = false;        
+     p_vci.wrap       = false;       
+     p_vci.contig     = true;       
+     p_vci.clen       = 0;         
+     p_vci.cfixed     = false;           
 
 
@@ -205,4 +221,10 @@
       case VCI_IDLE:
         {
+	  p_vci.cmdval  = false;                 
+	  p_vci.address = 0; 
+	  p_vci.plen    = 0;                                         
+	  p_vci.wdata   = 0;                                       
+	  p_vci.trdid   = 0;                  
+	  p_vci.eop     = false;                                   
           break;
         }
@@ -210,4 +232,5 @@
       case VCI_SINGLE_SEND:
         {
+	  p_vci.cmdval = true ;
           break;
         }
