Index: /trunk/modules/vci_synthetic_initator/caba/metadata/vci_synthetic_initiator.sd
===================================================================
--- /trunk/modules/vci_synthetic_initator/caba/metadata/vci_synthetic_initiator.sd	(revision 105)
+++ /trunk/modules/vci_synthetic_initator/caba/metadata/vci_synthetic_initiator.sd	(revision 106)
@@ -18,5 +18,5 @@
                 parameter.IntTab('vci_index'),
                 parameter.Int('length'),
-		parameter.Float('rho'),
+		parameter.Int('rho'),
                 parameter.Int('depth'),
 		parameter.Int('xmesh'),
Index: /trunk/modules/vci_synthetic_initator/caba/sources/include/vci_synthetic_initiator.h
===================================================================
--- /trunk/modules/vci_synthetic_initator/caba/sources/include/vci_synthetic_initiator.h	(revision 105)
+++ /trunk/modules/vci_synthetic_initator/caba/sources/include/vci_synthetic_initiator.h	(revision 106)
@@ -47,6 +47,5 @@
       : public soclib::caba::BaseModule
     {
-      typedef sc_dt::sc_uint<40> addr_t;
-      typedef typename vci_param::fast_addr_t vci_addr_t;
+      typedef uint32_t addr_t;
       typedef uint32_t data_t;
       typedef uint32_t tag_t;
@@ -54,20 +53,4 @@
       typedef uint32_t be_t;
       typedef uint32_t copy_t;
-
-      // Type of the addr_t and access of the fields
-      //typedef union{
-      //  PACKED_BITFIELD(
-      //    vci_addr_t srcid:vci_param::S,
-      //    vci_addr_t null:(8*sizeof(vci_addr_t)-(2*vci_param::S)),
-      //  ) normal_address;
-      //  PACKED_BITFIELD(
-      //    vci_addr_t xmin:vci_param::S,
-      //    vci_addr_t xmax:vci_param::S,
-      //    vci_addr_t ymin:vci_param::S,
-      //    vci_addr_t ymax:vci_param::S,
-      //    vci_addr_t null_:(8*sizeof(vci_addr_t)-(4*vci_param::S)),
-      //    vci_addr_t bc:2,
-      //  ) broadcast_address;
-      //} addr_t;
 
 
@@ -85,5 +68,5 @@
       };
 
-      uint64_t	   m_cpt_cycles;            // Counter of cycles 
+      uint32_t	   m_cpt_cycles;            // Counter of cycles 
       
 
@@ -102,5 +85,6 @@
 		const soclib::common::IntTab       &vci_index,
 		const uint32_t length,    // Packet length (flit numbers)
-		const float  rho,       // Packets ratio on the network
+		const uint32_t rho,       // Packets ratio on the network
+		//const float    rho,       // Packets ratio on the network
 		const uint32_t depth,     // Fifo depth
 		const uint32_t xmesh,	
@@ -121,9 +105,14 @@
       size_t destAdress();
 
+      void printStats();
+
+      void print_trace();
+
     private:
 
       // Component attributes
       const size_t   			  m_length;		// Number of words to write
-      const float			  m_rho;		// Rate of packets in the network wanted
+      const size_t			  m_rho;		// Rate of packets in the network wanted
+      //const float			  m_rho;		// Rate of packets in the network wanted
       const size_t			  m_depth;     		// Fifo depth
       const size_t			  m_xmesh;	
@@ -135,5 +124,4 @@
       const size_t			  m_ymax;
       const size_t			  m_srcid;
-      const size_t			  m_coord;
 
       size_t      			  m_count;                  // Numbers of words sent
@@ -141,9 +129,10 @@
       uint64_t	  			  m_start_latency1;         // Start time of sending packet wanted
       uint64_t	  			  m_start_latency2;         // Start time of sending packet
-      float				  m_rhos;		    // Effective Rho during the simulation
+//      float				  m_rhos;		    // Effective Rho during the simulation
       size_t				  m_bc_nrsp;		    // Expected number of responses for a broadcast command
+      addr_t				  m_address_to_send; 	    // Address to send the write command
 
       // Fifo transmitting date to the VCI FSM
-      GenericFifo<uint64_t>    m_date_fifo;
+      GenericFifo<uint32_t>    m_date_fifo;
 
       sc_signal<int>           r_vci_fsm;
@@ -153,5 +142,4 @@
       sc_signal<bool>	       r_broadcast_req;
 
-      sc_signal<addr_t>	       r_address_to_send;        // Address to send the write command
 
     }; // end class VciSyntheticInitiator
Index: /trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initiator.cpp
===================================================================
--- /trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initiator.cpp	(revision 105)
+++ /trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initiator.cpp	(revision 106)
@@ -29,4 +29,5 @@
 
 #include "../include/vci_synthetic_initiator.h"
+#include <iostream>
 
 
@@ -48,5 +49,6 @@
       const soclib::common::IntTab       &vci_index,
       const uint32_t length,    // Packet length (flit numbers)
-      const float  rho,       // Packets ratio on the network
+      const uint32_t rho,       // Packets ratio on the network
+    //  const float  rho,       // Packets ratio on the network
       const uint32_t depth,     // Fifo depth
       const uint32_t xmesh,	
@@ -66,5 +68,4 @@
 
     m_srcid( mt.indexForId(vci_index) ),
-    m_coord(vci_index[1]),
     //  FIFOs 
     m_length(length),
@@ -104,9 +105,5 @@
   ///////////////////////////////////
   {
-    size_t dest;
-    do{
-      dest = (size_t) (rand() % (m_xmesh * m_ymesh));
-    } while(dest == m_srcid);
-    return dest ;
+    return (size_t) (rand() % (m_xmesh * m_ymesh)) ;
   }
 
@@ -123,7 +120,31 @@
 //  }
 
+  
+  //////////////////////////////////
+  tmpl(void)::print_trace()
+  //////////////////////////////////
+  {
+  	const char* state_str[] = { "IDLE",
+				     "SINGLE_SEND",
+				     "SINGLE_RECEIVE",
+				     "BC_SEND",
+				     "BC_RECEIVE" };
+
+	std::cout << "Vci_Synthetic_Initiator " << name()
+		  << " : " << m_cpt_cycles << " cycles " 
+		  << " : state = " << state_str[r_vci_fsm] 
+		  << " Adresse to send : " << m_address_to_send << std::endl;
+  }
+
+  //////////////////////////////////
+  tmpl(void)::printStats()
+  //////////////////////////////////
+  {
+  	std::cout << m_cpt_cycles << " cycles, " << m_npackets << " packets sent" << std::endl;
+  }
+
   //////////////////////////////////
   tmpl(void)::transition()
-    //////////////////////////////////
+  //////////////////////////////////
   {
     //  RESET          
@@ -142,4 +163,6 @@
       m_npackets		= 0;
 
+      r_broadcast_req		= false;
+
       return;
     }
@@ -148,6 +171,16 @@
     bool    date_fifo_get = false;
 
+//   if (m_cpt_cycles == 0) {
+//           m_rhos = 0.0 ;
+//   } else {
+//           m_rhos = static_cast<float>(m_npackets * m_length) / static_cast<float>(m_cpt_cycles) ;
+//   }
+    
+
+
     switch ( r_vci_fsm.read() ) {
 
+  	std::cout << m_cpt_cycles << " cycles, " << m_npackets << " packets sent" << std::endl;
+      //printStats();
       //////////////////
       case VCI_IDLE:
@@ -155,8 +188,9 @@
 	  if (m_date_fifo.rok()){
 	    if (r_broadcast_req.read()){
+	      m_address_to_send = (((((((((m_xmin << 5) | m_xmax ) << 5 ) | m_ymin ) << 5 ) | m_ymax ) << 5 ) << vci_param::N-(4*5) ) | 0x3) | 0 ;
 	      r_vci_fsm = VCI_BC_SEND ;
 	    } else {
 	      r_vci_fsm = VCI_SINGLE_SEND ;
-	      r_address_to_send = destAdress();
+	      m_address_to_send = destAdress() << 32-10;
 	      m_count = 0;
 	    }
@@ -168,5 +202,4 @@
         {
 	  if (p_vci.cmdack.read()){
-	    m_count++;
 	    if (m_count == m_length-1) {
 	      m_start_latency1 = m_date_fifo.read();
@@ -175,4 +208,5 @@
 	    } else {
 	      r_vci_fsm = VCI_SINGLE_SEND ;
+	      m_count++;
 	    }
 	  }
@@ -187,4 +221,5 @@
 	    m_npackets++;
 	    date_fifo_get = true;
+	    m_address_to_send = 0;
 	    r_vci_fsm = VCI_IDLE ;
 	  }
@@ -194,10 +229,4 @@
       case VCI_BC_SEND:
         {
-	  r_address_to_send = (((((((((m_xmin << 5) & m_xmax ) << 5 ) & m_ymin ) << 5 ) & m_ymax ) << 5 ) << 17 ) & 0x3) | 0 ;
-	  //m_address_to_send.broadcast_address.xmin = m_xmin;
-	  //m_address_to_send.broadcast_address.xmax = m_xmax;
-	  //m_address_to_send.broadcast_address.ymin = m_ymin;
-	  //m_address_to_send.broadcast_address.ymax = m_ymax;
-	  //m_address_to_send.broadcast_address.bc   = 0x3;
 	  m_bc_nrsp = (m_xmax - m_xmin) * (m_ymax - m_ymin);
 	  r_vci_fsm = VCI_BC_SEND;
@@ -210,4 +239,5 @@
 	    if (m_bc_nrsp == 0) {
 	      r_broadcast_req = false;
+	      m_address_to_send = 0;
 	      r_vci_fsm = VCI_IDLE ;
 	    } else {
@@ -221,11 +251,13 @@
 
 
-/////////////////// Filling fifo
-    if( (m_rhos < m_rho) && (rand()/RAND_MAX) ){
+    /////////////////// Filling fifo
+    if( ( (uint64_t)(m_rho*m_cpt_cycles) >= (uint64_t)(m_length*m_npackets*1000)) ){
       if (m_date_fifo.wok()){
         date_fifo_put = true ;
       } 
-      if (!r_broadcast_req.read() && (m_cpt_cycles % m_bc_period)){
-        r_broadcast_req = true;
+      if (m_bc_period){
+	      if (!r_broadcast_req.read() && (m_cpt_cycles % m_bc_period)){
+		      r_broadcast_req = true;
+	      }
       }
     }
@@ -243,6 +275,4 @@
     }
    
-    m_rhos = (float) ((m_npackets * m_length) / m_cpt_cycles) ;
-
     m_cpt_cycles++;
 
@@ -287,5 +317,5 @@
         {
 	  p_vci.cmdval  = true;                 
-	  p_vci.address = (vci_addr_t)(r_address_to_send.read() + (m_count*4)); 
+	  p_vci.address = (addr_t)(m_address_to_send + (m_count*4)); 
 	  p_vci.plen    = m_length*4;                                         
 	  p_vci.wdata   = 0;                                       
@@ -315,5 +345,5 @@
         {
        	  p_vci.cmdval  = true;                 
-	  p_vci.address = (vci_addr_t) r_address_to_send.read(); 
+	  p_vci.address = (addr_t) m_address_to_send; 
 	  p_vci.plen    = 4;                                         
 	  p_vci.wdata   = 0;                                       
