Index: trunk/modules/vci_synthetic_initator/caba/metadata/vci_synthetic_initator.sd
===================================================================
--- trunk/modules/vci_synthetic_initator/caba/metadata/vci_synthetic_initator.sd	(revision 96)
+++ 	(revision )
@@ -1,16 +1,0 @@
-# -*- python -*-
-
-Module('caba:vci_synthetic_initiator',
-       classname = 'soclib::caba::VciSyntheticInitiator',
-       tmpl_parameters = [parameter.Module('vci_param', default = 'caba:vci_param'),],
-       header_files = ['../source/include/vci_synthetic_initiator.h',],
-       implementation_files = ['../source/src/vci_synthetic_initiator.cpp',],
-       uses = [Uses('caba:base_module'),
-               Uses('common:loader'),
-               Uses('common:mapping_table'),
-               Uses('caba:generic_fifo'),
-               ],
-       ports = [Port('caba:vci_initiator','p_vci'),
-                Port('caba:bit_in', 'p_resetn', auto = 'resetn'),
-                Port('caba:clock_in', 'p_clk', auto = 'clock'),],
-)
Index: trunk/modules/vci_synthetic_initator/caba/metadata/vci_synthetic_initiator.sd
===================================================================
--- trunk/modules/vci_synthetic_initator/caba/metadata/vci_synthetic_initiator.sd	(revision 98)
+++ trunk/modules/vci_synthetic_initator/caba/metadata/vci_synthetic_initiator.sd	(revision 98)
@@ -0,0 +1,35 @@
+# -*- python -*-
+
+Module('caba:vci_synthetic_initiator',
+       classname = 'soclib::caba::VciSyntheticInitiator',
+       tmpl_parameters = [parameter.Module('vci_param', default = 'caba:vci_param'),],
+       header_files = ['../sources/include/vci_synthetic_initiator.h',
+                       ],
+       implementation_files = ['../sources/src/vci_synthetic_initiator.cpp',],
+       uses = [Uses('caba:base_module'),
+               Uses('common:mapping_table'),
+               Uses('caba:generic_fifo'),
+               ],
+       ports = [Port('caba:vci_initiator','p_vci'),
+                Port('caba:bit_in', 'p_resetn', auto = 'resetn'),
+                Port('caba:clock_in', 'p_clk', auto = 'clock'),],
+       instance_parameters = [
+                parameter.Module('mt'),
+                parameter.IntTab('vci_index'),
+                parameter.Int('length'),
+		parameter.Float('rho'),
+                parameter.Int('depth'),
+		parameter.Int('xmesh'),
+		parameter.Int('ymesh'),
+		parameter.Int('bc_period', default = 0),
+		parameter.Int('xmin', default = 0),
+		parameter.Int('xmax', default = 0),
+		parameter.Int('ymin', default = 0),
+		parameter.Int('ymax', default = 0),
+                ],
+       extensions = [
+          'dsx:get_ident='
+          'vci_ini_index:p_vci:mt,'
+       ],
+)
+
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 96)
+++ 	(revision )
@@ -1,132 +1,0 @@
-/* -*- c++ -*-
- * File         : vci_synthetic_initiator.h
- * Date         : 26/08/2010
- * Copyright    : UPMC / LIP6
- * Authors      : Christophe Choichillon
- *
- * SOCLIB_LGPL_HEADER_BEGIN
- *
- * This file is part of SoCLib, GNU LGPLv2.1.
- *
- * SoCLib is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; version 2.1 of the License.
- *
- * SoCLib is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with SoCLib; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- * SOCLIB_LGPL_HEADER_END
- *
- * Maintainers: christophe.choichillon@lip6.fr
- */
-
-#ifndef SOCLIB_CABA_SYNTHETIC_INITIATOR_H
-#define SOCLIB_CABA_SYNTHETIC_INITIATOR_H
-
-#include <systemc>
-
-namespace soclib {  namespace caba {
-    using namespace sc_core;
-
-    template<typename vci_param>
-    class VciSyntheticInitiator
-      : public soclib::caba::BaseModule
-    {
-      typedef uint32_t addr_t;
-      typedef uint32_t data_t;
-      typedef uint32_t tag_t;
-      typedef uint32_t size_t;
-      typedef uint32_t be_t;
-      typedef uint32_t copy_t;
-
-
-      /* States of the GENERATOR fsm */
-      enum vci_fsm_state_e{
-	VCI_IDLE,
-	VCI_SINGLE_SEND,
-	VCI_SINGLE_RECEIVE,
-	VCI_BC_SEND,
-	VCI_BC_RECEIVE
-      };
-      enum gen_fsm_state_e{
-	A_IDLE,
-	A_DATA
-      };
-
-      uint64_t	   m_cpt_cycles;            // Counter of cycles 
-      
-
-    protected:
-
-      SC_HAS_PROCESS(VciSyntheticInitiator);
-    
-    public:
-      sc_in<bool> 			  	p_clk;
-      sc_in<bool> 			  	p_resetn;
-      soclib::caba::VciInitiator<vci_param> 	p_vci;	
-
-      VciSyntheticInitiator(
-		sc_module_name name,
-		size_t length,    // Packet length (flit numbers)
-		float  rho,       // Packets ratio on the network
-		size_t depth,     // Fifo depth
-		size_t x,	  // X location of the synthetic initiator
-		size_t y,	  // Y location of the synthetic initiator
-		size_t xmesh,	
-		size_t ymesh,
-		size_t bc_period, // Broadcast period, if no broadcast => 0
-		size_t xmin, 
-		size_t xmax,
-		size_t ymin,
-		size_t ymax,
-		const soclib::common::IntTab &vci_index
-		);                                 
-
-      ~VciSyntheticInitiator();
-
-      void transition();
-
-      void genMoore();
-
-      void destAdress(size_t X_local, size_t Y_local, size_t &X_dest, size_t &Y_dest);
-
-    private:
-
-      // Component attributes
-      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;			// 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
-      GenericFifo<uint64_t>    m_date_fifo;
-
-      sc_signal<int>         r_vci_fsm;
-	
-      sc_signal<size_t>	     r_index;
-
-      sc_signal<bool>	     r_broadcast_req;
-
-    }; // end class VciSyntheticInitiator
- 
-  }}
-
-#endif
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 98)
+++ trunk/modules/vci_synthetic_initator/caba/sources/include/vci_synthetic_initiator.h	(revision 98)
@@ -0,0 +1,160 @@
+/* -*- c++ -*-
+ * File         : vci_synthetic_initiator.h
+ * Date         : 26/08/2010
+ * Copyright    : UPMC / LIP6
+ * Authors      : Christophe Choichillon
+ *
+ * SOCLIB_LGPL_HEADER_BEGIN
+ *
+ * This file is part of SoCLib, GNU LGPLv2.1.
+ *
+ * SoCLib is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 of the License.
+ *
+ * SoCLib is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with SoCLib; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ * SOCLIB_LGPL_HEADER_END
+ *
+ * Maintainers: christophe.choichillon@lip6.fr
+ */
+
+#ifndef SOCLIB_CABA_SYNTHETIC_INITIATOR_H
+#define SOCLIB_CABA_SYNTHETIC_INITIATOR_H
+
+#include <systemc>
+#include <inttypes.h>
+#include "generic_fifo.h"
+#include "vci_initiator.h"
+#include "soclib_endian.h"
+#include "caba_base_module.h"
+#include "int_tab.h"
+#include "mapping_table.h"
+
+namespace soclib {  namespace caba {
+    using namespace sc_core;
+
+    template<typename vci_param>
+    class VciSyntheticInitiator
+      : 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 data_t;
+      typedef uint32_t tag_t;
+      typedef uint32_t size_t;
+      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;
+
+
+      /* States of the GENERATOR fsm */
+      enum vci_fsm_state_e{
+	VCI_IDLE,
+	VCI_SINGLE_SEND,
+	VCI_SINGLE_RECEIVE,
+	VCI_BC_SEND,
+	VCI_BC_RECEIVE
+      };
+      enum gen_fsm_state_e{
+	A_IDLE,
+	A_DATA
+      };
+
+      uint64_t	   m_cpt_cycles;            // Counter of cycles 
+      
+
+    protected:
+
+      SC_HAS_PROCESS(VciSyntheticInitiator);
+    
+    public:
+      sc_in<bool> 			  	p_clk;
+      sc_in<bool> 			  	p_resetn;
+      soclib::caba::VciInitiator<vci_param> 	p_vci;	
+
+      VciSyntheticInitiator(
+		sc_module_name name,
+		const  soclib::common::MappingTable &mt,
+		const  soclib::common::IntTab       &vci_index,
+		size_t length,    // Packet length (flit numbers)
+		float  rho,       // Packets ratio on the network
+		size_t depth,     // Fifo depth
+		size_t xmesh,	
+		size_t ymesh,
+		size_t bc_period = 0, // Broadcast period, if no broadcast => 0
+		size_t xmin = 0, 
+		size_t xmax = 0,
+		size_t ymin = 0,
+		size_t ymax = 0,
+		);                                 
+
+      ~VciSyntheticInitiator();
+
+      void transition();
+
+      void genMoore();
+
+      void destAdress(size_t X_local, size_t Y_local, size_t &X_dest, size_t &Y_dest);
+
+    private:
+
+      // Component attributes
+      const size_t   			  m_length;		// Number of words to write
+      const size_t			  m_rho;		// Rate of packets in the network wanted
+      const size_t			  m_depth;     		// Fifo depth
+      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_srcid;
+      const size_t			  m_coord;
+
+      size_t      			  m_count;                  // Numbers of words sent
+      size_t      			  m_npackets;		    // Total number of packets already sent
+      uint64_t	  			  m_start_latency1;         // Start time of sending packet wanted
+      uint64_t	  			  m_start_latency2;         // Start time of sending packet
+      addr_t				  m_address_to_send;        // Address to send the write command
+      float				  m_rhos;		    // Effective Rho during the simulation
+      size_t				  m_bc_nrsp;		    // Expected number of responses for a broadcast command
+
+      // Fifo transmitting date to the VCI FSM
+      GenericFifo<uint64_t>    m_date_fifo;
+
+      sc_signal<int>           r_vci_fsm;
+	
+      sc_signal<size_t>	       r_index;
+
+      sc_signal<bool>	       r_broadcast_req;
+
+    }; // end class VciSyntheticInitiator
+ 
+  }}
+
+#endif
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 96)
+++ 	(revision )
@@ -1,256 +1,0 @@
-/* -*- c++ -*-
- * File 	: vci_traffic_generator.cpp
- * Date 	: 26/08/2010
- * Copyright 	: UPMC / LIP6
- * Authors 	: Christophe Choichillon
- *
- * SOCLIB_LGPL_HEADER_BEGIN
- *
- * This file is part of SoCLib, GNU LGPLv2.1.
- *
- * SoCLib is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; version 2.1 of the License.
- *
- * SoCLib is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with SoCLib; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- * SOCLIB_LGPL_HEADER_END
- *
- * Maintainers: christophe.choichillon@lip6.fr
- */
-
-#include "../include/vci_synthetic_initiator.h"
-
-
-
-namespace soclib { namespace caba {
-
-
-#define tmpl(x) template<typename vci_param> x VciSyntheticInitiator<vci_param>
-
-  //using soclib::common::uint32_log2;	
-  
-  ////////////////////////////////
-  // 	Constructor 
-  ////////////////////////////////
-
-  tmpl(/**/)::VciSyntheticInitiator( 
-      sc_module_name name,
-      size_t length,    // Packet length (flit numbers)
-      float  rho,       // Packets ratio on the network
-      size_t depth,     // Fifo depth
-      size_t x,		// 
-      size_t y,		//
-      size_t xmesh,	
-      size_t ymesh,
-      size_t bc_period, // Broadcast period, if no broadcast => 0
-      size_t xmin, 
-      size_t xmax,
-      size_t ymin,
-      size_t ymax
-      )
-
-    : soclib::caba::BaseModule(name),
-
-    p_clk("clk"),
-    p_resetn("resetn"),
-    p_vci("vci_ini"),
-
-    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"),
-    {
-
-
-      SC_METHOD(transition);
-      dont_initialize();
-      sensitive << p_clk.pos();
-
-      SC_METHOD(genMoore);
-      dont_initialize();
-      sensitive << p_clk.neg();
-
-    } // end constructor
-
-
-  /////////////////////////////////
-  tmpl(/**/)::~VciSyntheticInitiator()
-    /////////////////////////////////
-  {
-  }
-
-  ///////////////////////////////////
-  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);
-  }
-
-  //////////////////////////////////
-  tmpl(void)::transition()
-    //////////////////////////////////
-  {
-    //using soclib::common::uint32_log2;
-    //  RESET          
-    if ( ! p_resetn.read() ) {
-      //srand(time(NULL));
-      //     Initializing FSMs
-      r_tgt_cmd_fsm 	= TGT_CMD_IDLE;
-
-      // initializing FIFOs and communication Buffers
-
-      m_date_fifo.init();
-
-      // Activity counters
-      m_cpt_cycles		= 0;
-      m_npackets		= 0;
-
-      return;
-    }
-
-    bool    date_fifo_put = false;
-    bool    date_fifo_get = false;
-
-    switch ( r_vci_fsm.read() ) {
-
-      //////////////////
-      case VCI_IDLE:
-        {
-          break;
-        }
-        //////////////////
-      case VCI_SINGLE_SEND:
-        {
-          break;
-        }
-        //////////////////////
-      case VCI_SINGLE_RECEIVE:
-        {
-	  if (p_vci.cmdack.read()) {
-	    // LATENCY
-	    r_vci_fsm = VCI_IDLE ;
-	  }
-          break;
-        }
-        ///////////////////
-      case VCI_BC_SEND:
-        {
-          break;
-        }
-        ////////////////////
-      case VCI_BC_RECEIVE:
-        {
-	  r_broadcast_req = false;
-          break;
-        }
-    } // end switch vci_fsm
-
-
-/////////////////// 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_date_fifo.simple_put(m_cpt_cycles);
-      }
-    } else {
-      if (date_fifo_get){
-        m_date_fifo.simple_get();
-      }
-    }
-
-
-    m_cpt_cycles++;
-
-    return;
-
-  } // end transition()
-
-  /////////////////////////////
-  tmpl(void)::genMoore()
-    /////////////////////////////
-  {
-    ////////////////////////////////////////////////////////////
-    // 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;           
-
-
-    switch ( r_vci_fsm.read() ) {
-
-      //////////////////
-      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;
-        }
-        //////////////////
-      case VCI_SINGLE_SEND:
-        {
-	  p_vci.cmdval = true ;
-          break;
-        }
-        //////////////////////
-      case VCI_SINGLE_RECEIVE:
-        {
-          break;
-        }
-        ///////////////////
-      case VCI_BC_SEND:
-        {
-          break;
-        }
-        ////////////////////
-      case VCI_BC_RECEIVE:
-        {
-          break;
-        }
-    } // end switch vci_fsm
-
-  } // end genMoore()
-
-}} // end name space
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 98)
+++ trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initiator.cpp	(revision 98)
@@ -0,0 +1,342 @@
+/* -*- c++ -*-
+ * File 	: vci_traffic_generator.cpp
+ * Date 	: 26/08/2010
+ * Copyright 	: UPMC / LIP6
+ * Authors 	: Christophe Choichillon
+ *
+ * SOCLIB_LGPL_HEADER_BEGIN
+ *
+ * This file is part of SoCLib, GNU LGPLv2.1.
+ *
+ * SoCLib is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 of the License.
+ *
+ * SoCLib is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with SoCLib; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ * SOCLIB_LGPL_HEADER_END
+ *
+ * Maintainers: christophe.choichillon@lip6.fr
+ */
+
+#include "../include/vci_synthetic_initiator.h"
+
+
+
+namespace soclib { namespace caba {
+
+
+#define tmpl(x) template<typename vci_param> x VciSyntheticInitiator<vci_param>
+
+  //using soclib::common::uint32_log2;	
+  
+  ////////////////////////////////
+  // 	Constructor 
+  ////////////////////////////////
+
+  tmpl(/**/)::VciSyntheticInitiator( 
+      sc_module_name name,
+      const  soclib::common::MappingTable &mt,
+      const  soclib::common::IntTab       &vci_index,
+      size_t length,    // Packet length (flit numbers)
+      float  rho,       // Packets ratio on the network
+      size_t depth,     // Fifo depth
+      size_t xmesh,	
+      size_t ymesh,
+      size_t bc_period = 0, // Broadcast period, if no broadcast => 0
+      size_t xmin = 0, 
+      size_t xmax = 0,
+      size_t ymin = 0,
+      size_t ymax = 0
+      )
+
+    : soclib::caba::BaseModule(name),
+
+    p_clk("clk"),
+    p_resetn("resetn"),
+    p_vci("vci_ini"),
+
+    m_srcid( mt.indexForId(vci_index) ),
+    m_coord(vci_index[1]),
+    //  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_vci_fsm("r_vci_fsm"),
+    {
+
+
+      SC_METHOD(transition);
+      dont_initialize();
+      sensitive << p_clk.pos();
+
+      SC_METHOD(genMoore);
+      dont_initialize();
+      sensitive << p_clk.neg();
+
+    } // end constructor
+
+
+  /////////////////////////////////
+  tmpl(/**/)::~VciSyntheticInitiator()
+    /////////////////////////////////
+  {
+  }
+
+  ///////////////////////////////////
+  tmpl(size_t)::destAdress()
+  ///////////////////////////////////
+  {
+    size_t dest;
+    do{
+      dest = (size_t) (rand() % (m_xmesh * m_ymesh));
+    } while(dest == m_srcid);
+    return dest ;
+  }
+
+
+  ///////////////////////////////////
+//  tmpl(void)::destAdress(/*size_t X_local, size_t Y_local,*/ size_t &X_dest, size_t &Y_dest)
+  ///////////////////////////////////
+//  {
+//    size_t x_dest_calc, y_dest_calc; 
+//    do{
+//      x_dest_calc = (rand()%m_xmesh);
+//      y_dest_calc = (rand()%m_ymesh);
+//    } while((x_dest_calc = m_x) && (y_dest_calc == m_y));
+//  }
+
+  //////////////////////////////////
+  tmpl(void)::transition()
+    //////////////////////////////////
+  {
+    //  RESET          
+    if ( ! p_resetn.read() ) {
+      // Initializing seed for random numbers generation
+      srand(time(NULL));
+
+      // Initializing FSMs
+      r_vci_fsm = VCI_IDLE;
+
+      // Initializing FIFOs 
+      m_date_fifo.init();
+
+      // Activity counters
+      m_cpt_cycles		= 0;
+      m_npackets		= 0;
+
+      return;
+    }
+
+    bool    date_fifo_put = false;
+    bool    date_fifo_get = false;
+
+    switch ( r_vci_fsm.read() ) {
+
+      //////////////////
+      case VCI_IDLE:
+        {
+	  if (m_date_fifo.rok()){
+	    if (r_broadcast_req.read()){
+	      r_vci_fsm = VCI_BC_SEND ;
+	    } else {
+	      r_vci_fsm = VCI_SINGLE_SEND ;
+	      destAdress();
+	      m_count = 0;
+	    }
+	  }
+          break;
+        }
+        //////////////////
+      case VCI_SINGLE_SEND:
+        {
+	  if (p_vci.cmdack.read()){
+	    m_count++;
+	    if (m_count == m_length-1) {
+	      m_start_latency1 = m_date_fifo.read();
+	      m_start_latency2 = m_cpt_cycles;
+	      r_vci_fsm = VCI_SINGLE_RECEIVE ;
+	    } else {
+	      r_vci_fsm = VCI_SINGLE_SEND ;
+	    }
+	  }
+          break;
+        }
+        //////////////////////
+      case VCI_SINGLE_RECEIVE:
+        {
+	  if (p_vci.rspval.read()) {
+	    m_start_latency1 = m_date_fifo.read();
+	    m_start_latency2 = m_cpt_cycles;
+	    m_npackets++;
+	    date_fifo_get = true;
+	    r_vci_fsm = VCI_IDLE ;
+	  }
+          break;
+        }
+        ///////////////////
+      case VCI_BC_SEND:
+        {
+	  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;
+          break;
+        }
+        ////////////////////
+      case VCI_BC_RECEIVE:
+        {
+	  if (p_vci.rspval.read()){
+	    if (m_bc_nrsp == 0) {
+	      r_broadcast_req = false;
+	      r_vci_fsm = VCI_IDLE ;
+	    } else {
+	      m_bc_nrsp--;
+	      r_vci_fsm = VCI_BC_RECEIVE ;
+	    }
+	  }
+          break;
+        }
+    } // end switch vci_fsm
+
+
+/////////////////// Filling fifo
+    if( (rhos < m_rho) && (rand()/RAND_MAX) ){
+      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_date_fifo.simple_put(m_cpt_cycles);
+      }
+    } else {
+      if (date_fifo_get){
+        m_date_fifo.simple_get();
+      }
+    }
+   
+    m_rhos = (float) ((m_npackets * m_length) / m_cpt_cycles) ;
+
+    m_cpt_cycles++;
+
+    return;
+
+  } // end transition()
+
+  /////////////////////////////
+  tmpl(void)::genMoore()
+    /////////////////////////////
+  {
+    ////////////////////////////////////////////////////////////
+    // Command signals on the p_vci port
+    ////////////////////////////////////////////////////////////
+     p_vci.cmd        = vci_param::CMD_WRITE;   
+     p_vci.be         = 0xF;                             
+     p_vci.pktid      = 0;      
+     p_vci.srcid      = m_srcid;   
+     p_vci.cons       = false;        
+     p_vci.wrap       = false;       
+     p_vci.contig     = true;       
+     p_vci.clen       = 0;         
+     p_vci.cfixed     = false;           
+
+
+    switch ( r_vci_fsm.read() ) {
+
+      //////////////////
+      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;                                   
+	  p_vci.rspack  = false;
+          break;
+        }
+        //////////////////
+      case VCI_SINGLE_SEND:
+        {
+	  p_vci.cmdval  = true;                 
+	  p_vci.address = (typename vci_param::addr_t)(m_address_to_send+(m_count*4)); 
+	  p_vci.plen    = m_length*4;                                         
+	  p_vci.wdata   = 0;                                       
+	  p_vci.trdid   = 0;                  
+	  if (m_count == m_length - 1 ) {
+	    p_vci.eop     = true;                                   
+	  } else {
+	    p_vci.eop     = false;                                   
+	  }
+	  p_vci.rspack  = false;
+          break;
+        }
+        //////////////////////
+      case VCI_SINGLE_RECEIVE:
+        {
+       	  p_vci.cmdval  = false;                 
+	  p_vci.address = 0; 
+	  p_vci.plen    = 0;                                         
+	  p_vci.wdata   = 0;                                       
+	  p_vci.trdid   = 0;                  
+	  p_vci.eop     = false;                                   
+	  p_vci.rspack  = true;
+   	  break;
+        }
+        ///////////////////
+      case VCI_BC_SEND:
+        {
+       	  p_vci.cmdval  = true;                 
+	  p_vci.address = (typename vci_param::addr_t) m_address_to_send; 
+	  p_vci.plen    = 4;                                         
+	  p_vci.wdata   = 0;                                       
+	  p_vci.trdid   = 0;                  
+	  p_vci.eop     = true;                                   
+	  p_vci.rspack  = false;
+          break;
+        }
+        ////////////////////
+      case VCI_BC_RECEIVE:
+        {
+       	  p_vci.cmdval  = false;                 
+	  p_vci.address = 0; 
+	  p_vci.plen    = 0;                                         
+	  p_vci.wdata   = 0;                                       
+	  p_vci.trdid   = 0;                  
+	  p_vci.eop     = false;                                   
+	  p_vci.rspack  = true;
+          break;
+        }
+    } // end switch vci_fsm
+
+  } // end genMoore()
+
+}} // end name space
